Changeset bc02b83 in mainline for uspace/app/vuhid/main.c


Ignore:
Timestamp:
2011-05-07T09:59:39Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6fb003e, 7ab7c7f6, d38d830
Parents:
f90c0d6 (diff), beee81a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Virtual USB improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/vuhid/main.c

    rf90c0d6 rbc02b83  
    132132        .in_endpoint_first_free = 1,
    133133        .out_endpoints_mapping = { NULL },
    134         .out_endpoint_first_free = 1
    135 };
     134        .out_endpoint_first_free = 1,
     135
     136        .iface_count = 0,
     137        .iface_died_count = 0
     138        // mutex and CV must be initialized elsewhere
     139};
     140
    136141
    137142/** Keyboard device.
     
    151156
    152157        usb_log_enable(USB_LOG_LEVEL_DEBUG2, "vusbhid");
     158
     159        fibril_mutex_initialize(&vuhid_data.iface_count_mutex);
     160        fibril_condvar_initialize(&vuhid_data.iface_count_cv);
    153161
    154162        /* Determine which interfaces to initialize. */
     
    182190        printf("Connected to VHCD...\n");
    183191
    184         while (true) {
    185                 async_usleep(10 * 1000 * 1000);
    186         }
     192        wait_for_interfaces_death(&hid_dev);
    187193       
    188194        printf("Terminating...\n");
    189195       
     196        usbvirt_device_unplug(&hid_dev);
     197
    190198        return 0;
    191199}
Note: See TracChangeset for help on using the changeset viewer.