Linux wireless drivers development
 help / color / mirror / Atom feed
From: Vladimir Bely <vlwwwwww@gmail.com>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>,
	Jeff Johnson <jjohnson@kernel.org>
Cc: wcn36xx@lists.infradead.org, linux-wireless@vger.kernel.org,
	linux-kernel@vger.kernel.org, Vladimir Bely <vlwwwwww@gmail.com>
Subject: [PATCH ath-next 3/3] wifi: wcn36xx: enable MFP (802.11w) support
Date: Sun, 29 Nov 2026 02:31:57 +0300	[thread overview]
Message-ID: <20261128233157.966718-4-vlwwwwww@gmail.com> (raw)
In-Reply-To: <20261128233157.966718-1-vlwwwwww@gmail.com>

wcn36xx does not currently advertise IEEE80211_HW_MFP_CAPABLE or BIP
cipher suites, which prevents connecting to networks requiring 802.11w
Management Frame Protection (MFP), including WPA3-SAE, OWE, and
WPA2-PSK-SHA256 with MFPR (cfg80211 rejects IGTK installation with
-EINVAL).

Enable MFP using mac80211 software crypto for protected management
frames while keeping data frames on the hardware DPU, following the
same pattern as ath9k, ath5k, carl9170, and rtl8xxxu:
- Advertise IEEE80211_HW_MFP_CAPABLE and the four BIP cipher suites
  (AES-CMAC, BIP-CMAC-256, BIP-GMAC-128, BIP-GMAC-256) in
  wcn36xx_init_ieee80211().
- Return -EOPNOTSUPP without logging an error for BIP ciphers in
  wcn36xx_set_key() so mac80211 installs them as software keys.
- Set IEEE80211_KEY_FLAG_SW_MGMT_TX on CCMP keys during SET_KEY so
  mac80211 encrypts unicast robust management frames in software,
  matching wcn36xx_set_tx_mgmt() which always sets bd->dpu_ne = 1.

Note that WCN36XX_TXBD_SSN_FILL_DPU_NON_QOS in wcn36xx_set_tx_mgmt()
does not invalidate CCMP or BIP MICs, since the 802.11 sequence number
is masked out of CCMP AAD and excluded from BIP AAD. Using software
crypto for low-rate management frames works uniformly across WCN36xx
firmware versions and supports all four BIP ciphers.

Tested on Samsung Galaxy A3 (SM-A300F, MSM8916, WCN3620, firmware
CNSS-PR-2-0-1-c8-00048) across Open, OWE, WPA2-PSK-TKIP,
WPA2-PSK-CCMP, WPA2-PSK-SHA256 with MFPR, WPA2/WPA3-Transition (both
PSK and SAE), and WPA3-SAE/SAE-EXT-KEY networks, including encrypted
TX/RX Deauth and AddBA Action frames as well as broadcast BIP Deauth.

Signed-off-by: Vladimir Bely <vlwwwwww@gmail.com>
---
 drivers/net/wireless/ath/wcn36xx/main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/ath/wcn36xx/main.c b/drivers/net/wireless/ath/wcn36xx/main.c
index f7e0a4aa8..f31a55f4e 100644
--- a/drivers/net/wireless/ath/wcn36xx/main.c
+++ b/drivers/net/wireless/ath/wcn36xx/main.c
@@ -530,6 +530,13 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 	case WLAN_CIPHER_SUITE_TKIP:
 		vif_priv->encrypt_type = WCN36XX_HAL_ED_TKIP;
 		break;
+	case WLAN_CIPHER_SUITE_AES_CMAC:
+	case WLAN_CIPHER_SUITE_BIP_CMAC_256:
+	case WLAN_CIPHER_SUITE_BIP_GMAC_128:
+	case WLAN_CIPHER_SUITE_BIP_GMAC_256:
+		/* Handled in software by mac80211 */
+		ret = -EOPNOTSUPP;
+		goto out;
 	default:
 		wcn36xx_err("Unsupported key type 0x%x\n",
 			      key_conf->cipher);
@@ -539,6 +546,8 @@ static int wcn36xx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 
 	switch (cmd) {
 	case SET_KEY:
+		if (key_conf->cipher == WLAN_CIPHER_SUITE_CCMP)
+			key_conf->flags |= IEEE80211_KEY_FLAG_SW_MGMT_TX;
 		if (WCN36XX_HAL_ED_TKIP == vif_priv->encrypt_type) {
 			/*
 			 * Supplicant is sending key in the wrong order:
@@ -1447,6 +1456,10 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 		WLAN_CIPHER_SUITE_WEP104,
 		WLAN_CIPHER_SUITE_TKIP,
 		WLAN_CIPHER_SUITE_CCMP,
+		WLAN_CIPHER_SUITE_AES_CMAC,
+		WLAN_CIPHER_SUITE_BIP_CMAC_256,
+		WLAN_CIPHER_SUITE_BIP_GMAC_128,
+		WLAN_CIPHER_SUITE_BIP_GMAC_256,
 	};
 
 	ieee80211_hw_set(wcn->hw, TIMING_BEACON_ONLY);
@@ -1456,6 +1469,7 @@ static int wcn36xx_init_ieee80211(struct wcn36xx *wcn)
 	ieee80211_hw_set(wcn->hw, HAS_RATE_CONTROL);
 	ieee80211_hw_set(wcn->hw, SINGLE_SCAN_ON_ALL_BANDS);
 	ieee80211_hw_set(wcn->hw, REPORTS_TX_ACK_STATUS);
+	ieee80211_hw_set(wcn->hw, MFP_CAPABLE);
 
 	wcn->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
 		BIT(NL80211_IFTYPE_AP) |
-- 
2.43.0


      parent reply	other threads:[~2026-11-28 23:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 23:31 [PATCH ath-next 0/3] wifi: wcn36xx: enable MFP (802.11w) support Vladimir Bely
2026-11-28 23:31 ` [PATCH ath-next 1/3] wifi: wcn36xx: set RX decryption flags only on encrypted data frames Vladimir Bely
2026-11-28 23:31 ` [PATCH ath-next 2/3] wifi: wcn36xx: track WoWLAN GTK offload validity and skip with MFP Vladimir Bely
2026-11-28 23:31 ` Vladimir Bely [this message]

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=20261128233157.966718-4-vlwwwwww@gmail.com \
    --to=vlwwwwww@gmail.com \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=wcn36xx@lists.infradead.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