Skip to contentSkip to conversation

ar9170usb: introduce tx urb queue

PATCH In review Christian Lamparter 1 participant 2 messages May 12, 2009

lore
Share & tools
lore
#0 lore raw

PATCH v2 5/6 ar9170usb: introduce tx urb queue

This patch is a back-port of some tx-aggregation code.

In the past, we didn't limit the amount of active tx_urb. However, ar9170 only has a limited buffer reserved for pending data frames.

---
Changes v2 -> v1:
- removed leaky auto reset. It will be enabled again, once the tx-aggregation code is ready for action.
---

drivers/net/wireless/ath/ar9170/ar9170.h +3 -0
index 77dc647..cd3d1ed 100644
@@ -121,6 +121,8 @@ struct ar9170 {
 	int (*exec_cmd)(struct ar9170 *, enum ar9170_cmd, u32 ,
 			void *, u32 , void *);
 	void (*callback_cmd)(struct ar9170 *, u32 , void *);
+	void (*reset)(struct ar9170 *);
+	int (*flush)(struct ar9170 *);
 
 	/* interface mode settings */
 	struct ieee80211_vif *vif;
@@ -206,6 +208,7 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb);
 void ar9170_unregister(struct ar9170 *ar);
 void ar9170_handle_tx_status(struct ar9170 *ar, struct sk_buff *skb,
 			     bool update_statistics, u16 tx_status);
+void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
 
 /* MAC */
 int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
drivers/net/wireless/ath/ar9170/main.c +2 -2
index df83883..a66aa7d 100644
@@ -374,8 +374,8 @@ static void ar9170_tx_status_janitor(struct work_struct *work)
 	mutex_unlock(&ar->mutex);
 }
 
-static void ar9170_handle_command_response(struct ar9170 *ar,
-					   void *buf, u32 len)
+void ar9170_handle_command_response(struct ar9170 *ar,
+				    void *buf, u32 len)
 {
 	struct ar9170_cmd_response *cmd = (void *) buf;
 
drivers/net/wireless/ath/ar9170/usb.c +136 -33

294 lines not on this page · raw message

drivers/net/wireless/ath/ar9170/usb.h +8 -1
index ac42586..d75e6ee 100644
@@ -51,6 +51,7 @@
 #include "ar9170.h"
 
 #define AR9170_NUM_RX_URBS			16
+#define AR9170_NUM_TX_URBS			8
 
 struct firmware;
 
@@ -60,15 +61,21 @@ struct ar9170_usb {
 	struct usb_interface *intf;
 
 	struct usb_anchor rx_submitted;
+	struct usb_anchor tx_pending;
 	struct usb_anchor tx_submitted;
 
-	spinlock_t cmdlock;
+	spinlock_t tx_urb_lock;
+	unsigned int tx_submitted_urbs;
+	unsigned int tx_pending_urbs;
+
 	struct completion cmd_wait;
 	int readlen;
 	u8 *readbuf;
 
 	const struct firmware *init_values;
 	const struct firmware *firmware;
+
+	struct work_struct reset_work;
 };
 
 #endif /* __USB_H */
#1 lore raw

This patch is a back-port of some tx-aggregation code.

In the past, we didn't limit the amount of active tx_urb. However, ar9170 only has a limited buffer reserved for pending data frames.

---
Changes
v3-> v2:
- run diff against a clean tree... sorry!

v2 -> v1:
- removed leaky auto reset. It will be enabled again, once the tx-aggregation code is ready for action.
---

drivers/net/wireless/ath/ar9170/ar9170.h +3 -0
index 77dc647..cd3d1ed 100644
@@ -121,6 +121,8 @@ struct ar9170 {
 	int (*exec_cmd)(struct ar9170 *, enum ar9170_cmd, u32 ,
 			void *, u32 , void *);
 	void (*callback_cmd)(struct ar9170 *, u32 , void *);
+	void (*reset)(struct ar9170 *);
+	int (*flush)(struct ar9170 *);
 
 	/* interface mode settings */
 	struct ieee80211_vif *vif;
@@ -206,6 +208,7 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb);
 void ar9170_unregister(struct ar9170 *ar);
 void ar9170_handle_tx_status(struct ar9170 *ar, struct sk_buff *skb,
 			     bool update_statistics, u16 tx_status);
+void ar9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len);
 
 /* MAC */
 int ar9170_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
drivers/net/wireless/ath/ar9170/main.c +2 -2
index df83883..a66aa7d 100644
@@ -374,8 +374,8 @@ static void ar9170_tx_status_janitor(struct work_struct *work)
 	mutex_unlock(&ar->mutex);
 }
 
-static void ar9170_handle_command_response(struct ar9170 *ar,
-					   void *buf, u32 len)
+void ar9170_handle_command_response(struct ar9170 *ar,
+				    void *buf, u32 len)
 {
 	struct ar9170_cmd_response *cmd = (void *) buf;
 
drivers/net/wireless/ath/ar9170/usb.c +135 -29

283 lines not on this page · raw message

drivers/net/wireless/ath/ar9170/usb.h +8 -1
index ac42586..d75e6ee 100644
@@ -51,6 +51,7 @@
 #include "ar9170.h"
 
 #define AR9170_NUM_RX_URBS			16
+#define AR9170_NUM_TX_URBS			8
 
 struct firmware;
 
@@ -60,15 +61,21 @@ struct ar9170_usb {
 	struct usb_interface *intf;
 
 	struct usb_anchor rx_submitted;
+	struct usb_anchor tx_pending;
 	struct usb_anchor tx_submitted;
 
-	spinlock_t cmdlock;
+	spinlock_t tx_urb_lock;
+	unsigned int tx_submitted_urbs;
+	unsigned int tx_pending_urbs;
+
 	struct completion cmd_wait;
 	int readlen;
 	u8 *readbuf;
 
 	const struct firmware *init_values;
 	const struct firmware *firmware;
+
+	struct work_struct reset_work;
 };
 
 #endif /* __USB_H */