From: Wright Feng <wright.feng@cypress.com>
To: linux-wireless@vger.kernel.org,
Arend van Spriel <arend.vanspriel@broadcom.com>,
Kalle Valo <kvalo@codeaurora.org>,
chi-hsien.lin@cypress.com
Cc: wright.feng@cypress.com, brcm80211-dev-list@broadcom.com,
brcm80211-dev-list@cypress.com,
Franky Lin <franky.lin@broadcom.com>,
Hante Meuleman <hante.meuleman@broadcom.com>,
Ting-Ying Li <tingying.li@cypress.com>
Subject: [PATCH v2 2/4] brcmfmac: don't allow arp/nd offload to be enabled if ap mode exists
Date: Mon, 19 Oct 2020 21:28:10 -0500 [thread overview]
Message-ID: <20201020022812.37064-3-wright.feng@cypress.com> (raw)
In-Reply-To: <20201020022812.37064-1-wright.feng@cypress.com>
From: Ting-Ying Li <tingying.li@cypress.com>
Add a condition to determine whether arp/nd offload enabling
request is allowed. If there is any interface acts as ap
mode and is operating, then reject the request of arp oflload
enabling from cfg80211.
Signed-off-by: Ting-Ying Li <tingying.li@cypress.com>
Signed-off-by: Wright Feng <wright.feng@cypress.com>
---
.../broadcom/brcm80211/brcmfmac/cfg80211.c | 17 ++++++++++++++++-
.../broadcom/brcm80211/brcmfmac/cfg80211.h | 1 +
.../wireless/broadcom/brcm80211/brcmfmac/core.c | 5 +++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
index 4d0447784426..2f24222eb59c 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
@@ -769,6 +769,21 @@ void brcmf_set_mpc(struct brcmf_if *ifp, int mpc)
}
}
+bool brcmf_is_apmode_operating(struct wiphy *wiphy)
+{
+ struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
+ struct brcmf_cfg80211_vif *vif;
+ bool ret = false;
+
+ list_for_each_entry(vif, &cfg->vif_list, list) {
+ if (brcmf_is_apmode(vif) &&
+ test_bit(BRCMF_VIF_STATUS_AP_CREATED, &vif->sme_state))
+ ret = true;
+ }
+
+ return ret;
+}
+
s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
struct brcmf_if *ifp, bool aborted,
bool fw_abort)
@@ -4990,8 +5005,8 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
bphy_err(drvr, "bss_enable config failed %d\n", err);
}
brcmf_set_mpc(ifp, 1);
- brcmf_configure_arp_nd_offload(ifp, true);
clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state);
+ brcmf_configure_arp_nd_offload(ifp, true);
brcmf_net_setcarrier(ifp, false);
return err;
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
index 17817cdb5de2..94996574c9c7 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.h
@@ -461,5 +461,6 @@ s32 brcmf_notify_escan_complete(struct brcmf_cfg80211_info *cfg,
void brcmf_set_mpc(struct brcmf_if *ndev, int mpc);
void brcmf_abort_scanning(struct brcmf_cfg80211_info *cfg);
void brcmf_cfg80211_free_netdev(struct net_device *ndev);
+bool brcmf_is_apmode_operating(struct wiphy *wiphy);
#endif /* BRCMFMAC_CFG80211_H */
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
index 3dd28f5fef19..043c9cbc6394 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
@@ -96,6 +96,11 @@ void brcmf_configure_arp_nd_offload(struct brcmf_if *ifp, bool enable)
s32 err;
u32 mode;
+ if (enable && brcmf_is_apmode_operating(ifp->drvr->wiphy)) {
+ brcmf_dbg(TRACE, "Skip ARP/ND offload enable when soft AP is running\n");
+ return;
+ }
+
if (enable)
mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY;
else
--
2.25.0
next prev parent reply other threads:[~2020-10-20 2:29 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-20 2:28 [PATCH v2 0/4] brcmfmac: Add few features in AP mode Wright Feng
2020-10-20 2:28 ` [PATCH v2 1/4] brcmfmac: add change_bss to support AP isolation Wright Feng
2020-10-22 7:20 ` Arend Van Spriel
2020-11-07 16:17 ` Kalle Valo
2020-10-20 2:28 ` Wright Feng [this message]
2020-10-22 7:27 ` [PATCH v2 2/4] brcmfmac: don't allow arp/nd offload to be enabled if ap mode exists Arend Van Spriel
2020-10-20 2:28 ` [PATCH v2 3/4] brcmfmac: support the forwarding packet Wright Feng
2020-10-22 7:38 ` Arend Van Spriel
2020-10-20 2:28 ` [PATCH v2 4/4] brcmfmac: add a variable for packet forwarding condition Wright Feng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201020022812.37064-3-wright.feng@cypress.com \
--to=wright.feng@cypress.com \
--cc=arend.vanspriel@broadcom.com \
--cc=brcm80211-dev-list@broadcom.com \
--cc=brcm80211-dev-list@cypress.com \
--cc=chi-hsien.lin@cypress.com \
--cc=franky.lin@broadcom.com \
--cc=hante.meuleman@broadcom.com \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=tingying.li@cypress.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).