Repository navigation
Conversation
Follow-up to the radar channel support. A radar or no-IR candidate now has to have been heard during the current connect attempt. cfg80211 keeps a BSS for 30 s, and the driver did not stamp entries with a receive time, so a cached entry for an AP that had already left the channel for radar was enough to send authentication there. Beacons are now informed with their boot time, and mt_connect_find_bss() returns a radar or no-IR entry only if it was seen after the attempt started listening; otherwise the connect worker runs its passive discovery for it, a single dwell when userspace names the channel. A beacon announcing a switch away from a radar channel is no longer informed, and the AP's entry on that channel is unlinked. Before, the same beacon refreshed the entry right after the driver left, so iwd rejoined the AP on the old channel, failed, and then avoided its BSSID even once it was heard on the new channel. The local disconnect sequence shared by .disconnect and the switch announcement moves to mt_disconnect_local_locked(). The announcement check moves to packet.h as mt7932_rx_switch_announced() so KUnit can cover it, along with the freshness rule. Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Follow-up to #318, which lets the MT7932 join APs on radar (DFS) channels and leave when they announce a channel switch. Review found two gaps.
A stale BSS was enough to transmit on a radar channel.
mt_connect_prepare()checks only channel flags.connect_bsscomes fromcfg80211_get_bss(), which returns entries up to 30 s old, and this driver informs beacons without a receive time, sots_boottimeis always 0. An AP that left the channel because of radar can still be in the table, and the station would send authentication to it there. A station without radar detection should transmit on a radar channel only after it has heard the AP. Whether the firmware waits for a beacon itself is unknown.After a switch announcement, iwd rejoins the AP on the old channel, then avoids it. The same CSA beacon that triggers the local disconnect is then passed to
cfg80211_inform_bss_frame(), which refreshes the entry on the old channel. iwd reconnects to it, the next CSA beacon fails the join with-ECONNRESET, and iwd blacklists the BSSID. The BSSID doesn't change when the AP moves, so iwd won't follow it to the new channel until the blacklist expires. It falls back to 2.4 GHz, where the mesh band-steers it again: the problem #318 set out to fix.Change
mt_packet_receive()informs throughcfg80211_inform_bss_frame_data()withboottime_ns, sots_boottimeand nl80211'sBSS_LAST_SEEN_BOOTTIMEare real for every BSS, not only for radar channels.mt_connect()andmt_connect_discover()setconnect_heard_sincewhen the attempt starts listening.mt_connect_find_bss()returns a radar or no-IR entry only if it was seen after that (mt7932_bss_heard()). Otherwise the connect worker runs its existing passive discovery. When userspace names the channel, as iwd does, that is a single dwell of about 220 ms on that channel. The worst-case age at submission is the length of the discovery pass, not 30 s.response_lockis released, becausecfg80211_unlink_bss()takesbss_lockwithspin_lock_bh. The disconnect and abandon-join paths from wifi: mt7932: join APs on radar channels, leave on their switch announcement #318 are unchanged.mt_disconnect()moves tomt_disconnect_local_locked(), used by both.packet.hasmt7932_rx_switch_announced(), so KUnit can call it. The radar-flag check stays infrontend.c.Not changed: iwd still blacklists the BSSID if it tries to join during the countdown, before the entry is unlinked. Following the AP to its new channel (
cfg80211_ch_switch_notify()) would need firmware CSA support that isn't established.Testing
integration/auroraat1630ee1with LLVM 18 andW=1(defconfig +asahi.config, with MT7932 and its KUnit tests enabled): no warnings in the driver.kunit.py run --arch=arm64in QEMU (-cpu neoverse-n1, 16K pages),mt7932*suites: 47/47 passed, including the newmt7932_rx_switch_announced_test(complete and truncated CSA/ECSA, no elements, CSA after another element) andmt_bss_heard_test.CONNECT_DISCOVERY: refreshing missing scan candidatebeforeCONNECT_SUBMITTED.RADAR_CHANNEL_SWITCHand the unlink haven't run on air; that needs an AP that can be made to switch away from a DFS channel.