Changeset 837581fd in mainline for uspace/drv/bus/usb/xhci/commands.c


Ignore:
Timestamp:
2018-01-13T01:53:13Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
598733c9
Parents:
230ef1c
Message:

xhci: logging changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/commands.c

    r230ef1c r837581fd  
    187187        }
    188188
    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)));
    191190
    192191        list_append(&cmd->_header.link, &cr->cmd_list);
     
    297296        assert(trb);
    298297
    299         usb_log_debug2("HC(%p) Command completed.", hc);
    300 
    301298        fibril_mutex_lock(&cr->guard);
    302299
     
    314311                 * requesting thread is waiting inside the CV.
    315312                 */
     313                usb_log_debug2("Command ring stopped.");
    316314                fibril_condvar_broadcast(&cr->stopped_cv);
    317315                fibril_mutex_unlock(&cr->guard);
     
    321319        xhci_cmd_t *command = find_command(hc, phys);
    322320        if (command == NULL) {
    323                 usb_log_error("No command struct for this completion event found.");
     321                usb_log_error("No command struct for completion event found.");
    324322
    325323                if (code != XHCI_TRBC_SUCCESS)
     
    338336        command->slot_id = TRB_GET_SLOT(*trb);
    339337
    340         usb_log_debug2("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)));
    341339
    342340        if (code != XHCI_TRBC_SUCCESS) {
    343341                report_error(code);
    344342                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;
    361343        }
    362344
     
    613595                // The CR is either stopped, or different fibril is already
    614596                // restarting it.
     597                usb_log_debug2("Command ring already being stopped.");
    615598                fibril_mutex_unlock(&cr->guard);
    616599                return EOK;
    617600        }
    618601
    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.");
    620603
    621604        cr->state = XHCI_CR_STATE_CHANGING;
     
    631614                 * reset it.
    632615                 */
    633                 usb_log_error("HC(%p): Command didn't abort.", hc);
     616                usb_log_error("Command didn't abort.");
    634617
    635618                cr->state = XHCI_CR_STATE_CLOSED;
     
    643626        }
    644627
    645         usb_log_error("HC(%p): Command ring stopped. Starting again.", hc);
     628        usb_log_error("Command ring stopped. Starting again.");
    646629        hc_ring_doorbell(hc, 0, 0);
    647630
Note: See TracChangeset for help on using the changeset viewer.