Skip to content

wifi: mt76: mt7996: properly disable in-band discovery when interval is 0 - #1126

Open
astrouski-google wants to merge 1 commit into
openwrt:masterfrom
astrouski-google:fix_disable_inband_discovery
Open

astrouski-google wants to merge 1 commit into
openwrt:masterfrom
astrouski-google:fix_disable_inband_discovery

Conversation

@astrouski-google

Copy link
Copy Markdown

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.

…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>
@astrouski-google

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant