Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ath: add support to get the detected radar specifications

This enables ath10k/ath9k drivers to collect the specifications of the
radar type once it is detected by the dfs pattern detector unit.
Usage of the collected info is specific to driver implementation.
For example, collected radar info could be used by the host driver
to send to co-processors for additional processing/validation.

Note: 'radar_detector_specs' data containing the specifications of
different radar types which was private within dfs_pattern_detector/
dfs_pri_detector is now shared with drivers as well for making use
of this information.

Signed-off-by: Sriram R <srirrama@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

authored by

Sriram R and committed by
Kalle Valo
f40105e6 ffbc9197

+10 -5
+1 -1
drivers/net/wireless/ath/ath10k/wmi.c
··· 3757 3757 3758 3758 ATH10K_DFS_STAT_INC(ar, pulses_detected); 3759 3759 3760 - if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe)) { 3760 + if (!ar->dfs_detector->add_pulse(ar->dfs_detector, &pe, NULL)) { 3761 3761 ath10k_dbg(ar, ATH10K_DBG_REGULATORY, 3762 3762 "dfs no pulse pattern detected, yet\n"); 3763 3763 return;
+1 -1
drivers/net/wireless/ath/ath9k/dfs.c
··· 277 277 DFS_STAT_INC(sc, pulses_processed); 278 278 if (pd == NULL) 279 279 return; 280 - if (!pd->add_pulse(pd, pe)) 280 + if (!pd->add_pulse(pd, pe, NULL)) 281 281 return; 282 282 DFS_STAT_INC(sc, radar_detected); 283 283 ieee80211_radar_detected(sc->hw);
+4 -1
drivers/net/wireless/ath/dfs_pattern_detector.c
··· 268 268 } 269 269 270 270 static bool 271 - dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event) 271 + dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event, 272 + struct radar_detector_specs *rs) 272 273 { 273 274 u32 i; 274 275 struct channel_detector *cd; ··· 295 294 struct pri_detector *pd = cd->detectors[i]; 296 295 struct pri_sequence *ps = pd->add_pulse(pd, event); 297 296 if (ps != NULL) { 297 + if (rs != NULL) 298 + memcpy(rs, pd->rs, sizeof(*rs)); 298 299 ath_dbg(dpd->common, DFS, 299 300 "DFS: radar found on freq=%d: id=%d, pri=%d, " 300 301 "count=%d, count_false=%d\n",
+2 -1
drivers/net/wireless/ath/dfs_pattern_detector.h
··· 97 97 bool (*set_dfs_domain)(struct dfs_pattern_detector *dpd, 98 98 enum nl80211_dfs_regions region); 99 99 bool (*add_pulse)(struct dfs_pattern_detector *dpd, 100 - struct pulse_event *pe); 100 + struct pulse_event *pe, 101 + struct radar_detector_specs *rs); 101 102 102 103 struct ath_dfs_pool_stats (*get_stats)(struct dfs_pattern_detector *dpd); 103 104 enum nl80211_dfs_regions region;
+2 -1
drivers/net/wireless/ath/dfs_pri_detector.h
··· 62 62 (*add_pulse)(struct pri_detector *de, struct pulse_event *e); 63 63 void (*reset) (struct pri_detector *de, u64 ts); 64 64 65 - /* private: internal use only */ 66 65 const struct radar_detector_specs *rs; 66 + 67 + /* private: internal use only */ 67 68 u64 last_ts; 68 69 struct list_head sequences; 69 70 struct list_head pulses;