mac80211: introduce hw config change flags
[firefly-linux-kernel-4.4.55.git] / net / mac80211 / wext.c
index 7e0d53abde24bb9e10b86e55d1112b76eaa63331..94c4b35eeb14dd88ac0fc42f3fe28e58d5e1a3db 100644 (file)
@@ -147,7 +147,7 @@ static int ieee80211_ioctl_giwname(struct net_device *dev,
        sband = local->hw.wiphy->bands[IEEE80211_BAND_5GHZ];
        if (sband) {
                is_a = 1;
-               is_ht |= sband->ht_info.ht_supported;
+               is_ht |= sband->ht_cap.ht_supported;
        }
 
        sband = local->hw.wiphy->bands[IEEE80211_BAND_2GHZ];
@@ -160,7 +160,7 @@ static int ieee80211_ioctl_giwname(struct net_device *dev,
                        if (sband->bitrates[i].bitrate == 60)
                                is_g = 1;
                }
-               is_ht |= sband->ht_info.ht_supported;
+               is_ht |= sband->ht_cap.ht_supported;
        }
 
        strcpy(name, "IEEE 802.11");
@@ -656,7 +656,7 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
                                      union iwreq_data *data, char *extra)
 {
        struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-       bool need_reconfig = 0;
+       u32 reconf_flags = 0;
        int new_power_level;
 
        if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM)
@@ -680,21 +680,17 @@ static int ieee80211_ioctl_siwtxpower(struct net_device *dev,
 
        if (local->hw.conf.power_level != new_power_level) {
                local->hw.conf.power_level = new_power_level;
-               need_reconfig = 1;
+               reconf_flags |= IEEE80211_CONF_CHANGE_POWER;
        }
 
        if (local->hw.conf.radio_enabled != !(data->txpower.disabled)) {
                local->hw.conf.radio_enabled = !(data->txpower.disabled);
-               need_reconfig = 1;
+               reconf_flags |= IEEE80211_CONF_CHANGE_RADIO_ENABLED;
                ieee80211_led_radio(local, local->hw.conf.radio_enabled);
        }
 
-       if (need_reconfig) {
-               ieee80211_hw_config(local);
-               /* The return value of hw_config is not of big interest here,
-                * as it doesn't say that it failed because of _this_ config
-                * change or something else. Ignore it. */
-       }
+       if (reconf_flags)
+               ieee80211_hw_config(local, reconf_flags);
 
        return 0;
 }
@@ -775,7 +771,7 @@ static int ieee80211_ioctl_siwfrag(struct net_device *dev,
         * configure it here */
 
        if (local->ops->set_frag_threshold)
-               local->ops->set_frag_threshold(
+               return local->ops->set_frag_threshold(
                        local_to_hw(local),
                        local->fragmentation_threshold);
 
@@ -980,7 +976,7 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
 
        if (wrq->disabled) {
                conf->flags &= ~IEEE80211_CONF_PS;
-               return ieee80211_hw_config(local);
+               return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
        }
 
        switch (wrq->flags & IW_POWER_MODE) {
@@ -993,7 +989,7 @@ static int ieee80211_ioctl_siwpower(struct net_device *dev,
                return -EINVAL;
        }
 
-       return ieee80211_hw_config(local);
+       return ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_PS);
 }
 
 static int ieee80211_ioctl_giwpower(struct net_device *dev,