Changeset 5e2b1ae6 in mainline for uspace/drv
- Timestamp:
- 2018-01-07T01:54:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3dc3f99
- Parents:
- 63431db2
- Location:
- uspace/drv/bus/usb
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/hc.c
r63431db2 r5e2b1ae6 388 388 int hc_init_mem_structures(hc_t *instance, hc_device_t *hcd) 389 389 { 390 int err;391 390 assert(instance); 392 391 393 if ((err = usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11))) 394 return err; 392 usb2_bus_init(&instance->bus, BANDWIDTH_AVAILABLE_USB11); 395 393 396 394 bus_t *bus = (bus_t *) &instance->bus; -
uspace/drv/bus/usb/usbhub/port.c
r63431db2 r5e2b1ae6 406 406 407 407 /* Reserve default address */ 408 while ((ret = usbhc_reserve_default_address(exch, speed)) == E NOENT) {408 while ((ret = usbhc_reserve_default_address(exch, speed)) == EAGAIN) { 409 409 async_usleep(1000000); 410 410 } -
uspace/drv/bus/usb/xhci/bus.c
r63431db2 r5e2b1ae6 426 426 } 427 427 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 448 428 static usb_transfer_batch_t *batch_create(endpoint_t *ep) 449 429 { … … 461 441 // TODO: Is it good idea to use this macro? It blurrs the fact that the callbacks and static functions are called the same. 462 442 #define BIND_OP(op) .op = op, 463 BIND_OP(reserve_default_address)464 BIND_OP(release_default_address)465 466 443 BIND_OP(device_enumerate) 467 444 BIND_OP(device_remove) … … 501 478 bus->hc = hc; 502 479 bus->base.ops = &xhci_bus_ops; 503 bus->default_address_speed = USB_SPEED_MAX;504 480 return EOK; 505 481 } -
uspace/drv/bus/usb/xhci/bus.h
r63431db2 r5e2b1ae6 51 51 52 52 xhci_device_t **devices_by_slot; /**< Devices by Slot ID */ 53 54 usb_speed_t default_address_speed; /**< Used to get speed from usb hubs */55 53 } xhci_bus_t; 56 54
Note:
See TracChangeset
for help on using the changeset viewer.