Lines Matching refs:pde
160 static struct pulse_elem *pulse_queue_get_tail(struct pri_detector *pde) in pulse_queue_get_tail() argument
162 struct list_head *l = &pde->pulses; in pulse_queue_get_tail()
168 static bool pulse_queue_dequeue(struct pri_detector *pde) in pulse_queue_dequeue() argument
170 struct pulse_elem *p = pulse_queue_get_tail(pde); in pulse_queue_dequeue()
173 pde->count--; in pulse_queue_dequeue()
177 return (pde->count > 0); in pulse_queue_dequeue()
181 static void pulse_queue_check_window(struct pri_detector *pde) in pulse_queue_check_window() argument
187 if (pde->count < 2) in pulse_queue_check_window()
190 if (pde->last_ts <= pde->window_size) in pulse_queue_check_window()
193 min_valid_ts = pde->last_ts - pde->window_size; in pulse_queue_check_window()
194 while ((p = pulse_queue_get_tail(pde)) != NULL) { in pulse_queue_check_window()
197 pulse_queue_dequeue(pde); in pulse_queue_check_window()
201 static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) in pulse_queue_enqueue() argument
215 list_add(&p->head, &pde->pulses); in pulse_queue_enqueue()
216 pde->count++; in pulse_queue_enqueue()
217 pde->last_ts = ts; in pulse_queue_enqueue()
218 pulse_queue_check_window(pde); in pulse_queue_enqueue()
219 if (pde->count >= pde->max_count) in pulse_queue_enqueue()
220 pulse_queue_dequeue(pde); in pulse_queue_enqueue()
224 static bool pseq_handler_create_sequences(struct pri_detector *pde, in pseq_handler_create_sequences() argument
228 list_for_each_entry(p, &pde->pulses, head) { in pseq_handler_create_sequences()
235 if (delta_ts < pde->rs->pri_min) in pseq_handler_create_sequences()
239 if (delta_ts > pde->rs->pri_max) in pseq_handler_create_sequences()
248 ps.pri = GET_PRI_TO_USE(pde->rs->pri_min, in pseq_handler_create_sequences()
249 pde->rs->pri_max, ts - p->ts); in pseq_handler_create_sequences()
250 ps.dur = ps.pri * (pde->rs->ppb - 1) in pseq_handler_create_sequences()
251 + 2 * pde->rs->max_pri_tolerance; in pseq_handler_create_sequences()
257 list_for_each_entry_continue(p2, &pde->pulses, head) { in pseq_handler_create_sequences()
264 pde->rs->max_pri_tolerance); in pseq_handler_create_sequences()
297 list_add(&new_ps->head, &pde->sequences); in pseq_handler_create_sequences()
304 pseq_handler_add_to_existing_seqs(struct pri_detector *pde, u64 ts) in pseq_handler_add_to_existing_seqs() argument
308 list_for_each_entry_safe(ps, ps2, &pde->sequences, head) { in pseq_handler_add_to_existing_seqs()
321 pde->rs->max_pri_tolerance); in pseq_handler_add_to_existing_seqs()
336 pseq_handler_check_detection(struct pri_detector *pde) in pseq_handler_check_detection() argument
340 if (list_empty(&pde->sequences)) in pseq_handler_check_detection()
343 list_for_each_entry(ps, &pde->sequences, head) { in pseq_handler_check_detection()
349 if ((ps->count >= pde->rs->ppb_thresh) && in pseq_handler_check_detection()
350 (ps->count * pde->rs->num_pri >= ps->count_falses)) in pseq_handler_check_detection()
358 static void pri_detector_reset(struct pri_detector *pde, u64 ts) in pri_detector_reset() argument
362 list_for_each_entry_safe(ps, ps0, &pde->sequences, head) { in pri_detector_reset()
366 list_for_each_entry_safe(p, p0, &pde->pulses, head) { in pri_detector_reset()
370 pde->count = 0; in pri_detector_reset()
371 pde->last_ts = ts; in pri_detector_reset()