From: Ben Greear <greearb@candelatech.com>
To: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Cc: Chad Monroe <chad@monroe.io>
Subject: Re: [PATCH 1/2] wifi: mt76: fix multi-radio on-channel scanning
Date: Tue, 18 Nov 2025 08:47:46 -0800 [thread overview]
Message-ID: <6180e894-0071-470a-a8c6-59cdf888488d@candelatech.com> (raw)
In-Reply-To: <c1557aad-e2ea-4a31-960b-16694569b4de@candelatech.com>
On 11/18/25 5:46 AM, Ben Greear wrote:
> On 11/18/25 2:27 AM, Felix Fietkau wrote:
>> From: Chad Monroe <chad@monroe.io>
>>
>> avoid unnecessary channel switch when performing an on-channel scan
>> using a multi-radio device.
>>
>> Fixes: c56d6edebc1f ("wifi: mt76: mt7996: use emulated hardware scan support")
>> Signed-off-by: Chad Monroe <chad@monroe.io>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>> drivers/net/wireless/mediatek/mt76/scan.c | 12 +++++++-----
>> 1 file changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/net/wireless/mediatek/mt76/scan.c b/drivers/net/wireless/mediatek/mt76/scan.c
>> index ff9176cdee3d..0b1922f7792e 100644
>> --- a/drivers/net/wireless/mediatek/mt76/scan.c
>> +++ b/drivers/net/wireless/mediatek/mt76/scan.c
>> @@ -16,7 +16,7 @@ static void mt76_scan_complete(struct mt76_dev *dev, bool abort)
>> clear_bit(MT76_SCANNING, &phy->state);
>> - if (dev->scan.chan && phy->main_chandef.chan &&
>> + if (dev->scan.chan && phy->main_chandef.chan && phy->offchannel &&
>> !test_bit(MT76_MCU_RESET, &dev->phy.state))
>> mt76_set_channel(phy, &phy->main_chandef, false);
>> mt76_put_vif_phy_link(phy, dev->scan.vif, dev->scan.mlink);
>> @@ -94,7 +94,7 @@ void mt76_scan_work(struct work_struct *work)
>> return;
>> }
>> - if (dev->scan.chan && phy->num_sta) {
>> + if (dev->scan.chan && phy->num_sta && phy->offchannel) {
>> dev->scan.chan = NULL;
>> mt76_set_channel(phy, &phy->main_chandef, false);
>> goto out;
>> @@ -102,20 +102,22 @@ void mt76_scan_work(struct work_struct *work)
>> dev->scan.chan = req->channels[dev->scan.chan_idx++];
>> cfg80211_chandef_create(&chandef, dev->scan.chan, NL80211_CHAN_HT20);
>> - mt76_set_channel(phy, &chandef, true);
>> + if (dev->scan.chan != phy->main_chandef.chan)
>> + mt76_set_channel(phy, &chandef, true);
>
> Do you still need to call the cfg80211_chandef_create(&chandef, dev->scan.chan, NL80211_CHAN_HT20);
> method above if scan.chan == main_chandef.chan?
>
> Thanks,
> Ben
Nevermind, I see why you need it.
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
prev parent reply other threads:[~2025-11-18 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 10:27 [PATCH 1/2] wifi: mt76: fix multi-radio on-channel scanning Felix Fietkau
2025-11-18 10:27 ` [PATCH 2/2] wifi: mt76: support upgrading passive scans to active Felix Fietkau
2025-11-18 13:46 ` [PATCH 1/2] wifi: mt76: fix multi-radio on-channel scanning Ben Greear
2025-11-18 16:47 ` Ben Greear [this message]
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=6180e894-0071-470a-a8c6-59cdf888488d@candelatech.com \
--to=greearb@candelatech.com \
--cc=chad@monroe.io \
--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