linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [01/20] usb: host: xhci: rename queue_bulk_tx() to queue_bulk_intr_tx()
@ 2018-04-30 15:29 Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2018-04-30 15:29 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linux USB

Hi,

Felipe Balbi <felipe.balbi@linux.intel.com> writes:
> That function is used for both Bulk and Interrupt transfer types,
> let's make it clear on the function name and provide one extra helper
> for queueing bulk transfers.
>
> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

gentle reminder about this series.

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [01/20] usb: host: xhci: rename queue_bulk_tx() to queue_bulk_intr_tx()
@ 2018-04-16 12:29 Felipe Balbi
  0 siblings, 0 replies; 2+ messages in thread
From: Felipe Balbi @ 2018-04-16 12:29 UTC (permalink / raw)
  To: Mathias Nyman; +Cc: Linux USB, Felipe Balbi

That function is used for both Bulk and Interrupt transfer types,
let's make it clear on the function name and provide one extra helper
for queueing bulk transfers.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
---
 drivers/usb/host/xhci-ring.c | 23 +++++++++++++++++++++--
 drivers/usb/host/xhci.c      |  6 ------
 2 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 91a1a824673d..e9c6053f90c5 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3064,6 +3064,9 @@ static void check_interval(struct xhci_hcd *xhci, struct urb *urb,
 	}
 }
 
+static int xhci_queue_bulk_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+		struct urb *urb, int slot_id, unsigned int ep_index);
+
 /*
  * xHCI uses normal TRBs for both bulk and interrupt.  When the interrupt
  * endpoint is to be serviced, the xHC will consume (at most) one TD.  A TD
@@ -3078,7 +3081,23 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 	ep_ctx = xhci_get_ep_ctx(xhci, xhci->devs[slot_id]->out_ctx, ep_index);
 	check_interval(xhci, urb, ep_ctx);
 
-	return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index);
+	return xhci_queue_bulk_intr_tx(xhci, mem_flags, urb, slot_id, ep_index);
+}
+
+int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+		struct urb *urb, int slot_id, unsigned int ep_index)
+{
+	unsigned int ep_state;
+
+	ep_state = xhci->devs[slot_id]->eps[ep_index].ep_state;
+
+	if (ep_state & (EP_GETTING_STREAMS | EP_GETTING_NO_STREAMS)) {
+		xhci_warn(xhci, "WARN: Can't enqueue URB, ep in streams transition state %x\n",
+				ep_state);
+		return -EINVAL;
+	}
+
+	return xhci_queue_bulk_intr_tx(xhci, mem_flags, urb, slot_id, ep_index);
 }
 
 /*
@@ -3189,7 +3208,7 @@ static int xhci_align_td(struct xhci_hcd *xhci, struct urb *urb, u32 enqd_len,
 }
 
 /* This is very similar to what ehci-q.c qtd_fill() does */
-int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+static int xhci_queue_bulk_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_ring *ring;
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 9b27798ecce5..65c454b94165 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1353,12 +1353,6 @@ static int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flag
 		ret = -ESHUTDOWN;
 		goto free_priv;
 	}
-	if (*ep_state & (EP_GETTING_STREAMS | EP_GETTING_NO_STREAMS)) {
-		xhci_warn(xhci, "WARN: Can't enqueue URB, ep in streams transition state %x\n",
-			  *ep_state);
-		ret = -EINVAL;
-		goto free_priv;
-	}
 	if (*ep_state & EP_SOFT_CLEAR_TOGGLE) {
 		xhci_warn(xhci, "Can't enqueue URB while manually clearing toggle\n");
 		ret = -EINVAL;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-04-30 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-30 15:29 [01/20] usb: host: xhci: rename queue_bulk_tx() to queue_bulk_intr_tx() Felipe Balbi
  -- strict thread matches above, loose matches on Subject: below --
2018-04-16 12:29 Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).