* [PATCH v3 0/3] mwifiex: add support for WPA-PSK-SHA256
@ 2024-07-23 7:09 Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Sascha Hauer @ 2024-07-23 7:09 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Kalle Valo
Cc: David Lin, linux-wireless, linux-kernel, Sascha Hauer,
Francesco Dolcini
This series adds support for the WPA-PSK AKM suite with SHA256 as hashing
method (WPA-PSK-SHA256)
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Changes in v3:
- add patch to replace '=' with '|=' in the key_mgmt setting
- Link to v2: https://lore.kernel.org/r/20240717-mwifiex-wpa-psk-sha256-v2-0-eb53d5082b62@pengutronix.de
Changes in v2:
- set bss_config->protocol to zero to make the code clearer
- Link to v1: https://lore.kernel.org/r/20240716-mwifiex-wpa-psk-sha256-v1-0-05ae70f37bb3@pengutronix.de
---
Sascha Hauer (3):
wifi: mwifiex: simplify WPA flags setting
wifi: mwifiex: fix key_mgmt setting
wifi: mwifiex: add support for WPA-PSK-SHA256
drivers/net/wireless/marvell/mwifiex/fw.h | 1 +
drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 32 ++++++++++----------------
2 files changed, 13 insertions(+), 20 deletions(-)
---
base-commit: 0c3836482481200ead7b416ca80c68a29cfdaabd
change-id: 20240716-mwifiex-wpa-psk-sha256-2d2a9fc3b06b
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting
2024-07-23 7:09 [PATCH v3 0/3] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
@ 2024-07-23 7:09 ` Sascha Hauer
2024-08-04 8:57 ` Kalle Valo
2024-07-23 7:09 ` [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2 siblings, 1 reply; 9+ messages in thread
From: Sascha Hauer @ 2024-07-23 7:09 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Kalle Valo
Cc: David Lin, linux-wireless, linux-kernel, Sascha Hauer,
Francesco Dolcini
The WPA flags setting only depends on the wpa_versions bitfield and not
on the AKM suite, so move it out of the switch/case to simplify the code
a bit. Also set bss_config->protocol to zero explicitly. This is done
only to make the code clearer, bss_config has been zero alloced by the
caller, so should be zero already. No functional change intended.
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 28 ++++++++------------------
1 file changed, 8 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index 491e366119096..7f822660fd955 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -46,31 +46,19 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
bss_config->key_mgmt_operation |= KEY_MGMT_ON_HOST;
+ bss_config->protocol = 0;
+ if (params->crypto.wpa_versions & NL80211_WPA_VERSION_1)
+ bss_config->protocol |= PROTOCOL_WPA;
+ if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2)
+ bss_config->protocol |= PROTOCOL_WPA2;
+
for (i = 0; i < params->crypto.n_akm_suites; i++) {
switch (params->crypto.akm_suites[i]) {
case WLAN_AKM_SUITE_8021X:
- if (params->crypto.wpa_versions &
- NL80211_WPA_VERSION_1) {
- bss_config->protocol = PROTOCOL_WPA;
- bss_config->key_mgmt = KEY_MGMT_EAP;
- }
- if (params->crypto.wpa_versions &
- NL80211_WPA_VERSION_2) {
- bss_config->protocol |= PROTOCOL_WPA2;
- bss_config->key_mgmt = KEY_MGMT_EAP;
- }
+ bss_config->key_mgmt = KEY_MGMT_EAP;
break;
case WLAN_AKM_SUITE_PSK:
- if (params->crypto.wpa_versions &
- NL80211_WPA_VERSION_1) {
- bss_config->protocol = PROTOCOL_WPA;
- bss_config->key_mgmt = KEY_MGMT_PSK;
- }
- if (params->crypto.wpa_versions &
- NL80211_WPA_VERSION_2) {
- bss_config->protocol |= PROTOCOL_WPA2;
- bss_config->key_mgmt = KEY_MGMT_PSK;
- }
+ bss_config->key_mgmt = KEY_MGMT_PSK;
break;
default:
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting
2024-07-23 7:09 ` [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
@ 2024-08-04 8:57 ` Kalle Valo
2024-08-05 7:36 ` Sascha Hauer
0 siblings, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2024-08-04 8:57 UTC (permalink / raw)
To: Sascha Hauer
Cc: Brian Norris, Francesco Dolcini, David Lin, linux-wireless,
linux-kernel, Sascha Hauer, Francesco Dolcini
Sascha Hauer <s.hauer@pengutronix.de> wrote:
> The WPA flags setting only depends on the wpa_versions bitfield and not
> on the AKM suite, so move it out of the switch/case to simplify the code
> a bit. Also set bss_config->protocol to zero explicitly. This is done
> only to make the code clearer, bss_config has been zero alloced by the
> caller, so should be zero already. No functional change intended.
>
> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Acked-by: Brian Norris <briannorris@chromium.org>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
There were conflicts on wireless-next, please rebase.
Recorded preimage for 'drivers/net/wireless/marvell/mwifiex/fw.h'
Recorded preimage for 'drivers/net/wireless/marvell/mwifiex/uap_cmd.c'
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Applying: wifi: mwifiex: add support for WPA-PSK-SHA256
Using index info to reconstruct a base tree...
M drivers/net/wireless/marvell/mwifiex/fw.h
M drivers/net/wireless/marvell/mwifiex/uap_cmd.c
Falling back to patching base and 3-way merge...
Auto-merging drivers/net/wireless/marvell/mwifiex/uap_cmd.c
CONFLICT (content): Merge conflict in drivers/net/wireless/marvell/mwifiex/uap_cmd.c
Auto-merging drivers/net/wireless/marvell/mwifiex/fw.h
CONFLICT (content): Merge conflict in drivers/net/wireless/marvell/mwifiex/fw.h
Patch failed at 0001 wifi: mwifiex: add support for WPA-PSK-SHA256
3 patches set to Changes Requested.
13739655 [v3,1/3] wifi: mwifiex: simplify WPA flags setting
13739654 [v3,2/3] wifi: mwifiex: fix key_mgmt setting
13739653 [v3,3/3] wifi: mwifiex: add support for WPA-PSK-SHA256
--
https://patchwork.kernel.org/project/linux-wireless/patch/20240723-mwifiex-wpa-psk-sha256-v3-1-025168a91da1@pengutronix.de/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting
2024-08-04 8:57 ` Kalle Valo
@ 2024-08-05 7:36 ` Sascha Hauer
0 siblings, 0 replies; 9+ messages in thread
From: Sascha Hauer @ 2024-08-05 7:36 UTC (permalink / raw)
To: Kalle Valo
Cc: Brian Norris, Francesco Dolcini, David Lin, linux-wireless,
linux-kernel, Francesco Dolcini
On Sun, Aug 04, 2024 at 08:57:54AM +0000, Kalle Valo wrote:
> Sascha Hauer <s.hauer@pengutronix.de> wrote:
>
> > The WPA flags setting only depends on the wpa_versions bitfield and not
> > on the AKM suite, so move it out of the switch/case to simplify the code
> > a bit. Also set bss_config->protocol to zero explicitly. This is done
> > only to make the code clearer, bss_config has been zero alloced by the
> > caller, so should be zero already. No functional change intended.
> >
> > Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> > Acked-by: Brian Norris <briannorris@chromium.org>
> > Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
>
> There were conflicts on wireless-next, please rebase.
Thanks for noting. Just sent out a v4.
I realized the host-mlme patches are merged in wireless-next. I had them
in my tree anyway already, so the necessary changes looked all familiar.
Sascha
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting
2024-07-23 7:09 [PATCH v3 0/3] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
@ 2024-07-23 7:09 ` Sascha Hauer
2024-07-23 7:52 ` Francesco Dolcini
2024-07-23 17:10 ` Brian Norris
2024-07-23 7:09 ` [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2 siblings, 2 replies; 9+ messages in thread
From: Sascha Hauer @ 2024-07-23 7:09 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Kalle Valo
Cc: David Lin, linux-wireless, linux-kernel, Sascha Hauer
bss_config->key_mgmt specifies the AKM suites that are usable in
hardware. This variable is set to specific values while iterating
over the advertised AKM suites. This means the final value of the
variable depends on the order of the entries in the AKM suites
array. Instead of setting the variable, just set the relevant bits
in the key_mgmt bit field to make us independent of the order of
entries.
This behaviour is derived from the downstream driver that does the
same.
Also, set bss_config->key_mgmt to zero explicitly right before the
loop. bss_config has been zero allocated by the caller already, but
do so again to safe the reader from following the code path.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index 7f822660fd955..57280eaae483c 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -52,13 +52,14 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
if (params->crypto.wpa_versions & NL80211_WPA_VERSION_2)
bss_config->protocol |= PROTOCOL_WPA2;
+ bss_config->key_mgmt = 0;
for (i = 0; i < params->crypto.n_akm_suites; i++) {
switch (params->crypto.akm_suites[i]) {
case WLAN_AKM_SUITE_8021X:
- bss_config->key_mgmt = KEY_MGMT_EAP;
+ bss_config->key_mgmt |= KEY_MGMT_EAP;
break;
case WLAN_AKM_SUITE_PSK:
- bss_config->key_mgmt = KEY_MGMT_PSK;
+ bss_config->key_mgmt |= KEY_MGMT_PSK;
break;
default:
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting
2024-07-23 7:09 ` [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting Sascha Hauer
@ 2024-07-23 7:52 ` Francesco Dolcini
2024-07-23 17:10 ` Brian Norris
1 sibling, 0 replies; 9+ messages in thread
From: Francesco Dolcini @ 2024-07-23 7:52 UTC (permalink / raw)
To: Sascha Hauer
Cc: Brian Norris, Francesco Dolcini, Kalle Valo, David Lin,
linux-wireless, linux-kernel
On Tue, Jul 23, 2024 at 09:09:58AM +0200, Sascha Hauer wrote:
> bss_config->key_mgmt specifies the AKM suites that are usable in
> hardware. This variable is set to specific values while iterating
> over the advertised AKM suites. This means the final value of the
> variable depends on the order of the entries in the AKM suites
> array. Instead of setting the variable, just set the relevant bits
> in the key_mgmt bit field to make us independent of the order of
> entries.
> This behaviour is derived from the downstream driver that does the
> same.
> Also, set bss_config->key_mgmt to zero explicitly right before the
> loop. bss_config has been zero allocated by the caller already, but
> do so again to safe the reader from following the code path.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Francesco
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting
2024-07-23 7:09 ` [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting Sascha Hauer
2024-07-23 7:52 ` Francesco Dolcini
@ 2024-07-23 17:10 ` Brian Norris
1 sibling, 0 replies; 9+ messages in thread
From: Brian Norris @ 2024-07-23 17:10 UTC (permalink / raw)
To: Sascha Hauer
Cc: Francesco Dolcini, Kalle Valo, David Lin, linux-wireless,
linux-kernel
On Tue, Jul 23, 2024 at 09:09:58AM +0200, Sascha Hauer wrote:
> bss_config->key_mgmt specifies the AKM suites that are usable in
> hardware. This variable is set to specific values while iterating
> over the advertised AKM suites. This means the final value of the
> variable depends on the order of the entries in the AKM suites
> array. Instead of setting the variable, just set the relevant bits
> in the key_mgmt bit field to make us independent of the order of
> entries.
> This behaviour is derived from the downstream driver that does the
> same.
> Also, set bss_config->key_mgmt to zero explicitly right before the
> loop. bss_config has been zero allocated by the caller already, but
> do so again to safe the reader from following the code path.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Acked-by: Brian Norris <briannorris@chromium.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256
2024-07-23 7:09 [PATCH v3 0/3] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting Sascha Hauer
@ 2024-07-23 7:09 ` Sascha Hauer
2024-07-23 17:10 ` Brian Norris
2 siblings, 1 reply; 9+ messages in thread
From: Sascha Hauer @ 2024-07-23 7:09 UTC (permalink / raw)
To: Brian Norris, Francesco Dolcini, Kalle Valo
Cc: David Lin, linux-wireless, linux-kernel, Sascha Hauer,
Francesco Dolcini
This adds support for the WPA-PSK AKM suite with SHA256 as hashing
method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP
using key_mgmt=WPA-PSK-SHA256.
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://lore.kernel.org/r/20240717-mwifiex-wpa-psk-sha256-v2-2-eb53d5082b62@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/wireless/marvell/mwifiex/fw.h | 1 +
drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
index 3adc447b715f6..1c76754b616ff 100644
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
@@ -415,6 +415,7 @@ enum MWIFIEX_802_11_PRIVACY_FILTER {
#define KEY_MGMT_NONE 0x04
#define KEY_MGMT_PSK 0x02
#define KEY_MGMT_EAP 0x01
+#define KEY_MGMT_PSK_SHA256 0x100
#define CIPHER_TKIP 0x04
#define CIPHER_AES_CCMP 0x08
#define VALID_CIPHER_BITMAP 0x0c
diff --git a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
index 57280eaae483c..3888c7a86876c 100644
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
@@ -61,6 +61,9 @@ int mwifiex_set_secure_params(struct mwifiex_private *priv,
case WLAN_AKM_SUITE_PSK:
bss_config->key_mgmt |= KEY_MGMT_PSK;
break;
+ case WLAN_AKM_SUITE_PSK_SHA256:
+ bss_config->key_mgmt |= KEY_MGMT_PSK_SHA256;
+ break;
default:
break;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256
2024-07-23 7:09 ` [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
@ 2024-07-23 17:10 ` Brian Norris
0 siblings, 0 replies; 9+ messages in thread
From: Brian Norris @ 2024-07-23 17:10 UTC (permalink / raw)
To: Sascha Hauer
Cc: Francesco Dolcini, Kalle Valo, David Lin, linux-wireless,
linux-kernel, Francesco Dolcini
On Tue, Jul 23, 2024 at 09:09:59AM +0200, Sascha Hauer wrote:
> This adds support for the WPA-PSK AKM suite with SHA256 as hashing
> method (WPA-PSK-SHA256). Tested with a wpa_supplicant provided AP
> using key_mgmt=WPA-PSK-SHA256.
>
> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
> Link: https://lore.kernel.org/r/20240717-mwifiex-wpa-psk-sha256-v2-2-eb53d5082b62@pengutronix.de
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/net/wireless/marvell/mwifiex/fw.h | 1 +
> drivers/net/wireless/marvell/mwifiex/uap_cmd.c | 3 +++
> 2 files changed, 4 insertions(+)
Acked-by: Brian Norris <briannorris@chromium.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2024-08-05 7:37 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-23 7:09 [PATCH v3 0/3] mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 1/3] wifi: mwifiex: simplify WPA flags setting Sascha Hauer
2024-08-04 8:57 ` Kalle Valo
2024-08-05 7:36 ` Sascha Hauer
2024-07-23 7:09 ` [PATCH v3 2/3] wifi: mwifiex: fix key_mgmt setting Sascha Hauer
2024-07-23 7:52 ` Francesco Dolcini
2024-07-23 17:10 ` Brian Norris
2024-07-23 7:09 ` [PATCH v3 3/3] wifi: mwifiex: add support for WPA-PSK-SHA256 Sascha Hauer
2024-07-23 17:10 ` Brian Norris
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).