linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] brcmfmac: check p2pdev mac address uniqueness
@ 2018-04-26 10:16 Arend van Spriel
  2018-04-26 10:16 ` [PATCH 3/6] brcmfmac: use nl80211_band directly to get ieee80211 channel Arend van Spriel
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Arend van Spriel @ 2018-04-26 10:16 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Arend van Spriel

The mac address for p2pdev must be different from the primary interface
due to firmware requirement. Add an explicit check for this requirement
if user-space provides a mac address.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
---
 drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
index bcef208..4b2149b 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
@@ -2073,6 +2073,13 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p,
 	}
 
 	pri_ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp;
+
+	/* firmware requires unique mac address for p2pdev interface */
+	if (addr && ether_addr_equal(addr, pri_ifp->mac_addr)) {
+		brcmf_err("discovery vif must be different from primary interface\n");
+		return ERR_PTR(-EINVAL);
+	}
+
 	brcmf_p2p_generate_bss_mac(p2p, addr);
 	brcmf_p2p_set_firmware(pri_ifp, p2p->dev_addr);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-04-30 10:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-26 10:16 [PATCH 1/6] brcmfmac: check p2pdev mac address uniqueness Arend van Spriel
2018-04-26 10:16 ` [PATCH 3/6] brcmfmac: use nl80211_band directly to get ieee80211 channel Arend van Spriel
2018-04-30 10:43   ` [3/6] " Kalle Valo
2018-04-26 10:16 ` [PATCH 4/6] brcmfmac: constify firmware mapping tables Arend van Spriel
2018-04-26 10:16 ` [PATCH 5/6] brcmfmac: add hostready indication Arend van Spriel
2018-04-26 10:16 ` [PATCH 6/6] brcmfmac: coarse support for PCIe shared structure rev7 Arend van Spriel
2018-04-30 10:42 ` [1/6] brcmfmac: check p2pdev mac address uniqueness Kalle Valo

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).