aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ti
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2013-09-09 05:24:43 -0400
committerLuciano Coelho <luciano.coelho@intel.com>2013-10-23 02:47:44 -0400
commite9687ea9caaf9f961df8144a95ca63ec77c02b49 (patch)
tree585f51e22d1d20ccc7e559235cb64b350ce51e83 /drivers/net/wireless/ti
parent2473ec8f909d8c46e52e13f6fc3215c9c08400c8 (diff)
wlcore: fix started_vifs calculation
wlcore configures different dwell times according to number of active interfaces (in order to prevent hurting VO during scan). However, determining active vif only according to bss_conf->idle is not explicit enough, and might result in non-started vifs being counted as started as well (e.g. unassociated sta during sta). Fix it by checking for explicit conditions according to the vif type. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/ti')
-rw-r--r--drivers/net/wireless/ti/wlcore/scan.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/wireless/ti/wlcore/scan.c b/drivers/net/wireless/ti/wlcore/scan.c
index 13e743df2e31..7ed86203304b 100644
--- a/drivers/net/wireless/ti/wlcore/scan.c
+++ b/drivers/net/wireless/ti/wlcore/scan.c
@@ -92,9 +92,31 @@ out:
92static void wlcore_started_vifs_iter(void *data, u8 *mac, 92static void wlcore_started_vifs_iter(void *data, u8 *mac,
93 struct ieee80211_vif *vif) 93 struct ieee80211_vif *vif)
94{ 94{
95 struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif);
96 bool active = false;
95 int *count = (int *)data; 97 int *count = (int *)data;
96 98
97 if (!vif->bss_conf.idle) 99 /*
100 * count active interfaces according to interface type.
101 * checking only bss_conf.idle is bad for some cases, e.g.
102 * we don't want to count sta in p2p_find as active interface.
103 */
104 switch (wlvif->bss_type) {
105 case BSS_TYPE_STA_BSS:
106 if (test_bit(WLVIF_FLAG_STA_ASSOCIATED, &wlvif->flags))
107 active = true;
108 break;
109
110 case BSS_TYPE_AP_BSS:
111 if (wlvif->wl->active_sta_count > 0)
112 active = true;
113 break;
114
115 default:
116 break;
117 }
118
119 if (active)
98 (*count)++; 120 (*count)++;
99} 121}
100 122