diff mbox series

[wireless-next,v3,3/5] wifi: wil6210: reject SET_BSS if any changed AP BSS param is not supported

Message ID 20250603161057.19101-4-gokulkumar.sivakumar@infineon.com
State New
Headers show
Series wifi: cfg80211: Add support to indicate changed AP BSS parameters to drivers | expand

Commit Message

Gokul Sivakumar June 3, 2025, 4:10 p.m. UTC
The userspace can change more than one AP BSS Parameter in the SET_BSS
operation. Incase if any BSS param other than the currently supported
"ap_isolate" is passed by userspace, reject the entire SET_BSS operation
instead of misleading the userspace that the operation is fully successful.

Also add an individual check for the CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE
flag, before handling "ap_isolate" value from the userspace. This addresses
case where driver unnecessarily checks the value of ap_isolate, even if the
userspace did not pass this param in the SET_BSS request.

Signed-off-by: Gokul Sivakumar <gokulkumar.sivakumar@infineon.com>
---
 drivers/net/wireless/ath/wil6210/cfg80211.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c
index 5473c01cbe66..41df409f5fad 100644
--- a/drivers/net/wireless/ath/wil6210/cfg80211.c
+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c
@@ -2416,7 +2416,15 @@  static int wil_cfg80211_change_bss(struct wiphy *wiphy,
 	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
 	struct wil6210_vif *vif = ndev_to_vif(dev);
 
-	if (params->ap_isolate >= 0) {
+	/* Reject the operation if any of the AP BSS params that got changed are not
+	 * supported by the driver for explicit configuration.
+	 */
+	if (params->changed &
+	    ~(CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE))
+		return -EOPNOTSUPP;
+
+	if (params->changed &
+	    CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE) {
 		wil_dbg_misc(wil, "change_bss: ap_isolate MID %d, %d => %d\n",
 			     vif->mid, vif->ap_isolate, params->ap_isolate);
 		vif->ap_isolate = params->ap_isolate;