Changeset e50bdd92 in mainline for uspace/drv/bus/usb/xhci/hc.c
- Timestamp:
- 2017-07-23T19:14:43Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c46c356
- Parents:
- c4d4fa2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/hc.c
rc4d4fa2 re50bdd92 354 354 int hc_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch) 355 355 { 356 // TODO: This function currently contains cmd ring testing 357 // stuff, remove it. 358 xhci_cmd_t *cmd = xhci_alloc_command(); 356 359 xhci_dump_state(hc); 357 xhci_send_no_op_command(hc, NULL); 358 async_usleep(1000); 360 xhci_send_no_op_command(hc, cmd); 361 xhci_wait_for_command(cmd, 1000000); 362 xhci_free_command(cmd); 363 359 364 xhci_dump_state(hc); 360 async_usleep(10000); 361 xhci_send_no_op_command(hc, NULL); 365 366 for (int i = 0; i < 10; ++i) { 367 xhci_cmd_t *cmd2 = xhci_alloc_command(); 368 xhci_send_enable_slot_command(hc, cmd2); 369 xhci_wait_for_command(cmd2, 1000000); 370 usb_log_error("Enabled slot ID: %u.", cmd2->slot_id); 371 xhci_free_command(cmd2); 372 } 373 362 374 363 375 xhci_dump_trb(hc->event_ring.dequeue_trb); … … 386 398 xhci_trb_t trb; 387 399 388 // TODO: Apparently we are supposed to process events until ering is empty389 // and then update the erdp?390 400 err = xhci_event_ring_dequeue(event_ring, &trb);; 391 401 392 switch (err) { 393 case EOK: 394 usb_log_debug2("Dequeued from event ring."); 395 xhci_dump_trb(&trb); 396 397 hc_handle_event(hc, &trb); 398 break; 399 case ENOENT: 400 usb_log_debug2("Event ring finished."); 401 break; 402 default: 403 usb_log_warning("Error while accessing event ring: %s", str_error(err)); 404 } 402 while (err != ENOENT) { 403 if (err == EOK) { 404 usb_log_debug2("Dequeued from event ring."); 405 xhci_dump_trb(&trb); 406 407 hc_handle_event(hc, &trb); 408 } else { 409 usb_log_warning("Error while accessing event ring: %s", str_error(err)); 410 break; 411 } 412 413 err = xhci_event_ring_dequeue(event_ring, &trb);; 414 } 415 usb_log_debug2("Event ring processing finished."); 405 416 406 417 /* Update the ERDP to make room in the ring */
Note:
See TracChangeset
for help on using the changeset viewer.