From: Ben Greear <greearb@candelatech.com>
To: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 1/2] wifi: mt76: mt7996: disable beacons when going offchannel
Date: Tue, 19 Aug 2025 10:27:30 -0700 [thread overview]
Message-ID: <08f86ed0-32d8-5a8f-2beb-d885dba40232@candelatech.com> (raw)
In-Reply-To: <20250813121106.81559-1-nbd@nbd.name>
On 8/13/25 05:11, Felix Fietkau wrote:
> Avoid leaking beacons on unrelated channels during scanning/roc
>
> Fixes: c56d6edebc1f ("wifi: mt76: mt7996: use emulated hardware scan support")
> Reported-by: Chad Monroe <chad.monroe@adtran.com>
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
> .../net/wireless/mediatek/mt76/mt7996/mac.c | 46 +++++++++++--------
> .../net/wireless/mediatek/mt76/mt7996/main.c | 5 ++
> .../net/wireless/mediatek/mt76/mt7996/mcu.c | 11 +++--
> .../wireless/mediatek/mt76/mt7996/mt7996.h | 1 +
> 4 files changed, 42 insertions(+), 21 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> index 6333a064c4f7..d3d3b96f7dd2 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7996/mac.c
> @@ -1698,17 +1698,37 @@ mt7996_wait_reset_state(struct mt7996_dev *dev, u32 state)
> static void
> mt7996_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
> {
> - struct ieee80211_hw *hw = priv;
> + struct ieee80211_bss_conf *link_conf;
> + struct mt7996_phy *phy = priv;
> + struct mt7996_dev *dev = phy->dev;
> + unsigned int link_id;
> +
>
> switch (vif->type) {
> case NL80211_IFTYPE_MESH_POINT:
> case NL80211_IFTYPE_ADHOC:
> case NL80211_IFTYPE_AP:
> - mt7996_mcu_add_beacon(hw, vif, &vif->bss_conf);
> break;
> default:
> - break;
> + return;
> }
> +
> + for_each_vif_active_link(vif, link_conf, link_id) {
> + struct mt7996_vif_link *link;
> +
> + link = mt7996_vif_link(dev, vif, link_id);
> + if (link->phy != phy)
> + continue;
> +
> + mt7996_mcu_add_beacon(dev->mt76.hw, vif, link_conf);
> + }
Hello Felix,
We attempted to backport this into our tree, and we found that 'link'
in the code above is NULL sometimes and we were seeing crashes. Adding
a check for null seems to have fixed it.
Possibly this does not happen in upstream code, so just FYI.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2025-08-19 17:36 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 12:11 [PATCH 1/2] wifi: mt76: mt7996: disable beacons when going offchannel Felix Fietkau
2025-08-13 12:11 ` [PATCH 2/2] wifi: mt76: prevent non-offchannel mgmt tx during scan/roc Felix Fietkau
2025-08-19 17:27 ` Ben Greear [this message]
2025-08-19 17:51 ` [PATCH 1/2] wifi: mt76: mt7996: disable beacons when going offchannel Felix Fietkau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=08f86ed0-32d8-5a8f-2beb-d885dba40232@candelatech.com \
--to=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox