Skip to content

Commit bca8bc0

Browse files
Aditya Kumar Singhjmberg-intel
authored andcommitted
wifi: mac80211: handle ieee80211_radar_detected() for MLO
Currently DFS works under assumption there could be only one channel context in the hardware. Hence, drivers just calls the function ieee80211_radar_detected() passing the hardware structure. However, with MLO, this obviously will not work since number of channel contexts will be more than one and hence drivers would need to pass the channel information as well on which the radar is detected. Also, when radar is detected in one of the links, other link's CAC should not be cancelled. Hence, in order to support DFS with MLO, do the following changes - * Add channel context conf pointer as an argument to the function ieee80211_radar_detected(). During MLO, drivers would have to pass on which channel context conf radar is detected. Otherwise, drivers could just pass NULL. * ieee80211_radar_detected() will iterate over all channel contexts present and * if channel context conf is passed, only mark that as radar detected * if NULL is passed, then mark all channel contexts as radar detected * Then as usual, schedule the radar detected work. * In the worker, go over all the contexts again and for all such context which is marked with radar detected, cancel the ongoing CAC by calling ieee80211_dfs_cac_cancel() and then notify cfg80211 via cfg80211_radar_event(). * To cancel the CAC, pass the channel context as well where radar is detected to ieee80211_dfs_cac_cancel(). This ensures that CAC is canceled only on the links using the provided context, leaving other links unaffected. This would also help in scenarios where there is split phy 5 GHz radio, which is capable of DFS channels in both lower and upper band. In this case, simultaneous radars can be detected. Signed-off-by: Aditya Kumar Singh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 0b77982 commit bca8bc0

File tree

18 files changed

+66
-29
lines changed

18 files changed

+66
-29
lines changed

drivers/net/wireless/ath/ath10k/debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Copyright (c) 2005-2011 Atheros Communications Inc.
44
* Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
55
* Copyright (c) 2018, The Linux Foundation. All rights reserved.
6-
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
6+
* Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved.
77
*/
88

99
#include <linux/module.h>
@@ -1774,7 +1774,7 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
17741774
if (!arvif->is_started)
17751775
return -EINVAL;
17761776

1777-
ieee80211_radar_detected(ar->hw);
1777+
ieee80211_radar_detected(ar->hw, NULL);
17781778

17791779
return count;
17801780
}

drivers/net/wireless/ath/ath10k/mac.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ static void ath10k_recalc_radar_detection(struct ath10k *ar)
14371437
* by indicating that radar was detected.
14381438
*/
14391439
ath10k_warn(ar, "failed to start CAC: %d\n", ret);
1440-
ieee80211_radar_detected(ar->hw);
1440+
ieee80211_radar_detected(ar->hw, NULL);
14411441
}
14421442
}
14431443

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3990,7 +3990,7 @@ static void ath10k_radar_detected(struct ath10k *ar)
39903990
if (ar->dfs_block_radar_events)
39913991
ath10k_info(ar, "DFS Radar detected, but ignored as requested\n");
39923992
else
3993-
ieee80211_radar_detected(ar->hw);
3993+
ieee80211_radar_detected(ar->hw, NULL);
39943994
}
39953995

39963996
static void ath10k_radar_confirmation_work(struct work_struct *work)

drivers/net/wireless/ath/ath11k/wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8358,7 +8358,7 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff
83588358
if (ar->dfs_block_radar_events)
83598359
ath11k_info(ab, "DFS Radar detected, but ignored as requested\n");
83608360
else
8361-
ieee80211_radar_detected(ar->hw);
8361+
ieee80211_radar_detected(ar->hw, NULL);
83628362

83638363
exit:
83648364
rcu_read_unlock();

drivers/net/wireless/ath/ath12k/wmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6789,7 +6789,7 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff
67896789
if (ar->dfs_block_radar_events)
67906790
ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
67916791
else
6792-
ieee80211_radar_detected(ath12k_ar_to_hw(ar));
6792+
ieee80211_radar_detected(ath12k_ar_to_hw(ar), NULL);
67936793

67946794
exit:
67956795
rcu_read_unlock();

drivers/net/wireless/ath/ath9k/dfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe)
280280
if (!pd->add_pulse(pd, pe, NULL))
281281
return;
282282
DFS_STAT_INC(sc, radar_detected);
283-
ieee80211_radar_detected(sc->hw);
283+
ieee80211_radar_detected(sc->hw, NULL);
284284
}
285285

286286
/*

drivers/net/wireless/ath/ath9k/dfs_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static ssize_t write_file_simulate_radar(struct file *file,
116116
{
117117
struct ath_softc *sc = file->private_data;
118118

119-
ieee80211_radar_detected(sc->hw);
119+
ieee80211_radar_detected(sc->hw, NULL);
120120

121121
return count;
122122
}

drivers/net/wireless/mediatek/mt76/mt7615/mcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb)
394394
if (mt76_phy_dfs_state(mphy) < MT_DFS_STATE_CAC)
395395
return;
396396

397-
ieee80211_radar_detected(mphy->hw);
397+
ieee80211_radar_detected(mphy->hw, NULL);
398398
dev->hw_pattern++;
399399
}
400400

drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
630630
radar_detected = mt76x02_dfs_check_detection(dev);
631631
if (radar_detected) {
632632
/* sw detector rx radar pattern */
633-
ieee80211_radar_detected(dev->mt76.hw);
633+
ieee80211_radar_detected(dev->mt76.hw, NULL);
634634
mt76x02_dfs_detector_reset(dev);
635635

636636
return;
@@ -658,7 +658,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
658658

659659
/* hw detector rx radar pattern */
660660
dfs_pd->stats[i].hw_pattern++;
661-
ieee80211_radar_detected(dev->mt76.hw);
661+
ieee80211_radar_detected(dev->mt76.hw, NULL);
662662
mt76x02_dfs_detector_reset(dev);
663663

664664
return;

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
293293
&dev->rdd2_chandef,
294294
GFP_ATOMIC);
295295
else
296-
ieee80211_radar_detected(mphy->hw);
296+
ieee80211_radar_detected(mphy->hw, NULL);
297297
dev->hw_pattern++;
298298
}
299299

0 commit comments

Comments
 (0)