Changeset e6b9182 in mainline for uspace/lib/usbhost/src/usb2_bus.c


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.

File:
1 edited

Legend:

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

    r0a5833d7 re6b9182  
    4141#include <errno.h>
    4242#include <macros.h>
     43#include <stdlib.h>
    4344#include <stdbool.h>
    4445
     
    110111}
    111112
     113static endpoint_t *usb2_bus_create_ep(bus_t *bus)
     114{
     115        endpoint_t *ep = malloc(sizeof(endpoint_t));
     116        if (!ep)
     117                return NULL;
     118
     119        endpoint_init(ep, bus);
     120        return ep;
     121}
     122
    112123/** Register an endpoint to the bus. Reserves bandwidth.
    113124 * @param bus usb_bus structure, non-null.
     
    271282
    272283static const bus_ops_t usb2_bus_ops = {
     284        .create_endpoint = usb2_bus_create_ep,
    273285        .find_endpoint = usb2_bus_find_ep,
    274286        .release_endpoint = usb2_bus_release_ep,
     
    287299 * @return Error code.
    288300 */
    289 int usb2_bus_init(usb2_bus_t *bus, hcd_t *hcd, size_t available_bandwidth, count_bw_func_t count_bw)
     301int usb2_bus_init(usb2_bus_t *bus, size_t available_bandwidth, count_bw_func_t count_bw)
    290302{
    291303        assert(bus);
    292304
    293         bus_init(&bus->base, hcd);
     305        bus_init(&bus->base);
    294306
    295307        bus->base.ops = usb2_bus_ops;
Note: See TracChangeset for help on using the changeset viewer.