Changeset 2fa43d1 in mainline
- Timestamp:
- 2017-07-24T13:08:00Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b78a7c1
- Parents:
- 3dc519f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
r3dc519f r2fa43d1 105 105 } 106 106 107 static inline xhci_cmd_t *get_ next_command(xhci_hc_t *hc)107 static inline xhci_cmd_t *get_command(xhci_hc_t *hc, uint64_t phys) 108 108 { 109 109 link_t *cmd_link = list_first(&hc->commands); 110 111 while (cmd_link != NULL) { 112 xhci_cmd_t *cmd = list_get_instance(cmd_link, xhci_cmd_t, link); 113 114 if (addr_to_phys(cmd->trb) == phys) 115 break; 116 117 cmd_link = list_next(cmd_link, &hc->commands); 118 } 110 119 111 120 if (cmd_link != NULL) { … … 420 429 assert(trb); 421 430 422 // TODO: STOP & ABORT may not have command structs in the list!423 424 431 usb_log_debug("HC(%p) Command completed.", hc); 425 432 426 433 int code; 427 434 uint32_t slot_id; 435 uint64_t phys; 428 436 xhci_cmd_t *command; 429 437 xhci_trb_t *command_trb; 430 438 431 command = get_next_command(hc); 432 assert(command); 439 code = XHCI_DWORD_EXTRACT(trb->status, 31, 24); 440 phys = XHCI_QWORD_EXTRACT(trb->parameter, 63, 4) << 4; 441 command = get_command(hc, phys); 442 if (command == NULL) { 443 // TODO: STOP & ABORT may not have command structs in the list! 444 usb_log_error("No command struct for this completion event"); 445 446 if (code != XHCI_TRBC_SUCCESS) 447 report_error(code); 448 449 return EOK; 450 } 433 451 434 452 command_trb = command->trb; 435 453 436 code = XHCI_DWORD_EXTRACT(trb->status, 31, 24);437 454 command->status = code; 438 455
Note:
See TracChangeset
for help on using the changeset viewer.