9e9eba7417a2c6f8cb6530a28258982b8af47869
[openwrt.git] / package / kernel / mac80211 / patches / 914-wlcore-consider-multiple-APs-when-checking-active_link_count.patch
1 Each AP has its own global and broadcast links, so when
2 checking for active sta count (according to the active_link_count)
3 we must take them all into account.
4
5 Signed-off-by: Eliad Peller <eliad@wizery.com>
6
7 ---
8 drivers/net/wireless/ti/wlcore/main.c | 10 +++++-----
9  drivers/net/wireless/ti/wlcore/tx.c   | 10 +++++-----
10  2 files changed, 10 insertions(+), 10 deletions(-)
11
12 --- a/drivers/net/wireless/ti/wlcore/main.c
13 +++ b/drivers/net/wireless/ti/wlcore/main.c
14 @@ -345,12 +345,12 @@ static void wl12xx_irq_ps_regulate_link(
15          * Start high-level PS if the STA is asleep with enough blocks in FW.
16          * Make an exception if this is the only connected link. In this
17          * case FW-memory congestion is less of a problem.
18 -        * Note that a single connected STA means 3 active links, since we must
19 -        * account for the global and broadcast AP links. The "fw_ps" check
20 -        * assures us the third link is a STA connected to the AP. Otherwise
21 -        * the FW would not set the PSM bit.
22 +        * Note that a single connected STA means 2*ap_count + 1 active links,
23 +        * since we must account for the global and broadcast AP links
24 +        * for each AP. The "fw_ps" check assures us the other link is a STA
25 +        * connected to the AP. Otherwise the FW would not set the PSM bit.
26          */
27 -       else if (wl->active_link_count > 3 && fw_ps &&
28 +       else if (wl->active_link_count > (wl->ap_count*2 + 1) && fw_ps &&
29                  tx_pkts >= WL1271_PS_STA_MAX_PACKETS)
30                 wl12xx_ps_link_start(wl, wlvif, hlid, true);
31  }
32 --- a/drivers/net/wireless/ti/wlcore/tx.c
33 +++ b/drivers/net/wireless/ti/wlcore/tx.c
34 @@ -134,12 +134,12 @@ static void wl1271_tx_regulate_link(stru
35          * into high-level PS and clean out its TX queues.
36          * Make an exception if this is the only connected link. In this
37          * case FW-memory congestion is less of a problem.
38 -        * Note that a single connected STA means 3 active links, since we must
39 -        * account for the global and broadcast AP links. The "fw_ps" check
40 -        * assures us the third link is a STA connected to the AP. Otherwise
41 -        * the FW would not set the PSM bit.
42 +        * Note that a single connected STA means 2*ap_count + 1 active links,
43 +        * since we must account for the global and broadcast AP links
44 +        * for each AP. The "fw_ps" check assures us the other link is a STA
45 +        * connected to the AP. Otherwise the FW would not set the PSM bit.
46          */
47 -       if (wl->active_link_count > 3 && fw_ps &&
48 +       if (wl->active_link_count > (wl->ap_count*2 + 1) && fw_ps &&
49             tx_pkts >= WL1271_PS_STA_MAX_PACKETS)
50                 wl12xx_ps_link_start(wl, wlvif, hlid, true);
51  }