Changeset e6b9182 in mainline for uspace/drv/bus/usb/xhci


Ignore:
Timestamp:
2017-10-13T08:49:29Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
741bcdeb
Parents:
0a5833d7
Message:

WIP usbhost refactoring: ohci completed

Along with that we noticed hcd_t in bus_t is superfluous and it complicates initialization (and breaks isolation), so we removed it. Also, type of the toggle has changed to bool in the functions.

Location:
uspace/drv/bus/usb/xhci
Files:
4 edited

Legend:

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

    r0a5833d7 re6b9182  
    171171
    172172/* Endpoint ops, optional (have generic fallback) */
    173 static int endpoint_get_toggle(endpoint_t *ep)
    174 {
    175         // TODO: Implement me!
    176         return ENOTSUP;
    177 }
    178 
    179 static void endpoint_set_toggle(endpoint_t *ep, unsigned toggle)
     173static bool endpoint_get_toggle(endpoint_t *ep)
     174{
     175        // TODO: Implement me!
     176        return ENOTSUP;
     177}
     178
     179static void endpoint_set_toggle(endpoint_t *ep, bool toggle)
    180180{
    181181        // TODO: Implement me!
     
    227227};
    228228
    229 int xhci_bus_init(xhci_bus_t *bus, hcd_t *hcd)
    230 {
    231         assert(bus);
    232 
    233         bus_init(&bus->base, hcd);
     229int xhci_bus_init(xhci_bus_t *bus)
     230{
     231        assert(bus);
     232
     233        bus_init(&bus->base);
    234234
    235235        if (!hash_table_create(&bus->endpoints, 0, 0, &endpoint_ht_ops)) {
  • uspace/drv/bus/usb/xhci/bus.h

    r0a5833d7 re6b9182  
    5252         */
    5353
    54         hash_table_t endpoints;
     54        hash_table_t endpoints;
    5555} xhci_bus_t;
    5656
    57 int xhci_bus_init(xhci_bus_t *, hcd_t *);
     57int xhci_bus_init(xhci_bus_t *);
    5858void xhci_bus_fini(xhci_bus_t *);
    5959
  • uspace/drv/bus/usb/xhci/hc.c

    r0a5833d7 re6b9182  
    216216                goto err_cmd;
    217217
    218         return EOK;
    219 
     218        if ((err = xhci_bus_init(&hc->bus)))
     219                goto err_rh;
     220
     221
     222        return EOK;
     223
     224err_rh:
     225        xhci_rh_fini(&hc->rh);
    220226err_cmd:
    221227        xhci_fini_commands(hc);
     
    610616void hc_fini(xhci_hc_t *hc)
    611617{
     618        xhci_bus_fini(&hc->bus);
    612619        xhci_trb_ring_fini(&hc->command_ring);
    613620        xhci_event_ring_fini(&hc->event_ring);
  • uspace/drv/bus/usb/xhci/main.c

    r0a5833d7 re6b9182  
    8181                goto err;
    8282
    83         if ((err = xhci_bus_init(&hc->bus, hcd)))
    84                 goto err;
    85 
    8683        if ((err = hc_init_memory(hc)))
    8784                goto err;
     
    151148        hc_fini(hc);
    152149
    153         // FIXME: Probably move init/fini of XHCI bus into HC.
    154         xhci_bus_fini(&hc->bus);
    155 
    156150        free(hc);
    157151}
Note: See TracChangeset for help on using the changeset viewer.