From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.54 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796032252; b=HWNckpGeyKIFSJ0z/la/D6FOfibn2Zq4hy+mWE4Opw+Iq+fhJCxV8bZYFhG1Y78D8CTg QnMxxe2tccgJorsbYat5sPfdwGW91fDdP6jUZMWsAZvQBVquf7jsgt32yTcqkZVlF8WiO /PxNUMm1CbtmqbcNJV0dAAhUxpemBgqEquE4Vpq23w3KOsJwgtwbSGke5GeISZ2EzRVp/ qYNEVqLdSbbmA++kjOdPFc5qnanT7ynujydQMPHUN4igooEpUvYUmSVkVjNV904aKxWbu 63kMV1QgrOYSq8igYTZhW3f1kLIEQWIcHzakyWL2cum5sEo0P5y1RLDkDwSV+hlOE6A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796032252; 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:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=x9wcDw8lMV3KwBU92Y/6+s0jK+/g3SkHHcpDge3cJUE=; b=Ws9jq9mTzMB61bOIZj2jWmjqPS7ReNwVL1jyq+bJjiJF1/cQU261fyZtD5q5vTzqwnLO PK13zUAhGxkS1nRw7ORW9ZyQLTwj1xRrUIpOuXzoMojp5MViWCXevGlfSAfHI/i59CFop KvN2eZXdBnkuSUl4z8nDJSCPzlKXV2sne1JMU/qFfCQhea1zKbN1egJLMhqLsjSCC9LlT hUMorI3HJZfO3ljTr0DEL+LfsfT0tb+JXtoeCgehPA1fA011OwrGC5BoToDHUKbu9oTs5 ExjAIs4lnA3AyGpnFitV953+D+z4Nh/fPSFZDkTJhPQfcALnPrJLE1+HH1tf3cqhxLA== 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=y8FVziy1; arc=none smtp.remote-ip=209.85.221.54 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (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 1CF6D606A33A for ; Mon, 30 Nov 2026 09:50:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1CF6D606A33A 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=y8FVziy1 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-4ac109a8a12so6085124f8f.3 for ; Mon, 30 Nov 2026 01:50:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796032250; x=1796637050; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=x9wcDw8lMV3KwBU92Y/6+s0jK+/g3SkHHcpDge3cJUE=; b=y8FVziy1DvAhumP1yuAtQkcxUuCXhrYbJCiBKJIaxq+7RSCM1e3Fx+0E+M7HWKUArZ JaDNsBtZpDL/Enenbz+0IJZPzmMFwgYbqBU+Tl2gg/TezolsDbpoPabwaGkxsiOlWF1q 1TM0+ieK6sNmqxqw43uLJVKoydmqkIiUbwd2Re7wuVVu6Cq/8/XuIEPcZQNj0K7n82sv A6Q66JPIa7mu2dJDji5IpYUU0w4JsnTX7Q2BU/W6obSaulsPcs74yuA7/GoDvHEdNP9o tCsNOeO0UKK406yMLLR64tRQufTJuTrN0eRE+EherobLEkOFNv8xGvqfbHKH1FtuxfPx KINA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796032250; x=1796637050; h=content-transfer-encoding:mime-version:references:in-reply-to :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=x9wcDw8lMV3KwBU92Y/6+s0jK+/g3SkHHcpDge3cJUE=; b=Vv7/hO8mc443N8oJlVoDnSvk/W+m+cpz4zmzZDa+zDOenZbq1MZDt1eBfEAicwul7N gAV3DIDGQFJCBzSa2pEu/MVCRPzmzrDRMJUAog+wzHGUcceDDQ3396uA2EYxHFn1Q62I 8yZHsDnYgPi92jVmADWB1ubIqyLJAUtXg+rQNro/RMyHolzUXI/+MHFAL7VM4PodXKpE UQr/Y6L63zC2aHCkeYxBcxVWXhtBvepctCtEMwUxWnqs+i1jMoCa88q7QjSOvzlAw9M0 XTqyfRH+2zn0A+SWoNcb7WemDDwzb7vRB/PfFlrAP6b03tX85ASdKVX50z93DkOVOVbn 7hJg== X-Gm-Message-State: APuU4Z83ma6vekJMwFXZJecNMotyM2FuFHIBB2aUbYIklygBW6IfeKQZ 1Vvft8sx/YE+10yTG3R9OvqxK4fPZE/m+T8gWkG/8Hlo8eoyBrCMbZAT/2ed9j0V X-Gm-Gg: AZFdTZepWBydWyBoECGGPxHgkOA2OEuULJswFZLOMnrxZhyaxKjqGv2quQN/0Ct/fq5 f9lbzp5sYvOUO3mHvTZ8iXCEzz6eexaAwCxce+OmbOJE+uMb3e8ohnqhjrqThsQKnI78d9og7Bv ypoB1NsGKJnyTRJ/5rIcqrYGM8k1TD7Ly7+bo61pwzyDS5ocxYSe60nPUjEh2MWKqOXRHwpnjPI dRKPaALwf7nBjbDJiUEbsRuW6HviYRhFFspEPYuQr2xXJb7B6D/lXtbDRbYgA+eS0fv8tT4f2HA opwmoAQImjNtz1GWMMYksPYXZgqJf6FMYnZFqwnz1D4ovSldl7PN4OlsOw8mM/kkZrkRwazSr1A 9i+uhHUa3MGxgZ7+UGcvDwb/UXiFjuWBF39DZAx6jbNujcqz1w1xPSAi4mRkRdY/+95HlBxwyeH MWKdaRrOTL9+0qwxI4Z1wf0RcqIfrYh+CqecJSHMOTWxKkfFzep52Pa+bkEabfkzHPejQm2X12m jGYw3Xe9FvpHiu6Kv9I86mzf6+T0HHb3VMVVSiYcQLximN1KFNetpfQ3h/4/tYeEiuEf4X7s5Oc ccRgeD8NVtRoPwjmkKrlPU38frFyhvFnEXj31xizNI75uDJ6sY9hPHQNxCuq9NIrKmgRMNST8Wx BMA2Na6y8kFl8cUjTAmsqIMSlvEaRtHd8DS6rnllDzdctrIi5iW/qsKuiPo3JB8jkZ9UkI7op3s ZGja4aElKIX2Q5l+RdkJJqlzEVthGUb8Oh3IwyJit/8Z6tSIadqs5W X-Received: by 2002:a05:6000:2003:b0:4c7:d3ec:39a2 with SMTP id ffacd0b85a97d-4c7d3ec3d4dmr1928122f8f.7.1796032250323; Mon, 30 Nov 2026 01:50:50 -0800 (PST) Received: from localhost.localdomain (dynamic-2a00-1028-8388-a84e-1080-8fd8-c252-0ba8.ipv6.o2.cz. [2a00:1028:8388:a84e:1080:8fd8:c252:ba8]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b10b5f6sm59591566f8f.34.2026.11.30.01.50.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 30 Nov 2026 01:50:49 -0800 (PST) From: Josef Schlehofer To: Jeff Johnson Cc: linux-wireless@vger.kernel.org Subject: [PATCH ath-next 7/9] wifi: ath6kl: handle unsupported connection frequencies Date: Mon, 30 Nov 2026 10:50:40 +0100 Message-ID: <20261130095042.41330-8-pepe.schlehofer@gmail.com> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261130095042.41330-1-pepe.schlehofer@gmail.com> References: <20261130095042.41330-1-pepe.schlehofer@gmail.com> 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 The firmware picks the network on its own and reports the frequency in the connect event. ath6kl looks up the channel for it and passes the result to cfg80211. The channel tables of ath6kl do not cover every frequency. Channel 144 is missing, for example, and channels 184 to 196 sit at 5920 to 5980 MHz instead of 4920 to 4980 MHz. For a connection on such a frequency the lookup returns NULL. cfg80211_inform_bss() then dereferences it when ath6kl adds the BSS, and the channel switch notification for an AP passes it to cfg80211_chandef_create(), which warns and leaves the chandef uninitialised. Reject such a connection. Send a disconnect and run the normal disconnect handling, so cfg80211 sees the connection fail or end and the link is not marked up. Skip the channel switch notification for such a frequency. The next patch can drop a whole band for a board, which makes this case more likely. Signed-off-by: Josef Schlehofer --- On the test router the 2.4 GHz band was dropped through the device tree and wpa_supplicant left the choice of network to the firmware (ap_scan=2). The firmware connected on 2437 MHz, the connection was rejected, the AP saw the station leave and cfg80211 reported a failed connect. The channel switch check could not be triggered. An AP starts on the channel the host gives it, so that check only guards against firmware that reports a different one. drivers/net/wireless/ath/ath6kl/cfg80211.c | 11 +++++++++-- drivers/net/wireless/ath/ath6kl/main.c | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 6b03627e2..7f1ffe4b7 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -1110,14 +1110,21 @@ void ath6kl_cfg80211_scan_complete_event(struct ath6kl_vif *vif, bool aborted) void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq, enum wmi_phy_mode mode) { + struct ieee80211_channel *chan; struct cfg80211_chan_def chandef; ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "channel switch notify nw_type %d freq %d mode %d\n", vif->nw_type, freq, mode); - cfg80211_chandef_create(&chandef, - ieee80211_get_channel(vif->ar->wiphy, freq), + chan = ieee80211_get_channel(vif->ar->wiphy, freq); + if (!chan) { + ath6kl_err("channel switch to unsupported frequency %d MHz\n", + freq); + return; + } + + cfg80211_chandef_create(&chandef, chan, (mode == WMI_11G_HT20 && vif->ar->band_2ghz.ht_cap.ht_supported) ? NL80211_CHAN_HT20 : NL80211_CHAN_NO_HT); diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index 9dd39d79f..a062598ce 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -633,6 +633,18 @@ void ath6kl_connect_event(struct ath6kl_vif *vif, u16 channel, u8 *bssid, { struct ath6kl *ar = vif->ar; + /* + * cfg80211 needs a channel for the BSS. Reject a connection on a + * frequency that has no channel on this device. + */ + if (!ieee80211_get_channel(ar->wiphy, channel)) { + ath6kl_err("connected on unsupported frequency %u MHz\n", channel); + ath6kl_wmi_disconnect_cmd(ar->wmi, vif->fw_vif_idx); + ath6kl_disconnect_event(vif, DISCONNECT_CMD, bssid, 0, NULL, + WLAN_REASON_UNSPECIFIED); + return; + } + ath6kl_cfg80211_connect_event(vif, channel, bssid, listen_int, beacon_int, net_type, beacon_ie_len, -- 2.54.0 (Apple Git-157)