Skip to contentSkip to conversation

mwifiex: Random MAC address during scanning

PATCH In review Ganapathi Bhat 3 participants 6 messages Sep 29, 2017 – Oct 12, 2017 Marvell mwifiex wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mwifiex: Random MAC address during scanning

From: Karthik Ananthapadmanabha <[email protected]>

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

---
 drivers/net/wireless/marvell/mwifiex/cfg80211.c | 10 ++++++----
 drivers/net/wireless/marvell/mwifiex/fw.h       |  1 +
 2 files changed, 7 insertions(+), 4 deletions(-)
drivers/net/wireless/marvell/mwifiex/cfg80211.c +6 -4
index 32c5074..f22f7b8 100644
@@ -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;
drivers/net/wireless/marvell/mwifiex/fw.h +1 -0
index 9e75522..6b765f3 100644
@@ -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) | \
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Ganapathi Bhat

From: Karthik Ananthapadmanabha <[email protected]>

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

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

073a435d55a6 mwifiex: Random MAC address during scanning

Signature · 3 lines
https://patchwork.kernel.org/patch/9977525/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
maintainer
#2 lore raw
In reply to Ganapathi Bhat
Quoted 7 lines · Ganapathi Bhat

From: Karthik Ananthapadmanabha <[email protected]>

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

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

#3 lore raw

Hi Brian,

Quoted 19 lines

----------------------------------------------------------------------

Quoted 7 lines · Ganapathi Bhat

From: Karthik Ananthapadmanabha <[email protected]>

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

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:

Quoted 4 lines

"[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.

Quoted 2 lines

Brian

#4 lore raw
In reply to Brian Norris

Hi Kalle,

Quoted 20 lines
Quoted 20 lines

----------------------------------------------------------------------

Quoted 7 lines · Ganapathi Bhat

From: Karthik Ananthapadmanabha <[email protected]>

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

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:

Quoted 7 lines
Quoted 4 lines

"[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.

Quoted 2 lines
Quoted 2 lines

Brian

Regards,
Ganapathi

#5 lore raw
Quoted 25 lines · Ganapathi Bhat

Hi Kalle,

Quoted 24 lines
Quoted 24 lines

----------------------------------------------------------------------

Quoted 7 lines · Ganapathi Bhat

From: Karthik Ananthapadmanabha <[email protected]>

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

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.

Quoted 6 lines
Quoted 2 lines

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

Signature · 1 line
Kalle Valo