Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset c9bec1c in mainline


Ignore:
Timestamp:
2017-07-30T16:01:06Z (3 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
master
Children:
73e5b62
Parents:
0cabd10
Message:

Refactored the add_command function, the return of the cmd was meant to be used for post config if cmd passed into the command sender was NULL, however the only sender that uses this is no_op sender and that has no post config of the command.

Location:
uspace/drv/bus/usb/xhci
Files:
2 edited

Legend:

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

    r0cabd10 rc9bec1c  
    167167}
    168168
    169 static inline xhci_cmd_t *add_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
     169static inline int add_cmd(xhci_hc_t *hc, xhci_cmd_t *cmd)
    170170{
    171171        if (cmd == NULL) {
    172172                cmd = xhci_alloc_command();
    173173                if (cmd == NULL)
    174                         return cmd;
     174                        return ENOMEM;
    175175
    176176                cmd->has_owner = false;
     
    180180        cmd->trb = hc->command_ring.enqueue_trb;
    181181
    182         return cmd;
     182        return EOK;
    183183}
    184184
     
    273273        TRB_SET_TYPE(trb, XHCI_TRB_TYPE_NO_OP_CMD);
    274274
    275         cmd = add_cmd(hc, cmd);
     275        add_cmd(hc, cmd);
    276276
    277277        return enqueue_trb(hc, &trb, 0, 0);
     
    288288        trb.control |= host2xhci(32, XHCI_REG_RD(hc->xecp, XHCI_EC_SP_SLOT_TYPE) << 16);
    289289
    290         cmd = add_cmd(hc, cmd);
     290        add_cmd(hc, cmd);
    291291
    292292        return enqueue_trb(hc, &trb, 0, 0);
     
    337337        TRB_SET_SLOT(trb, cmd->slot_id);
    338338
    339         cmd = add_cmd(hc, cmd);
     339        add_cmd(hc, cmd);
    340340
    341341        return enqueue_trb(hc, &trb, 0, 0);
     
    357357        TRB_SET_SLOT(trb, cmd->slot_id);
    358358
    359         cmd = add_cmd(hc, cmd);
     359        add_cmd(hc, cmd);
    360360
    361361        return enqueue_trb(hc, &trb, 0, 0);
     
    383383        TRB_SET_SLOT(trb, cmd->slot_id);
    384384
    385         cmd = add_cmd(hc, cmd);
     385        add_cmd(hc, cmd);
    386386
    387387        return enqueue_trb(hc, &trb, 0, 0);
     
    405405        TRB_SET_SLOT(trb, cmd->slot_id);
    406406
     407        add_cmd(hc, cmd);
     408
    407409        return enqueue_trb(hc, &trb, 0, 0);
    408410}
     
    421423        TRB_SET_SLOT(trb, cmd->slot_id);
    422424
    423         cmd = add_cmd(hc, cmd);
     425        add_cmd(hc, cmd);
    424426
    425427        return enqueue_trb(hc, &trb, 0, 0);
     
    446448         */
    447449
    448         cmd = add_cmd(hc, cmd);
     450        add_cmd(hc, cmd);
    449451
    450452        return enqueue_trb(hc, &trb, 0, 0);
     
    461463        TRB_SET_TYPE(trb, XHCI_TRB_TYPE_RESET_DEVICE_CMD);
    462464        TRB_SET_SLOT(trb, cmd->slot_id);
     465
     466        add_cmd(hc, cmd);
    463467
    464468        return enqueue_trb(hc, &trb, 0, 0);
  • uspace/drv/bus/usb/xhci/hc.c

    r0cabd10 rc9bec1c  
    331331        XHCI_REG_WR(intr0, XHCI_INTR_ERSTBA_HI, UPPER32(erstptr));
    332332
    333         // TODO: Setup scratchpad buffers
    334 
    335333        if (irq) {
    336334                XHCI_REG_SET(intr0, XHCI_INTR_IE, 1);
Note: See TracChangeset for help on using the changeset viewer.