Changes in uspace/drv/uhci-hcd/hc.c [391d55b:1585c7e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
r391d55b r1585c7e 66 66 static int hc_interrupt_emulator(void *arg); 67 67 static int hc_debug_checker(void *arg); 68 #if 0 68 69 69 static bool usb_is_allowed( 70 70 bool low_speed, usb_transfer_type_t transfer, size_t size); 71 #endif72 71 /*----------------------------------------------------------------------------*/ 73 72 /** Initialize UHCI hcd driver structure … … 239 238 usb_device_keeper_init(&instance->manager); 240 239 usb_log_debug("Initialized device manager.\n"); 241 242 ret =243 usb_endpoint_manager_init(&instance->ep_manager,244 BANDWIDTH_AVAILABLE_USB11);245 assert(ret == EOK);246 240 247 241 return EOK; … … 328 322 assert(instance); 329 323 assert(batch); 324 const int low_speed = (batch->speed == USB_SPEED_LOW); 325 if (!usb_is_allowed( 326 low_speed, batch->transfer_type, batch->max_packet_size)) { 327 usb_log_warning( 328 "Invalid USB transfer specified %s SPEED %d %zu.\n", 329 low_speed ? "LOW" : "FULL" , batch->transfer_type, 330 batch->max_packet_size); 331 return ENOTSUP; 332 } 333 /* TODO: check available bandwidth here */ 330 334 331 335 transfer_list_t *list = … … 334 338 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 335 339 usb_device_keeper_use_control( 336 &instance->manager, batch->target );340 &instance->manager, batch->target.address); 337 341 } 338 342 transfer_list_add_batch(list, batch); … … 354 358 { 355 359 assert(instance); 356 // status |= 1; //Uncomment to work around qemu hang357 360 /* TODO: Resume interrupts are not supported */ 358 361 /* Lower 2 bits are transaction error and transaction complete */ … … 373 376 usb_transfer_batch_t *batch = 374 377 list_get_instance(item, usb_transfer_batch_t, link); 375 switch (batch->transfer_type) 376 { 377 case USB_TRANSFER_CONTROL: 378 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 378 379 usb_device_keeper_release_control( 379 &instance->manager, batch->target); 380 break; 381 case USB_TRANSFER_INTERRUPT: 382 case USB_TRANSFER_ISOCHRONOUS: { 383 /* 384 int ret = bandwidth_free(&instance->bandwidth, 385 batch->target.address, 386 batch->target.endpoint, 387 batch->direction); 388 if (ret != EOK) 389 usb_log_warning("Failed(%d) to free " 390 "reserved bw: %s.\n", ret, 391 str_error(ret)); 392 */ 393 } 394 default: 395 break; 380 &instance->manager, batch->target.address); 396 381 } 397 382 batch->next_step(batch); … … 514 499 * @return True if transaction is allowed by USB specs, false otherwise 515 500 */ 516 #if 0517 501 bool usb_is_allowed( 518 502 bool low_speed, usb_transfer_type_t transfer, size_t size) … … 532 516 return false; 533 517 } 534 #endif535 518 /** 536 519 * @}
Note:
See TracChangeset
for help on using the changeset viewer.