summaryrefslogtreecommitdiffstats
path: root/net/wireless/sme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2022-05-31 18:00:00 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-06-20 12:55:43 +0200
commit0f7594489a8ab154edb899e84f877def0b48fbd0 (patch)
tree0cec0310ceaf416cf38c63c44dac80b1bcb199c2 /net/wireless/sme.c
parentwifi: mac80211: tx: simplify chanctx_conf handling (diff)
downloadlinux-0f7594489a8ab154edb899e84f877def0b48fbd0.tar.xz
linux-0f7594489a8ab154edb899e84f877def0b48fbd0.zip
wifi: cfg80211: mlme: get BSS entry outside cfg80211_mlme_assoc()
Today it makes more sense to pass the necessary parameters to look up the BSS entry to cfg80211_mlme_assoc(), but with MLO we will need to look up multiple, and that gets awkward. Pull the lookup code into the callers so we can change it better. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/sme.c')
-rw-r--r--net/wireless/sme.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index 35602201057b..c869152629b6 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -193,9 +193,18 @@ static int cfg80211_conn_do_work(struct wireless_dev *wdev,
req.vht_capa = params->vht_capa;
req.vht_capa_mask = params->vht_capa_mask;
- err = cfg80211_mlme_assoc(rdev, wdev->netdev, params->channel,
- params->bssid, params->ssid,
- params->ssid_len, &req);
+ req.bss = cfg80211_get_bss(&rdev->wiphy, params->channel,
+ params->bssid,
+ params->ssid, params->ssid_len,
+ IEEE80211_BSS_TYPE_ESS,
+ IEEE80211_PRIVACY_ANY);
+ if (!req.bss) {
+ err = -ENOENT;
+ } else {
+ err = cfg80211_mlme_assoc(rdev, wdev->netdev, &req);
+ cfg80211_put_bss(&rdev->wiphy, req.bss);
+ }
+
if (err)
cfg80211_mlme_deauth(rdev, wdev->netdev, params->bssid,
NULL, 0,