From: Arik Nemtsov Date: Thu, 25 Aug 2011 09:43:13 +0000 (+0300) Subject: wl12xx: AP mode - don't regulate FW blocks for non-active STAs X-Git-Tag: next-20110920~55^2~49^2~6 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=56d4f8f685c073c7ed7203b78c57f5d893d65102;p=karo-tx-linux.git wl12xx: AP mode - don't regulate FW blocks for non-active STAs Check a STA is associated before regulating its PS-status in mac80211. Should never happen, so warn as a precaution. [Small cosmetic change wrt Kalle Valo's comment. -- Luca] Signed-off-by: Arik Nemtsov Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/wl12xx/tx.c b/drivers/net/wireless/wl12xx/tx.c index b6b2d3ac75cf..b876e9eb4e83 100644 --- a/drivers/net/wireless/wl12xx/tx.c +++ b/drivers/net/wireless/wl12xx/tx.c @@ -30,6 +30,7 @@ #include "reg.h" #include "ps.h" #include "tx.h" +#include "event.h" static int wl1271_set_default_wep_key(struct wl1271 *wl, u8 id) { @@ -132,6 +133,9 @@ static void wl1271_tx_regulate_link(struct wl1271 *wl, u8 hlid) if (hlid < WL1271_AP_STA_HLID_START) return; + if (WARN_ON(!wl1271_is_active_sta(wl, hlid))) + return; + fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map); tx_pkts = wl->links[hlid].allocated_pkts;