diff mbox

mwifiex: Random MAC address during scanning

Message ID 1506682390-27716-1-git-send-email-gbhat@marvell.com (mailing list archive)
State Accepted
Commit 073a435d55a62813d0a871abcb1ae904b5726098
Delegated to: Kalle Valo
Headers show

Commit Message

Ganapathi Bhat Sept. 29, 2017, 10:53 a.m. UTC
From: Karthik Ananthapadmanabha <karthida@marvell.com>

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

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

Comments

Kalle Valo Oct. 10, 2017, 8:21 a.m. UTC | #1
Ganapathi Bhat <gbhat@marvell.com> wrote:

> From: Karthik Ananthapadmanabha <karthida@marvell.com>
> 
> Driver will advertise RANDOM_MAC support only if the device
> supports this feature.
> 
> Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

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

073a435d55a6 mwifiex: Random MAC address during scanning
Brian Norris Oct. 11, 2017, 7:41 p.m. UTC | #2
On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
> From: Karthik Ananthapadmanabha <karthida@marvell.com>
> 
> Driver will advertise RANDOM_MAC support only if the device
> supports this feature.
> 
> Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>

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
Ganapathi Bhat Oct. 12, 2017, 5:27 a.m. UTC | #3
Hi Brian,

> ----------------------------------------------------------------------
> On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
> > From: Karthik Ananthapadmanabha <karthida@marvell.com>
> >
> > Driver will advertise RANDOM_MAC support only if the device supports
> > this feature.
> >
> > Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
> > Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
>
> 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
Ganapathi Bhat Oct. 12, 2017, 5:53 a.m. UTC | #4
Hi Kalle,
>
> > ----------------------------------------------------------------------
> > On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
> > > From: Karthik Ananthapadmanabha <karthida@marvell.com>
> > >
> > > Driver will advertise RANDOM_MAC support only if the device supports
> > > this feature.
> > >
> > > Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
> > > Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
> >
> > 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.
>
The firmware which advertises this capability flag is yet to be shared in upstream. The latest available firmware does not contain this flag.
So, is it possible to revert this change, so that we will resubmit this (with proper subject) once our firmware is uploaded.
> >
> > Brian

Regards,
Ganapathi
Kalle Valo Oct. 12, 2017, 7:59 a.m. UTC | #5
Ganapathi Bhat <gbhat@marvell.com> writes:

> Hi Kalle,
>>
>> > ----------------------------------------------------------------------
>> > On Fri, Sep 29, 2017 at 04:23:10PM +0530, Ganapathi Bhat wrote:
>> > > From: Karthik Ananthapadmanabha <karthida@marvell.com>
>> > >
>> > > Driver will advertise RANDOM_MAC support only if the device supports
>> > > this feature.
>> > >
>> > > Signed-off-by: Karthik Ananthapadmanabha <karthida@marvell.com>
>> > > Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
>> >
>> > 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, thanks for pointing out that. I had missed it.

>> I'm Really Sorry.  I will take care of this in future.
>>
> The firmware which advertises this capability flag is yet to be shared
> in upstream. The latest available firmware does not contain this flag.
> So, is it possible to revert this change, so that we will resubmit
> this (with proper subject) once our firmware is uploaded.

Like Brian said, I don't think there's any point reverting it and
resending the patch. Just something to learn for the future, for both of
us. (I need to also check the titles more carefully.)
diff mbox

Patch

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