Lines Matching refs:dpd

168 static void channel_detector_reset(struct dfs_pattern_detector *dpd,  in channel_detector_reset()  argument
174 for (i = 0; i < dpd->num_radar_types; i++) in channel_detector_reset()
175 cd->detectors[i]->reset(cd->detectors[i], dpd->last_pulse_ts); in channel_detector_reset()
179 static void channel_detector_exit(struct dfs_pattern_detector *dpd, in channel_detector_exit() argument
187 for (i = 0; i < dpd->num_radar_types; i++) { in channel_detector_exit()
198 channel_detector_create(struct dfs_pattern_detector *dpd, u16 freq) in channel_detector_create() argument
209 sz = sizeof(cd->detectors) * dpd->num_radar_types; in channel_detector_create()
214 for (i = 0; i < dpd->num_radar_types; i++) { in channel_detector_create()
215 const struct radar_detector_specs *rs = &dpd->radar_spec[i]; in channel_detector_create()
221 list_add(&cd->head, &dpd->channel_detectors); in channel_detector_create()
225 ath_dbg(dpd->common, DFS, in channel_detector_create()
227 channel_detector_exit(dpd, cd); in channel_detector_create()
242 channel_detector_get(struct dfs_pattern_detector *dpd, u16 freq) in channel_detector_get() argument
245 list_for_each_entry(cd, &dpd->channel_detectors, head) { in channel_detector_get()
249 return channel_detector_create(dpd, freq); in channel_detector_get()
257 static void dpd_reset(struct dfs_pattern_detector *dpd) in dpd_reset() argument
260 list_for_each_entry(cd, &dpd->channel_detectors, head) in dpd_reset()
261 channel_detector_reset(dpd, cd); in dpd_reset()
264 static void dpd_exit(struct dfs_pattern_detector *dpd) in dpd_exit() argument
267 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) in dpd_exit()
268 channel_detector_exit(dpd, cd); in dpd_exit()
269 kfree(dpd); in dpd_exit()
273 dpd_add_pulse(struct dfs_pattern_detector *dpd, struct pulse_event *event, in dpd_add_pulse() argument
283 if (dpd->region == NL80211_DFS_UNSET) in dpd_add_pulse()
286 cd = channel_detector_get(dpd, event->freq); in dpd_add_pulse()
291 if (event->ts < dpd->last_pulse_ts) in dpd_add_pulse()
292 dpd_reset(dpd); in dpd_add_pulse()
293 dpd->last_pulse_ts = event->ts; in dpd_add_pulse()
296 for (i = 0; i < dpd->num_radar_types; i++) { in dpd_add_pulse()
302 ath_dbg(dpd->common, DFS, in dpd_add_pulse()
307 pd->reset(pd, dpd->last_pulse_ts); in dpd_add_pulse()
315 dpd_get_stats(struct dfs_pattern_detector *dpd) in dpd_get_stats() argument
320 static bool dpd_set_domain(struct dfs_pattern_detector *dpd, in dpd_set_domain() argument
326 if (dpd->region == region) in dpd_set_domain()
329 dpd->region = NL80211_DFS_UNSET; in dpd_set_domain()
336 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) in dpd_set_domain()
337 channel_detector_exit(dpd, cd); in dpd_set_domain()
338 dpd->radar_spec = rt->radar_types; in dpd_set_domain()
339 dpd->num_radar_types = rt->num_radar_types; in dpd_set_domain()
341 dpd->region = region; in dpd_set_domain()
357 struct dfs_pattern_detector *dpd; in dfs_pattern_detector_init() local
362 dpd = kmalloc(sizeof(*dpd), GFP_KERNEL); in dfs_pattern_detector_init()
363 if (dpd == NULL) in dfs_pattern_detector_init()
366 *dpd = default_dpd; in dfs_pattern_detector_init()
367 INIT_LIST_HEAD(&dpd->channel_detectors); in dfs_pattern_detector_init()
369 dpd->common = common; in dfs_pattern_detector_init()
370 if (dpd->set_dfs_domain(dpd, region)) in dfs_pattern_detector_init()
371 return dpd; in dfs_pattern_detector_init()
374 kfree(dpd); in dfs_pattern_detector_init()