summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/main.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-02-22 23:22:30 +0100
committerLuciano Coelho <coelho@ti.com>2011-02-23 10:18:46 +0100
commit09039f42a24084c10e7761ab28ef22932c62a46f (patch)
tree09c46d96003ef58080c3559158c94a7c5dd0b3b7 /drivers/net/wireless/wl12xx/main.c
parentwl12xx: AP mode - fix bug in cleanup of wl1271_op_sta_add() (diff)
downloadlinux-09039f42a24084c10e7761ab28ef22932c62a46f.tar.xz
linux-09039f42a24084c10e7761ab28ef22932c62a46f.zip
wl12xx: AP-mode - count free FW TX blocks per link
Count the number of FW TX blocks allocated per link. We add blocks to a link counter when allocated for a TX descriptor. We remove blocks according to counters in fw_status indicating the number of freed blocks in FW. These counters are polled after each IRQ. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r--drivers/net/wireless/wl12xx/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 92f822043331..5772a33d79ec 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -574,6 +574,17 @@ static void wl1271_fw_status(struct wl1271 *wl,
if (total)
clear_bit(WL1271_FLAG_FW_TX_BUSY, &wl->flags);
+ if (wl->bss_type == BSS_TYPE_AP_BSS) {
+ for (i = 0; i < AP_MAX_LINKS; i++) {
+ u8 cnt = status->tx_lnk_free_blks[i] -
+ wl->links[i].prev_freed_blks;
+
+ wl->links[i].prev_freed_blks =
+ status->tx_lnk_free_blks[i];
+ wl->links[i].allocated_blks -= cnt;
+ }
+ }
+
/* update the host-chipset time offset */
getnstimeofday(&ts);
wl->time_offset = (timespec_to_ns(&ts) >> 10) -