Changeset 25251bb in mainline
- Timestamp:
- 2017-10-26T08:38:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 928afc8d
- Parents:
- 62558202
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/bus.c
r62558202 r25251bb 266 266 267 267 usb_log_info("Endpoint(%d:%d) registered to XHCI bus.", ep->device->address, ep->endpoint); 268 return xhci_device_add_endpoint( xhci_dev, xhci_ep);268 return xhci_device_add_endpoint(bus->hc, xhci_dev, xhci_ep); 269 269 } 270 270 … … 278 278 xhci_device_t *xhci_dev = xhci_device_get(ep->device); 279 279 xhci_endpoint_t *xhci_ep = xhci_endpoint_get(ep); 280 const int res = xhci_device_remove_endpoint( xhci_dev, xhci_ep);280 const int res = xhci_device_remove_endpoint(bus->hc, xhci_dev, xhci_ep); 281 281 if (res != EOK) 282 282 return res; … … 396 396 return ENOMEM; 397 397 398 bus->hc = hc; 398 399 bus->base.ops = xhci_bus_ops; 399 400 bus->default_address_speed = USB_SPEED_MAX; -
uspace/drv/bus/usb/xhci/bus.h
r62558202 r25251bb 48 48 bus_t base; /**< Inheritance. Keep this first. */ 49 49 50 xhci_hc_t *hc; /**< Pointer to managing HC (to issue commands) */ 51 50 52 xhci_device_t **devices_by_slot; /**< Devices by Slot ID */ 51 53 -
uspace/drv/bus/usb/xhci/endpoint.c
r62558202 r25251bb 269 269 } 270 270 271 int xhci_device_add_endpoint(xhci_ device_t *dev, xhci_endpoint_t *ep)271 int xhci_device_add_endpoint(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *ep) 272 272 { 273 273 assert(dev); … … 299 299 xhci_setup_endpoint_context(ep, &ep_ctx); 300 300 301 return hc_add_endpoint( dev->hc, dev->slot_id, xhci_endpoint_index(ep), &ep_ctx);302 } 303 304 int xhci_device_remove_endpoint(xhci_ device_t *dev, xhci_endpoint_t *ep)301 return hc_add_endpoint(hc, dev->slot_id, xhci_endpoint_index(ep), &ep_ctx); 302 } 303 304 int xhci_device_remove_endpoint(xhci_hc_t *hc, xhci_device_t *dev, xhci_endpoint_t *ep) 305 305 { 306 306 assert(&dev->base == ep->base.device); … … 320 320 321 321 /* Drop the endpoint. */ 322 if ((err = hc_drop_endpoint( dev->hc, dev->slot_id, xhci_endpoint_index(ep)))) {322 if ((err = hc_drop_endpoint(hc, dev->slot_id, xhci_endpoint_index(ep)))) { 323 323 goto err; 324 324 } -
uspace/drv/bus/usb/xhci/endpoint.h
r62558202 r25251bb 117 117 uint8_t active_endpoint_count; 118 118 119 /** Need HC to schedule commands from bus callbacks. TODO: Move this elsewhere. */120 xhci_hc_t *hc;121 122 119 /** Flag indicating whether the device is USB3 (it's USB2 otherwise). */ 123 120 bool usb3; … … 137 134 void xhci_setup_endpoint_context(xhci_endpoint_t *, xhci_ep_ctx_t *); 138 135 139 int xhci_device_add_endpoint(xhci_ device_t *, xhci_endpoint_t *);140 int xhci_device_remove_endpoint(xhci_ device_t *, xhci_endpoint_t *);136 int xhci_device_add_endpoint(xhci_hc_t *, xhci_device_t *, xhci_endpoint_t *); 137 int xhci_device_remove_endpoint(xhci_hc_t *, xhci_device_t *, xhci_endpoint_t *); 141 138 xhci_endpoint_t * xhci_device_get_endpoint(xhci_device_t *, usb_endpoint_t); 142 139 -
uspace/drv/bus/usb/xhci/rh.c
r62558202 r25251bb 102 102 const xhci_port_speed_t *port_speed = xhci_rh_get_port_speed(rh, port_id); 103 103 xhci_device_t *xhci_dev = xhci_device_get(dev); 104 xhci_dev->hc = rh->hc;105 104 xhci_dev->usb3 = port_speed->major == 3; 106 105 xhci_dev->rh_port = port_id; … … 363 362 } 364 363 365 static inline int get_hub_available_bandwidth(xhci_ device_t* dev, uint8_t speed, xhci_port_bandwidth_ctx_t *ctx) {364 static inline int get_hub_available_bandwidth(xhci_hc_t *hc, xhci_device_t* dev, uint8_t speed, xhci_port_bandwidth_ctx_t *ctx) { 366 365 // TODO: find a correct place for this function + API 367 366 // We need speed, because a root hub device has both USB 2 and USB 3 speeds … … 383 382 384 383 int err; 385 if ((err = xhci_cmd_sync( dev->hc, &cmd))) {384 if ((err = xhci_cmd_sync(hc, &cmd))) { 386 385 goto end; 387 386 }
Note:
See TracChangeset
for help on using the changeset viewer.