提交 8790736d 编写于 作者: M Mathias Nyman 提交者: Greg Kroah-Hartman

xhci: Add stream id to xhci_dequeue_state structure

The values for the new dequeue segment, new dequeue pointer and new cycle
state are needed for manually moving the xHC ring dequeue pointer.
These are conveniently stored in a xhci_dequeue_state structure.

stream support was added later and stream_id was carried
as a function parameter.

Move the stream_id to the xhci_dequeue_state structure instead.
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cdd504e1
...@@ -483,7 +483,7 @@ struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci, ...@@ -483,7 +483,7 @@ struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci,
/* /*
* Move the xHC's endpoint ring dequeue pointer past cur_td. * Move the xHC's endpoint ring dequeue pointer past cur_td.
* Record the new state of the xHC's endpoint ring dequeue segment, * Record the new state of the xHC's endpoint ring dequeue segment,
* dequeue pointer, and new consumer cycle state in state. * dequeue pointer, stream id, and new consumer cycle state in state.
* Update our internal representation of the ring's dequeue pointer. * Update our internal representation of the ring's dequeue pointer.
* *
* We do this in three jumps: * We do this in three jumps:
...@@ -539,6 +539,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, ...@@ -539,6 +539,7 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
new_seg = ep_ring->deq_seg; new_seg = ep_ring->deq_seg;
new_deq = ep_ring->dequeue; new_deq = ep_ring->dequeue;
state->new_cycle_state = hw_dequeue & 0x1; state->new_cycle_state = hw_dequeue & 0x1;
state->stream_id = stream_id;
/* /*
* We want to find the pointer, segment and cycle state of the new trb * We want to find the pointer, segment and cycle state of the new trb
...@@ -779,7 +780,7 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, ...@@ -779,7 +780,7 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id,
/* If necessary, queue a Set Transfer Ring Dequeue Pointer command */ /* If necessary, queue a Set Transfer Ring Dequeue Pointer command */
if (deq_state.new_deq_ptr && deq_state.new_deq_seg) { if (deq_state.new_deq_ptr && deq_state.new_deq_seg) {
xhci_queue_new_dequeue_state(xhci, slot_id, ep_index, xhci_queue_new_dequeue_state(xhci, slot_id, ep_index,
ep->stopped_td->urb->stream_id, &deq_state); &deq_state);
xhci_ring_cmd_db(xhci); xhci_ring_cmd_db(xhci);
} else { } else {
/* Otherwise ring the doorbell(s) to restart queued transfers */ /* Otherwise ring the doorbell(s) to restart queued transfers */
...@@ -3966,13 +3967,12 @@ int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd, ...@@ -3966,13 +3967,12 @@ int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, struct xhci_command *cmd,
/* Set Transfer Ring Dequeue Pointer command */ /* Set Transfer Ring Dequeue Pointer command */
void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
unsigned int slot_id, unsigned int ep_index, unsigned int slot_id, unsigned int ep_index,
unsigned int stream_id,
struct xhci_dequeue_state *deq_state) struct xhci_dequeue_state *deq_state)
{ {
dma_addr_t addr; dma_addr_t addr;
u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id); u32 trb_slot_id = SLOT_ID_FOR_TRB(slot_id);
u32 trb_ep_index = EP_ID_FOR_TRB(ep_index); u32 trb_ep_index = EP_ID_FOR_TRB(ep_index);
u32 trb_stream_id = STREAM_ID_FOR_TRB(stream_id); u32 trb_stream_id = STREAM_ID_FOR_TRB(deq_state->stream_id);
u32 trb_sct = 0; u32 trb_sct = 0;
u32 type = TRB_TYPE(TRB_SET_DEQ); u32 type = TRB_TYPE(TRB_SET_DEQ);
struct xhci_virt_ep *ep; struct xhci_virt_ep *ep;
...@@ -4010,7 +4010,7 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, ...@@ -4010,7 +4010,7 @@ void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
ep->queued_deq_seg = deq_state->new_deq_seg; ep->queued_deq_seg = deq_state->new_deq_seg;
ep->queued_deq_ptr = deq_state->new_deq_ptr; ep->queued_deq_ptr = deq_state->new_deq_ptr;
if (stream_id) if (deq_state->stream_id)
trb_sct = SCT_FOR_TRB(SCT_PRI_TR); trb_sct = SCT_FOR_TRB(SCT_PRI_TR);
ret = queue_command(xhci, cmd, ret = queue_command(xhci, cmd,
lower_32_bits(addr) | trb_sct | deq_state->new_cycle_state, lower_32_bits(addr) | trb_sct | deq_state->new_cycle_state,
......
...@@ -2849,7 +2849,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, ...@@ -2849,7 +2849,7 @@ void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep, xhci_dbg_trace(xhci, trace_xhci_dbg_reset_ep,
"Queueing new dequeue state"); "Queueing new dequeue state");
xhci_queue_new_dequeue_state(xhci, udev->slot_id, xhci_queue_new_dequeue_state(xhci, udev->slot_id,
ep_index, ep->stopped_stream, &deq_state); ep_index, &deq_state);
} else { } else {
/* Better hope no one uses the input context between now and the /* Better hope no one uses the input context between now and the
* reset endpoint completion! * reset endpoint completion!
......
...@@ -1526,6 +1526,7 @@ struct xhci_dequeue_state { ...@@ -1526,6 +1526,7 @@ struct xhci_dequeue_state {
struct xhci_segment *new_deq_seg; struct xhci_segment *new_deq_seg;
union xhci_trb *new_deq_ptr; union xhci_trb *new_deq_ptr;
int new_cycle_state; int new_cycle_state;
unsigned int stream_id;
}; };
enum xhci_ring_type { enum xhci_ring_type {
...@@ -2052,7 +2053,6 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, ...@@ -2052,7 +2053,6 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci,
struct xhci_dequeue_state *state); struct xhci_dequeue_state *state);
void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci, void xhci_queue_new_dequeue_state(struct xhci_hcd *xhci,
unsigned int slot_id, unsigned int ep_index, unsigned int slot_id, unsigned int ep_index,
unsigned int stream_id,
struct xhci_dequeue_state *deq_state); struct xhci_dequeue_state *deq_state);
void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci, void xhci_cleanup_stalled_ring(struct xhci_hcd *xhci,
unsigned int ep_index, struct xhci_td *td); unsigned int ep_index, struct xhci_td *td);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册