Changeset dcaf819 in mainline for uspace/drv/uhci-hcd/hc.c
- Timestamp:
- 2011-04-06T22:33:08Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9a7e5b4
- Parents:
- 6bf9bc4 (diff), 87305bb (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
r6bf9bc4 rdcaf819 66 66 static int hc_interrupt_emulator(void *arg); 67 67 static int hc_debug_checker(void *arg); 68 68 #if 0 69 69 static bool usb_is_allowed( 70 70 bool low_speed, usb_transfer_type_t transfer, size_t size); 71 #endif 71 72 /*----------------------------------------------------------------------------*/ 72 73 /** Initialize UHCI hcd driver structure … … 239 240 usb_log_debug("Initialized device manager.\n"); 240 241 241 ret = bandwidth_init(&instance->bandwidth, BANDWIDTH_AVAILABLE_USB11, 242 bandwidth_count_usb11); 242 ret = 243 usb_endpoint_manager_init(&instance->ep_manager, 244 BANDWIDTH_AVAILABLE_USB11); 243 245 assert(ret == EOK); 244 246 … … 326 328 assert(instance); 327 329 assert(batch); 328 const int low_speed = (batch->speed == USB_SPEED_LOW);329 if (!usb_is_allowed(330 low_speed, batch->transfer_type, batch->max_packet_size)) {331 usb_log_error("Invalid USB transfer specified %s %d %zu.\n",332 usb_str_speed(batch->speed), batch->transfer_type,333 batch->max_packet_size);334 return ENOTSUP;335 }336 /* Check available bandwidth */337 if (batch->transfer_type == USB_TRANSFER_INTERRUPT ||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);342 int ret =343 bandwidth_use(&instance->bandwidth, batch->target.address,344 batch->target.endpoint, batch->direction, bw);345 if (ret != EOK) {346 usb_log_error("Failed(%d) to use reserved bw: %s.\n",347 ret, str_error(ret));348 return ret;349 }350 }351 330 352 331 transfer_list_t *list = … … 402 381 case USB_TRANSFER_INTERRUPT: 403 382 case USB_TRANSFER_ISOCHRONOUS: { 383 /* 404 384 int ret = bandwidth_free(&instance->bandwidth, 405 385 batch->target.address, … … 410 390 "reserved bw: %s.\n", ret, 411 391 str_error(ret)); 392 */ 412 393 } 413 394 default: … … 533 514 * @return True if transaction is allowed by USB specs, false otherwise 534 515 */ 516 #if 0 535 517 bool usb_is_allowed( 536 518 bool low_speed, usb_transfer_type_t transfer, size_t size) … … 550 532 return false; 551 533 } 534 #endif 552 535 /** 553 536 * @}
Note:
See TracChangeset
for help on using the changeset viewer.