diff mbox series

[v2] wifi: nl80211: allow MBSSID Tx VAP bringup without MBSSID Elements

Message ID 20240731122201.2635010-1-quic_ssreeela@quicinc.com
State New
Headers show
Series [v2] wifi: nl80211: allow MBSSID Tx VAP bringup without MBSSID Elements | expand

Commit Message

Sowmiya Sree Elavalagan July 31, 2024, 12:22 p.m. UTC
From: Rameshkumar Sundaram <quic_ramess@quicinc.com>

Current implementation of MBSSID configuration parsing mandates
MBSSID elements for Tx BSS (index 0). However with ML link addition
it is possible that Non-Tx BSS'es can be added at a later point in
time after Tx BSS is brought up. Hence allow bring up of MBSSID Tx
BSS even if no Non-Tx BSS are present at that time when EMA is
disabled. Later when new Non-TX BSS are added TX BSS beacon can be
updated with MBSSID Elements.

Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
---
v2:
  - Mandate num elements check if EMA is enabled
  - Rebased and changed 'IEs' to 'elements' in commit message
---
 net/wireless/nl80211.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 7397a372c78e..f1b0274681b9 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5496,8 +5496,10 @@  static int nl80211_parse_mbssid_config(struct wiphy *wiphy,
 	}
 
 	config->index = nla_get_u8(tb[NL80211_MBSSID_CONFIG_ATTR_INDEX]);
-	if (config->index >= wiphy->mbssid_max_interfaces ||
-	    (!config->index && !num_elems))
+	if (config->index >= wiphy->mbssid_max_interfaces)
+		return -EINVAL;
+
+	if (config->ema && !config->index && !num_elems)
 		return -EINVAL;
 
 	if (tb[NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX]) {