mac80211: replace SMPS hw flags with wiphy feature bits
authorEliad Peller <eliad@wizery.com>
Wed, 10 Sep 2014 11:07:36 +0000 (14:07 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 11 Sep 2014 11:37:02 +0000 (13:37 +0200)
Use the new static_smps / dynamic_smps feature bits
instead of mac80211-internal hw flags.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/iwlegacy/4965-mac.c
drivers/net/wireless/iwlwifi/dvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/mac80211_hwsim.c
include/net/mac80211.h
net/mac80211/debugfs.c
net/mac80211/debugfs_netdev.c
net/mac80211/mlme.c

index 9d61bb157189bed0798170f8f5be5b76ead4387b..4b5f0011ab5df5a5a34d5817d44957cf66e4abe3 100644 (file)
@@ -4759,7 +4759,6 @@ int ath10k_mac_register(struct ath10k *ar)
                        IEEE80211_HW_MFP_CAPABLE |
                        IEEE80211_HW_REPORTS_TX_ACK_STATUS |
                        IEEE80211_HW_HAS_RATE_CONTROL |
-                       IEEE80211_HW_SUPPORTS_STATIC_SMPS |
                        IEEE80211_HW_AP_LINK_PS |
                        IEEE80211_HW_SPECTRUM_MGMT;
 
@@ -4767,8 +4766,10 @@ int ath10k_mac_register(struct ath10k *ar)
         * bytes is used for padding/alignment if necessary. */
        ar->hw->extra_tx_headroom += sizeof(struct htt_data_tx_desc_frag)*2 + 4;
 
+       ar->hw->wiphy->features |= NL80211_FEATURE_STATIC_SMPS;
+
        if (ar->ht_cap_info & WMI_HT_CAP_DYNAMIC_SMPS)
-               ar->hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS;
+               ar->hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS;
 
        if (ar->ht_cap_info & WMI_HT_CAP_ENABLED) {
                ar->hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
index 3dcbe2cd2b287eebce041abc45b5de72d4f3d935..9f930a0cba092476cfc53613aec92b591b85fb2a 100644 (file)
@@ -5757,9 +5757,8 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
            IEEE80211_HW_REPORTS_TX_ACK_STATUS | IEEE80211_HW_SUPPORTS_PS |
            IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
        if (il->cfg->sku & IL_SKU_N)
-               hw->flags |=
-                   IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-                   IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+               hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS |
+                                      NL80211_FEATURE_STATIC_SMPS;
 
        hw->sta_data_size = sizeof(struct il_station_priv);
        hw->vif_data_size = sizeof(struct il_vif_priv);
index afb98f4fdaf3608afd3c9ab844ed34c8dff6851a..2364a3c09b9eb8037ba6237112c679749a3ac94c 100644 (file)
@@ -125,8 +125,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
         */
 
        if (priv->nvm_data->sku_cap_11n_enable)
-               hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-                            IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+               hw->wiphy->features |= NL80211_FEATURE_DYNAMIC_SMPS |
+                                      NL80211_FEATURE_STATIC_SMPS;
 
        /*
         * Enable 11w if advertised by firmware and software crypto
index 7c8796584c253d322291ec02cd177539a3869a14..395fc05638c28b9a8780a43633f9572d513c82b0 100644 (file)
@@ -301,9 +301,7 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
                    IEEE80211_HW_AMPDU_AGGREGATION |
                    IEEE80211_HW_TIMING_BEACON_ONLY |
                    IEEE80211_HW_CONNECTION_MONITOR |
-                   IEEE80211_HW_CHANCTX_STA_CSA |
-                   IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
-                   IEEE80211_HW_SUPPORTS_STATIC_SMPS;
+                   IEEE80211_HW_CHANCTX_STA_CSA;
 
        hw->queues = mvm->first_agg_queue;
        hw->offchannel_tx_hw_queue = IWL_MVM_OFFCHANNEL_QUEUE;
@@ -405,7 +403,9 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 
        hw->wiphy->features |= NL80211_FEATURE_P2P_GO_CTWIN |
                               NL80211_FEATURE_LOW_PRIORITY_SCAN |
-                              NL80211_FEATURE_P2P_GO_OPPPS;
+                              NL80211_FEATURE_P2P_GO_OPPPS |
+                              NL80211_FEATURE_DYNAMIC_SMPS |
+                              NL80211_FEATURE_STATIC_SMPS;
 
        mvm->rts_threshold = IEEE80211_MAX_RTS_THRESHOLD;
 
index 1326f61218351b275060e524e32086f9d125fb32..babbdc1ce741c62024bc6220fdcf2a7bd3487790 100644 (file)
@@ -2045,8 +2045,6 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
 
        hw->flags = IEEE80211_HW_MFP_CAPABLE |
                    IEEE80211_HW_SIGNAL_DBM |
-                   IEEE80211_HW_SUPPORTS_STATIC_SMPS |
-                   IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
                    IEEE80211_HW_AMPDU_AGGREGATION |
                    IEEE80211_HW_WANT_MONITOR_VIF |
                    IEEE80211_HW_QUEUE_CONTROL |
@@ -2059,8 +2057,10 @@ static int mac80211_hwsim_create_radio(int channels, const char *reg_alpha2,
                            WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
                            WIPHY_FLAG_AP_UAPSD |
                            WIPHY_FLAG_HAS_CHANNEL_SWITCH;
-       hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;
-       hw->wiphy->features |= NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE;
+       hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR |
+                              NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE |
+                              NL80211_FEATURE_STATIC_SMPS |
+                              NL80211_FEATURE_DYNAMIC_SMPS;
 
        /* ask mac80211 to reserve space for magic */
        hw->vif_data_size = sizeof(struct hwsim_vif_priv);
index c6e6a6804ee4fed7676e77f21aae93f6d8aefb24..0ad1f47d2dc77ee472656fbbfce1afb08d1e3a6f 100644 (file)
@@ -1537,16 +1537,6 @@ struct ieee80211_tx_control {
  * @IEEE80211_HW_MFP_CAPABLE:
  *     Hardware supports management frame protection (MFP, IEEE 802.11w).
  *
- * @IEEE80211_HW_SUPPORTS_STATIC_SMPS:
- *     Hardware supports static spatial multiplexing powersave,
- *     ie. can turn off all but one chain even on HT connections
- *     that should be using more chains.
- *
- * @IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS:
- *     Hardware supports dynamic spatial multiplexing powersave,
- *     ie. can turn off all but one chain and then wake the rest
- *     up as required after, for example, rts/cts handshake.
- *
  * @IEEE80211_HW_SUPPORTS_UAPSD:
  *     Hardware supports Unscheduled Automatic Power Save Delivery
  *     (U-APSD) in managed mode. The mode is configured with
@@ -1632,8 +1622,7 @@ enum ieee80211_hw_flags {
        IEEE80211_HW_SUPPORTS_DYNAMIC_PS                = 1<<12,
        IEEE80211_HW_MFP_CAPABLE                        = 1<<13,
        IEEE80211_HW_WANT_MONITOR_VIF                   = 1<<14,
-       IEEE80211_HW_SUPPORTS_STATIC_SMPS               = 1<<15,
-       IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS              = 1<<16,
+       /* free slots */
        IEEE80211_HW_SUPPORTS_UAPSD                     = 1<<17,
        IEEE80211_HW_REPORTS_TX_ACK_STATUS              = 1<<18,
        IEEE80211_HW_CONNECTION_MONITOR                 = 1<<19,
index 574656174f912ba1f415ddeaab68428beac7e089..54a189f0393efe546d1949801468e065a7481c0e 100644 (file)
@@ -303,11 +303,6 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,
                sf += scnprintf(buf + sf, mxln - sf, "SUPPORTS_DYNAMIC_PS\n");
        if (local->hw.flags & IEEE80211_HW_MFP_CAPABLE)
                sf += scnprintf(buf + sf, mxln - sf, "MFP_CAPABLE\n");
-       if (local->hw.flags & IEEE80211_HW_SUPPORTS_STATIC_SMPS)
-               sf += scnprintf(buf + sf, mxln - sf, "SUPPORTS_STATIC_SMPS\n");
-       if (local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS)
-               sf += scnprintf(buf + sf, mxln - sf,
-                               "SUPPORTS_DYNAMIC_SMPS\n");
        if (local->hw.flags & IEEE80211_HW_SUPPORTS_UAPSD)
                sf += scnprintf(buf + sf, mxln - sf, "SUPPORTS_UAPSD\n");
        if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS)
index e205ebabfa5015f5375a60cb79af9b2bfdbd9f80..c68896adfa960113c584656c478fd8ff043a11ca 100644 (file)
@@ -226,12 +226,12 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
        struct ieee80211_local *local = sdata->local;
        int err;
 
-       if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_STATIC_SMPS) &&
+       if (!(local->hw.wiphy->features & NL80211_FEATURE_STATIC_SMPS) &&
            smps_mode == IEEE80211_SMPS_STATIC)
                return -EINVAL;
 
        /* auto should be dynamic if in PS mode */
-       if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS) &&
+       if (!(local->hw.wiphy->features & NL80211_FEATURE_DYNAMIC_SMPS) &&
            (smps_mode == IEEE80211_SMPS_DYNAMIC ||
             smps_mode == IEEE80211_SMPS_AUTOMATIC))
                return -EINVAL;
index efa41fc66c1ffda31e0c7667067c737ed6c17525..9d4ccb2cf3c9cfd1120b682acf9eaf29718f2ef8 100644 (file)
@@ -3805,7 +3805,7 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
        ifmgd->uapsd_max_sp_len = sdata->local->hw.uapsd_max_sp_len;
        ifmgd->p2p_noa_index = -1;
 
-       if (sdata->local->hw.flags & IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS)
+       if (sdata->local->hw.wiphy->features & NL80211_FEATURE_DYNAMIC_SMPS)
                ifmgd->req_smps = IEEE80211_SMPS_AUTOMATIC;
        else
                ifmgd->req_smps = IEEE80211_SMPS_OFF;