mac80211: allow to set smps mode to OFF in AP mode
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 7 Jan 2014 11:11:41 +0000 (13:11 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 7 Jan 2014 15:25:49 +0000 (16:25 +0100)
In managed mode, we should not ask for OFF mode because the
power settings may still require DYNAMIC. In AP mode, this
should be allowed since the default settings is OFF and
AUTOMATIC is not allowed.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/ht.c

index 9a8be8f69224d0be11fe9b10a0176a2f5a0002f1..fab7b91923e0a8b93313797b53a469234ce83506 100644 (file)
@@ -479,10 +479,9 @@ void ieee80211_request_smps(struct ieee80211_vif *vif,
                         vif->type != NL80211_IFTYPE_AP))
                return;
 
-       if (WARN_ON(smps_mode == IEEE80211_SMPS_OFF))
-               smps_mode = IEEE80211_SMPS_AUTOMATIC;
-
        if (vif->type == NL80211_IFTYPE_STATION) {
+               if (WARN_ON(smps_mode == IEEE80211_SMPS_OFF))
+                       smps_mode = IEEE80211_SMPS_AUTOMATIC;
                if (sdata->u.mgd.driver_smps_mode == smps_mode)
                        return;
                sdata->u.mgd.driver_smps_mode = smps_mode;