Skip to contentSkip to conversation

ath10k: support NET_DETECT WoWLAN feature

PATCH In review Wen Gong 4 participants 16 messages Aug 16, 2018 – Oct 3, 2019 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore

Wen Gong

author
#0 lore raw

PATCH v3 1/1 ath10k: support NET_DETECT WoWLAN feature

For WoWLAN support, it expect to support wake up based on discovery of one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature, which shows up as an NL80211 feature flag.

With an upgrade iw, this shows up in 'iw phy' as:
WoWLAN support:
* wake up on network detection, up to 16 match sets
And it can use command:
"iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo" to configure the parameters of net detect.

Firmware will do scan by the configured parameters after suspend and wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

---
V3:
-fix the waring of alloc with no test

 drivers/net/wireless/ath/ath10k/core.h    |   1 +
 drivers/net/wireless/ath/ath10k/mac.c     |  12 ++
 drivers/net/wireless/ath/ath10k/wmi-ops.h |  21 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 180 +++++++++++++++++++++++-
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 226 ++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h     |  57 ++++++++
 drivers/net/wireless/ath/ath10k/wow.c     | 174 +++++++++++++++++++++++
 7 files changed, 670 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.h +1 -0
index 427ee57..7885462 100644
@@ -904,6 +904,7 @@ struct ath10k {
 	u32 high_5ghz_chan;
 	bool ani_enabled;
 
+	bool nlo_enabled;
 	bool p2p;
 
 	struct {
drivers/net/wireless/ath/ath10k/mac.c +12 -0
index 95243b4..ba9b9af 100644
@@ -8361,6 +8361,18 @@ int ath10k_mac_register(struct ath10k *ar)
 	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
 	ar->hw->wiphy->max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN;
 
+	if (test_bit(WMI_SERVICE_NLO, ar->wmi.svc_map)) {
+		ar->hw->wiphy->max_sched_scan_reqs = 1;
+		ar->hw->wiphy->max_sched_scan_ssids = WMI_PNO_MAX_SUPP_NETWORKS;
+		ar->hw->wiphy->max_match_sets       = WMI_PNO_MAX_SUPP_NETWORKS;
+		ar->hw->wiphy->max_sched_scan_ie_len = WMI_PNO_MAX_IE_LENGTH;
+		ar->hw->wiphy->max_sched_scan_plans = WMI_PNO_MAX_SCHED_SCAN_PLANS;
+		ar->hw->wiphy->max_sched_scan_plan_interval =
+			WMI_PNO_MAX_SCHED_SCAN_PLAN_INT;
+		ar->hw->wiphy->max_sched_scan_plan_iterations =
+			WMI_PNO_MAX_SCHED_SCAN_PLAN_ITRNS;
+	}
+
 	ar->hw->vif_data_size = sizeof(struct ath10k_vif);
 	ar->hw->sta_data_size = sizeof(struct ath10k_sta);
 	ar->hw->txq_data_size = sizeof(struct ath10k_txq);
drivers/net/wireless/ath/ath10k/wmi-ops.h +21 -0
index 5ecce04..68fff3a 100644
@@ -208,6 +208,9 @@ struct wmi_ops {
 					       u32 fw_feature_bitmap);
 	int (*get_vdev_subtype)(struct ath10k *ar,
 				enum wmi_vdev_subtype subtype);
+	struct sk_buff *(*gen_wow_config_pno)(struct ath10k *ar,
+					      u32 vdev_id,
+					      struct wmi_pno_scan_req *pno_scan);
 	struct sk_buff *(*gen_pdev_bss_chan_info_req)
 					(struct ath10k *ar,
 					 enum wmi_bss_survey_req_type type);
@@ -1349,6 +1352,24 @@ struct wmi_ops {
 }
 
 static inline int
+ath10k_wmi_wow_config_pno(struct ath10k *ar, u32 vdev_id,
+			  struct wmi_pno_scan_req  *pno_scan)
+{
+	struct sk_buff *skb;
+	u32 cmd_id;
+
+	if (!ar->wmi.ops->gen_wow_config_pno)
+		return -EOPNOTSUPP;
+
+	skb = ar->wmi.ops->gen_wow_config_pno(ar, vdev_id, pno_scan);
+	if (IS_ERR(skb))
+		return PTR_ERR(skb);
+
+	cmd_id = ar->wmi.cmd->network_list_offload_config_cmdid;
+	return ath10k_wmi_cmd_send(ar, skb, cmd_id);
+}
+
+static inline int
 ath10k_wmi_update_fw_tdls_state(struct ath10k *ar, u32 vdev_id,
 				enum wmi_tdls_state state)
 {
drivers/net/wireless/ath/ath10k/wmi-tlv.c +179 -1

198 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/wmi-tlv.h +226 -0

232 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/wmi.h +57 -0

63 lines not on this page · raw message

drivers/net/wireless/ath/ath10k/wow.c +174 -0

204 lines not on this page · raw message

Signature · 7 lines
1.9.1


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#1 lore raw
Quoted 16 lines · Wen Gong

For WoWLAN support, it expect to support wake up based on discovery of one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature, which shows up as an NL80211 feature flag.

With an upgrade iw, this shows up in 'iw phy' as:
WoWLAN support:
* wake up on network detection, up to 16 match sets
And it can use command:
"iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo" to configure the parameters of net detect.

Firmware will do scan by the configured parameters after suspend and wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

[...]

Quoted 11 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.c +11 -0
+/* Request FW to start PNO operation */
+static struct sk_buff *ath10k_wmi_tlv_op_gen_config_pno_start
+				(struct ath10k *ar,
+				u32 vdev_id,
+				struct wmi_pno_scan_req *pno)
+{
+	struct wmi_tlv_wow_nlo_config_cmd *cmd;
+	struct wmi_tlv *tlv;
+	struct sk_buff *skb;
+	struct nlo_configured_parameters *nlo_list;
+	u32 *channel_list;

[...]

drivers/net/wireless/ath/ath10k/wmi-tlv.c static u32 ath10k_wmi_tlv_prepare_peer_qos(u8 uapsd_queues, u8 sp) · line 3484

Quoted 3 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.c +3 -0
+	channel_list = (u32 *)ptr;
+	for (i = 0; i < cmd->num_of_channels; i++)
+		channel_list[i] = pno->a_networks[0].channels[i];

channel_list does not look endian safe to me, I'll change this to use __le32.

drivers/net/wireless/ath/ath10k/wmi-tlv.h struct wmi_tlv_tdls_peer_event { · line 2150

Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.h +9 -0
+enum wmi_nlo_cipher_algorithm {
+	WMI_NLO_CIPHER_ALGO_NONE           = 0x00,
+	WMI_NLO_CIPHER_ALGO_WEP40          = 0x01,
+	WMI_NLO_CIPHER_ALGO_TKIP           = 0x02,
+	WMI_NLO_CIPHER_ALGO_CCMP           = 0x04,
+	WMI_NLO_CIPHER_ALGO_WEP104         = 0x05,
+	WMI_NLO_CIPHER_ALGO_BIP            = 0x06,
+	WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP  = 0x100,
+	WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP  = 0x100,

Two defines with the same value 0x100, is this really correct?

Signature · 6 lines
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#2 lore raw
Quoted 11 lines

-----Original Message-----
From: ath10k <[email protected]> On Behalf Of Kalle Valo
Sent: Tuesday, September 4, 2018 5:15 PM
To: Wen Gong <[email protected]>
Cc: [email protected]; [email protected]
Subject: [EXTERNAL] Re: [PATCH v3] ath10k: support NET_DETECT WoWLAN feature

Wen Gong <[email protected]> writes:

Quoted 8 lines
Quoted 1 line

For WoWLAN support, it expect to support wake up based on discovery of

[...]

drivers/net/wireless/ath/ath10k/wmi-tlv.c static u32 ath10k_wmi_tlv_prepare_peer_qos(u8 uapsd_queues, u8 sp) · line 3484

Quoted 3 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.c +3 -0
+	channel_list = (u32 *)ptr;
+	for (i = 0; i < cmd->num_of_channels; i++)
+		channel_list[i] = pno->a_networks[0].channels[i];

channel_list does not look endian safe to me, I'll change this to use __le32.

Yes, __le32 is more safe.

Quoted 11 lines

drivers/net/wireless/ath/ath10k/wmi-tlv.h struct wmi_tlv_tdls_peer_event { · line 2150

Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.h +9 -0
+enum wmi_nlo_cipher_algorithm {
+	WMI_NLO_CIPHER_ALGO_NONE           = 0x00,
+	WMI_NLO_CIPHER_ALGO_WEP40          = 0x01,
+	WMI_NLO_CIPHER_ALGO_TKIP           = 0x02,
+	WMI_NLO_CIPHER_ALGO_CCMP           = 0x04,
+	WMI_NLO_CIPHER_ALGO_WEP104         = 0x05,
+	WMI_NLO_CIPHER_ALGO_BIP            = 0x06,
+	WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP  = 0x100,
+	WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP  = 0x100,

Two defines with the same value 0x100, is this really correct?

Yes, it is an interface between host driver /firmware.

Quoted 7 lines

--
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#3 lore raw
Quoted 12 lines · Wen Gong
Quoted 11 lines

drivers/net/wireless/ath/ath10k/wmi-tlv.h struct wmi_tlv_tdls_peer_event { · line 2150

Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.h +9 -0
+enum wmi_nlo_cipher_algorithm {
+	WMI_NLO_CIPHER_ALGO_NONE           = 0x00,
+	WMI_NLO_CIPHER_ALGO_WEP40          = 0x01,
+	WMI_NLO_CIPHER_ALGO_TKIP           = 0x02,
+	WMI_NLO_CIPHER_ALGO_CCMP           = 0x04,
+	WMI_NLO_CIPHER_ALGO_WEP104         = 0x05,
+	WMI_NLO_CIPHER_ALGO_BIP            = 0x06,
+	WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP  = 0x100,
+	WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP  = 0x100,

Two defines with the same value 0x100, is this really correct?

Quoted 1 line

Yes, it is an interface between host driver /firmware.

Yeah, I know it's an interface between the host driver and the firmware but it does not make any sense and is just confusing. Either of them should be dropped.

Signature · 6 lines
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
author
#4 lore raw
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Wen Gong
Quoted 11 lines

drivers/net/wireless/ath/ath10k/wmi-tlv.h struct wmi_tlv_tdls_peer_event { · line 2150

Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.h +9 -0
+enum wmi_nlo_cipher_algorithm {
+	WMI_NLO_CIPHER_ALGO_NONE           = 0x00,
+	WMI_NLO_CIPHER_ALGO_WEP40          = 0x01,
+	WMI_NLO_CIPHER_ALGO_TKIP           = 0x02,
+	WMI_NLO_CIPHER_ALGO_CCMP           = 0x04,
+	WMI_NLO_CIPHER_ALGO_WEP104         = 0x05,
+	WMI_NLO_CIPHER_ALGO_BIP            = 0x06,
+	WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP  = 0x100,
+	WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP  = 0x100,

Two defines with the same value 0x100, is this really correct?

Quoted 5 lines
Quoted 1 line

Yes, it is an interface between host driver /firmware.

Yeah, I know it's an interface between the host driver and the firmware but it does not make any sense and is just confusing. Either of them should be dropped.

yes, either of them can be dropped.

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#5 lore raw
Quoted 15 lines · Wen Gong
Quoted 14 lines · Kalle Valo
Quoted 12 lines · Wen Gong
Quoted 11 lines

drivers/net/wireless/ath/ath10k/wmi-tlv.h struct wmi_tlv_tdls_peer_event { · line 2150

Quoted 9 lines
drivers/net/wireless/ath/ath10k/wmi-tlv.h +9 -0
+enum wmi_nlo_cipher_algorithm {
+	WMI_NLO_CIPHER_ALGO_NONE           = 0x00,
+	WMI_NLO_CIPHER_ALGO_WEP40          = 0x01,
+	WMI_NLO_CIPHER_ALGO_TKIP           = 0x02,
+	WMI_NLO_CIPHER_ALGO_CCMP           = 0x04,
+	WMI_NLO_CIPHER_ALGO_WEP104         = 0x05,
+	WMI_NLO_CIPHER_ALGO_BIP            = 0x06,
+	WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP  = 0x100,
+	WMI_NLO_CIPHER_ALGO_RSN_USE_GROUP  = 0x100,

Two defines with the same value 0x100, is this really correct?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Yes, it is an interface between host driver /firmware.

Yeah, I know it's an interface between the host driver and the firmware but it does not make any sense and is just confusing. Either of them should be dropped.

yes, either of them can be dropped.

Ok, I dropped WMI_NLO_CIPHER_ALGO_WPA_USE_GROUP in the pending branch.

Signature · 1 line
Kalle Valo
#6 lore raw
In reply to Wen Gong
Quoted 13 lines · Wen Gong

For WoWLAN support it is expected to support wake up based on discovery of one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature, which shows up as an NL80211 feature flag.

This shows up in 'iw phy' as:

WoWLAN support:
* wake up on network detection, up to 16 match sets

And it can be enabled with command:

iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo

Quoted 7 lines

Firmware will do scan by the configured parameters after suspend and wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

[[email protected]: fix lots of endian bugs, whitespace, commit log and style cleanup]

Patch applied to ath-next branch of ath.git, thanks.

ce834e280f2f ath10k: support NET_DETECT WoWLAN feature

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

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#7 lore raw
In reply to Wen Gong
Quoted 13 lines · Wen Gong

For WoWLAN support it is expected to support wake up based on discovery of one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature, which shows up as an NL80211 feature flag.

This shows up in 'iw phy' as:

WoWLAN support:
* wake up on network detection, up to 16 match sets

And it can be enabled with command:

iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo

Quoted 7 lines

Firmware will do scan by the configured parameters after suspend and wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

[[email protected]: fix lots of endian bugs, whitespace, commit log and style cleanup]

Patch applied to ath-next branch of ath.git, thanks.

ce834e280f2f ath10k: support NET_DETECT WoWLAN feature

Signature · 9 lines
https://patchwork.kernel.org/patch/10567005/

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


_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#8 lore raw
In reply to Wen Gong

Hi Wen,

You've introduced a regression in 4.20-rc1:

Quoted 48 lines · Wen Gong

For WoWLAN support, it expect to support wake up based on discovery of one or more known SSIDs. This is the WIPHY_WOWLAN_NET_DETECT feature, which shows up as an NL80211 feature flag.

With an upgrade iw, this shows up in 'iw phy' as:
WoWLAN support:
* wake up on network detection, up to 16 match sets
And it can use command:
"iw phy0 wowlan enable net-detect interval 5000 delay 30 freqs 2412 matches ssid foo" to configure the parameters of net detect.

Firmware will do scan by the configured parameters after suspend and wakeup if it found matched SSIDs. Tested with QCA6174 hw3.0 with firmware WLAN.RM.4.4.1-00110-QCARMSWPZ-1.

---
V3:

(quoted diff) +0 -1
-fix the waring of alloc with no test
 drivers/net/wireless/ath/ath10k/core.h    |   1 +
 drivers/net/wireless/ath/ath10k/mac.c     |  12 ++
 drivers/net/wireless/ath/ath10k/wmi-ops.h |  21 +++
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 180 +++++++++++++++++++++++-
 drivers/net/wireless/ath/ath10k/wmi-tlv.h | 226 ++++++++++++++++++++++++++++++
 drivers/net/wireless/ath/ath10k/wmi.h     |  57 ++++++++
 drivers/net/wireless/ath/ath10k/wow.c     | 174 +++++++++++++++++++++++
 7 files changed, 670 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/core.h +1 -0
index 427ee57..7885462 100644
@@ -904,6 +904,7 @@ struct ath10k {
 	u32 high_5ghz_chan;
 	bool ani_enabled;
 
+	bool nlo_enabled;
 	bool p2p;
 
 	struct {
drivers/net/wireless/ath/ath10k/mac.c +0 -0
index 95243b4..ba9b9af 100644
@@ -8361,6 +8361,18 @@ int ath10k_mac_register(struct ath10k *ar)
 	ar->hw->wiphy->max_scan_ssids = WLAN_SCAN_PARAMS_MAX_SSID;
 	ar->hw->wiphy->max_scan_ie_len = WLAN_SCAN_PARAMS_MAX_IE_LEN;
 

drivers/net/wireless/ath/ath10k/mac.c int ath10k_mac_register(struct ath10k *ar) · line 8373

Quoted 10 lines
drivers/net/wireless/ath/ath10k/mac.c +10 -0
+	if (test_bit(WMI_SERVICE_NLO, ar->wmi.svc_map)) {
+		ar->hw->wiphy->max_sched_scan_reqs = 1;
+		ar->hw->wiphy->max_sched_scan_ssids = WMI_PNO_MAX_SUPP_NETWORKS;
+		ar->hw->wiphy->max_match_sets       = WMI_PNO_MAX_SUPP_NETWORKS;
+		ar->hw->wiphy->max_sched_scan_ie_len = WMI_PNO_MAX_IE_LENGTH;
+		ar->hw->wiphy->max_sched_scan_plans = WMI_PNO_MAX_SCHED_SCAN_PLANS;
+		ar->hw->wiphy->max_sched_scan_plan_interval =
+			WMI_PNO_MAX_SCHED_SCAN_PLAN_INT;
+		ar->hw->wiphy->max_sched_scan_plan_iterations =
+			WMI_PNO_MAX_SCHED_SCAN_PLAN_ITRNS;

It seems like youre enabling SCHED_SCAN support? But you're not adding the NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR feature flag. So it puts us in a tough place on using randomization -- we either can't trust the FEATURE flags, or else we can't use both SCHED_SCAN and scan randomization.

I haven't played with this much at all yet (except to notice that my tests no longer pass), but maybe you just need to add the FEATURE flag.

Brian

Quoted 5 lines
drivers/net/wireless/ath/ath10k/mac.c +2 -0
+	}
+
 	ar->hw->vif_data_size = sizeof(struct ath10k_vif);
 	ar->hw->sta_data_size = sizeof(struct ath10k_sta);
 	ar->hw->txq_data_size = sizeof(struct ath10k_txq);

...

#10 lore raw
Quoted 8 lines · Brian Norris

Since Wen has once again suggested I use this patch in other forums, I'll ping here to note:

Quoted 1 line · Brian Norris

You've introduced a regression in 4.20-rc1:

This regression still survives in the latest tree. Is it fair to just submit a revert?

Your description about the problem from an earlier email:

"It seems like youre enabling SCHED_SCAN support? But you're not
adding the NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR feature flag. So it puts us in a tough place on using randomization -- we either can't trust the FEATURE flags, or else we can't use both SCHED_SCAN and scan randomization."

So essentially the problem is that with firmwares supporting both WMI_SERVICE_NLO and WMI_SERVICE_SPOOF_MAC_SUPPORT ath10k enables NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR, but NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR is not enabled which is inconsistent from user space point of view. Is my understanding correct?

Wen, can you enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR? Does firmware support that?

If that's not possible, one workaround might to be to not enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR if firmware supports WMI_SERVICE_NLO, but of course that would suck big time.

Here's the full context in case someone is interested:

https://patchwork.kernel.org/patch/10567005/

Signature · 6 lines
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k
#11 lore raw

(I realize I replied to the v3, not the v4 which was merged.)

Quoted 10 lines · Kalle Valo
Quoted 8 lines · Brian Norris

Since Wen has once again suggested I use this patch in other forums, I'll ping here to note:

Quoted 1 line · Brian Norris

You've introduced a regression in 4.20-rc1:

This regression still survives in the latest tree. Is it fair to just submit a revert?

Quoted 7 lines

Your description about the problem from an earlier email:

"It seems like youre enabling SCHED_SCAN support? But you're not
adding the NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR feature flag. So it puts us in a tough place on using randomization -- we either can't trust the FEATURE flags, or else we can't use both SCHED_SCAN and scan randomization."

Yeah, maybe I shouldn't have trimmed that context :)

Quoted 5 lines

So essentially the problem is that with firmwares supporting both WMI_SERVICE_NLO and WMI_SERVICE_SPOOF_MAC_SUPPORT ath10k enables NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR, but NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR is not enabled which is inconsistent from user space point of view. Is my understanding correct?

Yes, that sounds about right.

Quoted 2 lines

Wen, can you enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR? Does firmware support that?

I feel like I've asked him that privately, but asking here might not hurt :D

Quoted 3 lines

If that's not possible, one workaround might to be to not enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR if firmware supports WMI_SERVICE_NLO, but of course that would suck big time.

Yeah, that would be strictly worse than the current situation I think. SCAN_RANDOM_MAC_ADDRESS is a product requirement for us. At least right now, it's possible I could teach a user space to just ignore SCHED_SCAN if it doesn't support the appropriate randomization features. (I don't want to have to do that, but at least it's possible.)

Brian

Quoted 3 lines

Here's the full context in case someone is interested:

https://patchwork.kernel.org/patch/10567005/

#12 lore raw
In reply to Kalle Valo
Quoted 17 lines

-----Original Message-----
From: ath10k <[email protected]> On Behalf Of Kalle Valo
Sent: Wednesday, September 18, 2019 10:03 PM
To: Brian Norris <[email protected]>
Cc: linux-wireless <[email protected]>; Linux Kernel <linux- [email protected]>; [email protected]; Wen Gong <[email protected]>
Subject: [EXT] Re: [PATCH v3] ath10k: support NET_DETECT WoWLAN feature

So essentially the problem is that with firmwares supporting both WMI_SERVICE_NLO and WMI_SERVICE_SPOOF_MAC_SUPPORT ath10k enables
NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR, but NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR is not enabled which is
inconsistent from user space point of view. Is my understanding correct?

Quoted 3 lines

Wen, can you enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR? Does firmware
support that?

Yes, I test again, it is enabled NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR now.

Quoted 5 lines

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#13 lore raw
Quoted 17 lines · Wen Gong
Quoted 17 lines

-----Original Message-----
From: ath10k <[email protected]> On Behalf Of Kalle Valo
Sent: Wednesday, September 18, 2019 10:03 PM
To: Brian Norris <[email protected]>
Cc: linux-wireless <[email protected]>; Linux Kernel <linux- [email protected]>; [email protected]; Wen Gong <[email protected]>
Subject: [EXT] Re: [PATCH v3] ath10k: support NET_DETECT WoWLAN feature

So essentially the problem is that with firmwares supporting both WMI_SERVICE_NLO and WMI_SERVICE_SPOOF_MAC_SUPPORT ath10k enables
NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR, but NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR is not enabled which is
inconsistent from user space point of view. Is my understanding correct?

Quoted 5 lines
Quoted 3 lines

Wen, can you enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR? Does firmware
support that?

Yes, I test again, it is enabled NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR now.

Sorry, I'm not quite understanding your reply.

But I mixed up the flags. I meant that can we enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR in ath10k? Does the firmware releases which have WMI_SERVICE_NLO support NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR as well?

Signature · 1 line
Kalle Valo
#14 lore raw
Quoted 16 lines

-----Original Message-----
From: Kalle Valo <[email protected]>
Sent: Friday, September 20, 2019 3:32 PM
To: Wen Gong <[email protected]>
Cc: Brian Norris <[email protected]>; linux-wireless <linux- [email protected]>; Linux Kernel <[email protected]>; [email protected]; Wen Gong <[email protected]>
Subject: [EXT] Re: [PATCH v3] ath10k: support NET_DETECT WoWLAN feature

Quoted 5 lines
Quoted 3 lines

Wen, can you enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR? Does firmware
support that?

Yes, I test again, it is enabled

NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR now.

Quoted 7 lines

Sorry, I'm not quite understanding your reply.

But I mixed up the flags. I meant that can we enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR in ath10k? Does the firmware
releases which have WMI_SERVICE_NLO support NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR as well?

Kalle,
I tested with this firmware: https://github.com/kvalo/ath10k-firmware/blob/master/QCA6174/hw3.0/sdio-4.4.1/firmware-sdio-6.bin_WLAN.RMH.4.4.1-00017-QCARMSWPZ-2

In ath10k_mac_register, it has flag WMI_SERVICE_SPOOF_MAC_SUPPORT enabled.

	if (test_bit(WMI_SERVICE_SPOOF_MAC_SUPPORT, ar->wmi.svc_map)) {
		ar->hw->wiphy->features |=
			NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
	}

In ath10k_wow_init, it has flag ATH10K_FW_FEATURE_WOWLAN_SUPPORT, WMI_SERVICE_WOW, WMI_SERVICE_NLO enabled. int ath10k_wow_init(struct ath10k *ar)

{
	if (!test_bit(ATH10K_FW_FEATURE_WOWLAN_SUPPORT,
		      ar->running_fw->fw_file.fw_features))
		return 0;

	if (WARN_ON(!test_bit(WMI_SERVICE_WOW, ar->wmi.svc_map)))
		return -EINVAL;

	if (test_bit(WMI_SERVICE_NLO, ar->wmi.svc_map)) {
		ar->wow.wowlan_support.flags |= WIPHY_WOWLAN_NET_DETECT;
		ar->wow.wowlan_support.max_nd_match_sets = WMI_PNO_MAX_SUPP_NETWORKS;
	}
}
Quoted 3 lines

--
Kalle Valo

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k

#15 lore raw
In reply to Kalle Valo

Hi Kalle,

Sorry, I failed to follow up on some of this.

Quoted 4 lines · Kalle Valo

But I mixed up the flags. I meant that can we enable NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR in ath10k? Does the firmware releases which have WMI_SERVICE_NLO support NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR as well?

I'm looking at firmware which supports WMI_SERVICE_NLO and WMI_SERVICE_SPOOF_MAC_SUPPORT. This leads to support for NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR and NL80211_WOWLAN_TRIG_NET_DETECT (good!), but it also leads to NL80211_CMD_START_SCHED_SCAN support and *not* NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR, which is inconsistent (bad!).

(I think a few times in here you noted the FEATURE_SCAN variant, when you probably meant FEATURE_SCHED_SCAN.)

If I understand Wen correctly, he is working on dropping NL80211_CMD_START_SCHED_SCAN, which would fix the inconsistency.

But I also noticed that ath10k does not support NL80211_FEATURE_ND_RANDOM_MAC_ADDR, which is again an inconsistency:
we're going to lose randomization when in WoWLAN + NET_DETECT mode. I don't suspect we (Chrome OS) would ever enable this feature in that state.

Regards,
Brian

_______________________________________________
ath10k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath10k