Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH v2] wl12xx: use ieee80211_free_txskb()
@ 2011-12-13 13:26 Eliad Peller
  2011-12-15  8:54 ` Luciano Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Eliad Peller @ 2011-12-13 13:26 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless

Use the newly introduced ieee80211_free_txskb() instead
of dev_kfree_skb() for failed tx packets.

Additionally, if the skb is a dummy packet, re-enqueue
it (as the fw expects it) instead of freeing it.

Reported-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
---
v2: handle dummy packets (thanks Arik)

 drivers/net/wireless/wl12xx/main.c |    2 +-
 drivers/net/wireless/wl12xx/tx.c   |    9 ++++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 2a0fb86..22106a6 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1532,7 +1532,7 @@ static void wl1271_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 	if (hlid == WL12XX_INVALID_LINK_ID ||
 	    (wlvif && !test_bit(hlid, wlvif->links_map))) {
 		wl1271_debug(DEBUG_TX, "DROP skb hlid %d q %d", hlid, q);
-		dev_kfree_skb(skb);
+		ieee80211_free_txskb(hw, skb);
 		goto out;
 	}
 
diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index df20e12..431b2f8 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -749,7 +749,14 @@ void wl1271_tx_work_locked(struct wl1271 *wl)
 			set_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
 			goto out_ack;
 		} else if (ret < 0) {
-			dev_kfree_skb(skb);
+			if (wl12xx_is_dummy_packet(wl, skb))
+				/*
+				 * fw still expects dummy packet,
+				 * so re-enqueue it
+				 */
+				wl1271_skb_queue_head(wl, wlvif, skb);
+			else
+				ieee80211_free_txskb(wl->hw, skb);
 			goto out_ack;
 		}
 		buf_offset += ret;
-- 
1.7.6.401.g6a319


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

* Re: [PATCH v2] wl12xx: use ieee80211_free_txskb()
  2011-12-13 13:26 [PATCH v2] wl12xx: use ieee80211_free_txskb() Eliad Peller
@ 2011-12-15  8:54 ` Luciano Coelho
  0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2011-12-15  8:54 UTC (permalink / raw)
  To: Eliad Peller; +Cc: linux-wireless

On Tue, 2011-12-13 at 15:26 +0200, Eliad Peller wrote: 
> Use the newly introduced ieee80211_free_txskb() instead
> of dev_kfree_skb() for failed tx packets.
> 
> Additionally, if the skb is a dummy packet, re-enqueue
> it (as the fw expects it) instead of freeing it.
> 
> Reported-by: Arik Nemtsov <arik@wizery.com>
> Signed-off-by: Eliad Peller <eliad@wizery.com>
> ---

Applied, thanks Eliad!

-- 
Cheers,
Luca.


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

end of thread, other threads:[~2011-12-15  8:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 13:26 [PATCH v2] wl12xx: use ieee80211_free_txskb() Eliad Peller
2011-12-15  8:54 ` Luciano Coelho

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox