mac80211: disable power save if an infra AP vif exists
authorRajkumar Manoharan <rmanoharan@atheros.com>
Mon, 31 Jan 2011 18:58:59 +0000 (00:28 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 31 Jan 2011 20:06:26 +0000 (15:06 -0500)
PS should not be enabled if an infra AP vif exists in
the interface list. So while recalculating PS,
AP vif type should be taken into account.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/mac80211/mlme.c

index 32210695b8b6caf04c8affbebf9cc592c0997ce1..dfa752e5520b511db097d64b328fccd8ceb952ce 100644 (file)
@@ -601,6 +601,14 @@ void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency)
        list_for_each_entry(sdata, &local->interfaces, list) {
                if (!ieee80211_sdata_running(sdata))
                        continue;
+               if (sdata->vif.type == NL80211_IFTYPE_AP) {
+                       /* If an AP vif is found, then disable PS
+                        * by setting the count to zero thereby setting
+                        * ps_sdata to NULL.
+                        */
+                       count = 0;
+                       break;
+               }
                if (sdata->vif.type != NL80211_IFTYPE_STATION)
                        continue;
                found = sdata;