Re: [PATCH ath-next 3/3] wifi: wcn36xx: enable MFP (802.11w) support
From: Loic Poulain
Date: Mon Nov 30 2026 - 04:03:06 EST
On Sun, Nov 29, 2026 at 12:32 AM Vladimir Bely <vlwwwwww@xxxxxxxxx> wrote:
>
> 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@xxxxxxxxx>
Reviewed-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
> ---
> 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
>