]> git.baikalelectronics.ru Git - kernel.git/commitdiff
rt2800: enable MFP support unconditionally
authorRui Salvaterra <rsalvaterra@gmail.com>
Mon, 25 May 2020 13:49:07 +0000 (14:49 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 29 May 2020 15:42:28 +0000 (18:42 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200525134906.1672-1-rsalvaterra@gmail.com
drivers/net/wireless/ralink/rt2x00/rt2800lib.c
drivers/net/wireless/ralink/rt2x00/rt2x00mac.c

index 6beac1f74e7cb0e5aad96331656365aca3e91197..a779fe771a551795457d9b92b952a2a82d611c72 100644 (file)
@@ -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,
index 32efbc8e9f925dfcd32a18d7e009ec4cc79deba7..2f68a31072ae4f61008c8c039361184b962c2027 100644 (file)
@@ -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;
 
        /*