[PATCH v2] usb: xhci: Rename xhci_queue_xxx_tx() to xhci_queue_xxx_urb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The xhci_queue_bulk_tx() function is used for both OUT and IN
transactions, but the name implies that it is only used for transmits.
Rename it to xhci_queue_bulk_urb() to avoid any confusion.

Similarly rename the functions for ctrl, intr and isoc URB.
Rename the existing xhci_queue_isoc_tx() to write_isoc_trbs() to allow
consistent naming.

Signed-off-by: David Laight <david.laight@xxxxxxxxxx>
---
Changes for v2:
- Modified so that it applies before one of my other patches.
(which also needs a v2 now)

 drivers/usb/host/xhci-ring.c | 16 ++++++++--------
 drivers/usb/host/xhci.c      |  8 ++++----
 drivers/usb/host/xhci.h      |  8 ++++----
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 6d8b119..b98031b 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -3197,7 +3197,7 @@ static void giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
  * (comprised of sg list entries) can take several service intervals to
  * transmit.
  */
-int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+int xhci_queue_intr_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_ep_ctx *ep_ctx = xhci_get_ep_ctx(xhci,
@@ -3225,7 +3225,7 @@ int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 				urb->dev->speed == USB_SPEED_FULL)
 			urb->interval /= 8;
 	}
-	return xhci_queue_bulk_tx(xhci, mem_flags, urb, slot_id, ep_index);
+	return xhci_queue_bulk_urb(xhci, mem_flags, urb, slot_id, ep_index);
 }
 
 /*
@@ -3429,7 +3429,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 }
 
 /* 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,
+int xhci_queue_bulk_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_ring *ep_ring;
@@ -3562,7 +3562,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
 }
 
 /* Caller must have locked xhci->lock */
-int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+int xhci_queue_ctrl_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_ring *ep_ring;
@@ -3749,7 +3749,7 @@ static unsigned int xhci_get_last_burst_packet_count(struct xhci_hcd *xhci,
 }
 
 /* This is for isoc transfer */
-static int xhci_queue_isoc_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
+static int write_isoc_trbs(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_ring *ep_ring;
@@ -3930,11 +3930,11 @@ cleanup:
 /*
  * Check transfer ring to guarantee there is enough room for the urb.
  * Update ISO URB start_frame and interval.
- * Update interval as xhci_queue_intr_tx does. Just use xhci frame_index to
+ * Update interval as xhci_queue_intr_urb does. Just use xhci frame_index to
  * update the urb->start_frame by now.
  * Always assume URB_ISO_ASAP set, and NEVER use urb->start_frame as input.
  */
-int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
+int xhci_queue_isoc_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index)
 {
 	struct xhci_virt_device *xdev;
@@ -3993,7 +3993,7 @@ int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
 	}
 	ep_ring->num_trbs_free_temp = ep_ring->num_trbs_free;
 
-	return xhci_queue_isoc_tx(xhci, mem_flags, urb, slot_id, ep_index);
+	return write_isoc_trbs(xhci, mem_flags, urb, slot_id, ep_index);
 }
 
 /****		Command Ring Operations		****/
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 4f378f3..076292f 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1302,7 +1302,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 		spin_lock_irqsave(&xhci->lock, flags);
 		if (xhci->xhc_state & XHCI_STATE_DYING)
 			goto dying;
-		ret = xhci_queue_ctrl_tx(xhci, GFP_ATOMIC, urb,
+		ret = xhci_queue_ctrl_urb(xhci, GFP_ATOMIC, urb,
 				slot_id, ep_index);
 		if (ret)
 			goto free_priv;
@@ -1323,7 +1323,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 					"not having streams.\n");
 			ret = -EINVAL;
 		} else {
-			ret = xhci_queue_bulk_tx(xhci, GFP_ATOMIC, urb,
+			ret = xhci_queue_bulk_urb(xhci, GFP_ATOMIC, urb,
 					slot_id, ep_index);
 		}
 		if (ret)
@@ -1333,7 +1333,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 		spin_lock_irqsave(&xhci->lock, flags);
 		if (xhci->xhc_state & XHCI_STATE_DYING)
 			goto dying;
-		ret = xhci_queue_intr_tx(xhci, GFP_ATOMIC, urb,
+		ret = xhci_queue_intr_urb(xhci, GFP_ATOMIC, urb,
 				slot_id, ep_index);
 		if (ret)
 			goto free_priv;
@@ -1342,7 +1342,7 @@ int xhci_urb_enqueue(struct usb_hcd *hcd, struct urb *urb, gfp_t mem_flags)
 		spin_lock_irqsave(&xhci->lock, flags);
 		if (xhci->xhc_state & XHCI_STATE_DYING)
 			goto dying;
-		ret = xhci_queue_isoc_tx_prepare(xhci, GFP_ATOMIC, urb,
+		ret = xhci_queue_isoc_urb(xhci, GFP_ATOMIC, urb,
 				slot_id, ep_index);
 		if (ret)
 			goto free_priv;
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 0395e94..6f38ab7 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1818,13 +1818,13 @@ int xhci_queue_vendor_command(struct xhci_hcd *xhci,
 		u32 field1, u32 field2, u32 field3, u32 field4);
 int xhci_queue_stop_endpoint(struct xhci_hcd *xhci, int slot_id,
 		unsigned int ep_index, int suspend);
-int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
+int xhci_queue_ctrl_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
 		int slot_id, unsigned int ep_index);
-int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
+int xhci_queue_bulk_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
 		int slot_id, unsigned int ep_index);
-int xhci_queue_intr_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
+int xhci_queue_intr_urb(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb,
 		int slot_id, unsigned int ep_index);
-int xhci_queue_isoc_tx_prepare(struct xhci_hcd *xhci, gfp_t mem_flags,
+int xhci_queue_isoc_urb(struct xhci_hcd *xhci, gfp_t mem_flags,
 		struct urb *urb, int slot_id, unsigned int ep_index);
 int xhci_queue_configure_endpoint(struct xhci_hcd *xhci, dma_addr_t in_ctx_ptr,
 		u32 slot_id, bool command_must_succeed);
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux