Changeset df40775 in mainline
- Timestamp:
- 2011-04-04T19:38:11Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6bf9bc4
- Parents:
- 3094804b (diff), 65369473 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
r3094804b rdf40775 337 337 if (batch->transfer_type == USB_TRANSFER_INTERRUPT || 338 338 batch->transfer_type == USB_TRANSFER_ISOCHRONOUS) { 339 size_t bw = bandwidth_count_usb11(batch->speed, 340 batch->transfer_type, batch->buffer_size, 341 batch->max_packet_size); 339 342 int ret = 340 343 bandwidth_use(&instance->bandwidth, batch->target.address, 341 batch->target.endpoint, batch->direction );344 batch->target.endpoint, batch->direction, bw); 342 345 if (ret != EOK) { 343 346 usb_log_warning("Failed(%d) to use reserved bw: %s.\n", -
uspace/lib/usb/include/usb/host/bandwidth.h
r3094804b rdf40775 71 71 72 72 int bandwidth_use(bandwidth_t *instance, usb_address_t address, 73 usb_endpoint_t endpoint, usb_direction_t direction );73 usb_endpoint_t endpoint, usb_direction_t direction, size_t bw); 74 74 75 75 int bandwidth_free(bandwidth_t *instance, usb_address_t address, -
uspace/lib/usb/src/host/bandwidth.c
r3094804b rdf40775 66 66 const size_t bytes = 67 67 keys < MAX_KEYS ? keys * sizeof(unsigned long) : sizeof(transfer_t); 68 return bcmp(key, &status->transfer, bytes) ;68 return bcmp(key, &status->transfer, bytes) == 0; 69 69 } 70 70 /*----------------------------------------------------------------------------*/ … … 221 221 /*----------------------------------------------------------------------------*/ 222 222 int bandwidth_use(bandwidth_t *instance, usb_address_t address, 223 usb_endpoint_t endpoint, usb_direction_t direction )223 usb_endpoint_t endpoint, usb_direction_t direction, size_t bw) 224 224 { 225 225 assert(instance); … … 237 237 hash_table_get_instance(item, transfer_status_t, link); 238 238 assert(status); 239 if (status->used) { 240 ret = EINPROGRESS; 239 if (status->required >= bw) { 240 if (status->used) { 241 ret = EINPROGRESS; 242 } 243 status->used = true; 244 } else { 245 ret = ENOSPC; 241 246 } 242 status->used = true;243 247 } else { 244 248 ret = EINVAL;
Note:
See TracChangeset
for help on using the changeset viewer.