Changeset 7278cbc9 in mainline for uspace/lib/usbhost


Ignore:
Timestamp:
2018-01-22T23:53:11Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e546142
Parents:
3ac86a4
Message:

usbhost: dispose the EP0 properly (+some ehci cleanup while debugging)

Location:
uspace/lib/usbhost/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/src/bus.c

    r3ac86a4 r7278cbc9  
    208208
    209209        const bus_ops_t *ops = BUS_OPS_LOOKUP(dev->bus->ops, device_gone);
     210        const bus_ops_t *ep_ops = BUS_OPS_LOOKUP(dev->bus->ops, endpoint_unregister);
    210211        assert(ops);
    211212
     
    240241
    241242        /* Tell the HC to release its resources. */
    242         ops->device_gone(dev);
    243 
    244         /* Release the EP0 bus reference */
    245         endpoint_del_ref(dev->endpoints[0]);
     243        if (ops)
     244                ops->device_gone(dev);
     245
     246        /* Check whether the driver didn't forgot EP0 */
     247        if (dev->endpoints[0]) {
     248                if (ep_ops)
     249                        ep_ops->endpoint_unregister(dev->endpoints[0]);
     250                /* Release the EP0 bus reference */
     251                endpoint_del_ref(dev->endpoints[0]);
     252        }
    246253
    247254        /* Destroy the function, freeing also the device, unlocking mutex. */
  • uspace/lib/usbhost/src/usb2_bus.c

    r3ac86a4 r7278cbc9  
    209209}
    210210
    211 static void usb2_bus_device_gone(device_t *dev)
    212 {
    213         // TODO: Implement me!
    214 }
    215 
    216211/**
    217212 * Register an endpoint to the bus. Reserves bandwidth.
     
    245240const bus_ops_t usb2_bus_ops = {
    246241        .device_enumerate = usb2_bus_device_enumerate,
    247         .device_gone = usb2_bus_device_gone,
    248242        .endpoint_register = usb2_bus_register_ep,
    249243        .endpoint_unregister = usb2_bus_unregister_ep,
Note: See TracChangeset for help on using the changeset viewer.