Skip to content

Commit 60adfec

Browse files
committed
wifi: cfg80211: fix off channel operation allowed check for MLO
JIRA: https://issues.redhat.com/browse/RHEL-114891 commit e9a896d Author: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com> Date: Mon Jul 14 09:37:42 2025 +0530 wifi: cfg80211: fix off channel operation allowed check for MLO In cfg80211_off_channel_oper_allowed(), the current logic disallows off-channel operations if any link operates on a radar channel, assuming such channels cannot be vacated. This assumption holds for non-MLO interfaces but not for MLO. With MLO and multi-radio devices, different links may operate on separate radios. This allows one link to scan off-channel while another remains on a radar channel. For example, in a 5 GHz split-phy setup, the lower band can scan while the upper band stays on a radar channel. Off-channel operations can be allowed if the radio/link onto which the input channel falls is different from the radio/link which has an active radar channel. Therefore, fix cfg80211_off_channel_oper_allowed() by returning false only if the requested channel maps to the same radio as an active radar channel. Allow off-channel operations when the requested channel is on a different radio, as in MLO with multi-radio setups. Signed-off-by: Aditya Kumar Singh <aditya.kumar.singh@oss.qualcomm.com> Signed-off-by: Amith A <quic_amitajit@quicinc.com> Link: https://patch.msgid.link/20250714040742.538550-1-quic_amitajit@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent f0c8392 commit 60adfec

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

net/wireless/nl80211.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9768,6 +9768,7 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97689768
{
97699769
unsigned int link_id;
97709770
bool all_ok = true;
9771+
int radio_idx;
97719772

97729773
lockdep_assert_wiphy(wdev->wiphy);
97739774

@@ -9777,8 +9778,10 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97779778
if (!cfg80211_beaconing_iface_active(wdev))
97789779
return true;
97799780

9781+
radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy, chan);
9782+
97809783
/*
9781-
* FIXME: check if we have a free HW resource/link for chan
9784+
* FIXME: check if we have a free radio/link for chan
97829785
*
97839786
* This, as well as the FIXME below, requires knowing the link
97849787
* capabilities of the hardware.
@@ -9787,20 +9790,28 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97879790
/* we cannot leave radar channels */
97889791
for_each_valid_link(wdev, link_id) {
97899792
struct cfg80211_chan_def *chandef;
9793+
int link_radio_idx;
97909794

97919795
chandef = wdev_chandef(wdev, link_id);
97929796
if (!chandef || !chandef->chan)
97939797
continue;
97949798

9799+
if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR))
9800+
continue;
9801+
97959802
/*
9796-
* FIXME: don't require all_ok, but rather check only the
9797-
* correct HW resource/link onto which 'chan' falls,
9798-
* as only that link leaves the channel for doing
9799-
* the off-channel operation.
9803+
* chandef->chan is a radar channel. If the radio/link onto
9804+
* which this radar channel falls is the same radio/link onto
9805+
* which the input 'chan' falls, off-channel operation should
9806+
* not be allowed. Hence, set 'all_ok' to false.
98009807
*/
98019808

9802-
if (chandef->chan->flags & IEEE80211_CHAN_RADAR)
9809+
link_radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy,
9810+
chandef->chan);
9811+
if (link_radio_idx == radio_idx) {
98039812
all_ok = false;
9813+
break;
9814+
}
98049815
}
98059816

98069817
if (all_ok)

0 commit comments

Comments
 (0)