Changeset deb2e55 in mainline
- Timestamp:
- 2017-12-28T21:54:38Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 415c5116
- Parents:
- 66c16b0
- git-author:
- Petr Manek <petr.manek@…> (2017-12-28 21:54:31)
- git-committer:
- Petr Manek <petr.manek@…> (2017-12-28 21:54:38)
- Location:
- uspace
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/bus.c
r66c16b0 rdeb2e55 217 217 usb_log_debug2("Device " XHCI_DEV_FMT " going offline.", XHCI_DEV_ARGS(*xhci_dev)); 218 218 fibril_mutex_lock(&dev->guard); 219 xhci_dev->online = false;219 dev->online = false; 220 220 fibril_mutex_unlock(&dev->guard); 221 221 … … 304 304 usb_log_debug2("Device " XHCI_DEV_FMT " going online.", XHCI_DEV_ARGS(*dev)); 305 305 fibril_mutex_lock(&dev_base->guard); 306 dev ->online = true;306 dev_base->online = true; 307 307 fibril_mutex_unlock(&dev_base->guard); 308 308 … … 332 332 usb_log_debug2("Device " XHCI_DEV_FMT " going offline.", XHCI_DEV_ARGS(*dev)); 333 333 fibril_mutex_lock(&dev_base->guard); 334 dev ->online = false;334 dev_base->online = false; 335 335 fibril_mutex_unlock(&dev_base->guard); 336 336 -
uspace/drv/bus/usb/xhci/endpoint.c
r66c16b0 rdeb2e55 463 463 464 464 /* Offline devices don't create new endpoints other than EP0. */ 465 if (!dev-> online && ep->base.endpoint > 0) {465 if (!dev->base.online && ep->base.endpoint > 0) { 466 466 return EAGAIN; 467 467 } -
uspace/drv/bus/usb/xhci/endpoint.h
r66c16b0 rdeb2e55 141 141 /** Flag indicating whether the device is USB3 (it's USB2 otherwise). */ 142 142 bool usb3; 143 144 /** True if the device can add new endpoints and schedule transfers. */145 volatile bool online;146 143 } xhci_device_t; 147 144 -
uspace/drv/bus/usb/xhci/hc.c
r66c16b0 rdeb2e55 706 706 /* From now on, the device is officially online, yay! */ 707 707 fibril_mutex_lock(&dev->base.guard); 708 dev-> online = true;708 dev->base.online = true; 709 709 fibril_mutex_unlock(&dev->base.guard); 710 710 -
uspace/drv/bus/usb/xhci/transfers.c
r66c16b0 rdeb2e55 261 261 size_t tdpc = len / 1024 + ((len % 1024) ? 1 : 0); 262 262 size_t tbc = tdpc / (ep->max_burst + 1); 263 if (!tdpc % (ep->max_burst + 1)) --tbc;263 if (!tdpc % (ep->max_burst + 1)) --tbc; 264 264 size_t bsp = tdpc % (ep->max_burst + 1); 265 265 size_t tlbpc = (bsp ? bsp - 1 : ep->max_burst); … … 520 520 xhci_device_t *xhci_dev = xhci_ep_to_dev(xhci_ep); 521 521 522 /* Offline devices don't schedule transfers other than on EP0. */523 if (!xhci_dev->online && ep->endpoint > 0) {524 return EAGAIN;525 }526 527 522 // FIXME: find a better way to check if the ring is not initialized 528 523 if (!xhci_ep->ring.segment_count) { … … 533 528 534 529 // Isochronous transfer needs to be handled differently 535 if (batch->ep->transfer_type == USB_TRANSFER_ISOCHRONOUS) {530 if (batch->ep->transfer_type == USB_TRANSFER_ISOCHRONOUS) { 536 531 return schedule_isochronous(hc, transfer, xhci_ep, xhci_dev); 537 532 } -
uspace/lib/usbhost/include/usb/host/bus.h
r66c16b0 rdeb2e55 79 79 /* Managing bus */ 80 80 bus_t *bus; 81 82 /** True if the device can add new endpoints and schedule transfers. */ 83 volatile bool online; 81 84 82 85 /* This structure is meant to be extended by overriding. */ -
uspace/lib/usbhost/src/endpoint.c
r66c16b0 rdeb2e55 214 214 } 215 215 216 /* Offline devices don't schedule transfers other than on EP0. */ 217 if (!ep->device->online && ep->endpoint > 0) { 218 return EAGAIN; 219 } 220 216 221 const size_t bw = endpoint_count_bw(ep, size); 217 222 /* Check if we have enough bandwidth reserved */ -
uspace/lib/usbhost/src/usb2_bus.c
r66c16b0 rdeb2e55 271 271 } 272 272 273 /* From now on, the device is officially online, yay! */ 274 fibril_mutex_lock(&dev->guard); 275 dev->online = true; 276 fibril_mutex_unlock(&dev->guard); 277 273 278 return EOK; 274 279
Note:
See TracChangeset
for help on using the changeset viewer.