提交 b83cdc8f 编写于 作者: A Andiry Xu 提交者: Sarah Sharp

xHCI 1.0: Setup Stage TRB Transfer Type flag

Setup Stage Transfer Type field is added to indicate the presence and the
direction of the Data Stage TD, and determines the direction of the Status
Stage TD so the wLength length field should be ignored by the xHC.
Signed-off-by: NAndiry Xu <andiry.xu@amd.com>
Signed-off-by: NSarah Sharp <sarah.a.sharp@linux.intel.com>
上级 04aebcbb
...@@ -3053,6 +3053,17 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, ...@@ -3053,6 +3053,17 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
field |= TRB_IDT | TRB_TYPE(TRB_SETUP); field |= TRB_IDT | TRB_TYPE(TRB_SETUP);
if (start_cycle == 0) if (start_cycle == 0)
field |= 0x1; field |= 0x1;
/* xHCI 1.0 6.4.1.2.1: Transfer Type field */
if (xhci->hci_version == 0x100) {
if (urb->transfer_buffer_length > 0) {
if (setup->bRequestType & USB_DIR_IN)
field |= TRB_TX_TYPE(TRB_DATA_IN);
else
field |= TRB_TX_TYPE(TRB_DATA_OUT);
}
}
queue_trb(xhci, ep_ring, false, true, queue_trb(xhci, ep_ring, false, true,
setup->bRequestType | setup->bRequest << 8 | le16_to_cpu(setup->wValue) << 16, setup->bRequestType | setup->bRequest << 8 | le16_to_cpu(setup->wValue) << 16,
le16_to_cpu(setup->wIndex) | le16_to_cpu(setup->wLength) << 16, le16_to_cpu(setup->wIndex) | le16_to_cpu(setup->wLength) << 16,
......
...@@ -967,6 +967,9 @@ struct xhci_event_cmd { ...@@ -967,6 +967,9 @@ struct xhci_event_cmd {
/* Control transfer TRB specific fields */ /* Control transfer TRB specific fields */
#define TRB_DIR_IN (1<<16) #define TRB_DIR_IN (1<<16)
#define TRB_TX_TYPE(p) ((p) << 16)
#define TRB_DATA_OUT 2
#define TRB_DATA_IN 3
/* Isochronous TRB specific fields */ /* Isochronous TRB specific fields */
#define TRB_SIA (1<<31) #define TRB_SIA (1<<31)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册