Changeset 5e2b1ae6 in mainline for uspace/drv/bus/usb/xhci/bus.c


Ignore:
Timestamp:
2018-01-07T01:54:45Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3dc3f99
Parents:
63431db
Message:

usbhost: reserve default speed in library

File:
1 edited

Legend:

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

    r63431db r5e2b1ae6  
    426426}
    427427
    428 static int reserve_default_address(bus_t *bus_base, usb_speed_t speed)
    429 {
    430         xhci_bus_t *xhci_bus = bus_to_xhci_bus(bus_base);
    431 
    432         if (xhci_bus->default_address_speed != USB_SPEED_MAX)
    433                 /* Already allocated */
    434                 return ENOENT;
    435 
    436         xhci_bus->default_address_speed = speed;
    437         return EOK;
    438 }
    439 
    440 static int release_default_address(bus_t *bus_base)
    441 {
    442         xhci_bus_t *xhci_bus = bus_to_xhci_bus(bus_base);
    443 
    444         xhci_bus->default_address_speed = USB_SPEED_MAX;
    445         return EOK;
    446 }
    447 
    448428static usb_transfer_batch_t *batch_create(endpoint_t *ep)
    449429{
     
    461441// TODO: Is it good idea to use this macro? It blurrs the fact that the callbacks and static functions are called the same.
    462442#define BIND_OP(op) .op = op,
    463         BIND_OP(reserve_default_address)
    464         BIND_OP(release_default_address)
    465 
    466443        BIND_OP(device_enumerate)
    467444        BIND_OP(device_remove)
     
    501478        bus->hc = hc;
    502479        bus->base.ops = &xhci_bus_ops;
    503         bus->default_address_speed = USB_SPEED_MAX;
    504480        return EOK;
    505481}
Note: See TracChangeset for help on using the changeset viewer.