Changeset b357377 in mainline for uspace/lib/usbhost/src/usb2_bus.c
- Timestamp:
- 2018-01-25T02:05:57Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d369b3b
- Parents:
- 5f0b366
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-25 01:23:20)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-25 02:05:57)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb2_bus.c
r5f0b366 rb357377 219 219 assert(ep); 220 220 221 bus_t *bus = ep->device->bus; 222 const bus_ops_t *ops = BUS_OPS_LOOKUP(bus->ops, endpoint_count_bw); 223 if (!ops) 224 return 0; 225 226 return ops->endpoint_count_bw(ep, ep->max_transfer_size); 221 usb2_bus_t *bus = bus_to_usb2_bus(ep->device->bus); 222 223 return bus->bw_accounting->count_bw(ep); 227 224 } 228 225 … … 269 266 * @param available_bandwidth Size of the bandwidth pool. 270 267 */ 271 void usb2_bus_init(usb2_bus_t *bus, size_t available_bandwidth)268 void usb2_bus_init(usb2_bus_t *bus, const bandwidth_accounting_t *bw_accounting) 272 269 { 273 270 assert(bus); 271 assert(bw_accounting); 274 272 275 273 bus_init(&bus->base, sizeof(device_t)); 276 274 bus->base.ops = &usb2_bus_ops; 277 275 278 bus->free_bw = available_bandwidth; 276 bus->bw_accounting = bw_accounting; 277 bus->free_bw = bw_accounting->available_bandwidth; 279 278 280 279 /*
Note:
See TracChangeset
for help on using the changeset viewer.