@@ -1773,7 +1773,7 @@ static ssize_t ath10k_write_simulate_radar(struct file *file,
if (!arvif->is_started)
return -EINVAL;
- ieee80211_radar_detected(ar->hw);
+ ieee80211_radar_detected(ar->hw, 0, 0);
return count;
}
@@ -1442,7 +1442,7 @@ static void ath10k_recalc_radar_detection(struct ath10k *ar)
* by indicating that radar was detected.
*/
ath10k_warn(ar, "failed to start CAC: %d\n", ret);
- ieee80211_radar_detected(ar->hw);
+ ieee80211_radar_detected(ar->hw, 0, 0);
}
}
@@ -3969,7 +3969,7 @@ static void ath10k_radar_detected(struct ath10k *ar)
if (ar->dfs_block_radar_events)
ath10k_info(ar, "DFS Radar detected, but ignored as requested\n");
else
- ieee80211_radar_detected(ar->hw);
+ ieee80211_radar_detected(ar->hw, 0, 0);
}
static void ath10k_radar_confirmation_work(struct work_struct *work)
@@ -7738,7 +7738,7 @@ ath11k_wmi_pdev_dfs_radar_detected_event(struct ath11k_base *ab, struct sk_buff
if (ar->dfs_block_radar_events)
ath11k_info(ab, "DFS Radar detected, but ignored as requested\n");
else
- ieee80211_radar_detected(ar->hw);
+ ieee80211_radar_detected(ar->hw, 0, 0);
exit:
kfree(tb);
@@ -6192,7 +6192,7 @@ ath12k_wmi_pdev_dfs_radar_detected_event(struct ath12k_base *ab, struct sk_buff
if (ar->dfs_block_radar_events)
ath12k_info(ab, "DFS Radar detected, but ignored as requested\n");
else
- ieee80211_radar_detected(ar->hw);
+ ieee80211_radar_detected(ar->hw, 0, 0);
exit:
kfree(tb);
@@ -280,7 +280,7 @@ ath9k_dfs_process_radar_pulse(struct ath_softc *sc, struct pulse_event *pe)
if (!pd->add_pulse(pd, pe, NULL))
return;
DFS_STAT_INC(sc, radar_detected);
- ieee80211_radar_detected(sc->hw);
+ ieee80211_radar_detected(sc->hw, 0, 0);
}
/*
@@ -122,7 +122,7 @@ static ssize_t write_file_simulate_radar(struct file *file,
{
struct ath_softc *sc = file->private_data;
- ieee80211_radar_detected(sc->hw);
+ ieee80211_radar_detected(sc->hw, 0, 0);
return count;
}
@@ -1008,7 +1008,7 @@ static int hwsim_write_simulate_radar(void *dat, u64 val)
{
struct mac80211_hwsim_data *data = dat;
- ieee80211_radar_detected(data->hw);
+ ieee80211_radar_detected(data->hw, 0, 0);
return 0;
}
@@ -394,7 +394,7 @@ mt7615_mcu_rx_radar_detected(struct mt7615_dev *dev, struct sk_buff *skb)
if (mt76_phy_dfs_state(mphy) < MT_DFS_STATE_CAC)
return;
- ieee80211_radar_detected(mphy->hw);
+ ieee80211_radar_detected(mphy->hw, 0, 0);
dev->hw_pattern++;
}
@@ -630,7 +630,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
radar_detected = mt76x02_dfs_check_detection(dev);
if (radar_detected) {
/* sw detector rx radar pattern */
- ieee80211_radar_detected(dev->mt76.hw);
+ ieee80211_radar_detected(dev->mt76.hw, 0, 0);
mt76x02_dfs_detector_reset(dev);
return;
@@ -658,7 +658,7 @@ static void mt76x02_dfs_tasklet(struct tasklet_struct *t)
/* hw detector rx radar pattern */
dfs_pd->stats[i].hw_pattern++;
- ieee80211_radar_detected(dev->mt76.hw);
+ ieee80211_radar_detected(dev->mt76.hw, 0, 0);
mt76x02_dfs_detector_reset(dev);
return;
@@ -277,7 +277,7 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
&dev->rdd2_chandef,
GFP_ATOMIC);
else
- ieee80211_radar_detected(mphy->hw);
+ ieee80211_radar_detected(mphy->hw, 0, 0);
dev->hw_pattern++;
}
@@ -344,7 +344,7 @@ mt7996_mcu_rx_radar_detected(struct mt7996_dev *dev, struct sk_buff *skb)
&dev->rdd2_chandef,
GFP_ATOMIC);
else
- ieee80211_radar_detected(mphy->hw);
+ ieee80211_radar_detected(mphy->hw, 0, 0);
dev->hw_pattern++;
}
@@ -142,7 +142,7 @@ int wl18xx_process_mailbox_events(struct wl1271 *wl)
wl18xx_radar_type_decode(mbox->radar_type));
if (!wl->radar_debug_mode)
- ieee80211_radar_detected(wl->hw);
+ ieee80211_radar_detected(wl->hw, 0, 0);
}
if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) {
@@ -6396,8 +6396,11 @@ void ieee80211_cqm_beacon_loss_notify(struct ieee80211_vif *vif, gfp_t gfp);
* ieee80211_radar_detected - inform that a radar was detected
*
* @hw: pointer as obtained from ieee80211_alloc_hw()
+ * @cf1_radar_bitmap: denotes the bitmap of radar in the first part of channel.
+ * @cf2_radar_bitmap: denotes the bitmap of radar in the second part of channel.
*/
-void ieee80211_radar_detected(struct ieee80211_hw *hw);
+void ieee80211_radar_detected(struct ieee80211_hw *hw, u16 cf1_radar_bitmap,
+ u16 cf2_radar_bitmap);
/**
* ieee80211_chswitch_done - Complete channel switch process
@@ -1552,6 +1552,8 @@ struct ieee80211_local {
/* virtual monitor interface */
struct ieee80211_sub_if_data __rcu *monitor_sdata;
struct cfg80211_chan_def monitor_chandef;
+ u16 cf1_radar_bitmap;
+ u16 cf2_radar_bitmap;
/* extended capabilities provided by mac80211 */
u8 ext_capa[8];
@@ -4247,6 +4247,11 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work)
ieee80211_dfs_cac_cancel(local);
wiphy_unlock(local->hw.wiphy);
+ chandef.cf1_radar_bitmap = local->cf1_radar_bitmap;
+ chandef.cf2_radar_bitmap = local->cf2_radar_bitmap;
+ local->cf1_radar_bitmap = 0;
+ local->cf2_radar_bitmap = 0;
+
if (num_chanctx > 1)
/* XXX: multi-channel is not supported yet */
WARN_ON(1);
@@ -4254,9 +4259,12 @@ void ieee80211_dfs_radar_detected_work(struct work_struct *work)
cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL);
}
-void ieee80211_radar_detected(struct ieee80211_hw *hw)
+void ieee80211_radar_detected(struct ieee80211_hw *hw, u16 cf1_radar_bitmap,
+ u16 cf2_radar_bitmap)
{
struct ieee80211_local *local = hw_to_local(hw);
+ local->cf1_radar_bitmap = cf1_radar_bitmap;
+ local->cf2_radar_bitmap = cf2_radar_bitmap;
trace_api_radar_detected(local);
With the current implementation when radar is detected, the whole configured DFS channels are moved to "unavailable" state(NOL). However to move only the radar affected channels alone to NOL, introducing two unsigned 16bit variables "cf1_radar_bitmap" and "cf2_radar_bitmap" which denotes the radar(with a granularity of 20 MHz) in the first and the second part of the channel respectively. The LSB of the radar bitmap corresponds to the lowest 20 MHz channel of the configured channel bandwidth. Each bit set to "1" in this radar bitmap indicates that radar is detected in that sub-channel. Pass these radar bitmaps from driver to cfg80211 through the existing radar detected workqueue, to move the affected channels alone to NOL. Change the "ieee80211_radar_detected" API calls in drivers to address the new parameters. With these radar bitmaps, we can support bandwidth reduction and RX puncturing in the DFS Channels. Signed-off-by: Nagarajan Maran <quic_nmaran@quicinc.com> --- drivers/net/wireless/ath/ath10k/debug.c | 2 +- drivers/net/wireless/ath/ath10k/mac.c | 2 +- drivers/net/wireless/ath/ath10k/wmi.c | 2 +- drivers/net/wireless/ath/ath11k/wmi.c | 2 +- drivers/net/wireless/ath/ath12k/wmi.c | 2 +- drivers/net/wireless/ath/ath9k/dfs.c | 2 +- drivers/net/wireless/ath/ath9k/dfs_debug.c | 2 +- drivers/net/wireless/mac80211_hwsim.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7996/mcu.c | 2 +- drivers/net/wireless/ti/wl18xx/event.c | 2 +- include/net/mac80211.h | 5 ++++- net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/util.c | 10 +++++++++- 16 files changed, 29 insertions(+), 16 deletions(-)