Changes in uspace/drv/uhci-hcd/hc.c [1585c7e:391d55b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
r1585c7e 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 … … 238 239 usb_device_keeper_init(&instance->manager); 239 240 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); 240 246 241 247 return EOK; … … 322 328 assert(instance); 323 329 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 */334 330 335 331 transfer_list_t *list = … … 338 334 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 339 335 usb_device_keeper_use_control( 340 &instance->manager, batch->target .address);336 &instance->manager, batch->target); 341 337 } 342 338 transfer_list_add_batch(list, batch); … … 358 354 { 359 355 assert(instance); 356 // status |= 1; //Uncomment to work around qemu hang 360 357 /* TODO: Resume interrupts are not supported */ 361 358 /* Lower 2 bits are transaction error and transaction complete */ … … 376 373 usb_transfer_batch_t *batch = 377 374 list_get_instance(item, usb_transfer_batch_t, link); 378 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 375 switch (batch->transfer_type) 376 { 377 case USB_TRANSFER_CONTROL: 379 378 usb_device_keeper_release_control( 380 &instance->manager, batch->target.address); 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; 381 396 } 382 397 batch->next_step(batch); … … 499 514 * @return True if transaction is allowed by USB specs, false otherwise 500 515 */ 516 #if 0 501 517 bool usb_is_allowed( 502 518 bool low_speed, usb_transfer_type_t transfer, size_t size) … … 516 532 return false; 517 533 } 534 #endif 518 535 /** 519 536 * @}
Note:
See TracChangeset
for help on using the changeset viewer.