wireless: Set NL80211_EXT_FEATURE_CQM_RSSI_LIST in multiple drivers
authorAndrew Zaborowski <andrew.zaborowski@intel.com>
Fri, 10 Feb 2017 03:50:23 +0000 (04:50 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Mar 2017 08:21:39 +0000 (09:21 +0100)
Set the NL80211_EXT_FEATURE_CQM_RSSI_LIST wiphy extended feature
wholesale in all mac80211-based drivers that do not set the
IEEE80211_VIF_BEACON_FILTER flags on their interfaces.  mac80211 will
be processing supplied RSSI values in ieee80211_rx_mgmt_beacon and
will detect when the thresholds set by
ieee80211_set_cqm_rssi_range_config are crossed.  Remaining (few)
drivers need code to enable the firmware to monitor the thresholds.
This is mostly only compile-tested.

Signed-off-by: Andrew Zaborowski <andrew.zaborowski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
25 files changed:
drivers/net/wireless/admtek/adm8211.c
drivers/net/wireless/ath/ar5523/ar5523.c
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath5k/base.c
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/carl9170/main.c
drivers/net/wireless/ath/wcn36xx/main.c
drivers/net/wireless/atmel/at76c50x-usb.c
drivers/net/wireless/broadcom/b43/main.c
drivers/net/wireless/broadcom/b43legacy/main.c
drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
drivers/net/wireless/intel/iwlegacy/3945-mac.c
drivers/net/wireless/intel/iwlegacy/4965-mac.c
drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/marvell/libertas_tf/main.c
drivers/net/wireless/marvell/mwl8k.c
drivers/net/wireless/mediatek/mt7601u/init.c
drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c
drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
drivers/net/wireless/rsi/rsi_91x_mac80211.c
drivers/net/wireless/zydas/zd1211rw/zd_mac.c

index 098c814e22c8b6d7478bbc81035bb7fd9d6f4f5a..ed626f568b5802006473e077affd4f417f850917 100644 (file)
@@ -1917,6 +1917,8 @@ static int adm8211_probe(struct pci_dev *pdev,
 
        dev->wiphy->bands[NL80211_BAND_2GHZ] = &priv->band;
 
+       wiphy_ext_feature_set(dev->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        err = ieee80211_register_hw(dev);
        if (err) {
                printk(KERN_ERR "%s (adm8211): Cannot register device\n",
index 7a60d2e652dad6be1cab67ef64b708355e982ded..f2f4ccfdf8da0f01e49554666eaaf6e1e4dbdf26 100644 (file)
@@ -1689,6 +1689,8 @@ static int ar5523_probe(struct usb_interface *intf,
        if (error)
                goto out_cancel_rx_cmd;
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        usb_set_intfdata(intf, hw);
 
        error = ieee80211_register_hw(hw);
index 3029f257a19a5988e13368a3922e9e55fc961258..abc291de1d31ad3a82c2478d93a77b5b94d15632 100644 (file)
@@ -8248,6 +8248,8 @@ int ath10k_mac_register(struct ath10k *ar)
        ar->hw->wiphy->cipher_suites = cipher_suites;
        ar->hw->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites);
 
+       wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(ar->hw);
        if (ret) {
                ath10k_err(ar, "failed to register ieee80211: %d\n", ret);
index d98fd421c7ec58c3c815947a5fd8a0597eada4d5..92ece64fd45594c66b84409e4d90e1f20f031ff2 100644 (file)
@@ -2564,6 +2564,8 @@ ath5k_init_ah(struct ath5k_hw *ah, const struct ath_bus_ops *bus_ops)
 
        hw->extra_tx_headroom = 2;
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        /*
         * Mark the device as detached to avoid processing
         * interrupts until setup is complete.
index b65c1b661adeb4c86f79722d86958816072b768d..defacc6c9c995ea6b2b755a1ac11978d805006eb 100644 (file)
@@ -780,6 +780,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
        }
 
        SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
+
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
 }
 
 static int ath9k_init_firmware_version(struct ath9k_htc_priv *priv)
index fa4b3cc1ba22c8dcf3882dd51b738dd412ddea75..fd9a61834c17f8ac8f3612f3c89de13a78de5189 100644 (file)
@@ -955,6 +955,8 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
        ath9k_cmn_reload_chainmask(ah);
 
        SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
+
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
 }
 
 int ath9k_init_device(u16 devid, struct ath_softc *sc,
index ffb22a04beeb748a8a7339bf93ed9c9a0fdc298e..988c8857d78c9d21abbe3b007ce605b13e04b109 100644 (file)
@@ -1874,6 +1874,8 @@ void *carl9170_alloc(size_t priv_size)
        for (i = 0; i < ARRAY_SIZE(ar->noise); i++)
                ar->noise[i] = -95; /* ATH_DEFAULT_NOISE_FLOOR */
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        return ar;
 
 err_nomem:
index 7a0c2e7da7f643333506e595d39fd988b535825e..cee4f655bf36def42aef0b1e8bd0bbb6b58f7dcc 100644 (file)
@@ -1112,6 +1112,9 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
        wcn->hw->sta_data_size = sizeof(struct wcn36xx_sta);
        wcn->hw->vif_data_size = sizeof(struct wcn36xx_vif);
 
+       wiphy_ext_feature_set(wcn->hw->wiphy,
+                             NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        return ret;
 }
 
index 0e180677c7fc5dc6030f7d577ce16eb14eb03999..09defbcedd5e4b6dd769a9883e67c7e906b8c156 100644 (file)
@@ -2377,6 +2377,8 @@ static int at76_init_new_device(struct at76_priv *priv,
 
        wiphy->hw_version = priv->board_type;
 
+       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                printk(KERN_ERR "cannot register mac80211 hw (status %d)!\n",
index 52f3541ecbcfe40f3289bbba681503d974900625..d23aac7503d332cfe741442fb66c9bc7e1373923 100644 (file)
@@ -5598,6 +5598,8 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
 
        hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        wl->hw_registred = false;
        hw->max_rates = 2;
        SET_IEEE80211_DEV(hw, dev->dev);
index cdafebb9c936b445b89ed2cf8fcab26302efb0a2..f1e3dad576292ef5b8e2f03a01a8c185c927a101 100644 (file)
@@ -3850,6 +3850,8 @@ static int b43legacy_wireless_init(struct ssb_device *dev)
        else
                SET_IEEE80211_PERM_ADDR(hw, sprom->il0mac);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        /* Get and initialize struct b43legacy_wl */
        wl = hw_to_b43legacy_wl(hw);
        memset(wl, 0, sizeof(*wl));
index 7c2a9a9bc372c19502d3bf1d7091ccbd4654b061..ddfdfe177e245cae6396145bc18500ed672f087f 100644 (file)
@@ -1082,6 +1082,8 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
         * hw->wiphy->flags |= WIPHY_FLAG_AP_PROBE_RESP_OFFLOAD;
         */
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        hw->rate_control_algorithm = "minstrel_ht";
 
        hw->sta_data_size = 0;
index e8e65115feba4ca892623975a6b55e901df545aa..38bf403bb1e1ad06e45c0587832156276a176c03 100644 (file)
@@ -3592,6 +3592,8 @@ il3945_setup_mac(struct il_priv *il)
 
        il_leds_init(il);
 
+       wiphy_ext_feature_set(il->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(il->hw);
        if (ret) {
                IL_ERR("Failed to register hw (error %d)\n", ret);
index 2781f5728d0768169276d380d625695f7513e917..7eda525e3f4fecf66b1190777be869e7855c06f6 100644 (file)
@@ -5799,6 +5799,8 @@ il4965_mac_setup_register(struct il_priv *il, u32 max_probe_length)
 
        il_leds_init(il);
 
+       wiphy_ext_feature_set(il->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(il->hw);
        if (ret) {
                IL_ERR("Failed to register hw (error %d)\n", ret);
index 2a04d0cd71aefc5b09022daee9e6470e924075a7..e3cab60ddf0fbf1d323baa5912bcd81bacc487a1 100644 (file)
@@ -213,6 +213,8 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
 
        iwl_leds_init(priv);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                IWL_ERR(priv, "Failed to register hw (error %d)\n", ret);
index 50c219fb1a52b9799d502470c6a5bea08ba7174a..307a53a7da23ee324a0159de24b5b6db0d98ccb8 100644 (file)
@@ -2645,6 +2645,8 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
        if (param->no_vif)
                ieee80211_hw_set(hw, NO_AUTO_VIF);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        err = ieee80211_register_hw(hw);
        if (err < 0) {
                printk(KERN_DEBUG "mac80211_hwsim: ieee80211_register_hw failed (%d)\n",
index 54e426c1e405fd68b294d7fb3fd52607136c4d89..d8033311798929599b60f557c155567e9310a345 100644 (file)
@@ -641,6 +641,8 @@ struct lbtf_private *lbtf_add_card(void *card, struct device *dmdev)
                BIT(NL80211_IFTYPE_ADHOC);
        skb_queue_head_init(&priv->bc_ps_buf);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        SET_IEEE80211_DEV(hw, dmdev);
 
        INIT_WORK(&priv->cmd_work, lbtf_cmd_work);
index b1b400b59d86456ae5b75a66ba2f227b3dcb8b1c..c295a4c6e5cd5d6c405314e82acd025732708456 100644 (file)
@@ -6144,6 +6144,8 @@ static int mwl8k_firmware_load_success(struct mwl8k_priv *priv)
        if (priv->sta_macids_supported || priv->device_info->fw_image_sta)
                hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_STATION);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        rc = ieee80211_register_hw(hw);
        if (rc) {
                wiphy_err(hw->wiphy, "Cannot register device\n");
index a6e9017662269ee06b0d6f1be0d039f83542dbf5..d3b611aaf06180d29252ffd72bb11f67467803eb 100644 (file)
@@ -615,6 +615,8 @@ int mt7601u_register_device(struct mt7601u_dev *dev)
        wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR;
        wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
 
+       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = mt76_init_sband_2g(dev);
        if (ret)
                return ret;
index dd6678109b7e4609533c296f774dea5864df5370..57e6af9a44a19b679f5e973bc0254eedd69f2b5a 100644 (file)
@@ -1384,6 +1384,9 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
 
        rt2x00dev->hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
 
+       wiphy_ext_feature_set(rt2x00dev->hw->wiphy,
+                             NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        /*
         * Initialize ieee80211 structure.
         */
index e895a84481da0c68adf6642fc9614e3469e5ba90..e387dec82d3d2d19211fb930fd2ccb7eaed77809 100644 (file)
@@ -1877,6 +1877,8 @@ static int rtl8180_probe(struct pci_dev *pdev,
        else
                ieee80211_hw_set(dev, SIGNAL_UNSPEC);
 
+       wiphy_ext_feature_set(dev->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        rtl8180_eeprom_read(priv);
 
        switch (priv->rf_type) {
index 231f84db9ab0691e46eee60c41f2b1ce3ccf9312..274ad6d34d6870f07bc3c79b64949e6637fc569e 100644 (file)
@@ -1609,6 +1609,8 @@ static int rtl8187_probe(struct usb_interface *intf,
        dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
                                      BIT(NL80211_IFTYPE_ADHOC) ;
 
+       wiphy_ext_feature_set(dev->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        if ((id->driver_info == DEVICE_RTL8187) && priv->is_rtl8187b)
                printk(KERN_INFO "rtl8187: inconsistency between id with OEM"
                       " info!\n");
index e544dd1d618c3cea36d1a5d11068295e008c13c5..9b4a9a00be6419c29cf3e1248c2a906742cdfd00 100644 (file)
@@ -6135,6 +6135,8 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
        ieee80211_hw_set(hw, HAS_RATE_CONTROL);
        ieee80211_hw_set(hw, AMPDU_AGGREGATION);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        ret = ieee80211_register_hw(priv->hw);
        if (ret) {
                dev_err(&udev->dev, "%s: Failed to register: %i\n",
index e3216473aecb7a7e27afb707a66e3b00ddd3164d..021e5ac5f1073c2d3ba98815359ea3f88f8ef514 100644 (file)
@@ -1261,6 +1261,8 @@ int rsi_mac80211_attach(struct rsi_common *common)
 
        wiphy->reg_notifier = rsi_reg_notify;
 
+       wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        status = ieee80211_register_hw(hw);
        if (status)
                return status;
index 3e37a045f7025fa39cf55f55cc1d59d26b8feee9..fe6517a621b083ea3995703784de74a68a9655d4 100644 (file)
@@ -1408,6 +1408,8 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf)
                BIT(NL80211_IFTYPE_ADHOC) |
                BIT(NL80211_IFTYPE_AP);
 
+       wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
+
        hw->max_signal = 100;
        hw->queues = 1;
        hw->extra_tx_headroom = sizeof(struct zd_ctrlset);