From patchwork Tue Jun 3 10:32:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 894003 Received: from smtp2.infineon.com (smtp2.infineon.com [217.10.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBEA6214811 for ; Tue, 3 Jun 2025 10:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946900; cv=none; b=VEDt2DRal7NSoExuG8XGENTwS2YfbRyM66DeoEfPmjDLrcS7+vzSN7ERl2/kTsDtoIPYERrkVfUQDESIuJO6+5jZiwCqOR8RAexf4hRUxRILNJWWsF42lsOX1iKXbBT9PsVYoh47HPOmAV9LdK4LlCF2AKqcguwkaqw3dcm0/ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946900; c=relaxed/simple; bh=hfQG8bONJBeIT9xUVOfIypYgzSzybSYfr20KUidkYMU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dramTQnQmqKTIXVEFu5LPP7JgX/WOev3zfcEL69OiUaTx9RzqhhnCDLeLBDzpPHrvj23xoQThb6ETsq7JVD3J6sZuTn5hcfXlfu96z8jcY0g1ZeFz6hiG+IV4h0HO7nokAPlOOGz6iFGTj00E81fMsJPmRA1AsJ9YUl9NFBhqV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=kwYBRmdx; arc=none smtp.client-ip=217.10.52.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="kwYBRmdx" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1748946898; x=1780482898; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hfQG8bONJBeIT9xUVOfIypYgzSzybSYfr20KUidkYMU=; b=kwYBRmdxfUvIZD4SorU+sMBM1Fa53YCsayFIZ2su7aL9F/+T9udG4RSZ XaK2AYLMaQm+D7fh0aNxHxSoBw361TP5NWz2GqMUd0cnWtUxKgZ+xUlIr KT7NTIca6t9BSxny/EagbbHiJ4Y8+eBPE+fTN2KAQSjFrY22yxBHKdmSZ 8=; X-CSE-ConnectionGUID: wiaYOMExRfq2HtCR4NpSLw== X-CSE-MsgGUID: WqCEaBbgQiylMYOtFHcWZQ== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="112926831" X-IronPort-AV: E=Sophos;i="6.16,205,1744063200"; d="scan'208";a="112926831" Received: from unknown (HELO MUCSE803.infineon.com) ([172.23.29.29]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2025 12:33:48 +0200 Received: from MUCSE827.infineon.com (172.23.29.20) by MUCSE803.infineon.com (172.23.29.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 3 Jun 2025 12:33:47 +0200 Received: from ISCN5CG14747PP.infineon.com (10.161.6.196) by MUCSE827.infineon.com (172.23.29.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:33:45 +0200 From: Gokul Sivakumar To: Johannes Berg , Arend van Spriel , Ajay Singh , Claudiu Beznea CC: , , , Subject: [PATCH wireless-next v2 1/5] wifi: cfg80211: Add support to indicate changed AP BSS parameters to driver Date: Tue, 3 Jun 2025 16:02:48 +0530 Message-ID: <20250603103252.18039-2-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> References: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE815.infineon.com (172.23.29.41) To MUCSE827.infineon.com (172.23.29.20) With the userspace applications like hostapd, incase if the user explicitly enabled an AP BSS param related config file option, like "ap_isolate", or if the hostapd implicitly sets an AP BSS param like "cts_protection", then those params are sent to the cfg80211 as part of SET_BSS operation request. cfg80211 would then set the bits corresponding to the AP BSS parameters in the newly introduced "changed" bitmap. Drivers which have registered for the .change_bss() cfg80211_ops, on receiving this SET_BSS request, can now understand which specific subset of params are changed by the userspace using this bitmask. If the driver allows explicit configuration of changed AP BSS params and if the values of those params are different from default value in driver/firmware, then the driver can update it accordingly. This helps ensuring that the driver does not partially handle the AP BSS params and avoid misleading the userspace that the SET_BSS operation is fully successful. Signed-off-by: Gokul Sivakumar --- include/net/cfg80211.h | 30 ++++++++++++++++++++++++++++++ net/wireless/nl80211.c | 28 +++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index d1848dc8ec99..1f069ccb411e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h @@ -2326,12 +2326,41 @@ struct mpath_info { int generation; }; +/** + * enum cfg80211_bss_params_changed - BSS parameters that are being changed + * + * This enum provides information of all BSS parameters that + * have to be updated as part of change_bss() call. + * + * @CFG80211_BSS_PARAM_CHANGED_CTS_PROT: Indicates that CTS Protection changed. + * @CFG80211_BSS_PARAM_CHANGED_SHORT_PREAMBLE: Indicates that preamble changed. + * @CFG80211_BSS_PARAM_CHANGED_SHORT_SLOT_TIME: Indicates that slot timing changed. + * @CFG80211_BSS_PARAM_CHANGED_BASIC_RATES: Indicatesthat Basic Rateset changed. + * @CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE: Indicates that AP Isolation setting changed. + * @CFG80211_BSS_PARAM_CHANGED_HT_OPMODE: Indicates that HT mode to be changed. + * @CFG80211_BSS_PARAM_CHANGED_P2P_CTWINDOW: Indicates that P2P CTWindow changed. + * @CFG80211_BSS_PARAM_CHANGED_P2P_OPPPS: Indicates that P2P Opportunistic + * Power Save Mode changed. + */ +enum cfg80211_bss_params_changed { + CFG80211_BSS_PARAM_CHANGED_CTS_PROT = BIT(0), + CFG80211_BSS_PARAM_CHANGED_SHORT_PREAMBLE = BIT(1), + CFG80211_BSS_PARAM_CHANGED_SHORT_SLOT_TIME = BIT(2), + CFG80211_BSS_PARAM_CHANGED_BASIC_RATES = BIT(3), + CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE = BIT(4), + CFG80211_BSS_PARAM_CHANGED_HT_OPMODE = BIT(5), + CFG80211_BSS_PARAM_CHANGED_P2P_CTWINDOW = BIT(6), + CFG80211_BSS_PARAM_CHANGED_P2P_OPPPS = BIT(7), +}; + /** * struct bss_parameters - BSS parameters * * Used to change BSS parameters (mainly for AP mode). * * @link_id: link_id or -1 for non-MLD + * @changed: bitmask of BSS parameters being changed by the user, + * see &enum cfg80211_bss_params_changed. * @use_cts_prot: Whether to use CTS protection * (0 = no, 1 = yes, -1 = do not change) * @use_short_preamble: Whether the use of short preambles is allowed @@ -2350,6 +2379,7 @@ struct mpath_info { */ struct bss_parameters { int link_id; + u32 changed; int use_cts_prot; int use_short_preamble; int use_short_slot_time; diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index fd5f79266471..719517f58110 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -8243,26 +8243,42 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) params.p2p_ctwindow = -1; params.p2p_opp_ps = -1; - if (info->attrs[NL80211_ATTR_BSS_CTS_PROT]) + if (info->attrs[NL80211_ATTR_BSS_CTS_PROT]) { params.use_cts_prot = nla_get_u8(info->attrs[NL80211_ATTR_BSS_CTS_PROT]); - if (info->attrs[NL80211_ATTR_BSS_SHORT_PREAMBLE]) + params.changed |= CFG80211_BSS_PARAM_CHANGED_CTS_PROT; + } + + if (info->attrs[NL80211_ATTR_BSS_SHORT_PREAMBLE]) { params.use_short_preamble = nla_get_u8(info->attrs[NL80211_ATTR_BSS_SHORT_PREAMBLE]); - if (info->attrs[NL80211_ATTR_BSS_SHORT_SLOT_TIME]) + params.changed |= CFG80211_BSS_PARAM_CHANGED_SHORT_PREAMBLE; + } + + if (info->attrs[NL80211_ATTR_BSS_SHORT_SLOT_TIME]) { params.use_short_slot_time = nla_get_u8(info->attrs[NL80211_ATTR_BSS_SHORT_SLOT_TIME]); + params.changed |= CFG80211_BSS_PARAM_CHANGED_SHORT_SLOT_TIME; + } + if (info->attrs[NL80211_ATTR_BSS_BASIC_RATES]) { params.basic_rates = nla_data(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); params.basic_rates_len = nla_len(info->attrs[NL80211_ATTR_BSS_BASIC_RATES]); + params.changed |= CFG80211_BSS_PARAM_CHANGED_BASIC_RATES; } - if (info->attrs[NL80211_ATTR_AP_ISOLATE]) + + if (info->attrs[NL80211_ATTR_AP_ISOLATE]) { params.ap_isolate = !!nla_get_u8(info->attrs[NL80211_ATTR_AP_ISOLATE]); - if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE]) + params.changed |= CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE; + } + + if (info->attrs[NL80211_ATTR_BSS_HT_OPMODE]) { params.ht_opmode = nla_get_u16(info->attrs[NL80211_ATTR_BSS_HT_OPMODE]); + params.changed |= CFG80211_BSS_PARAM_CHANGED_HT_OPMODE; + } if (info->attrs[NL80211_ATTR_P2P_CTWINDOW]) { if (dev->ieee80211_ptr->iftype != NL80211_IFTYPE_P2P_GO) @@ -8272,6 +8288,7 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) if (params.p2p_ctwindow != 0 && !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_CTWIN)) return -EINVAL; + params.changed |= CFG80211_BSS_PARAM_CHANGED_P2P_CTWINDOW; } if (info->attrs[NL80211_ATTR_P2P_OPPPS]) { @@ -8284,6 +8301,7 @@ static int nl80211_set_bss(struct sk_buff *skb, struct genl_info *info) if (params.p2p_opp_ps && !(rdev->wiphy.features & NL80211_FEATURE_P2P_GO_OPPPS)) return -EINVAL; + params.changed |= CFG80211_BSS_PARAM_CHANGED_P2P_OPPPS; } if (!rdev->ops->change_bss) From patchwork Tue Jun 3 10:32:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 894429 Received: from smtp2.infineon.com (smtp2.infineon.com [217.10.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF2FA229B16 for ; Tue, 3 Jun 2025 10:35:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946902; cv=none; b=e0nuHsTyb+CjQ3LKYgDlZjjfzt0HRmNRRMjiAgv7Tg/fnaHldl16OV6+8sb2QDeR40eSusKZ9FinXdJ1C+xu0I13XTM0IqctEHBWNJDnxqtGrmsglssPpSj2p/chvTZbuFvqzCkSSCZHUDWRMV7bdX+gWNJo8zcwLg+pnsPAKlk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946902; c=relaxed/simple; bh=u56Lt9MMGPwAbq1BiE8JqMkchWM5YQHZIABLJmNOUvU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=s+sJ7fqh/C1Oj5rsx84LBUKYwAoY3b25DC5Yih8nYOzHHUPO8MxnCP/bjLeouMbgUZDeSk9RZGm5vlfyJor5lYFqudn8WV24bBoipfU429x4o59mtsJwPyfUNCxOnmO80l4eClXpYCly9qZmElCKOxNndc1Lt7Bne7aFUVflN/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=GRmqPNdX; arc=none smtp.client-ip=217.10.52.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="GRmqPNdX" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1748946901; x=1780482901; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u56Lt9MMGPwAbq1BiE8JqMkchWM5YQHZIABLJmNOUvU=; b=GRmqPNdX9ZTy4qXTqIcMNNe0r21C22ExE6tUtvL+SalB4yH+STRPUoAz 6F4qdJuH460ewTb3q4CIAwJNwJi5JxJobMc8D+O4aooTwYrVq2X1xpC2A bPtAM5pz/8yCmkwmVwfxcsL3y3eGCKvz/V3PGYNpCXyK+P1aEcEoV295e Y=; X-CSE-ConnectionGUID: JD5OgGgmSmyy1lllthXHOw== X-CSE-MsgGUID: yw+X4Np+SOeTC3HYiP/TKg== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="112926834" X-IronPort-AV: E=Sophos;i="6.16,205,1744063200"; d="scan'208";a="112926834" Received: from unknown (HELO MUCSE822.infineon.com) ([172.23.29.53]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2025 12:33:50 +0200 Received: from MUCSE827.infineon.com (172.23.29.20) by MUCSE822.infineon.com (172.23.29.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:33:49 +0200 Received: from ISCN5CG14747PP.infineon.com (10.161.6.196) by MUCSE827.infineon.com (172.23.29.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:33:47 +0200 From: Gokul Sivakumar To: Johannes Berg , Arend van Spriel , Ajay Singh , Claudiu Beznea CC: , , , Subject: [PATCH wireless-next v2 2/5] wifi: brcmfmac: support AP isolation to restrict reachability between stations Date: Tue, 3 Jun 2025 16:02:49 +0530 Message-ID: <20250603103252.18039-3-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> References: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE815.infineon.com (172.23.29.41) To MUCSE827.infineon.com (172.23.29.20) From: Wright Feng hostapd & wpa_supplicant userspace daemons exposes an AP mode specific config file parameter "ap_isolate" to the user, which is used to control low-level bridging of frames between the stations associated in the BSS. In driver, handle this user setting in the newly defined cfg80211_ops function brcmf_cfg80211_change_bss() by enabling "ap_isolate" IOVAR in the firmware. In AP mode, the "ap_isolate" value from the cfg80211 layer represents, 0 = allow low-level bridging of frames between associated stations 1 = restrict low-level bridging of frames to isolate associated stations -1 = do not change existing setting 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. Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Gokul Sivakumar --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index dc2383faddd1..31067c640480 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5933,6 +5933,52 @@ static int brcmf_cfg80211_del_pmk(struct wiphy *wiphy, struct net_device *dev, return brcmf_set_pmk(ifp, NULL, 0); } +static int brcmf_set_ap_bssparam_isolate(struct brcmf_if *ifp, int param_ap_isolate) +{ + int ret = 0, cur_ap_isolate = 0; + + /* In cfg80211, for AP mode, the "param_ap_isolate" value represents + * 0 = allow low-level bridging of frames between associated stations + * 1 = restrict low-level bridging of frames to isolate associated stations + * -1 = do not change existing setting + */ + if (param_ap_isolate >= 0) { + ret = brcmf_fil_iovar_int_get(ifp, "ap_isolate", &cur_ap_isolate); + if (ret < 0) + return ret; + + if (cur_ap_isolate != param_ap_isolate) { + ret = brcmf_fil_iovar_int_set(ifp, "ap_isolate", param_ap_isolate); + if (ret < 0) { + brcmf_err("ap_isolate iovar failed: ret=%d\n", ret); + return ret; + } + } + } + + return ret; +} + +static int brcmf_cfg80211_change_bss(struct wiphy *wiphy, struct net_device *dev, + struct bss_parameters *params) +{ + struct brcmf_if *ifp = netdev_priv(dev); + int ret = 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; + + ret = brcmf_set_ap_bssparam_isolate(ifp, params->ap_isolate); + if (ret) + return ret; + + return ret; +} + static struct cfg80211_ops brcmf_cfg80211_ops = { .add_virtual_intf = brcmf_cfg80211_add_iface, .del_virtual_intf = brcmf_cfg80211_del_iface, @@ -5980,6 +6026,7 @@ static struct cfg80211_ops brcmf_cfg80211_ops = { .update_connect_params = brcmf_cfg80211_update_conn_params, .set_pmk = brcmf_cfg80211_set_pmk, .del_pmk = brcmf_cfg80211_del_pmk, + .change_bss = brcmf_cfg80211_change_bss, }; struct cfg80211_ops *brcmf_cfg80211_get_ops(struct brcmf_mp_device *settings) From patchwork Tue Jun 3 10:32:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 894002 Received: from smtp14.infineon.com (smtp14.infineon.com [217.10.52.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C0C7D53365 for ; Tue, 3 Jun 2025 10:35:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.160 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946905; cv=none; b=n7jg2k4F5dlpf7nHKSUfusQF4ng16GZ8YQAAVU7ztjNrzAvFSjsl1q1NkDcOJaU11lEH+LYukfqk5B1xey3mK4dgKq9XmNhb4lzKjEKAETWmL8V46u9qTZvcid/alwxgO+abEvtDBSkU+6YnRnNamtmvJxgjwrCep02HGcUT6Ro= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946905; c=relaxed/simple; bh=OmhfM5l0F6ZhYAzFl+0A6VmNjBv+K1QrKB9WIAp3zMk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XesuUT2Cs09EgK36QlbgGd0vyUtO3dk5iTUwRIYINBJuDn0/bkMoMsJ5+2/T7qq3bCuedsijSd3Uu5h9awNOKfU6ygWM/jzBIXOH75D3DeklgDpIRw188yatBaNBgEWZMyl3vHunZ9a0K86VpfCTiQnSxQn5KudRDyHCbR4z6AM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=YSM+Yybn; arc=none smtp.client-ip=217.10.52.160 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="YSM+Yybn" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1748946903; x=1780482903; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OmhfM5l0F6ZhYAzFl+0A6VmNjBv+K1QrKB9WIAp3zMk=; b=YSM+YybnhMab32f1SvVl2dWau0d3Ry2nIGhGuxPdVQRLZ9JemsrDMNo0 GGtUgU2KRqLzFXVdO3ji2IkrB2Bqdt3bqTPXknHl1QIeUqJz89wUv6iPM oJ2suiBiaKkyp2g4RLOeYL8uKMGLetpCt5vpPy9jHpWJ9YV7/tCSq5BdQ A=; X-CSE-ConnectionGUID: 4o/r49c7TU+Hg2exKOm3xQ== X-CSE-MsgGUID: sjq+3EDyR6yrISelyms7aQ== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="87131965" X-IronPort-AV: E=Sophos;i="6.16,205,1744063200"; d="scan'208";a="87131965" Received: from unknown (HELO MUCSE819.infineon.com) ([172.23.29.45]) by smtp14.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2025 12:33:52 +0200 Received: from MUCSE827.infineon.com (172.23.29.20) by MUCSE819.infineon.com (172.23.29.45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:33:51 +0200 Received: from ISCN5CG14747PP.infineon.com (10.161.6.196) by MUCSE827.infineon.com (172.23.29.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:33:49 +0200 From: Gokul Sivakumar To: Johannes Berg , Arend van Spriel , Ajay Singh , Claudiu Beznea CC: , , , Subject: [PATCH wireless-next v2 3/5] wifi: wil6210: reject SET_BSS if any changed AP BSS param is not supported Date: Tue, 3 Jun 2025 16:02:50 +0530 Message-ID: <20250603103252.18039-4-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> References: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE815.infineon.com (172.23.29.41) To MUCSE827.infineon.com (172.23.29.20) 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. Signed-off-by: Gokul Sivakumar --- drivers/net/wireless/ath/wil6210/cfg80211.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/wil6210/cfg80211.c b/drivers/net/wireless/ath/wil6210/cfg80211.c index 5473c01cbe66..fbf7e21d91fe 100644 --- a/drivers/net/wireless/ath/wil6210/cfg80211.c +++ b/drivers/net/wireless/ath/wil6210/cfg80211.c @@ -2416,6 +2416,13 @@ 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); + /* 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->ap_isolate >= 0) { wil_dbg_misc(wil, "change_bss: ap_isolate MID %d, %d => %d\n", vif->mid, vif->ap_isolate, params->ap_isolate); From patchwork Tue Jun 3 10:32:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 894431 Received: from smtp2.infineon.com (smtp2.infineon.com [217.10.52.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB531226D08 for ; Tue, 3 Jun 2025 10:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946850; cv=none; b=qFX+0oiLrmRJwu4S6lzs+0ndfiIGfYoPuZljf9PToun34lmpMDkyWgf5XBUUVPWQ3twRjJcnYWo190/vhLTEGef0qCLQAArNju66vABUIDyRf70pLyrT2IjlOnnd1N7j+THLIuaeMuxeS7AjAXq7/TZK09fsFPY/6iFbQ1qBRKw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946850; c=relaxed/simple; bh=Uowr0sIP+wDxmN8p1DSg+tWmGaoaZ/UnJmKUP1z6qyc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gR8ROAMNlagCgUpLz2YsiYVJSuujjeZxJscVojdRR4XO011Hg9jAuQfj8ctH18UH99n857tAf4NVnBOV4tmrtvAvOFYP+AOTSaXYqQ+K/4HDHwzCTH9f61+FIlBXM1+k3dOr+xywyosEcHQl5nX6r8uCYh082sY+w37aGqc+CiA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=Y6lniUji; arc=none smtp.client-ip=217.10.52.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="Y6lniUji" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1748946849; x=1780482849; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uowr0sIP+wDxmN8p1DSg+tWmGaoaZ/UnJmKUP1z6qyc=; b=Y6lniUji7HBizwPR9zbNbe24qnB1KFFLW4649avhFklk4gusYn/aExh0 ztaaCzg/n4CWucSP3IJPJMct4UYSA05ElSIBs4jz75VhumR2Y5Pnw6vFV fNpH2ADCul4FxGtcZ28yoAr1rQSLvdExZv8sJXBcyn/eh0ThR03NVaz25 c=; X-CSE-ConnectionGUID: x9VJdPTPTLO7sPlu6pQv8Q== X-CSE-MsgGUID: 6F5SPthrSTK0zmoYCShTIg== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="112926854" X-IronPort-AV: E=Sophos;i="6.16,205,1744063200"; d="scan'208";a="112926854" Received: from unknown (HELO MUCSE814.infineon.com) ([172.23.29.40]) by smtp2.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2025 12:34:07 +0200 Received: from MUCSE827.infineon.com (172.23.29.20) by MUCSE814.infineon.com (172.23.29.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 3 Jun 2025 12:34:06 +0200 Received: from ISCN5CG14747PP.infineon.com (10.161.6.196) by MUCSE827.infineon.com (172.23.29.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:34:04 +0200 From: Gokul Sivakumar To: Johannes Berg , Arend van Spriel , Ajay Singh , Claudiu Beznea CC: , , , Subject: [PATCH wireless-next v2 4/5] wifi: wilc1000: reject SET_BSS if any changed AP BSS param is not supported Date: Tue, 3 Jun 2025 16:02:51 +0530 Message-ID: <20250603103252.18039-5-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> References: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE805.infineon.com (172.23.29.31) To MUCSE827.infineon.com (172.23.29.20) Since the driver currently does not support setting any of the AP BSS parameters, reject the entire SET_BSS operation instead of misleading the userspace that the operation is fully successful. Signed-off-by: Gokul Sivakumar --- drivers/net/wireless/microchip/wilc1000/cfg80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/wireless/microchip/wilc1000/cfg80211.c b/drivers/net/wireless/microchip/wilc1000/cfg80211.c index e7aa0f991923..98776ef9195b 100644 --- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c +++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c @@ -797,6 +797,12 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev, static int change_bss(struct wiphy *wiphy, struct net_device *dev, struct bss_parameters *params) { + /* 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) + return -EOPNOTSUPP; + return 0; } From patchwork Tue Jun 3 10:32:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 894004 Received: from smtp14.infineon.com (smtp14.infineon.com [217.10.52.160]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DC924227E9B for ; Tue, 3 Jun 2025 10:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.160 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946852; cv=none; b=sVhUm30SJWF9sxTGMTgiwXp3aP3dg2F6iwLBru1YVsEEfxK4IvaiFleoMP41ZlKDAw1aQ1ch5g5+L271RW/ghMnJ/ygDHtXXrwktJ/tx3yfZPoh494f8Z30I9FEBimAQuAsD9Hob0QhOhBGSAyopUQS0U5XxGU8SYt3FbuQla1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748946852; c=relaxed/simple; bh=v7zBSG7olmCeG4gl01X01XXFrXsbVghOVYDCkedNy20=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KnCJ92o3zvy2AYU46ebCyLIVUavkbekEhIdX2PLBpLcbqLRNIecGEHIWUc9WLML1TSBjsCwILiMNeF8cAkXkGdXs8acSyAG5P9WNlHelZTyumNH4mBWmOS9lMi4kqT0f28ZTHrWoERqDq14IH106smZC0W/PH+OTkAmgNG37vco= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=Dzp9Udt7; arc=none smtp.client-ip=217.10.52.160 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="Dzp9Udt7" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1748946851; x=1780482851; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=v7zBSG7olmCeG4gl01X01XXFrXsbVghOVYDCkedNy20=; b=Dzp9Udt7RJdWSI5CzfcTXHn26grZN0eGKzQG1O+fiSSiqG42yvYNDJ2O F0Fx5AzueK78Kxsc70ktF54DwHZgaGhcTXkrAqUiXx92rAxXnEk0vAm4W WQTfk2MCFCKWpF0TgZt6aI+BzaXcz3J+H2WuBfPIHMvabwsSrjHFRgAK3 w=; X-CSE-ConnectionGUID: Ap4fr8CZSieWWMmf+odctQ== X-CSE-MsgGUID: 8llYkxBkRc22MGNzz8EErA== X-IronPort-AV: E=McAfee;i="6700,10204,11451"; a="87132005" X-IronPort-AV: E=Sophos;i="6.16,205,1744063200"; d="scan'208";a="87132005" Received: from unknown (HELO MUCSE812.infineon.com) ([172.23.29.38]) by smtp14.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2025 12:34:09 +0200 Received: from MUCSE827.infineon.com (172.23.29.20) by MUCSE812.infineon.com (172.23.29.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Tue, 3 Jun 2025 12:34:08 +0200 Received: from ISCN5CG14747PP.infineon.com (10.161.6.196) by MUCSE827.infineon.com (172.23.29.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 3 Jun 2025 12:34:06 +0200 From: Gokul Sivakumar To: Johannes Berg , Arend van Spriel , Ajay Singh , Claudiu Beznea CC: , , , Subject: [PATCH wireless-next v2 5/5] wifi: mac80211: reject SET_BSS if any changed AP BSS param is not supported Date: Tue, 3 Jun 2025 16:02:52 +0530 Message-ID: <20250603103252.18039-6-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> References: <20250603103252.18039-1-gokulkumar.sivakumar@infineon.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE805.infineon.com (172.23.29.31) To MUCSE827.infineon.com (172.23.29.20) The userspace can change more than one AP BSS Parameter in the SET_BSS operation. Incase if any BSS param other than the list of parameters currently supported for explicit configuration are passed by userspace, reject the entire SET_BSS operation. Signed-off-by: Gokul Sivakumar --- net/mac80211/cfg.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index d9d88f2f2831..c57d6f995fa7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2751,6 +2751,20 @@ static int ieee80211_change_bss(struct wiphy *wiphy, struct ieee80211_supported_band *sband; u64 changed = 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_CTS_PROT | + CFG80211_BSS_PARAM_CHANGED_SHORT_PREAMBLE | + CFG80211_BSS_PARAM_CHANGED_SHORT_SLOT_TIME | + CFG80211_BSS_PARAM_CHANGED_BASIC_RATES | + CFG80211_BSS_PARAM_CHANGED_AP_ISOLATE | + CFG80211_BSS_PARAM_CHANGED_HT_OPMODE | + CFG80211_BSS_PARAM_CHANGED_P2P_CTWINDOW | + CFG80211_BSS_PARAM_CHANGED_P2P_OPPPS)) + return -EOPNOTSUPP; + link = ieee80211_link_or_deflink(sdata, params->link_id, true); if (IS_ERR(link)) return PTR_ERR(link);