Changeset b5f813c in mainline for uspace/lib/usbhost/src/hcd.c


Ignore:
Timestamp:
2015-07-04T03:28:02Z (9 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
55346870
Parents:
2dbfe44
Message:

libusbhost,ehci,ohci,uhci,vhc: Pass ops structure instead of function pointers to intialization

File:
1 edited

Legend:

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

    r2dbfe44 rb5f813c  
    5454        assert(ep);
    5555        assert(hcd);
    56         if (hcd->driver.ep_add_hook)
    57                 return hcd->driver.ep_add_hook(hcd, ep);
     56        if (hcd->ops.ep_add_hook)
     57                return hcd->ops.ep_add_hook(hcd, ep);
    5858        return EOK;
    5959}
     
    6868        assert(ep);
    6969        assert(hcd);
    70         if (hcd->driver.ep_remove_hook)
    71                 hcd->driver.ep_remove_hook(hcd, ep);
     70        if (hcd->ops.ep_remove_hook)
     71                hcd->ops.ep_remove_hook(hcd, ep);
    7272}
    7373
     
    9999        usb_bus_init(&hcd->bus, bandwidth, bw_count, max_speed);
    100100
    101         hcd->driver.data = NULL;
    102         hcd->driver.schedule = NULL;
    103         hcd->driver.ep_add_hook = NULL;
    104         hcd->driver.ep_remove_hook = NULL;
     101        hcd_set_implementation(hcd, NULL, NULL);
    105102}
    106103
     
    127124        assert(hcd);
    128125        usb_address_t address = 0;
    129         return usb_bus_request_address(
    130             &hcd->bus, &address, true, speed);
     126        return usb_bus_request_address(&hcd->bus, &address, true, speed);
    131127}
    132128
     
    209205                return ENOSPC;
    210206        }
    211         if (!hcd->driver.schedule) {
     207        if (!hcd->ops.schedule) {
    212208                usb_log_error("HCD does not implement scheduler.\n");
    213209                return ENOTSUP;
     
    241237        }
    242238
    243         const int ret = hcd->driver.schedule(hcd, batch);
     239        const int ret = hcd->ops.schedule(hcd, batch);
    244240        if (ret != EOK)
    245241                usb_transfer_batch_destroy(batch);
Note: See TracChangeset for help on using the changeset viewer.