]> Git Repo - linux.git/commitdiff
Revert "nl80211/cfg80211: Specify band specific min RSSI thresholds with sched scan"
authorJeff Johnson <[email protected]>
Thu, 25 Jan 2024 22:55:47 +0000 (14:55 -0800)
committerJohannes Berg <[email protected]>
Fri, 26 Jan 2024 08:49:46 +0000 (09:49 +0100)
This *mostly* reverts commit 1e1b11b6a111 ("nl80211/cfg80211: Specify
band specific min RSSI thresholds with sched scan").

During the review of a new patch [1] it was observed that the
functionality being modified was not actually being used by any
in-tree driver. Further research determined that the functionality was
originally introduced to support a new Android interface, but that
interface was subsequently abandoned. Since the functionality has
apparently never been used, remove it. However, to mantain the
sanctity of the UABI, keep the nl80211.h assignments, but clearly mark
them as obsolete.

Cc: Lin Ma <[email protected]>
Cc: Vamsi Krishna <[email protected]>
Link: https://lore.kernel.org/linux-wireless/[email protected]/
Signed-off-by: Jeff Johnson <[email protected]>
Link: https://msgid.link/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
include/net/cfg80211.h
include/uapi/linux/nl80211.h
net/wireless/nl80211.c

index 56bce924bec6df64fde67e4b854c9e0007b94465..51b9e6fa12f89e0f608480a71f0df70fa5acb30c 100644 (file)
@@ -2695,19 +2695,11 @@ static inline void get_random_mask_addr(u8 *buf, const u8 *addr, const u8 *mask)
  * @bssid: BSSID to be matched; may be all-zero BSSID in case of SSID match
  *     or no match (RSSI only)
  * @rssi_thold: don't report scan results below this threshold (in s32 dBm)
- * @per_band_rssi_thold: Minimum rssi threshold for each band to be applied
- *     for filtering out scan results received. Drivers advertise this support
- *     of band specific rssi based filtering through the feature capability
- *     %NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD. These band
- *     specific rssi thresholds take precedence over rssi_thold, if specified.
- *     If not specified for any band, it will be assigned with rssi_thold of
- *     corresponding matchset.
  */
 struct cfg80211_match_set {
        struct cfg80211_ssid ssid;
        u8 bssid[ETH_ALEN];
        s32 rssi_thold;
-       s32 per_band_rssi_thold[NUM_NL80211_BANDS];
 };
 
 /**
index 3e239df3528f3d24493d01d2d4dae45fae0cfff3..853ac538a686fffcfea5634661515d64c1845139 100644 (file)
@@ -4463,14 +4463,7 @@ enum nl80211_reg_rule_attr {
  *     value as specified by &struct nl80211_bss_select_rssi_adjust.
  * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
  *     (this cannot be used together with SSID).
- * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Nested attribute that carries the
- *     band specific minimum rssi thresholds for the bands defined in
- *     enum nl80211_band. The minimum rssi threshold value(s32) specific to a
- *     band shall be encapsulated in attribute with type value equals to one
- *     of the NL80211_BAND_* defined in enum nl80211_band. For example, the
- *     minimum rssi threshold value for 2.4GHZ band shall be encapsulated
- *     within an attribute of type NL80211_BAND_2GHZ. And one or more of such
- *     attributes will be nested within this attribute.
+ * @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Obsolete
  * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
  *     attribute number currently defined
  * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
@@ -4483,7 +4476,7 @@ enum nl80211_sched_scan_match_attr {
        NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
        NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
        NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
-       NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI,
+       NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI, /* obsolete */
 
        /* keep last */
        __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
@@ -6418,8 +6411,7 @@ enum nl80211_feature_flags {
  * @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
  *     (set/del PMKSA operations) in AP mode.
  *
- * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Driver supports
- *     filtering of sched scan results using band specific RSSI thresholds.
+ * @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Obsolete
  *
  * @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
  *     to a station.
@@ -6574,7 +6566,7 @@ enum nl80211_ext_feature_index {
        NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
        NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
        NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
-       NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD,
+       NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, /* obsolete */
        NL80211_EXT_FEATURE_EXT_KEY_ID,
        NL80211_EXT_FEATURE_STA_TX_PWR,
        NL80211_EXT_FEATURE_SAE_OFFLOAD,
index 0809f721f04592cca7a92fc8508a9d7d251a6b49..e4f41f86e295df519e6dbf22d17c9b5d822a8208 100644 (file)
@@ -906,23 +906,12 @@ nl80211_rekey_policy[NUM_NL80211_REKEY_DATA] = {
        [NL80211_REKEY_DATA_AKM] = { .type = NLA_U32 },
 };
 
-static const struct nla_policy
-nl80211_match_band_rssi_policy[NUM_NL80211_BANDS] = {
-       [NL80211_BAND_2GHZ] = { .type = NLA_S32 },
-       [NL80211_BAND_5GHZ] = { .type = NLA_S32 },
-       [NL80211_BAND_6GHZ] = { .type = NLA_S32 },
-       [NL80211_BAND_60GHZ] = { .type = NLA_S32 },
-       [NL80211_BAND_LC]    = { .type = NLA_S32 },
-};
-
 static const struct nla_policy
 nl80211_match_policy[NL80211_SCHED_SCAN_MATCH_ATTR_MAX + 1] = {
        [NL80211_SCHED_SCAN_MATCH_ATTR_SSID] = { .type = NLA_BINARY,
                                                 .len = IEEE80211_MAX_SSID_LEN },
        [NL80211_SCHED_SCAN_MATCH_ATTR_BSSID] = NLA_POLICY_EXACT_LEN_WARN(ETH_ALEN),
        [NL80211_SCHED_SCAN_MATCH_ATTR_RSSI] = { .type = NLA_U32 },
-       [NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI] =
-               NLA_POLICY_NESTED(nl80211_match_band_rssi_policy),
 };
 
 static const struct nla_policy
@@ -9490,41 +9479,6 @@ nl80211_parse_sched_scan_plans(struct wiphy *wiphy, int n_plans,
        return 0;
 }
 
-static int
-nl80211_parse_sched_scan_per_band_rssi(struct wiphy *wiphy,
-                                      struct cfg80211_match_set *match_sets,
-                                      struct nlattr *tb_band_rssi,
-                                      s32 rssi_thold)
-{
-       struct nlattr *attr;
-       int i, tmp, ret = 0;
-
-       if (!wiphy_ext_feature_isset(wiphy,
-                   NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD)) {
-               if (tb_band_rssi)
-                       ret = -EOPNOTSUPP;
-               else
-                       for (i = 0; i < NUM_NL80211_BANDS; i++)
-                               match_sets->per_band_rssi_thold[i] =
-                                       NL80211_SCAN_RSSI_THOLD_OFF;
-               return ret;
-       }
-
-       for (i = 0; i < NUM_NL80211_BANDS; i++)
-               match_sets->per_band_rssi_thold[i] = rssi_thold;
-
-       nla_for_each_nested(attr, tb_band_rssi, tmp) {
-               enum nl80211_band band = nla_type(attr);
-
-               if (band < 0 || band >= NUM_NL80211_BANDS)
-                       return -EINVAL;
-
-               match_sets->per_band_rssi_thold[band] = nla_get_s32(attr);
-       }
-
-       return 0;
-}
-
 static struct cfg80211_sched_scan_request *
 nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
                         struct nlattr **attrs, int max_match_sets)
@@ -9799,15 +9753,6 @@ nl80211_parse_sched_scan(struct wiphy *wiphy, struct wireless_dev *wdev,
                        if (rssi)
                                request->match_sets[i].rssi_thold =
                                        nla_get_s32(rssi);
-
-                       /* Parse per band RSSI attribute */
-                       err = nl80211_parse_sched_scan_per_band_rssi(wiphy,
-                               &request->match_sets[i],
-                               tb[NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI],
-                               request->match_sets[i].rssi_thold);
-                       if (err)
-                               goto out_free;
-
                        i++;
                }
 
This page took 0.135681 seconds and 4 git commands to generate.