From patchwork Wed Apr 23 17:51:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gokul Sivakumar X-Patchwork-Id: 883728 Received: from smtp9.infineon.com (smtp9.infineon.com [217.10.52.204]) (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 8D9ED28E5F1 for ; Wed, 23 Apr 2025 17:52:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.204 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745430776; cv=none; b=Kj9Uz+gI0VjT9c4hqxkstqR2JVAD5tZzGT15D+f+k8yoFVPDaLhhRLbwOzprtuFUIGTkXnGiwcEUMPWPIKxIz+kINVsUe2EwyXSljSNoXsNjaG5OKy8sNIQX+NCjXPJWO/gZmh/H98uyPYpjhk777cXTuTQDq4pdriohVUsoXLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745430776; c=relaxed/simple; bh=OrDEqIilOMy2w+hOXFiB72lAvYn/C545uiwG2bIRd/A=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZoHL8E0Mp4ixcVe4HxOXJpLuG3n80OoEKldGbqtj/EeuPbBrfYQkupJFRiagcYjiVRnIgKaL8xlokJPrw98CXj2Q3lFeJgRP7qDTpMxtvq519lNmiamktOQGc/DusM4o66iN9k6wVfhHr+iW6yJNBUeSuqQoy5A3u2q8+gCMpd4= 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=XVqivPNZ; arc=none smtp.client-ip=217.10.52.204 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="XVqivPNZ" DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1745430773; x=1776966773; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=OrDEqIilOMy2w+hOXFiB72lAvYn/C545uiwG2bIRd/A=; b=XVqivPNZ7Z5qqYdS1SKLx/O7iY2qgfuvSOo2hhtNz8iem/e4TA2ZI1sb 5Da/GPeecNduw3MiA/L9vFW7Lt0/BHfgwRp+bcLr0irhIhJrU7kiEC0lj RpDXFMC1abhlIAMKl9RiHVqlH8aVCnbMS5+ZjbKy4o7Mb0KsYZJ/tt9yJ Q=; X-CSE-ConnectionGUID: oRqkN82sT/KAcjIRULvIaQ== X-CSE-MsgGUID: A3vpMq03T9iM7k3Mnnsq2A== X-IronPort-AV: E=McAfee;i="6700,10204,11412"; a="49679325" X-IronPort-AV: E=Sophos;i="6.15,233,1739833200"; d="scan'208";a="49679325" Received: from unknown (HELO MUCSE814.infineon.com) ([172.23.29.40]) by smtp9.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 19:51:43 +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; Wed, 23 Apr 2025 19:51:42 +0200 Received: from ISCN5CG14747PP.blr.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; Wed, 23 Apr 2025 19:51:41 +0200 From: Gokul Sivakumar To: Arend van Spriel CC: , , , Gokul Sivakumar Subject: [PATCH] brcmfmac: support AP isolation to restrict reachability between stations Date: Wed, 23 Apr 2025 23:21:22 +0530 Message-ID: <20250423175125.7233-1-gokulkumar.sivakumar@infineon.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: MUCSE823.infineon.com (172.23.29.54) 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 Signed-off-by: Wright Feng Signed-off-by: Chi-hsien Lin Signed-off-by: Gokul Sivakumar --- .../broadcom/brcm80211/brcmfmac/cfg80211.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 4b70845e1a26..bd72d8df2a22 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -5931,6 +5931,26 @@ static int brcmf_cfg80211_del_pmk(struct wiphy *wiphy, struct net_device *dev, return brcmf_set_pmk(ifp, NULL, 0); } +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; + + /* In AP mode, the "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 (params->ap_isolate >= 0) { + ret = brcmf_fil_iovar_int_set(ifp, "ap_isolate", params->ap_isolate); + if (ret < 0) + brcmf_err("ap_isolate iovar failed: ret=%d\n", ret); + } + + return ret; +} + static struct cfg80211_ops brcmf_cfg80211_ops = { .add_virtual_intf = brcmf_cfg80211_add_iface, .del_virtual_intf = brcmf_cfg80211_del_iface, @@ -5978,6 +5998,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)