Changeset 7278cbc9 in mainline


Ignore:
Timestamp:
2018-01-22T23:53:11Z (6 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
Files:
5 edited

Legend:

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

    r3ac86a4 r7278cbc9  
    7070        endpoint_init(&ehci_ep->base, dev, desc);
    7171
    72         // TODO: extract USB2 information from desc
    73        
    7472        if (dma_buffer_alloc(&ehci_ep->dma_buffer, sizeof(qh_t)))
    7573                return NULL;
  • uspace/drv/bus/usb/ehci/endpoint_list.c

    r3ac86a4 r7278cbc9  
    9595{
    9696        assert(instance);
     97        assert(instance->list_head);
    9798        assert(ep);
    9899        assert(ep->qh);
  • uspace/drv/bus/usb/ehci/hc.c

    r3ac86a4 r7278cbc9  
    236236        assert(ep);
    237237        ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep);
    238         usb_log_debug("HC(%p) dequeue EP(?:%d:%s:%s)", instance,
    239             ep->endpoint,
     238        usb_log_debug("HC(%p) dequeue EP(%d:%d:%s:%s)", instance,
     239            ep->device->address, ep->endpoint,
    240240            usb_str_transfer_type_short(ep->transfer_type),
    241241            usb_str_direction(ep->direction));
     
    360360
    361361        if (status & (USB_STS_IRQ_FLAG | USB_STS_ERR_IRQ_FLAG)) {
    362 
    363                 LIST_INITIALIZE(completed);
    364 
    365362                fibril_mutex_lock(&hc->guard);
    366363
  • 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.