Commit 6d531b9af16e ("wifi: mac80211: rework RX packet handling") intentionally made mac80211 more strict by checking the RX frame's frequency when determining the link. However, it did not account for drivers reporting the center frequency of the configured channel rather than the primary channel frequency. Relax the check to also accept configured channel center frequencies, including both centers for 80+80MHz channels. Fixes: 6d531b9af16e ("wifi: mac80211: rework RX packet handling") Signed-off-by: Catalin Iacob --- Since 7.4-rc1 my wireless card doesn't work at all on a 5GHz access point, not even ping to the default gateway. This is perfectly reproducible at every boot since rc1, I just did not get the chance to debug and report it so far. lspci identifies the card as: c0:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8922AE 802.11be PCIe Wireless Network Ad From code analysis I expect more drivers could be broken the same way though it's dependent on channel frequencies which I guess explains why this one is rare enough that it wasn't reported yet based on what I see in the wireless tree and on lore. I bisected the issue to 6d531b9af16e ("wifi: mac80211: rework RX packet handling") I don't know the code at all but, with some LLM help, I poked around, added some debug prints and this one added to ieee80211_rx_valid_freq when it would return falso best shows what's happening: pr_warn_ratelimited("wifihangdebug: mac80211: rejecting RX frame on %s: fc=%04x reported frequency %d MHz, expected primary %d MHz (channel %d), width %d MHz, center_freq1 %d MHz, center_freq2 %d MHz\n", link->sdata->name, le16_to_cpu(hdr->frame_control), freq, conf->def.chan->center_freq, conf->def.chan->hw_value, nl80211_chan_width_to_mhz(conf->def.width), conf->def.center_freq1, conf->def.center_freq2); prints: wifihangdebug: mac80211: rejecting RX frame on wlp192s0: fc=4208 reported frequency 5210 MHz, expected primary 5180 MHz (channel 36), width 80 MHz, center_freq1 5210 MHz, center_freq2 0 MHz See the patch for what appears to me as a correct fix: drivers can report both frequencies so both need to be accepted. In my tests this works and fixes wifi for my card. But take the code and expecially the commit message with grains of salt, I don't know the area to trust that it's a proper fix explained with correct terminology. #regzbot introduced: 6d531b9af16e --- net/mac80211/rx.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index f8cfd04c0c6c..2d8c160d84b0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c @@ -5346,6 +5346,14 @@ static void __ieee80211_rx_handle_8023(struct ieee80211_hw *hw, dev_kfree_skb(skb); } +static bool ieee80211_rx_freq_matches_chan(int freq, + struct ieee80211_chanctx_conf *conf) +{ + return freq == conf->def.chan->center_freq || + freq == conf->def.center_freq1 || + (conf->def.center_freq2 && freq == conf->def.center_freq2); +} + static bool ieee80211_rx_valid_freq(int freq, struct ieee80211_link_data *link) { struct ieee80211_chanctx_conf *conf; @@ -5358,7 +5366,7 @@ static bool ieee80211_rx_valid_freq(int freq, struct ieee80211_link_data *link) if (!conf || !conf->def.chan) return false; - return freq == conf->def.chan->center_freq; + return ieee80211_rx_freq_matches_chan(freq, conf); } static struct ieee80211_link_data * @@ -5374,7 +5382,7 @@ ieee80211_link_from_freq(struct ieee80211_sub_if_data *sdata, int freq) if (!conf || !conf->def.chan) continue; - if (freq == conf->def.chan->center_freq) + if (ieee80211_rx_freq_matches_chan(freq, conf)) return link; } --- base-commit: 2dcd468aff400f859d8e520e41814e7fd35e35aa base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless.git main change-id: 20261203-wifi-breakage-7-4-rc1-d46f38f9ed7f Best regards, -- Catalin Iacob