aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hif_usb.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2010-04-16 02:24:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:47:11 -0400
commiteac8e385e9446e591aacbc9ef2c2a3b0836dd2d4 (patch)
tree5484400ffd79db6811cedd2b779b0d69ede2a238 /drivers/net/wireless/ath/ath9k/hif_usb.c
parent0daa3e3a7d85d70cdd4d9cc8e589e79a4a37a5ef (diff)
ath9k_htc: Add dropped SKB count to debugfs
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hif_usb.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index fe994e22989..3091bb3cef9 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -129,6 +129,7 @@ static void hif_usb_tx_cb(struct urb *urb)
129 TX_STAT_INC(skb_completed); 129 TX_STAT_INC(skb_completed);
130 } else { 130 } else {
131 dev_kfree_skb_any(skb); 131 dev_kfree_skb_any(skb);
132 TX_STAT_INC(skb_dropped);
132 } 133 }
133 } 134 }
134 135
@@ -149,11 +150,15 @@ static void hif_usb_tx_cb(struct urb *urb)
149 } 150 }
150} 151}
151 152
152static inline void ath9k_skb_queue_purge(struct sk_buff_head *list) 153static inline void ath9k_skb_queue_purge(struct hif_device_usb *hif_dev,
154 struct sk_buff_head *list)
153{ 155{
154 struct sk_buff *skb; 156 struct sk_buff *skb;
155 while ((skb = __skb_dequeue(list)) != NULL) 157
158 while ((skb = __skb_dequeue(list)) != NULL) {
156 dev_kfree_skb_any(skb); 159 dev_kfree_skb_any(skb);
160 TX_STAT_INC(skb_dropped);
161 }
157} 162}
158 163
159/* TX lock has to be taken */ 164/* TX lock has to be taken */
@@ -214,7 +219,7 @@ static int __hif_usb_tx(struct hif_device_usb *hif_dev)
214 ret = usb_submit_urb(tx_buf->urb, GFP_ATOMIC); 219 ret = usb_submit_urb(tx_buf->urb, GFP_ATOMIC);
215 if (ret) { 220 if (ret) {
216 tx_buf->len = tx_buf->offset = 0; 221 tx_buf->len = tx_buf->offset = 0;
217 ath9k_skb_queue_purge(&tx_buf->skb_queue); 222 ath9k_skb_queue_purge(hif_dev, &tx_buf->skb_queue);
218 __skb_queue_head_init(&tx_buf->skb_queue); 223 __skb_queue_head_init(&tx_buf->skb_queue);
219 list_move_tail(&tx_buf->list, &hif_dev->tx.tx_buf); 224 list_move_tail(&tx_buf->list, &hif_dev->tx.tx_buf);
220 hif_dev->tx.tx_buf_cnt++; 225 hif_dev->tx.tx_buf_cnt++;
@@ -281,7 +286,7 @@ static void hif_usb_stop(void *hif_handle, u8 pipe_id)
281 unsigned long flags; 286 unsigned long flags;
282 287
283 spin_lock_irqsave(&hif_dev->tx.tx_lock, flags); 288 spin_lock_irqsave(&hif_dev->tx.tx_lock, flags);
284 ath9k_skb_queue_purge(&hif_dev->tx.tx_skb_queue); 289 ath9k_skb_queue_purge(hif_dev, &hif_dev->tx.tx_skb_queue);
285 hif_dev->tx.tx_skb_cnt = 0; 290 hif_dev->tx.tx_skb_cnt = 0;
286 hif_dev->tx.flags |= HIF_USB_TX_STOP; 291 hif_dev->tx.flags |= HIF_USB_TX_STOP;
287 spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags); 292 spin_unlock_irqrestore(&hif_dev->tx.tx_lock, flags);