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


Ignore:
Timestamp:
2017-10-23T21:26:22Z (7 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ec700c7
Parents:
327f147
Message:

Moved some code from RH to HC. Simplified device address process. Issuing deconfigure device command.

File:
1 edited

Legend:

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

    r327f147 rb724494  
    4646#define TRB_SET_TCS(trb, tcs)   (trb).control |= host2xhci(32, ((tcs &0x1) << 9))
    4747#define TRB_SET_TYPE(trb, type) (trb).control |= host2xhci(32, (type) << 10)
     48#define TRB_SET_DC(trb, dc)     (trb).control |= host2xhci(32, (dc) << 9)
    4849#define TRB_SET_EP(trb, ep)     (trb).control |= host2xhci(32, ((ep) & 0x5) << 16)
    4950#define TRB_SET_STREAM(trb, st) (trb).control |= host2xhci(32, ((st) & 0xFFFF) << 16)
     
    323324        assert(hc);
    324325        assert(cmd);
    325         assert(ictx);
    326 
    327         xhci_trb_clean(&cmd->trb);
    328 
    329         uint64_t phys_addr = (uint64_t) addr_to_phys(ictx);
    330         TRB_SET_ICTX(cmd->trb, phys_addr);
     326
     327        xhci_trb_clean(&cmd->trb);
     328
     329        if (!cmd->deconfigure) {
     330                /* If the DC flag is on, input context is not evaluated. */
     331                assert(ictx);
     332
     333                uint64_t phys_addr = (uint64_t) addr_to_phys(ictx);
     334                TRB_SET_ICTX(cmd->trb, phys_addr);
     335        }
    331336
    332337        TRB_SET_TYPE(cmd->trb, XHCI_TRB_TYPE_CONFIGURE_ENDPOINT_CMD);
    333338        TRB_SET_SLOT(cmd->trb, cmd->slot_id);
     339        TRB_SET_DC(cmd->trb, cmd->deconfigure);
    334340
    335341        return enqueue_command(hc, cmd, 0, 0);
Note: See TracChangeset for help on using the changeset viewer.