Changeset 68dbe3e in mainline


Ignore:
Timestamp:
2011-10-14T18:53:04Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
aaf835d
Parents:
98604cc
Message:

usbhid: Add fibril running indicator.

Location:
uspace/drv/bus/usb/usbhid
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhid/main.c

    r98604cc r68dbe3e  
    126126           hid_dev);
    127127
    128 
    129128        if (rc != EOK) {
    130129                usb_log_error("Failed to start polling fibril for `%s'.\n",
     
    133132                return rc;
    134133        }
     134        hid_dev->running = true;
    135135        dev->driver_data = hid_dev;
    136136
     
    195195{
    196196        usb_hid_dev_t *hid_dev = dev->driver_data;
     197        unsigned tries = 10;
     198        while (hid_dev->running) {
     199                async_usleep(100000);
     200                if (!tries--) {
     201                        usb_log_error("Can't remove hub, still running.\n");
     202                        return EINPROGRESS;
     203                }
     204        }
     205
     206        assert(!hid_dev->running);
    197207        usb_hid_destroy(hid_dev);
    198208        return EOK;
  • uspace/drv/bus/usb/usbhid/usbhid.c

    r98604cc r68dbe3e  
    630630        }
    631631
     632        hid_dev->running = false;
    632633//      usb_hid_destroy(hid_dev);
    633634}
  • uspace/drv/bus/usb/usbhid/usbhid.h

    r98604cc r68dbe3e  
    129129
    130130        int report_nr;
     131        bool running;
    131132};
    132133
Note: See TracChangeset for help on using the changeset viewer.