2017-09-29 10:56:56

by Ganapathi Bhat

[permalink] [raw]
Subject: [PATCH] mwifiex: Random MAC address during scanning

From: Karthik Ananthapadmanabha <[email protected]>

Driver will advertise RANDOM_MAC support only if the device
supports this feature.

Signed-off-by: Karthik Ananthapadmanabha <[email protected]>
Signed-off-by: Ganapathi Bhat <[email protected]>
---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 10 ++++++----
drivers/net/wireless/marvell/mwifiex/fw.h | 1 +
2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
index 32c5074..f22f7b8 100644
--- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c
@@ -4306,10 +4306,12 @@ int mwifiex_register_cfg80211(struct mwifiex_adapter *adapter)
wiphy->features |= NL80211_FEATURE_HT_IBSS |
NL80211_FEATURE_INACTIVITY_TIMER |
NL80211_FEATURE_LOW_PRIORITY_SCAN |
- NL80211_FEATURE_NEED_OBSS_SCAN |
- NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR |
- NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
- NL80211_FEATURE_ND_RANDOM_MAC_ADDR;
+ NL80211_FEATURE_NEED_OBSS_SCAN;
+
+ if (ISSUPP_RANDOM_MAC(adapter->fw_cap_info))
+ wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR |
+ NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
+ NL80211_FEATURE_ND_RANDOM_MAC_ADDR;

if (ISSUPP_TDLS_ENABLED(adapter->fw_cap_info))
wiphy->features |= NL80211_FEATURE_TDLS_CHANNEL_SWITCH;
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 9e75522..6b765f3 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -238,6 +238,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define ISSUPP_DRCS_ENABLED(FwCapInfo) (FwCapInfo & BIT(15))
#define ISSUPP_SDIO_SPA_ENABLED(FwCapInfo) (FwCapInfo & BIT(16))
#define ISSUPP_ADHOC_ENABLED(FwCapInfo) (FwCapInfo & BIT(25))
+#define ISSUPP_RANDOM_MAC(FwCapInfo) (FwCapInfo & BIT(27))

#define MWIFIEX_DEF_HT_CAP (IEEE80211_HT_CAP_DSSSCCK40 | \
(1 << IEEE80211_HT_CAP_RX_STBC_SHIFT) | \
--
1.9.1


2017-10-11 19:41:54

by Brian Norris

[permalink] [raw]
Subject: Re: [PATCH] mwifiex: Random MAC address during scanning

On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
> From: Karthik Ananthapadmanabha <[email protected]>
>
> Driver will advertise RANDOM_MAC support only if the device
> supports this feature.
>
> Signed-off-by: Karthik Ananthapadmanabha <[email protected]>
> Signed-off-by: Ganapathi Bhat <[email protected]>

I'd just like to point out that this is a very bad commit subject:

"[PATCH] mwifiex: Random MAC address during scanning"

It's borderline wrong, really. "Random MAC address during scanning" is
already supported. This patch is just adding a feature-flag check for
it, since some firmwares in the wild don't support it. A more accurate
description would be something like:

"[PATCH] mwifiex: Add feature flag support for MAC randomization"

The patch is already applied, so I'd only worry about it for future
submissions (no need to resend).

Brian

2017-10-10 08:21:39

by Kalle Valo

[permalink] [raw]
Subject: Re: mwifiex: Random MAC address during scanning

Ganapathi Bhat <[email protected]> wrote:

> From: Karthik Ananthapadmanabha <[email protected]>
>
> Driver will advertise RANDOM_MAC support only if the device
> supports this feature.
>
> Signed-off-by: Karthik Ananthapadmanabha <[email protected]>
> Signed-off-by: Ganapathi Bhat <[email protected]>

Patch applied to wireless-drivers-next.git, thanks.

073a435d55a6 mwifiex: Random MAC address during scanning

--
https://patchwork.kernel.org/patch/9977525/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2017-10-12 05:27:49

by Ganapathi Bhat

[permalink] [raw]
Subject: RE: [EXT] Re: [PATCH] mwifiex: Random MAC address during scanning

Hi Brian,

> ----------------------------------------------------------------------
> On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
> > From: Karthik Ananthapadmanabha <[email protected]>
> >
> > Driver will advertise RANDOM_MAC support only if the device supports
> > this feature.
> >
> > Signed-off-by: Karthik Ananthapadmanabha <[email protected]>
> > Signed-off-by: Ganapathi Bhat <[email protected]>
>
> I'd just like to point out that this is a very bad commit subject:
>
> "[PATCH] mwifiex: Random MAC address during scanning"
>
> It's borderline wrong, really. "Random MAC address during scanning" is
> already supported. This patch is just adding a feature-flag check for it, since
> some firmwares in the wild don't support it. A more accurate description
> would be something like:
>
> "[PATCH] mwifiex: Add feature flag support for MAC randomization"
>
> The patch is already applied, so I'd only worry about it for future submissions
> (no need to resend).

I'm Really Sorry. I will take care of this in future.

>
> Brian