Skip to content

Commit e9a896d

Browse files
Aditya Kumar Singhjmberg-intel
authored andcommitted
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 <[email protected]> Signed-off-by: Amith A <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 9975aee commit e9a896d

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
@@ -9761,6 +9761,7 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97619761
{
97629762
unsigned int link_id;
97639763
bool all_ok = true;
9764+
int radio_idx;
97649765

97659766
lockdep_assert_wiphy(wdev->wiphy);
97669767

@@ -9770,8 +9771,10 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97709771
if (!cfg80211_beaconing_iface_active(wdev))
97719772
return true;
97729773

9774+
radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy, chan);
9775+
97739776
/*
9774-
* FIXME: check if we have a free HW resource/link for chan
9777+
* FIXME: check if we have a free radio/link for chan
97759778
*
97769779
* This, as well as the FIXME below, requires knowing the link
97779780
* capabilities of the hardware.
@@ -9780,20 +9783,28 @@ static bool cfg80211_off_channel_oper_allowed(struct wireless_dev *wdev,
97809783
/* we cannot leave radar channels */
97819784
for_each_valid_link(wdev, link_id) {
97829785
struct cfg80211_chan_def *chandef;
9786+
int link_radio_idx;
97839787

97849788
chandef = wdev_chandef(wdev, link_id);
97859789
if (!chandef || !chandef->chan)
97869790
continue;
97879791

9792+
if (!(chandef->chan->flags & IEEE80211_CHAN_RADAR))
9793+
continue;
9794+
97889795
/*
9789-
* FIXME: don't require all_ok, but rather check only the
9790-
* correct HW resource/link onto which 'chan' falls,
9791-
* as only that link leaves the channel for doing
9792-
* the off-channel operation.
9796+
* chandef->chan is a radar channel. If the radio/link onto
9797+
* which this radar channel falls is the same radio/link onto
9798+
* which the input 'chan' falls, off-channel operation should
9799+
* not be allowed. Hence, set 'all_ok' to false.
97939800
*/
97949801

9795-
if (chandef->chan->flags & IEEE80211_CHAN_RADAR)
9802+
link_radio_idx = cfg80211_get_radio_idx_by_chan(wdev->wiphy,
9803+
chandef->chan);
9804+
if (link_radio_idx == radio_idx) {
97969805
all_ok = false;
9806+
break;
9807+
}
97979808
}
97989809

97999810
if (all_ok)

0 commit comments

Comments
 (0)