Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wl12xx: Restart TX when TX descriptors are available
@ 2011-04-18 13:44 Ido Yariv
  2011-04-29 20:05 ` Luciano Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Ido Yariv @ 2011-04-18 13:44 UTC (permalink / raw)
  To: Luciano Coelho; +Cc: linux-wireless, Ido Yariv

The driver stops sending TX packets when either there aren't enough
memory blocks, or it runs out of TX descriptors. The driver continues to
send packets to the FW only when more memory blocks are available.

The FW might free TX descriptors without freeing the corresponding
memory blocks, especially when dynamic memory is enabled. In cases where
memory blocks are not freed at all, the driver will keep waiting for
more memory blocks indefinitely.

Fix this by clearing the WL1271_FLAG_FW_TX_BUSY flag when there are
available TX descriptors.

Signed-off-by: Ido Yariv <ido@wizery.com>
---
 drivers/net/wireless/wl12xx/tx.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c
index 7a3339f..5a1575f 100644
--- a/drivers/net/wireless/wl12xx/tx.c
+++ b/drivers/net/wireless/wl12xx/tx.c
@@ -65,6 +65,9 @@ static int wl1271_alloc_tx_id(struct wl1271 *wl, struct sk_buff *skb)
 static void wl1271_free_tx_id(struct wl1271 *wl, int id)
 {
 	if (__test_and_clear_bit(id, wl->tx_frames_map)) {
+		if (unlikely(wl->tx_frames_cnt == ACX_TX_DESCRIPTORS))
+			clear_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
+
 		wl->tx_frames[id] = NULL;
 		wl->tx_frames_cnt--;
 	}
-- 
1.7.1


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

end of thread, other threads:[~2011-04-29 20:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 13:44 [PATCH] wl12xx: Restart TX when TX descriptors are available Ido Yariv
2011-04-29 20:05 ` Luciano Coelho

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