Changeset 837581fd in mainline for uspace/drv/bus/usb/xhci/commands.c
- Timestamp:
- 2018-01-13T01:53:13Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 598733c9
- Parents:
- 230ef1c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/commands.c
r230ef1c r837581fd 187 187 } 188 188 189 usb_log_debug2("HC(%p): Sending command:", hc); 190 xhci_dump_trb(&cmd->_header.trb); 189 usb_log_debug("Sending command %s", xhci_trb_str_type(TRB_TYPE(cmd->_header.trb))); 191 190 192 191 list_append(&cmd->_header.link, &cr->cmd_list); … … 297 296 assert(trb); 298 297 299 usb_log_debug2("HC(%p) Command completed.", hc);300 301 298 fibril_mutex_lock(&cr->guard); 302 299 … … 314 311 * requesting thread is waiting inside the CV. 315 312 */ 313 usb_log_debug2("Command ring stopped."); 316 314 fibril_condvar_broadcast(&cr->stopped_cv); 317 315 fibril_mutex_unlock(&cr->guard); … … 321 319 xhci_cmd_t *command = find_command(hc, phys); 322 320 if (command == NULL) { 323 usb_log_error("No command struct for thiscompletion event found.");321 usb_log_error("No command struct for completion event found."); 324 322 325 323 if (code != XHCI_TRBC_SUCCESS) … … 338 336 command->slot_id = TRB_GET_SLOT(*trb); 339 337 340 usb_log_debug 2("Completed command trb:%s", xhci_trb_str_type(TRB_TYPE(command->_header.trb)));338 usb_log_debug("Completed command %s", xhci_trb_str_type(TRB_TYPE(command->_header.trb))); 341 339 342 340 if (code != XHCI_TRBC_SUCCESS) { 343 341 report_error(code); 344 342 xhci_dump_trb(&command->_header.trb); 345 }346 347 switch (TRB_TYPE(command->_header.trb)) {348 case XHCI_TRB_TYPE_NO_OP_CMD:349 case XHCI_TRB_TYPE_ENABLE_SLOT_CMD:350 case XHCI_TRB_TYPE_DISABLE_SLOT_CMD:351 case XHCI_TRB_TYPE_ADDRESS_DEVICE_CMD:352 case XHCI_TRB_TYPE_CONFIGURE_ENDPOINT_CMD:353 case XHCI_TRB_TYPE_EVALUATE_CONTEXT_CMD:354 case XHCI_TRB_TYPE_RESET_ENDPOINT_CMD:355 case XHCI_TRB_TYPE_STOP_ENDPOINT_CMD:356 case XHCI_TRB_TYPE_RESET_DEVICE_CMD:357 break;358 default:359 usb_log_debug2("Unsupported command trb: %s", xhci_trb_str_type(TRB_TYPE(command->_header.trb)));360 return ENAK;361 343 } 362 344 … … 613 595 // The CR is either stopped, or different fibril is already 614 596 // restarting it. 597 usb_log_debug2("Command ring already being stopped."); 615 598 fibril_mutex_unlock(&cr->guard); 616 599 return EOK; 617 600 } 618 601 619 usb_log_error(" HC(%p): Timeout while waiting for command: aborting current command.", hc);602 usb_log_error("Timeout while waiting for command: aborting current command."); 620 603 621 604 cr->state = XHCI_CR_STATE_CHANGING; … … 631 614 * reset it. 632 615 */ 633 usb_log_error(" HC(%p): Command didn't abort.", hc);616 usb_log_error("Command didn't abort."); 634 617 635 618 cr->state = XHCI_CR_STATE_CLOSED; … … 643 626 } 644 627 645 usb_log_error(" HC(%p): Command ring stopped. Starting again.", hc);628 usb_log_error("Command ring stopped. Starting again."); 646 629 hc_ring_doorbell(hc, 0, 0); 647 630
Note:
See TracChangeset
for help on using the changeset viewer.