From 0f7594489a8ab154edb899e84f877def0b48fbd0 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 31 May 2022 18:00:00 +0200 Subject: 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 --- net/wireless/sme.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'net/wireless/sme.c') 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, -- cgit v1.2.3-70-g09d2