Lines Matching +full:threshold +full:- +full:detector

25  * struct radar_types - contains array of patterns defined for one DFS domain
36 /* percentage on ppb threshold to trigger detection */
38 #define PPB_THRESH_RATE(PPB, RATE) ((PPB * RATE + 100 - RATE) / 100)
43 #define WIDTH_LOWER(X) ((X*(100-WIDTH_TOLERANCE)+50)/100)
49 (PRF2PRI(PMAX) - PRI_TOLERANCE), \
54 /* radar types as defined by ETSI EN-301-893 v1.5.1 */
74 PMIN - PRI_TOLERANCE, \
106 PMIN - PRI_TOLERANCE, \
135 * get_dfs_domain_radar_types() - get radar types for a given DFS domain
145 if (dfs_domains[i]->region == region) in get_dfs_domain_radar_types()
152 * struct channel_detector - detector elements for a DFS channel
154 * @freq: frequency for this channel detector in MHz
155 * @detectors: array of dynamically created detector elements for this freq
157 * Channel detectors are required to provide multi-channel DFS detection, e.g.
158 * to support off-channel scanning. A pattern detector has a list of channels
167 /* channel_detector_reset() - reset detector lines for a given channel */
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()
178 /* channel_detector_exit() - destructor */
185 list_del(&cd->head); in channel_detector_exit()
187 for (i = 0; i < dpd->num_radar_types; i++) { in channel_detector_exit()
188 struct pri_detector *de = cd->detectors[i]; in channel_detector_exit()
190 de->exit(de); in channel_detector_exit()
202 cd = kzalloc(struct_size(cd, detectors, dpd->num_radar_types), GFP_ATOMIC); in channel_detector_create()
206 INIT_LIST_HEAD(&cd->head); in channel_detector_create()
207 cd->freq = freq; in channel_detector_create()
209 for (i = 0; i < dpd->num_radar_types; i++) { in channel_detector_create()
210 const struct radar_detector_specs *rs = &dpd->radar_spec[i]; in channel_detector_create()
214 cd->detectors[i] = de; in channel_detector_create()
216 list_add(&cd->head, &dpd->channel_detectors); in channel_detector_create()
220 ath_dbg(dpd->common, DFS, in channel_detector_create()
227 * channel_detector_get() - get channel detector for given frequency
231 * Return value: pointer to channel detector on success, NULL otherwise
233 * Return existing channel detector for the given frequency or return a
240 list_for_each_entry(cd, &dpd->channel_detectors, head) { in channel_detector_get()
241 if (cd->freq == freq) in channel_detector_get()
248 * DFS Pattern Detector
255 list_for_each_entry(cd, &dpd->channel_detectors, head) in dpd_reset()
262 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) in dpd_exit()
275 * pulses received for a non-supported or un-initialized in dpd_add_pulse()
276 * domain are treated as detected radars for fail-safety in dpd_add_pulse()
278 if (dpd->region == NL80211_DFS_UNSET) in dpd_add_pulse()
281 cd = channel_detector_get(dpd, event->freq); in dpd_add_pulse()
285 /* reset detector on time stamp wraparound, caused by TSF reset */ in dpd_add_pulse()
286 if (event->ts < dpd->last_pulse_ts) in dpd_add_pulse()
288 dpd->last_pulse_ts = event->ts; in dpd_add_pulse()
291 for (i = 0; i < dpd->num_radar_types; i++) { in dpd_add_pulse()
292 struct pri_detector *pd = cd->detectors[i]; in dpd_add_pulse()
293 struct pri_sequence *ps = pd->add_pulse(pd, event); in dpd_add_pulse()
296 memcpy(rs, pd->rs, sizeof(*rs)); in dpd_add_pulse()
297 ath_dbg(dpd->common, DFS, in dpd_add_pulse()
300 event->freq, pd->rs->type_id, in dpd_add_pulse()
301 ps->pri, ps->count, ps->count_falses); in dpd_add_pulse()
302 pd->reset(pd, dpd->last_pulse_ts); in dpd_add_pulse()
321 if (dpd->region == region) in dpd_set_domain()
324 dpd->region = NL80211_DFS_UNSET; in dpd_set_domain()
331 list_for_each_entry_safe(cd, cd0, &dpd->channel_detectors, head) in dpd_set_domain()
333 dpd->radar_spec = rt->radar_types; in dpd_set_domain()
334 dpd->num_radar_types = rt->num_radar_types; in dpd_set_domain()
336 dpd->region = region; in dpd_set_domain()
362 INIT_LIST_HEAD(&dpd->channel_detectors); in dfs_pattern_detector_init()
364 dpd->common = common; in dfs_pattern_detector_init()
365 if (dpd->set_dfs_domain(dpd, region)) in dfs_pattern_detector_init()