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

Changeset f3ae58b in mainline


Ignore:
Timestamp:
2018-01-29T14:10:47Z (2 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
master
Children:
1bab1c8
Parents:
7bdfcaf
Message:

libusbhost: usb2_bus needs to release address when the device is gone

Location:
uspace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/ehci_bus.c

    r7bdfcaf rf3ae58b  
    6363}
    6464
     65static void ehci_device_gone(device_t *dev)
     66{
     67        ehci_bus_t *bus = (ehci_bus_t *) dev->bus;
     68        usb2_bus_device_gone(&bus->helper, dev);
     69}
     70
    6571/** Creates new hcd endpoint representation.
    6672 */
     
    163169
    164170        .device_enumerate = ehci_device_enumerate,
     171        .device_gone = ehci_device_gone,
    165172
    166173        .endpoint_destroy = ehci_endpoint_destroy,
  • uspace/drv/bus/usb/ohci/ohci_bus.c

    r7bdfcaf rf3ae58b  
    6363}
    6464
     65static void ohci_device_gone(device_t *dev)
     66{
     67        ohci_bus_t *bus = (ohci_bus_t *) dev->bus;
     68        usb2_bus_device_gone(&bus->helper, dev);
     69}
     70
    6571/** Creates new hcd endpoint representation.
    6672 */
     
    172178
    173179        .device_enumerate = ohci_device_enumerate,
     180        .device_gone = ohci_device_gone,
    174181
    175182        .endpoint_destroy = ohci_endpoint_destroy,
  • uspace/drv/bus/usb/uhci/hc.c

    r7bdfcaf rf3ae58b  
    412412}
    413413
     414static void device_gone(device_t *dev)
     415{
     416        hc_t * const hc = bus_to_hc(dev->bus);
     417        usb2_bus_device_gone(&hc->bus_helper, dev);
     418}
     419
    414420static int hc_status(bus_t *, uint32_t *);
    415421static int hc_schedule(usb_transfer_batch_t *);
     
    420426
    421427        .device_enumerate = device_enumerate,
     428        .device_gone = device_gone,
    422429
    423430        .endpoint_create = endpoint_create,
  • uspace/lib/usbhost/include/usb/host/usb2_bus.h

    r7bdfcaf rf3ae58b  
    6464
    6565extern int usb2_bus_device_enumerate(usb2_bus_helper_t *, device_t *);
     66extern void usb2_bus_device_gone(usb2_bus_helper_t *, device_t *);
     67
    6668extern int usb2_bus_endpoint_register(usb2_bus_helper_t *, endpoint_t *);
    6769extern void usb2_bus_endpoint_unregister(usb2_bus_helper_t *, endpoint_t *);
  • uspace/lib/usbhost/src/usb2_bus.c

    r7bdfcaf rf3ae58b  
    203203}
    204204
     205void usb2_bus_device_gone(usb2_bus_helper_t *helper, device_t *dev)
     206{
     207        release_address(helper, dev->address);
     208}
     209
    205210/**
    206211 * Register an endpoint to the bus. Reserves bandwidth.
Note: See TracChangeset for help on using the changeset viewer.