Changeset 19f0048 in mainline for uspace/drv/bus/usb/xhci/rh.c


Ignore:
Timestamp:
2018-02-01T02:13:34Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17d34a8
Parents:
53fdf8c
Message:

xhci: reinitialize in case of HC error

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/rh.c

    r53fdf8c r19f0048  
    113113        xhci_sw_ring_init(&rh->event_ring, rh->max_ports);
    114114
    115         joinable_fibril_start(rh->event_worker);
    116 
    117115        return EOK;
    118116}
     
    290288}
    291289
    292 void xhci_rh_startup(xhci_rh_t *rh)
    293 {
     290void xhci_rh_start(xhci_rh_t *rh)
     291{
     292        xhci_sw_ring_restart(&rh->event_ring);
     293        joinable_fibril_start(rh->event_worker);
     294
    294295        /* The reset changed status of all ports, and SW originated reason does
    295296         * not cause an interrupt.
     
    311312}
    312313
     314/**
     315 * Disconnect all devices on all ports. On contrary to ordinary disconnect, this
     316 * function waits until the disconnection routine is over.
     317 */
     318void xhci_rh_stop(xhci_rh_t *rh)
     319{
     320        xhci_sw_ring_stop(&rh->event_ring);
     321        joinable_fibril_join(rh->event_worker);
     322
     323        for (uint8_t i = 0; i < rh->max_ports; ++i) {
     324                rh_port_t * const port = &rh->ports[i];
     325                usb_port_disabled(&port->base, &rh_remove_device);
     326                usb_port_fini(&port->base);
     327        }
     328}
     329
    313330static int rh_worker(void *arg)
    314331{
Note: See TracChangeset for help on using the changeset viewer.