wifi: mt76: mt7996: properly disable in-band discovery when interval is 0 - #1126
Open
astrouski-google wants to merge 1 commit into
Open
astrouski-google wants to merge 1 commit into
astrouski-google wants to merge 1 commit into
Conversation
…is 0 When in-band discovery (FILS discovery or unsolicited broadcast probe responses) is disabled (interval set to 0), mac80211 frees the frame template and sends BSS_CHANGED_FILS_DISCOVERY / BSS_CHANGED_UNSOL_BCAST_PROBE_RESP. In mt7996_mcu_beacon_inband_discov(), the driver checked if the interval was non-zero before fetching the template. If interval is 0, skb remained NULL. The subsequent `if (!skb)` check returned -EINVAL immediately, preventing the driver from sending the BSS_INFO_UPDATE MCU command with discov->enable = false to the firmware. As a result, the hardware continued transmitting in-band discovery frames indefinitely. Fix this by introducing mt7996_mcu_beacon_inband_discov_disable() to send a dedicated BSS_INFO_INBAND_DISCOVERY TLV with enable = false when in-band discovery is disabled, and defer the large BSS offload request allocation until after validating the interval and template. Signed-off-by: Alexandr Astrouski <astrouski@google.com>
Author
|
It's not a small fix, pls let me know if you would like to have it send in mailing list prior to Review here, or it's ok to review here and then send to mailing list if everything is ok. |
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.
When in-band discovery (FILS discovery or unsolicited broadcast probe responses) is disabled (interval set to 0), mac80211 frees the frame template and sends BSS_CHANGED_FILS_DISCOVERY / BSS_CHANGED_UNSOL_BCAST_PROBE_RESP.
In mt7996_mcu_beacon_inband_discov(), the driver checked if the interval was non-zero before fetching the template. If interval is 0, skb remained NULL. The subsequent
if (!skb)check returned -EINVAL immediately, preventing the driver from sending the BSS_INFO_UPDATE MCU command with discov->enable = false to the firmware.As a result, the hardware continued transmitting in-band discovery frames indefinitely.
Fix this by introducing mt7996_mcu_beacon_inband_discov_disable() to send a dedicated BSS_INFO_INBAND_DISCOVERY TLV with enable = false when in-band discovery is disabled, and defer the large BSS offload request allocation until after validating the interval and template.
Verified on BPi-R4 with that patch. Run wifi-iface with fils_discovery.max_interval=20, update it to 0 and reload wifi, observe in pcap that there are no frames. Reset to 20 and reload wifi, frames start broadcasting.