Skip to content

Commit cbfbb4d

Browse files
djfunPing-Ke Shih
authored andcommitted
wifi: rtl8xxxu: enable MFP support with security flag of RX descriptor
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: [email protected] Signed-off-by: Martin Kaistra <[email protected]> Signed-off-by: Ping-Ke Shih <[email protected]> Link: https://msgid.link/[email protected]
1 parent 55e2843 commit cbfbb4d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

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

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

125+
enum rtl8xxxu_rx_desc_enc {
126+
RX_DESC_ENC_NONE = 0,
127+
RX_DESC_ENC_WEP40 = 1,
128+
RX_DESC_ENC_TKIP_WO_MIC = 2,
129+
RX_DESC_ENC_TKIP_MIC = 3,
130+
RX_DESC_ENC_AES = 4,
131+
RX_DESC_ENC_WEP104 = 5,
132+
};
133+
125134
struct rtl8xxxu_rxdesc16 {
126135
#ifdef __LITTLE_ENDIAN
127136
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
@@ -6468,7 +6468,8 @@ int rtl8xxxu_parse_rxdesc16(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
64686468
rx_status->mactime = rx_desc->tsfl;
64696469
rx_status->flag |= RX_FLAG_MACTIME_START;
64706470

6471-
if (!rx_desc->swdec)
6471+
if (!rx_desc->swdec &&
6472+
rx_desc->security != RX_DESC_ENC_NONE)
64726473
rx_status->flag |= RX_FLAG_DECRYPTED;
64736474
if (rx_desc->crc32)
64746475
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
@@ -6573,7 +6574,8 @@ int rtl8xxxu_parse_rxdesc24(struct rtl8xxxu_priv *priv, struct sk_buff *skb)
65736574
rx_status->mactime = rx_desc->tsfl;
65746575
rx_status->flag |= RX_FLAG_MACTIME_START;
65756576

6576-
if (!rx_desc->swdec)
6577+
if (!rx_desc->swdec &&
6578+
rx_desc->security != RX_DESC_ENC_NONE)
65776579
rx_status->flag |= RX_FLAG_DECRYPTED;
65786580
if (rx_desc->crc32)
65796581
rx_status->flag |= RX_FLAG_FAILED_FCS_CRC;
@@ -7993,6 +7995,7 @@ static int rtl8xxxu_probe(struct usb_interface *interface,
79937995
ieee80211_hw_set(hw, HAS_RATE_CONTROL);
79947996
ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
79957997
ieee80211_hw_set(hw, AMPDU_AGGREGATION);
7998+
ieee80211_hw_set(hw, MFP_CAPABLE);
79967999

79978000
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
79988001

0 commit comments

Comments
 (0)