Changes in uspace/drv/uhci-hcd/hc.c [d527a4e:391d55b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
rd527a4e r391d55b 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 int ret =340 bandwidth_use(&instance->bandwidth, batch->target.address,341 batch->target.endpoint, batch->direction);342 if (ret != EOK) {343 usb_log_warning("Failed(%d) to use reserved bw: %s.\n",344 ret, str_error(ret));345 }346 }347 330 348 331 transfer_list_t *list = … … 398 381 case USB_TRANSFER_INTERRUPT: 399 382 case USB_TRANSFER_ISOCHRONOUS: { 383 /* 400 384 int ret = bandwidth_free(&instance->bandwidth, 401 385 batch->target.address, … … 406 390 "reserved bw: %s.\n", ret, 407 391 str_error(ret)); 392 */ 408 393 } 409 394 default: … … 529 514 * @return True if transaction is allowed by USB specs, false otherwise 530 515 */ 516 #if 0 531 517 bool usb_is_allowed( 532 518 bool low_speed, usb_transfer_type_t transfer, size_t size) … … 546 532 return false; 547 533 } 534 #endif 548 535 /** 549 536 * @}
Note:
See TracChangeset
for help on using the changeset viewer.