Changeset 9748336 in mainline
- Timestamp:
- 2018-01-10T20:08:54Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a70f349
- Parents:
- 94a0904
- Location:
- uspace/lib/usbhost
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
r94a0904 r9748336 116 116 static inline bus_t *endpoint_get_bus(endpoint_t *ep) 117 117 { 118 return ep->device->bus; 118 device_t * const device = ep->device; 119 return device ? device->bus : NULL; 119 120 } 120 121 -
uspace/lib/usbhost/src/endpoint.c
r94a0904 r9748336 248 248 name, target.address, target.endpoint, size, ep->max_packet_size); 249 249 250 bus_t *bus = endpoint_get_bus(ep); 251 const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, batch_schedule); 250 device_t * const device = ep->device; 251 if (!device) { 252 usb_log_warning("Endpoint detached"); 253 return EAGAIN; 254 } 255 256 const bus_ops_t *ops = BUS_OPS_LOOKUP(device->bus->ops, batch_schedule); 252 257 if (!ops) { 253 258 usb_log_error("HCD does not implement scheduler.\n"); … … 256 261 257 262 /* Offline devices don't schedule transfers other than on EP0. */ 258 if (! ep->device->online && ep->endpoint > 0) {263 if (!device->online && ep->endpoint > 0) { 259 264 return EAGAIN; 260 265 } … … 265 270 usb_log_error("Endpoint(%d:%d) %s needs %zu bw " 266 271 "but only %zu is reserved.\n", 267 ep->device->address, ep->endpoint, name, bw, ep->bandwidth);272 device->address, ep->endpoint, name, bw, ep->bandwidth); 268 273 return ENOSPC; 269 274 }
Note:
See TracChangeset
for help on using the changeset viewer.