Changes in uspace/drv/uhci-hcd/hc.c [d527a4e:1585c7e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/hc.c
rd527a4e r1585c7e 239 239 usb_log_debug("Initialized device manager.\n"); 240 240 241 ret = bandwidth_init(&instance->bandwidth, BANDWIDTH_AVAILABLE_USB11,242 bandwidth_count_usb11);243 assert(ret == EOK);244 245 241 return EOK; 246 242 #undef CHECK_RET_DEST_CMDS_RETURN … … 329 325 if (!usb_is_allowed( 330 326 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, 327 usb_log_warning( 328 "Invalid USB transfer specified %s SPEED %d %zu.\n", 329 low_speed ? "LOW" : "FULL" , batch->transfer_type, 333 330 batch->max_packet_size); 334 331 return ENOTSUP; 335 332 } 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 } 333 /* TODO: check available bandwidth here */ 347 334 348 335 transfer_list_t *list = … … 351 338 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 352 339 usb_device_keeper_use_control( 353 &instance->manager, batch->target );340 &instance->manager, batch->target.address); 354 341 } 355 342 transfer_list_add_batch(list, batch); … … 371 358 { 372 359 assert(instance); 373 // status |= 1; //Uncomment to work around qemu hang374 360 /* TODO: Resume interrupts are not supported */ 375 361 /* Lower 2 bits are transaction error and transaction complete */ … … 390 376 usb_transfer_batch_t *batch = 391 377 list_get_instance(item, usb_transfer_batch_t, link); 392 switch (batch->transfer_type) 393 { 394 case USB_TRANSFER_CONTROL: 378 if (batch->transfer_type == USB_TRANSFER_CONTROL) { 395 379 usb_device_keeper_release_control( 396 &instance->manager, batch->target); 397 break; 398 case USB_TRANSFER_INTERRUPT: 399 case USB_TRANSFER_ISOCHRONOUS: { 400 int ret = bandwidth_free(&instance->bandwidth, 401 batch->target.address, 402 batch->target.endpoint, 403 batch->direction); 404 if (ret != EOK) 405 usb_log_warning("Failed(%d) to free " 406 "reserved bw: %s.\n", ret, 407 str_error(ret)); 408 } 409 default: 410 break; 380 &instance->manager, batch->target.address); 411 381 } 412 382 batch->next_step(batch);
Note:
See TracChangeset
for help on using the changeset viewer.