Skip to content

Commit 1dbb1a3

Browse files
djfungregkh
authored andcommitted
wifi: rtl8xxxu: enable MFP support with security flag of RX descriptor
[ Upstream commit cbfbb4d ] In order to connect to networks which require 802.11w, add the MFP_CAPABLE flag and let mac80211 do the actual crypto in software. When a robust management frame is received, rx_dec->swdec is not set, even though the HW did not decrypt it. Extend the check and don't set RX_FLAG_DECRYPTED for these frames in order to use SW decryption. Use the security flag in the RX descriptor for this purpose, like it is done in the rtw88 driver. Cc: stable@vger.kernel.org Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Link: https://msgid.link/20240418071813.1883174-3-martin.kaistra@linutronix.de Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent b30c9b1 commit 1dbb1a3

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,15 @@ enum rtl8xxxu_rx_type {
121121
RX_TYPE_ERROR = -1
122122
};
123123

124+
enum rtl8xxxu_rx_desc_enc {
125+
RX_DESC_ENC_NONE = 0,
126+
RX_DESC_ENC_WEP40 = 1,
127+
RX_DESC_ENC_TKIP_WO_MIC = 2,
128+
RX_DESC_ENC_TKIP_MIC = 3,
129+
RX_DESC_ENC_AES = 4,
130+
RX_DESC_ENC_WEP104 = 5,
131+
};
132+
124133
struct rtl8xxxu_rxdesc16 {
125134
#ifdef __LITTLE_ENDIAN
126135
u32 pktlen:14;

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6319,7 +6319,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
63196319
rx_status->mactime = rx_desc->tsfl;
63206320
rx_status->flag |= RX_FLAG_MACTIME_START;
63216321

6322-
if (!rx_desc->swdec)
6322+
if (!rx_desc->swdec &&
6323+
rx_desc->security != RX_DESC_ENC_NONE)
63236324
rx_status->flag |= RX_FLAG_DECRYPTED;
63246325
if (rx_desc->crc32)
63256326
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
@@ -6419,7 +6420,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
64196420
rx_status->mactime = rx_desc->tsfl;
64206421
rx_status->flag |= RX_FLAG_MACTIME_START;
64216422

6422-
if (!rx_desc->swdec)
6423+
if (!rx_desc->swdec &&
6424+
rx_desc->security != RX_DESC_ENC_NONE)
64236425
rx_status->flag |= RX_FLAG_DECRYPTED;
64246426
if (rx_desc->crc32)
64256427
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
@@ -7654,6 +7656,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
76547656
ieee80211_hw_set(hw, HAS_RATE_CONTROL);
76557657
ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
76567658
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
7659+
ieee80211_hw_set(hw, MFP_CAPABLE);
76577660

76587661
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
76597662

0 commit comments

Comments
 (0)