From: <yhchuang@realtek.com>
To: <kvalo@codeaurora.org>
Cc: <linux-wireless@vger.kernel.org>, <briannorris@chromium.org>
Subject: [PATCH 06/10] rtw88: add NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 support
Date: Tue, 8 Oct 2019 16:20:57 +0800 [thread overview]
Message-ID: <20191008082101.2494-7-yhchuang@realtek.com> (raw)
In-Reply-To: <20191008082101.2494-1-yhchuang@realtek.com>
From: Tzu-En Huang <tehuang@realtek.com>
Add support for NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 feature.
According to the "Hardware crypto acceleration" documentation section,
when set_key() is called with %DISABLE_KEY command, for outgoing frames,
we flush out frames in the queues with the old key; for incoming frames,
no frames will be passed to mac80211 decrypted with the old key due to
rtw_sec_clear_cam().
Signed-off-by: Tzu-En Huang <tehuang@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
---
drivers/net/wireless/realtek/rtw88/mac.h | 5 +++++
drivers/net/wireless/realtek/rtw88/mac80211.c | 1 +
drivers/net/wireless/realtek/rtw88/main.c | 2 ++
3 files changed, 8 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/mac.h b/drivers/net/wireless/realtek/rtw88/mac.h
index a67fa82973e4..592dc830160c 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.h
+++ b/drivers/net/wireless/realtek/rtw88/mac.h
@@ -33,4 +33,9 @@ int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
int rtw_mac_init(struct rtw_dev *rtwdev);
void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
+static inline void rtw_mac_flush_all_queues(struct rtw_dev *rtwdev, bool drop)
+{
+ rtw_mac_flush_queues(rtwdev, BIT(rtwdev->hw->queues) - 1, drop);
+}
+
#endif
diff --git a/drivers/net/wireless/realtek/rtw88/mac80211.c b/drivers/net/wireless/realtek/rtw88/mac80211.c
index 3e4f2f27ced2..2247bd61e716 100644
--- a/drivers/net/wireless/realtek/rtw88/mac80211.c
+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c
@@ -546,6 +546,7 @@ static int rtw_ops_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
hw_key_type, hw_key_idx);
break;
case DISABLE_KEY:
+ rtw_mac_flush_all_queues(rtwdev, false);
rtw_sec_clear_cam(rtwdev, sec, key->hw_key_idx);
break;
}
diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index edd490c507b5..71f11c973307 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1403,6 +1403,8 @@ int rtw_register_hw(struct rtw_dev *rtwdev, struct ieee80211_hw *hw)
hw->wiphy->features |= NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR;
+ wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
+
rtw_set_supported_band(hw, rtwdev->chip);
SET_IEEE80211_PERM_ADDR(hw, rtwdev->efuse.addr);
--
2.17.1
next prev parent reply other threads:[~2019-10-08 8:21 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-08 8:20 [PATCH 00/10] rtw88: minor throughput improvement yhchuang
2019-10-08 8:20 ` [PATCH 01/10] rtw88: add power tracking support yhchuang
2019-10-09 8:17 ` Kalle Valo
2019-10-08 8:20 ` [PATCH 02/10] rtw88: Enable 802.11ac beamformee support yhchuang
2019-10-14 9:38 ` Kalle Valo
2019-10-08 8:20 ` [PATCH 03/10] rtw88: config 8822c multicast address in MAC init flow yhchuang
2019-10-14 9:08 ` Kalle Valo
2019-10-08 8:20 ` [PATCH 04/10] rtw88: add set_bitrate_mask support yhchuang
2019-10-08 8:20 ` [PATCH 05/10] rtw88: update regulatory settings implementaion yhchuang
2019-10-14 9:39 ` Kalle Valo
2019-10-08 8:20 ` yhchuang [this message]
2019-10-14 9:11 ` [PATCH 06/10] rtw88: add NL80211_EXT_FEATURE_CAN_REPLACE_PTK0 support Kalle Valo
2019-10-08 8:20 ` [PATCH 07/10] rtw88: Use rtw_write8_set to set SYS_FUNC yhchuang
2019-10-08 8:20 ` [PATCH 08/10] rtw88: pci: config phy after chip info is setup yhchuang
2019-10-08 8:21 ` [PATCH 09/10] rtw88: coex: Set 4 slot mode for A2DP yhchuang
2019-10-08 8:21 ` [PATCH 10/10] rtw88: add phy_info debugfs to show Tx/Rx physical status yhchuang
2019-10-14 9:45 ` [PATCH 00/10] rtw88: minor throughput improvement Kalle Valo
2019-10-15 3:23 ` Tony Chuang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191008082101.2494-7-yhchuang@realtek.com \
--to=yhchuang@realtek.com \
--cc=briannorris@chromium.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).