Commit 0dfedd48 authored by Benjamin Berg's avatar Benjamin Berg Committed by Johannes Berg

wifi: mac80211: improve association error reporting slightly

There is no reason to check the request flags for each of the links, so
pull that out of the loop. Also, within the loop we can set the per-link
error everywhere.
Signed-off-by: default avatarBenjamin Berg <benjamin.berg@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240318184907.695faa9be279.I71b11a8d66a9cae4c27e242a47d1d92922609b03@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 6943e003
......@@ -8206,6 +8206,14 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
if (req->ap_mld_addr) {
uapsd_supported = true;
if (req->flags & (ASSOC_REQ_DISABLE_HT |
ASSOC_REQ_DISABLE_VHT |
ASSOC_REQ_DISABLE_HE |
ASSOC_REQ_DISABLE_EHT)) {
err = -EINVAL;
goto err_free;
}
for (i = 0; i < IEEE80211_MLD_MAX_NUM_LINKS; i++) {
struct ieee80211_supported_band *sband;
struct cfg80211_bss *link_cbss = req->links[i].bss;
......@@ -8218,19 +8226,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
if (!bss->wmm_used) {
err = -EINVAL;
goto err_free;
}
if (req->flags & (ASSOC_REQ_DISABLE_HT |
ASSOC_REQ_DISABLE_VHT |
ASSOC_REQ_DISABLE_HE |
ASSOC_REQ_DISABLE_EHT)) {
err = -EINVAL;
req->links[i].error = err;
goto err_free;
}
if (link_cbss->channel->band == NL80211_BAND_S1GHZ) {
err = -EINVAL;
req->links[i].error = err;
goto err_free;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment