Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c913f71e in mainline


Ignore:
Timestamp:
2018-01-09T14:43:07Z (4 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master
Children:
cf5cbac4
Parents:
8eb7095
Message:

uhci: implement onlining device functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/hc.c

    r8eb7095 rc913f71e  
    323323static int device_online(device_t *device)
    324324{
    325         // FIXME: Implement me!
    326 
    327         return ENOTSUP;
    328 }
    329 
    330 static int device_offline(device_t *device)
    331 {
     325        int err;
    332326        hc_t *instance = bus_to_hc(device->bus);
    333327        assert(instance);
    334328
     329        /* Allow creation of new endpoints and transfers. */
     330        usb_log_info("Device(%d): Going online.", device->address);
     331        fibril_mutex_lock(&device->guard);
     332        device->online = true;
     333        fibril_mutex_unlock(&device->guard);
     334
     335        if ((err = ddf_fun_online(device->fun))) {
     336                return err;
     337        }
     338
     339        return EOK;
     340}
     341
     342static int device_offline(device_t *device)
     343{
    335344        int err;
     345        hc_t *instance = bus_to_hc(device->bus);
     346        assert(instance);
     347
    336348        /* Tear down all drivers working with the device. */
    337349        if ((err = ddf_fun_offline(device->fun))) {
Note: See TracChangeset for help on using the changeset viewer.