Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796164407; b=dIrfXeoBHFDTV/dVZQLoPbKNxPm/QtIy4zjxSmzpuEtCL/Nfo99OTdUXyoPaZm/eAPq7 Ycfp6OTGc2Q7LHoxM/nS5SKZ7w4tEhqTWg3XySFMKVONP1wU7zyOur2WajY83gh+nL1wh /cbX3rC4l/Qrg2181owdw24LnZuS8bryLLdfxDtmD4gR2ArWKI8aSUGmhyPSfyBptVlIL sxt61xs9/wIxbGEBsvOucvkFmmfVb7oq8ieBpQpl9AU2ay8O+zemNepbET6klY9P3FMI/ XTIs9pLq/KWGhRBCwoqp6LXemHtwlYAo1LA8hcV3rsuxHzEoKB+KW+J/U0szewXsQiA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796164407; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=LcS1MAVVuZ9c0bwGMRtEx6FLkSrT8QizOCIqjBwrl9s=; b=guvlq7EFWzEG7gOQxQzx1LLlOzPVPGjATdJjUNfvSoFWiK6k1on8z0Qg0zgxg6Avsr/+ 9UNgfQQ+Tm8RRLmZ5VT+XCmBSxfaGGdZcoMUS3XgNVVFzsX5O/XVHASIjLuduzVRmFSNN 5MwuWkqK23vRfp6nZPW8S8pWlYoEwj2yL6Rk6WZ0Dbaa2O0uwlB/e0+xh1JLPdPIXQlf6 sqiAbO7gH8tzy2CIkZVLLRr82NU7oFAbk4GedbGa9Qsi+WuAyysN/2EVtc3YCVRHI9dEZ 7MGULsDRXnZ7UyPenqAs9x4LyPTWwgq1veRJoIjs096H4aYLuVFgpXuWtDsNwei1PFg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=L0pecfWt; arc=none smtp.remote-ip=209.85.221.44 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF699606A31A for ; Tue, 1 Dec 2026 22:33:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AF699606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=L0pecfWt Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-4c84abcb7bdso1257946f8f.1 for ; Tue, 01 Dec 2026 14:33:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796164405; x=1796769205; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=LcS1MAVVuZ9c0bwGMRtEx6FLkSrT8QizOCIqjBwrl9s=; b=L0pecfWt7e8sw9/O+Xp+17wm4+QbJz5JT7MidM8MiGpBaCa6fKfre5y7hTzgTwal5X 9FVEjLCUmfdmV/z2qSn9OLRRpGitejLT0h9Ud1hmrqWjl210f0e53xYQZmlevCB3CRfB 7S31ZRDarmXH/cfczig6gqzu830LdS3xGX/EqF/bSqaj5dNR5EbHmCaffCg3WUNmjABV PkObmguRTFnlcM339GHiwzu3+Ni59vsmBduWama2HjRw+lREIXMH3J2sGn8KBfaYmC2F BsVGVdpCS7cCniQE3mlcDaRsMaZ+wACkmWHJqukykNO6Dw97VKXpAuSmGG5JMq9r4LvQ 3/LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796164405; x=1796769205; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=LcS1MAVVuZ9c0bwGMRtEx6FLkSrT8QizOCIqjBwrl9s=; b=HKexjl8Yf5g5st0/dkrLhQnhqVHll6jb67Pcu2bV+XZH3v9ntCHjIjy9ahXLjzNGkk 2sm+VvnHmpTc2E/zTbA7qy8w1nXNUlDiWBYWxdAVN242fqn4/Rj9RuZn3soPFSi+bjSY T0723eeQ3f40Ogclbd1NrTLT/IEEe03vcmsNSlp+EOaNVA8bkF8Mbs1szFcSWbnTb+l9 O2/7ZcL+vv4hhi2oTTEARkEJ8M6rNFDskUJdQtB91IuuIxiaWuQKuMm8iWC4NREfmVsW UwgZzFlwzd8c3Ev0VlHwtFEn7Vu9H0m01Rl04c7X+3aNQgk2sswhjwoZo+aM1sMrNJtC V3LQ== X-Gm-Message-State: APuU4Z9YAEzWxT8GAPjbZT/ZZMUBx/Sehi1uDI/texi52PXZDCGobZLs 2/LEdMqA1GB38Dup1VeKI3BU9vxzRXA6Xmc17EDDgSyHypLLf2W1KEPaBPypMg== X-Gm-Gg: AZFdTZdf79ur6RRI4ub9OzZZYmOpWj27TdH1lq7Dfpov893Fs0SDjg20L6vDAh6Br8q r3mc6aqJdWK2PsgEl7+8B7xi0BgI170m1+jmqsgBpXg99ZmtdGpHPgfI48sl3jaCJcSEdh0moL1 XvVA4pQWhUT/PUqbks0/gHJuXnnZ7xklZpmfsJBUcWmYVYSCRhu4mpbzWWg3ReOic0+DufA1hGR ZALXT9o7ofIe3IFlHILKIYqMk2QUYLjxgsH88AOw+VyIrmGK/6dU2sNPkpBE7a1S7ZXRG9eV0E6 IENtDoSoJh4KQmAfaEhqVYsv58abYltjZfa4iG/cpoxFR3nGtsQowiiM76JjZT7qQXxP77xIMD9 IFNduArU6YSeQ72dQgyYGrblL35pIdk2a4+U1vaIipp5b7zWMu5KlNhcu/xNaAI1fG+US9+YpsJ foax1Q8t9M02SM0WiPkgeLr2QKvR+SPEA1NskOaSzpLhgrEdQniSNpyX3H7qfMeNV2L7gncsRDP E72bkc9Zhu66Vbv3esCVds1Fe+G1fzc6gdqbHW3YJyQPksYHZRWgGisu6y9NkvWNZdVAqMeD9G1 pbh4eowpea7ooHCqkQEL5pr42OEASTHiFNBUa4l3D1oX5QZgVa8ORB52hfyehMNLzaCykyo5W6e 4p5o3zBdkDBkGFna157IYSkd+jjoHvYT/OuZdwKcteJWW7YgmUaBCH8eRl8A0P4pyTz8QlKiXNd xit7x9b5lBFDVS4JAD/ha01mE02m7MbU4cRmAT95esA4iO8UssI3HbFA== X-Received: by 2002:a05:6000:178f:b0:4a3:d77e:4659 with SMTP id ffacd0b85a97d-4ac37756993mr73988093f8f.6.1796164404904; Tue, 01 Dec 2026 14:33:24 -0800 (PST) Received: from localhost.localdomain (dynamic-2a00-1028-8388-a84e-1554-489a-9b70-b4a4.ipv6.o2.cz. [2a00:1028:8388:a84e:1554:489a:9b70:b4a4]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6a67fe75sm84100899f8f.24.2026.12.01.14.33.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 01 Dec 2026 14:33:23 -0800 (PST) From: Josef Schlehofer To: Jeff Johnson Cc: linux-wireless@vger.kernel.org Subject: [PATCH ath-next] wifi: ath6kl: set the RSN capabilities in the AR6006 firmware Date: Tue, 1 Dec 2026 23:33:22 +0100 Message-ID: <20261201223322.9011-1-pepe.schlehofer@gmail.com> X-Mailer: git-send-email 2.54.0 X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit In AP mode the firmware builds the beacon and the probe response, RSN IE included. hostapd builds its own RSN IE for message 3 of the 4-way handshake. With WMM enabled hostapd announces 16 PTKSA replay counters in the RSN capabilities (0x000c), the AR6006 firmware puts 0x0000 into its beacon, and a station drops the connection because the two IEs differ: WPA: IE in 3/4 msg does not match with IE in Beacon/ProbeResp ath6kl already passes the capability field of the beacon's RSN IE to firmware that has the RSN_CAP_OVERRIDE capability. The AR6006 firmware 5.x does not announce it. Qualcomm's ath6kl-3.5 driver sets the field with WMI_SET_RSN_CAP_CMDID on this firmware, which is 0xf082 in its WMI layout and 0xf085 in mainline. Send the field with that command when an AP starts on the vendor WMI layout, and set it back to 0 when the AP stops or fails to start. ath6kl-3.5 reads the old value first and restores that one. The firmware's own value is 0, as its beacon shows before the command, so the read is left out. The resend on a channel change that the RSN_CAP_OVERRIDE path has is left out as well. It only runs with a second interface, and this firmware has one. The station path is not touched. ath6kl-3.5 sets the field there too, where it carries the management frame protection bits, and ath6kl does not support that. Signed-off-by: Josef Schlehofer --- This goes on top of the AR6006 series: https://lore.kernel.org/linux-wireless/20261130095042.41330-1-pepe.schlehofer@gmail.com/ Tested on a Xiaomi AIoT AC2350 (QCA9563, big endian) with OpenWrt 25.12 and backports 6.18.55. The test tree also had "wifi: ath6kl: set the permanent MAC address of the wiphy" [1] and a backport of 97aab70a03df ("wifi: ath6kl: don't take RTNL in del_virtual_intf"). With WMM enabled the beacon now carries 0x000c and a WPA2 station completes the 4-way handshake. That also holds after hostapd reloads the BSS for a new SSID, after it restarts the AP on another channel, and with the AP in a bridge. In these tests OpenWrt's scripts started the AP. On ath6kl that needs a hostapd patch, "nl80211: Do not set a MAC address the interface already has", which is on the hostap list [2]. The reset also ran on a build with a test switch that makes the AP start fail, once with a failing profile commit and once with an AP that the firmware never reported as started. The reset went out in both. One thing I cannot explain. With this patch as posted I connected the radio as a station once after an AP had been stopped. The first 4-way handshake did not complete, the firmware associated again by itself and the second one completed. In 27 other station connections of this radio the first handshake completed, 12 of them after an AP, with and without this patch. Those 12 ran on builds with extra log lines, which put about 5 ms between the RSN command and the command after it. I do not know whether that matters. [1] https://lore.kernel.org/linux-wireless/20261130121620.27137-1-pepe.schlehofer@gmail.com/ [2] https://lists.infradead.org/pipermail/hostap/2026-December/046151.html drivers/net/wireless/ath/ath6kl/cfg80211.c | 61 ++++++++++++++++++---- drivers/net/wireless/ath/ath6kl/wmi.c | 27 ++++++++++ drivers/net/wireless/ath/ath6kl/wmi.h | 5 ++ 3 files changed, 82 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 97107510b..13d2aacf1 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -2776,6 +2776,29 @@ static int ath6kl_get_rsn_capab(struct cfg80211_beacon_data *beacon, return 0; } +/* like the vendor driver, do not leave the RSN capabilities set */ +static void ath6kl_ap_reset_rsn_capab(struct ath6kl_vif *vif) +{ + struct ath6kl *ar = vif->ar; + u16 rsn_capab = 0; + int res; + + /* only what the vendor command in ath6kl_start_ap() has set */ + if (!(ar->hw.flags & ATH6KL_HW_VENDOR_WMI) || !vif->rsn_capab || + test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, + ar->fw_capabilities)) + return; + + res = ath6kl_wmi_set_rsn_cap_cmd(ar->wmi, vif->fw_vif_idx, + (const u8 *)&rsn_capab); + if (res < 0) { + ath6kl_warn("failed to reset the RSN capabilities: %d\n", res); + return; + } + + vif->rsn_capab = 0; +} + static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_ap_settings *info) { @@ -2951,22 +2974,34 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev, * advertise the same in beacon/probe response. Send * the complete RSN IE capability field to firmware */ - if (!ath6kl_get_rsn_capab(&info->beacon, (u8 *) &rsn_capab) && - test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, - ar->fw_capabilities)) { - res = ath6kl_wmi_set_ie_cmd(ar->wmi, vif->fw_vif_idx, - WLAN_EID_RSN, WMI_RSN_IE_CAPB, - (const u8 *) &rsn_capab, - sizeof(rsn_capab)); - vif->rsn_capab = rsn_capab; - if (res < 0) - return res; + if (!ath6kl_get_rsn_capab(&info->beacon, (u8 *)&rsn_capab)) { + if (test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, + ar->fw_capabilities)) { + res = ath6kl_wmi_set_ie_cmd(ar->wmi, vif->fw_vif_idx, + WLAN_EID_RSN, + WMI_RSN_IE_CAPB, + (const u8 *)&rsn_capab, + sizeof(rsn_capab)); + vif->rsn_capab = rsn_capab; + if (res < 0) + return res; + } else if (ar->hw.flags & ATH6KL_HW_VENDOR_WMI) { + /* the vendor WMI layout has a command for this */ + res = ath6kl_wmi_set_rsn_cap_cmd(ar->wmi, + vif->fw_vif_idx, + (const u8 *)&rsn_capab); + if (res < 0) + return res; + vif->rsn_capab = rsn_capab; + } } memcpy(&vif->profile, &p, sizeof(p)); res = ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &p); - if (res < 0) + if (res < 0) { + ath6kl_ap_reset_rsn_capab(vif); return res; + } return 0; } @@ -2993,6 +3028,10 @@ static int ath6kl_stop_ap(struct wiphy *wiphy, struct net_device *dev, if (vif->nw_type != AP_NETWORK) return -EOPNOTSUPP; + + /* also for an AP that the firmware never reported as started */ + ath6kl_ap_reset_rsn_capab(vif); + if (!test_bit(CONNECTED, &vif->flags)) return -ENOTCONN; diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 238dbfcf3..6582c6536 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -3679,6 +3679,33 @@ int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field, NO_SYNC_WMIFLAG); } +/* WMI_SET_RSN_CAP_CMDID of the vendor WMI layout, mainline has it at 0xf085 */ +#define WMI_VENDOR_SET_RSN_CAP_CMDID 0xf082 + +/* rsn_capab is the capability field as it stands in the RSN IE */ +int ath6kl_wmi_set_rsn_cap_cmd(struct wmi *wmi, u8 if_idx, const u8 *rsn_capab) +{ + struct wmi_rsn_cap_cmd *cmd; + struct sk_buff *skb; + + if (!ath6kl_wmi_vendor_abi(wmi)) + return -EOPNOTSUPP; + + skb = ath6kl_wmi_get_new_buf(sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + cmd = (struct wmi_rsn_cap_cmd *)skb->data; + memcpy(&cmd->rsn_cap, rsn_capab, sizeof(cmd->rsn_cap)); + + ath6kl_dbg(ATH6KL_DBG_WMI, "set_rsn_cap: 0x%04x\n", + le16_to_cpu(cmd->rsn_cap)); + + return ath6kl_wmi_cmd_send(wmi, if_idx, skb, + (enum wmi_cmd_id)WMI_VENDOR_SET_RSN_CAP_CMDID, + NO_SYNC_WMIFLAG); +} + int ath6kl_wmi_disable_11b_rates_cmd(struct wmi *wmi, bool disable) { struct sk_buff *skb; diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index f1da394dd..ea20c3ee3 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h @@ -1677,6 +1677,10 @@ struct set_dtim_cmd { __le32 dtim_period; } __packed; +struct wmi_rsn_cap_cmd { + __le16 rsn_cap; +} __packed; + /* AR6006 firmware 5.x uses 16 and 8 bits for these */ struct set_beacon_int_cmd_vendor { __le16 beacon_intvl; @@ -2732,6 +2736,7 @@ int ath6kl_wmi_set_rx_frame_format_cmd(struct wmi *wmi, u8 if_idx, int ath6kl_wmi_set_appie_cmd(struct wmi *wmi, u8 if_idx, u8 mgmt_frm_type, const u8 *ie, u8 ie_len); +int ath6kl_wmi_set_rsn_cap_cmd(struct wmi *wmi, u8 if_idx, const u8 *rsn_capab); int ath6kl_wmi_set_ie_cmd(struct wmi *wmi, u8 if_idx, u8 ie_id, u8 ie_field, const u8 *ie_info, u8 ie_len); -- 2.54.0 (Apple Git-157)