Changeset 3cbc138 in mainline for uspace/drv/bus/usb/xhci/commands.c


Ignore:
Timestamp:
2017-10-25T13:45:53Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
47ab89e
Parents:
2b35478
Message:

xhci commands: sync returns EOK only if the command was finished successfully

File:
1 edited

Legend:

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

    r2b35478 r3cbc138  
    262262        }
    263263
     264        /* Semantics of NO_OP_CMD is that success is marked as a TRB error. */
     265        if (command->_header.cmd == XHCI_CMD_NO_OP && code == XHCI_TRBC_TRB_ERROR)
     266                code = XHCI_TRBC_SUCCESS;
     267
    264268        command->status = code;
    265269        command->slot_id = TRB_GET_SLOT(*trb);
    266270
    267271        usb_log_debug2("Completed command trb: %s", xhci_trb_str_type(TRB_TYPE(command->_header.trb)));
    268         if (TRB_TYPE(command->_header.trb) != XHCI_TRB_TYPE_NO_OP_CMD) {
    269                 if (code != XHCI_TRBC_SUCCESS) {
    270                         report_error(code);
    271                         xhci_dump_trb(&command->_header.trb);
    272                 }
     272
     273        if (code != XHCI_TRBC_SUCCESS) {
     274                report_error(code);
     275                xhci_dump_trb(&command->_header.trb);
    273276        }
    274277
    275278        switch (TRB_TYPE(command->_header.trb)) {
    276279        case XHCI_TRB_TYPE_NO_OP_CMD:
    277                 assert(code == XHCI_TRBC_TRB_ERROR);
    278280                break;
    279281        case XHCI_TRB_TYPE_ENABLE_SLOT_CMD:
     
    585587        }
    586588
    587         return EOK;
     589        return cmd->status == XHCI_TRBC_SUCCESS ? EOK : EINVAL;
    588590}
    589591
Note: See TracChangeset for help on using the changeset viewer.