]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/mac80211/ht.c
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
[karo-tx-linux.git] / net / mac80211 / ht.c
index 9a8be8f69224d0be11fe9b10a0176a2f5a0002f1..70dd013de8361e39c95264eeae967e193fe240e5 100644 (file)
@@ -466,7 +466,9 @@ void ieee80211_request_smps_ap_work(struct work_struct *work)
                             u.ap.request_smps_work);
 
        sdata_lock(sdata);
-       __ieee80211_request_smps_ap(sdata, sdata->u.ap.driver_smps_mode);
+       if (sdata_dereference(sdata->u.ap.beacon, sdata))
+               __ieee80211_request_smps_ap(sdata,
+                                           sdata->u.ap.driver_smps_mode);
        sdata_unlock(sdata);
 }
 
@@ -479,10 +481,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;