]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
cfg80211: add bss_type and privacy arguments in cfg80211_get_bss()
authorDedy Lansky <dlansky@codeaurora.org>
Sun, 8 Feb 2015 13:52:03 +0000 (15:52 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Mar 2015 14:56:01 +0000 (15:56 +0100)
802.11ad adds new a network type (PBSS) and changes the capability
field interpretation for the DMG (60G) band.
The same 2 bits that were interpreted as "ESS" and "IBSS" before are
re-used as a 2-bit field with 3 valid values (and 1 reserved). Valid
values are: "IBSS", "PBSS" (new) and "AP".

In order to get the BSS struct for the new PBSS networks, change the
cfg80211_get_bss() function to take a new enum ieee80211_bss_type
argument with the valid network types, as "capa_mask" and "capa_val"
no longer work correctly (the search must be band-aware now.)

The remaining bits in "capa_mask" and "capa_val" are used only for
privacy matching so replace those two with a privacy enum as well.

Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
[rewrite commit log, tiny fixes]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 files changed:
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/cw1200/sta.c
drivers/net/wireless/libertas/cfg.c
drivers/net/wireless/mwifiex/cfg80211.c
include/net/cfg80211.h
net/mac80211/ibss.c
net/wireless/ibss.c
net/wireless/mlme.c
net/wireless/scan.c
net/wireless/sme.c
net/wireless/trace.h

index d6d2f0f00caad18ec00ba69f5635c79f161b2ba7..d372ebfd933d16296713ce3dd282fccbf4b20bcb 100644 (file)
@@ -1386,7 +1386,8 @@ static void ath10k_peer_assoc_h_crypto(struct ath10k *ar,
        lockdep_assert_held(&ar->conf_mutex);
 
        bss = cfg80211_get_bss(ar->hw->wiphy, ar->hw->conf.chandef.chan,
-                              info->bssid, NULL, 0, 0, 0);
+                              info->bssid, NULL, 0, IEEE80211_BSS_TYPE_ANY,
+                              IEEE80211_PRIVACY_ANY);
        if (bss) {
                const struct cfg80211_bss_ies *ies;
 
index 85da63a67faf56f35f92615f3bae5cda67504c4d..ff7ba5c195c666d1a685ec789f6a6ca04d2e62cc 100644 (file)
@@ -686,20 +686,21 @@ ath6kl_add_bss_if_needed(struct ath6kl_vif *vif,
 {
        struct ath6kl *ar = vif->ar;
        struct cfg80211_bss *bss;
-       u16 cap_mask, cap_val;
+       u16 cap_val;
+       enum ieee80211_bss_type bss_type;
        u8 *ie;
 
        if (nw_type & ADHOC_NETWORK) {
-               cap_mask = WLAN_CAPABILITY_IBSS;
                cap_val = WLAN_CAPABILITY_IBSS;
+               bss_type = IEEE80211_BSS_TYPE_IBSS;
        } else {
-               cap_mask = WLAN_CAPABILITY_ESS;
                cap_val = WLAN_CAPABILITY_ESS;
+               bss_type = IEEE80211_BSS_TYPE_ESS;
        }
 
        bss = cfg80211_get_bss(ar->wiphy, chan, bssid,
                               vif->ssid, vif->ssid_len,
-                              cap_mask, cap_val);
+                              bss_type, IEEE80211_PRIVACY_ANY);
        if (bss == NULL) {
                /*
                 * Since cfg80211 may not yet know about the BSS,
index 2d5ea21be47e592af98599e214697d6b022718f2..adfd815e3f7dccf33ce3f923875877124571169f 100644 (file)
@@ -395,7 +395,7 @@ static int wil_cfg80211_connect(struct wiphy *wiphy,
 
        bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
                               sme->ssid, sme->ssid_len,
-                              WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+                              IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
        if (!bss) {
                wil_err(wil, "Unable to find BSS\n");
                return -ENOENT;
index 4a47c7f8a246dac5c2fd3770163341adbeeec73b..1b58b2e2a5382808b0a914449c9eee1d4bed4785 100644 (file)
@@ -1240,8 +1240,8 @@ static void cw1200_do_join(struct cw1200_common *priv)
 
        bssid = priv->vif->bss_conf.bssid;
 
-       bss = cfg80211_get_bss(priv->hw->wiphy, priv->channel,
-                       bssid, NULL, 0, 0, 0);
+       bss = cfg80211_get_bss(priv->hw->wiphy, priv->channel, bssid, NULL, 0,
+                              IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY);
 
        if (!bss && !conf->ibss_joined) {
                wsm_unlock_tx(priv);
index a92985a6ea21f0628166fb4b66ce6b0e5915ca5c..1a4d558022d8c1dff78b1181c6f9bc79e7573a12 100644 (file)
@@ -1356,8 +1356,8 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
 
        /* Find the BSS we want using available scan results */
        bss = cfg80211_get_bss(wiphy, sme->channel, sme->bssid,
-               sme->ssid, sme->ssid_len,
-               WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+               sme->ssid, sme->ssid_len, IEEE80211_BSS_TYPE_ESS,
+               IEEE80211_PRIVACY_ANY);
        if (!bss) {
                wiphy_err(wiphy, "assoc: bss %pM not in scan results\n",
                          sme->bssid);
@@ -2000,7 +2000,7 @@ static int lbs_join_ibss(struct wiphy *wiphy, struct net_device *dev,
         * bss list is populated already */
        bss = cfg80211_get_bss(wiphy, params->chandef.chan, params->bssid,
                params->ssid, params->ssid_len,
-               WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
+               IEEE80211_BSS_TYPE_IBSS, IEEE80211_PRIVACY_ANY);
 
        if (bss) {
                ret = lbs_ibss_join_existing(priv, params, bss);
index 41c8e25df9544021278a0998c6b89fa3469d4c98..a47eb55bb6da3935fbb954e9931a5eac0f177486 100644 (file)
@@ -1954,13 +1954,13 @@ done:
                if (mode == NL80211_IFTYPE_ADHOC)
                        bss = cfg80211_get_bss(priv->wdev.wiphy, channel,
                                               bssid, ssid, ssid_len,
-                                              WLAN_CAPABILITY_IBSS,
-                                              WLAN_CAPABILITY_IBSS);
+                                              IEEE80211_BSS_TYPE_IBSS,
+                                              IEEE80211_PRIVACY_ANY);
                else
                        bss = cfg80211_get_bss(priv->wdev.wiphy, channel,
                                               bssid, ssid, ssid_len,
-                                              WLAN_CAPABILITY_ESS,
-                                              WLAN_CAPABILITY_ESS);
+                                              IEEE80211_BSS_TYPE_ESS,
+                                              IEEE80211_PRIVACY_ANY);
 
                if (!bss) {
                        if (is_scanning_required) {
index 64e09e1e809960be7daaef505e2e39dbab01c238..28fff56f560653deae8b6fe3c7530f0cf8b1bd66 100644 (file)
@@ -214,6 +214,39 @@ enum ieee80211_rate_flags {
        IEEE80211_RATE_SUPPORTS_10MHZ   = 1<<6,
 };
 
+/**
+ * enum ieee80211_bss_type - BSS type filter
+ *
+ * @IEEE80211_BSS_TYPE_ESS: Infrastructure BSS
+ * @IEEE80211_BSS_TYPE_PBSS: Personal BSS
+ * @IEEE80211_BSS_TYPE_IBSS: Independent BSS
+ * @IEEE80211_BSS_TYPE_MBSS: Mesh BSS
+ * @IEEE80211_BSS_TYPE_ANY: Wildcard value for matching any BSS type
+ */
+enum ieee80211_bss_type {
+       IEEE80211_BSS_TYPE_ESS,
+       IEEE80211_BSS_TYPE_PBSS,
+       IEEE80211_BSS_TYPE_IBSS,
+       IEEE80211_BSS_TYPE_MBSS,
+       IEEE80211_BSS_TYPE_ANY
+};
+
+/**
+ * enum ieee80211_privacy - BSS privacy filter
+ *
+ * @IEEE80211_PRIVACY_ON: privacy bit set
+ * @IEEE80211_PRIVACY_OFF: privacy bit clear
+ * @IEEE80211_PRIVACY_ANY: Wildcard value for matching any privacy setting
+ */
+enum ieee80211_privacy {
+       IEEE80211_PRIVACY_ON,
+       IEEE80211_PRIVACY_OFF,
+       IEEE80211_PRIVACY_ANY
+};
+
+#define IEEE80211_PRIVACY(x)   \
+       ((x) ? IEEE80211_PRIVACY_ON : IEEE80211_PRIVACY_OFF)
+
 /**
  * struct ieee80211_rate - bitrate definition
  *
@@ -4012,14 +4045,16 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
                                      struct ieee80211_channel *channel,
                                      const u8 *bssid,
                                      const u8 *ssid, size_t ssid_len,
-                                     u16 capa_mask, u16 capa_val);
+                                     enum ieee80211_bss_type bss_type,
+                                     enum ieee80211_privacy);
 static inline struct cfg80211_bss *
 cfg80211_get_ibss(struct wiphy *wiphy,
                  struct ieee80211_channel *channel,
                  const u8 *ssid, size_t ssid_len)
 {
        return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
-                               WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
+                               IEEE80211_BSS_TYPE_IBSS,
+                               IEEE80211_PRIVACY_ANY);
 }
 
 /**
index b606b53a49a7d92e178eb502f18469bd9da7a5cd..ee93d7d9aa4b36baa41844d35eeabd5b41d5d420 100644 (file)
@@ -470,22 +470,19 @@ int ieee80211_ibss_csa_beacon(struct ieee80211_sub_if_data *sdata,
        struct beacon_data *presp, *old_presp;
        struct cfg80211_bss *cbss;
        const struct cfg80211_bss_ies *ies;
-       u16 capability;
+       u16 capability = 0;
        u64 tsf;
        int ret = 0;
 
        sdata_assert_lock(sdata);
 
-       capability = WLAN_CAPABILITY_IBSS;
-
        if (ifibss->privacy)
-               capability |= WLAN_CAPABILITY_PRIVACY;
+               capability = WLAN_CAPABILITY_PRIVACY;
 
        cbss = cfg80211_get_bss(sdata->local->hw.wiphy, ifibss->chandef.chan,
                                ifibss->bssid, ifibss->ssid,
-                               ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
-                               WLAN_CAPABILITY_PRIVACY,
-                               capability);
+                               ifibss->ssid_len, IEEE80211_BSS_TYPE_IBSS,
+                               IEEE80211_PRIVACY(ifibss->privacy));
 
        if (WARN_ON(!cbss)) {
                ret = -EINVAL;
@@ -525,23 +522,17 @@ int ieee80211_ibss_finish_csa(struct ieee80211_sub_if_data *sdata)
        struct ieee80211_if_ibss *ifibss = &sdata->u.ibss;
        struct cfg80211_bss *cbss;
        int err, changed = 0;
-       u16 capability;
 
        sdata_assert_lock(sdata);
 
        /* update cfg80211 bss information with the new channel */
        if (!is_zero_ether_addr(ifibss->bssid)) {
-               capability = WLAN_CAPABILITY_IBSS;
-
-               if (ifibss->privacy)
-                       capability |= WLAN_CAPABILITY_PRIVACY;
-
                cbss = cfg80211_get_bss(sdata->local->hw.wiphy,
                                        ifibss->chandef.chan,
                                        ifibss->bssid, ifibss->ssid,
-                                       ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
-                                       WLAN_CAPABILITY_PRIVACY,
-                                       capability);
+                                       ifibss->ssid_len,
+                                       IEEE80211_BSS_TYPE_IBSS,
+                                       IEEE80211_PRIVACY(ifibss->privacy));
                /* XXX: should not really modify cfg80211 data */
                if (cbss) {
                        cbss->channel = sdata->csa_chandef.chan;
@@ -682,19 +673,13 @@ static void ieee80211_ibss_disconnect(struct ieee80211_sub_if_data *sdata)
        struct cfg80211_bss *cbss;
        struct beacon_data *presp;
        struct sta_info *sta;
-       u16 capability;
 
        if (!is_zero_ether_addr(ifibss->bssid)) {
-               capability = WLAN_CAPABILITY_IBSS;
-
-               if (ifibss->privacy)
-                       capability |= WLAN_CAPABILITY_PRIVACY;
-
                cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan,
                                        ifibss->bssid, ifibss->ssid,
-                                       ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
-                                       WLAN_CAPABILITY_PRIVACY,
-                                       capability);
+                                       ifibss->ssid_len,
+                                       IEEE80211_BSS_TYPE_IBSS,
+                                       IEEE80211_PRIVACY(ifibss->privacy));
 
                if (cbss) {
                        cfg80211_unlink_bss(local->hw.wiphy, cbss);
@@ -1325,7 +1310,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
        const u8 *bssid = NULL;
        enum nl80211_bss_scan_width scan_width;
        int active_ibss;
-       u16 capability;
 
        sdata_assert_lock(sdata);
 
@@ -1335,9 +1319,6 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
        if (active_ibss)
                return;
 
-       capability = WLAN_CAPABILITY_IBSS;
-       if (ifibss->privacy)
-               capability |= WLAN_CAPABILITY_PRIVACY;
        if (ifibss->fixed_bssid)
                bssid = ifibss->bssid;
        if (ifibss->fixed_channel)
@@ -1346,8 +1327,8 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
                bssid = ifibss->bssid;
        cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
                                ifibss->ssid, ifibss->ssid_len,
-                               WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_PRIVACY,
-                               capability);
+                               IEEE80211_BSS_TYPE_IBSS,
+                               IEEE80211_PRIVACY(ifibss->privacy));
 
        if (cbss) {
                struct ieee80211_bss *bss;
index e24fc585c8834782295558481f0f592be743e6dc..1a65662a5d7390013303136b259f3027bea0fead 100644 (file)
@@ -30,7 +30,7 @@ void __cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid,
                return;
 
        bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, NULL, 0,
-                              WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
+                              IEEE80211_BSS_TYPE_IBSS, IEEE80211_PRIVACY_ANY);
 
        if (WARN_ON(!bss))
                return;
index 2c52b59e43f319670e6ce054b0eda1bde995ce1c..7aae329e2b4e4a8e3afa943f670852a6e26e89dd 100644 (file)
@@ -229,7 +229,8 @@ int cfg80211_mlme_auth(struct cfg80211_registered_device *rdev,
                return -EALREADY;
 
        req.bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
-                                  WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+                                  IEEE80211_BSS_TYPE_ESS,
+                                  IEEE80211_PRIVACY_ANY);
        if (!req.bss)
                return -ENOENT;
 
@@ -296,7 +297,8 @@ int cfg80211_mlme_assoc(struct cfg80211_registered_device *rdev,
                                   rdev->wiphy.vht_capa_mod_mask);
 
        req->bss = cfg80211_get_bss(&rdev->wiphy, chan, bssid, ssid, ssid_len,
-                                   WLAN_CAPABILITY_ESS, WLAN_CAPABILITY_ESS);
+                                   IEEE80211_BSS_TYPE_ESS,
+                                   IEEE80211_PRIVACY_ANY);
        if (!req->bss)
                return -ENOENT;
 
index ceb8f0040dae22662adb17347c888c96a7ed2344..3a50aa2553bfd777cce2657eee38f0c3a7b34081 100644 (file)
@@ -531,24 +531,78 @@ static int cmp_bss(struct cfg80211_bss *a,
        }
 }
 
+static bool cfg80211_bss_type_match(u16 capability,
+                                   enum ieee80211_band band,
+                                   enum ieee80211_bss_type bss_type)
+{
+       bool ret = true;
+       u16 mask, val;
+
+       if (bss_type == IEEE80211_BSS_TYPE_ANY)
+               return ret;
+
+       if (band == IEEE80211_BAND_60GHZ) {
+               mask = WLAN_CAPABILITY_DMG_TYPE_MASK;
+               switch (bss_type) {
+               case IEEE80211_BSS_TYPE_ESS:
+                       val = WLAN_CAPABILITY_DMG_TYPE_AP;
+                       break;
+               case IEEE80211_BSS_TYPE_PBSS:
+                       val = WLAN_CAPABILITY_DMG_TYPE_PBSS;
+                       break;
+               case IEEE80211_BSS_TYPE_IBSS:
+                       val = WLAN_CAPABILITY_DMG_TYPE_IBSS;
+                       break;
+               default:
+                       return false;
+               }
+       } else {
+               mask = WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS;
+               switch (bss_type) {
+               case IEEE80211_BSS_TYPE_ESS:
+                       val = WLAN_CAPABILITY_ESS;
+                       break;
+               case IEEE80211_BSS_TYPE_IBSS:
+                       val = WLAN_CAPABILITY_IBSS;
+                       break;
+               case IEEE80211_BSS_TYPE_MBSS:
+                       val = 0;
+                       break;
+               default:
+                       return false;
+               }
+       }
+
+       ret = ((capability & mask) == val);
+       return ret;
+}
+
 /* Returned bss is reference counted and must be cleaned up appropriately. */
 struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
                                      struct ieee80211_channel *channel,
                                      const u8 *bssid,
                                      const u8 *ssid, size_t ssid_len,
-                                     u16 capa_mask, u16 capa_val)
+                                     enum ieee80211_bss_type bss_type,
+                                     enum ieee80211_privacy privacy)
 {
        struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
        struct cfg80211_internal_bss *bss, *res = NULL;
        unsigned long now = jiffies;
+       int bss_privacy;
 
-       trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, capa_mask,
-                              capa_val);
+       trace_cfg80211_get_bss(wiphy, channel, bssid, ssid, ssid_len, bss_type,
+                              privacy);
 
        spin_lock_bh(&rdev->bss_lock);
 
        list_for_each_entry(bss, &rdev->bss_list, list) {
-               if ((bss->pub.capability & capa_mask) != capa_val)
+               if (!cfg80211_bss_type_match(bss->pub.capability,
+                                            bss->pub.channel->band, bss_type))
+                       continue;
+
+               bss_privacy = (bss->pub.capability & WLAN_CAPABILITY_PRIVACY);
+               if ((privacy == IEEE80211_PRIVACY_ON && !bss_privacy) ||
+                   (privacy == IEEE80211_PRIVACY_OFF && bss_privacy))
                        continue;
                if (channel && bss->pub.channel != channel)
                        continue;
@@ -896,6 +950,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
        struct cfg80211_bss_ies *ies;
        struct ieee80211_channel *channel;
        struct cfg80211_internal_bss tmp = {}, *res;
+       int bss_type;
        bool signal_valid;
 
        if (WARN_ON(!wiphy))
@@ -950,8 +1005,15 @@ cfg80211_inform_bss_width(struct wiphy *wiphy,
        if (!res)
                return NULL;
 
-       if (res->pub.capability & WLAN_CAPABILITY_ESS)
-               regulatory_hint_found_beacon(wiphy, channel, gfp);
+       if (channel->band == IEEE80211_BAND_60GHZ) {
+               bss_type = res->pub.capability & WLAN_CAPABILITY_DMG_TYPE_MASK;
+               if (bss_type == WLAN_CAPABILITY_DMG_TYPE_AP ||
+                   bss_type == WLAN_CAPABILITY_DMG_TYPE_PBSS)
+                       regulatory_hint_found_beacon(wiphy, channel, gfp);
+       } else {
+               if (res->pub.capability & WLAN_CAPABILITY_ESS)
+                       regulatory_hint_found_beacon(wiphy, channel, gfp);
+       }
 
        trace_cfg80211_return_bss(&res->pub);
        /* cfg80211_bss_update gives us a referenced result */
@@ -973,6 +1035,7 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
        bool signal_valid;
        size_t ielen = len - offsetof(struct ieee80211_mgmt,
                                      u.probe_resp.variable);
+       int bss_type;
 
        BUILD_BUG_ON(offsetof(struct ieee80211_mgmt, u.probe_resp.variable) !=
                        offsetof(struct ieee80211_mgmt, u.beacon.variable));
@@ -1025,8 +1088,15 @@ cfg80211_inform_bss_width_frame(struct wiphy *wiphy,
        if (!res)
                return NULL;
 
-       if (res->pub.capability & WLAN_CAPABILITY_ESS)
-               regulatory_hint_found_beacon(wiphy, channel, gfp);
+       if (channel->band == IEEE80211_BAND_60GHZ) {
+               bss_type = res->pub.capability & WLAN_CAPABILITY_DMG_TYPE_MASK;
+               if (bss_type == WLAN_CAPABILITY_DMG_TYPE_AP ||
+                   bss_type == WLAN_CAPABILITY_DMG_TYPE_PBSS)
+                       regulatory_hint_found_beacon(wiphy, channel, gfp);
+       } else {
+               if (res->pub.capability & WLAN_CAPABILITY_ESS)
+                       regulatory_hint_found_beacon(wiphy, channel, gfp);
+       }
 
        trace_cfg80211_return_bss(&res->pub);
        /* cfg80211_bss_update gives us a referenced result */
index 0ab3711c79a01ae98cdaaafa64bf12ac94e80271..ea1da6621ff051028970f50154af56d6f2e01b46 100644 (file)
@@ -257,19 +257,15 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
 {
        struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
        struct cfg80211_bss *bss;
-       u16 capa = WLAN_CAPABILITY_ESS;
 
        ASSERT_WDEV_LOCK(wdev);
 
-       if (wdev->conn->params.privacy)
-               capa |= WLAN_CAPABILITY_PRIVACY;
-
        bss = cfg80211_get_bss(wdev->wiphy, wdev->conn->params.channel,
                               wdev->conn->params.bssid,
                               wdev->conn->params.ssid,
                               wdev->conn->params.ssid_len,
-                              WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_PRIVACY,
-                              capa);
+                              IEEE80211_BSS_TYPE_ESS,
+                              IEEE80211_PRIVACY(wdev->conn->params.privacy));
        if (!bss)
                return NULL;
 
@@ -637,8 +633,8 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
                WARN_ON_ONCE(!wiphy_to_rdev(wdev->wiphy)->ops->connect);
                bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
                                       wdev->ssid, wdev->ssid_len,
-                                      WLAN_CAPABILITY_ESS,
-                                      WLAN_CAPABILITY_ESS);
+                                      IEEE80211_BSS_TYPE_ESS,
+                                      IEEE80211_PRIVACY_ANY);
                if (bss)
                        cfg80211_hold_bss(bss_from_pub(bss));
        }
@@ -795,8 +791,8 @@ void cfg80211_roamed(struct net_device *dev,
        struct cfg80211_bss *bss;
 
        bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, wdev->ssid,
-                              wdev->ssid_len, WLAN_CAPABILITY_ESS,
-                              WLAN_CAPABILITY_ESS);
+                              wdev->ssid_len,
+                              IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
        if (WARN_ON(!bss))
                return;
 
index b17b3692f8c239d918a072d2fab9031eb91073b4..b19773c9c81b68df9ead2b3ea54008dc5b9729c7 100644 (file)
@@ -2636,28 +2636,30 @@ DEFINE_EVENT(wiphy_only_evt, cfg80211_sched_scan_stopped,
 TRACE_EVENT(cfg80211_get_bss,
        TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel,
                 const u8 *bssid, const u8 *ssid, size_t ssid_len,
-                u16 capa_mask, u16 capa_val),
-       TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, capa_mask, capa_val),
+                enum ieee80211_bss_type bss_type,
+                enum ieee80211_privacy privacy),
+       TP_ARGS(wiphy, channel, bssid, ssid, ssid_len, bss_type, privacy),
        TP_STRUCT__entry(
                WIPHY_ENTRY
                CHAN_ENTRY
                MAC_ENTRY(bssid)
                __dynamic_array(u8, ssid, ssid_len)
-               __field(u16, capa_mask)
-               __field(u16, capa_val)
+               __field(enum ieee80211_bss_type, bss_type)
+               __field(enum ieee80211_privacy, privacy)
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
                CHAN_ASSIGN(channel);
                MAC_ASSIGN(bssid, bssid);
                memcpy(__get_dynamic_array(ssid), ssid, ssid_len);
-               __entry->capa_mask = capa_mask;
-               __entry->capa_val = capa_val;
-       ),
-       TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT ", buf: %#.2x, "
-                 "capa_mask: %d, capa_val: %u", WIPHY_PR_ARG, CHAN_PR_ARG,
-                 MAC_PR_ARG(bssid), ((u8 *)__get_dynamic_array(ssid))[0],
-                 __entry->capa_mask, __entry->capa_val)
+               __entry->bss_type = bss_type;
+               __entry->privacy = privacy;
+       ),
+       TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT ", " MAC_PR_FMT
+                 ", buf: %#.2x, bss_type: %d, privacy: %d",
+                 WIPHY_PR_ARG, CHAN_PR_ARG, MAC_PR_ARG(bssid),
+                 ((u8 *)__get_dynamic_array(ssid))[0], __entry->bss_type,
+                 __entry->privacy)
 );
 
 TRACE_EVENT(cfg80211_inform_bss_width_frame,