linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] rt2800: enable MFP support unconditionally
@ 2020-05-25 13:49 Rui Salvaterra
  2020-05-25 15:03 ` Stanislaw Gruszka
  2020-05-29 15:42 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Rui Salvaterra @ 2020-05-25 13:49 UTC (permalink / raw)
  To: johannes
  Cc: stf_xl, julian.calaby, kvalo, Larry.Finger, linux-wireless,
	Rui Salvaterra

v2: fixed null pointer.

This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.

Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 4 +---
 drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 3 ++-
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 6beac1f74e7c..a779fe771a55 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -9971,9 +9971,7 @@ static int rt2800_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
 	if (!rt2x00_is_usb(rt2x00dev))
 		ieee80211_hw_set(rt2x00dev->hw, HOST_BROADCAST_PS_BUFFERING);
 
-	/* Set MFP if HW crypto is disabled. */
-	if (rt2800_hwcrypt_disabled(rt2x00dev))
-		ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
+	ieee80211_hw_set(rt2x00dev->hw, MFP_CAPABLE);
 
 	SET_IEEE80211_DEV(rt2x00dev->hw, rt2x00dev->dev);
 	SET_IEEE80211_PERM_ADDR(rt2x00dev->hw,
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
index 32efbc8e9f92..2f68a31072ae 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c
@@ -468,7 +468,8 @@ int rt2x00mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
 		return 0;
 
-	if (!rt2x00_has_cap_hw_crypto(rt2x00dev))
+	/* The hardware can't do MFP */
+	if (!rt2x00_has_cap_hw_crypto(rt2x00dev) || (sta && sta->mfp))
 		return -EOPNOTSUPP;
 
 	/*
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] rt2800: enable MFP support unconditionally
  2020-05-25 13:49 [PATCH v2] rt2800: enable MFP support unconditionally Rui Salvaterra
@ 2020-05-25 15:03 ` Stanislaw Gruszka
  2020-05-29 15:42 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Stanislaw Gruszka @ 2020-05-25 15:03 UTC (permalink / raw)
  To: Rui Salvaterra
  Cc: johannes, julian.calaby, kvalo, Larry.Finger, linux-wireless

On Mon, May 25, 2020 at 02:49:07PM +0100, Rui Salvaterra wrote:
> v2: fixed null pointer.

This should go after --- , but not need to resend patch, Kalle kindly
fixes that for us in the patchwork.

> This gives us WPA3 support out of the box without having to manually disable
> hardware crypto. The driver will fall back to software crypto if the connection
> requires management frame protection.
> 
> Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl>
> Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] rt2800: enable MFP support unconditionally
  2020-05-25 13:49 [PATCH v2] rt2800: enable MFP support unconditionally Rui Salvaterra
  2020-05-25 15:03 ` Stanislaw Gruszka
@ 2020-05-29 15:42 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-05-29 15:42 UTC (permalink / raw)
  To: Rui Salvaterra
  Cc: johannes, stf_xl, julian.calaby, Larry.Finger, linux-wireless,
	Rui Salvaterra

Rui Salvaterra <rsalvaterra@gmail.com> wrote:

> This gives us WPA3 support out of the box without having to manually disable
> hardware crypto. The driver will fall back to software crypto if the connection
> requires management frame protection.
> 
> Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl>
> Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

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

b6b15e20421f rt2800: enable MFP support unconditionally

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

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-29 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 13:49 [PATCH v2] rt2800: enable MFP support unconditionally Rui Salvaterra
2020-05-25 15:03 ` Stanislaw Gruszka
2020-05-29 15:42 ` Kalle Valo

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