Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56d4f8f6 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho
Browse files

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent f8e0af6b
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@
#include "reg.h"
#include "reg.h"
#include "ps.h"
#include "ps.h"
#include "tx.h"
#include "tx.h"
#include "event.h"


static int wl1271_set_default_wep_key(struct wl1271 *wl, u8 id)
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)
	if (hlid < WL1271_AP_STA_HLID_START)
		return;
		return;


	if (WARN_ON(!wl1271_is_active_sta(wl, hlid)))
	    return;

	fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map);
	fw_ps = test_bit(hlid, (unsigned long *)&wl->ap_fw_ps_map);
	tx_pkts = wl->links[hlid].allocated_pkts;
	tx_pkts = wl->links[hlid].allocated_pkts;