Lines Matching full:scan

65 			      uint16_t period, struct ll_scan_set **scan,
67 static uint8_t duration_period_setup(struct ll_scan_set *scan,
70 static uint8_t duration_period_update(struct ll_scan_set *scan,
86 struct ll_scan_set *scan; in ll_scan_params_set() local
89 scan = ull_scan_is_disabled_get(SCAN_HANDLE_1M); in ll_scan_params_set()
90 if (!scan) { in ll_scan_params_set()
110 scan = scan_coded; in ll_scan_params_set()
113 lll = &scan->lll; in ll_scan_params_set()
116 * scan instance. in ll_scan_params_set()
131 lll = &scan->lll; in ll_scan_params_set()
134 scan->own_addr_type = own_addr_type; in ll_scan_params_set()
136 scan->ticks_window = ull_scan_params_set(lll, type, interval, window, in ll_scan_params_set()
155 struct ll_scan_set *scan; local
174 scan = ull_scan_is_disabled_get(SCAN_HANDLE_1M);
175 if (!scan) {
178 &scan, &node_rx_scan_term);
203 (!is_coded_phy && (scan->own_addr_type & 0x1))) {
211 if (!is_coded_phy || IS_PHY_ENABLED(scan, PHY_1M))
214 err = duration_period_setup(scan, duration, period,
240 lll = &scan->lll;
241 own_addr_type = scan->own_addr_type;
265 if (!is_coded_phy || IS_PHY_ENABLED(scan, PHY_1M))
268 err = duration_period_update(scan, is_update_1m);
287 if (!is_coded_phy || IS_PHY_ENABLED(scan, PHY_1M))
291 err = ull_scan_enable(scan);
337 /* Initialize PHY value to 0 to not start scanning on the scan
385 uint8_t ull_scan_enable(struct ll_scan_set *scan) argument
397 /* Initialize extend scan stop request */
398 scan->is_stop = 0U;
401 /* Initialize LLL scan context */
402 lll = &scan->lll;
403 lll->init_addr_type = scan->own_addr_type;
408 ull_hdr_init(&scan->ull);
409 lll_hdr_init(lll, scan);
415 scan->ull.ticks_active_to_start = 0U;
416 scan->ull.ticks_prepare_to_start =
418 scan->ull.ticks_preempt_to_start =
422 ticks_slot_overhead = MAX(scan->ull.ticks_active_to_start,
423 scan->ull.ticks_prepare_to_start);
428 handle = ull_scan_handle_get(scan);
430 lll->ticks_window = scan->ticks_window;
434 scan->ull.ticks_slot =
440 scan->ull.ticks_slot + ticks_slot_overhead;
445 scan->ull.ticks_slot = 0U;
447 scan->ull.ticks_slot = ticks_interval -
481 * and the sum of the scan window duration equals their
489 scan->ull.ticks_slot = 0U;
491 scan->ull.ticks_slot =
498 /* Continuous scanning, no scan window stop
500 * ticks_window value when coded PHY scan is
502 * Due to this the first scan window will have
504 * scan window will not have the stop ticker
505 * started once coded PHY scan window has been
515 /* 1M scan window starts without any offset */
538 * and the sum of the scan window duration equals their
546 scan->ull.ticks_slot = 0U;
548 scan->ull.ticks_slot =
554 /* Offset the coded PHY scan window, place
555 * after 1M scan window.
563 /* Continuous scanning, no scan window stop
595 (scan->ull.ticks_slot +
623 (scan->ull.ticks_slot + ticks_slot_overhead),
624 ticker_cb, scan,
636 scan->is_enabled = 1U;
650 uint8_t ull_scan_disable(uint8_t handle, struct ll_scan_set *scan) argument
655 /* Request Extended Scan stop */
656 scan->is_stop = 1U;
661 scan, &scan->lll);
669 /* Stop associated auxiliary scan contexts */
670 err = ull_scan_aux_stop(&scan->lll);
675 /* Find and stop associated auxiliary scan contexts */
689 if (aux_scan == scan) {
717 struct ll_scan_set *scan; local
723 scan = CONTAINER_OF(done->param, struct ll_scan_set, ull);
724 lll = &scan->lll;
726 if (likely(scan->duration_lazy || !lll->duration_reload ||
734 handle = ull_scan_handle_get(scan);
739 * the other scan instance.
751 rx = (void *)scan->node_rx_scan_term;
757 scan);
765 struct ll_scan_set *scan; local
767 scan = ull_scan_set_get(handle);
768 LL_ASSERT(scan);
770 scan->is_enabled = 0U;
807 uint8_t ull_scan_handle_get(struct ll_scan_set *scan) argument
809 return ((uint8_t *)scan - (uint8_t *)ll_scan) / sizeof(*scan);
817 struct ll_scan_set *ull_scan_is_valid_get(struct ll_scan_set *scan) argument
819 if (((uint8_t *)scan < (uint8_t *)ll_scan) ||
820 ((uint8_t *)scan > ((uint8_t *)ll_scan +
826 return scan;
831 struct ll_scan_set *scan; local
833 scan = HDR_LLL2ULL(lll);
834 scan = ull_scan_is_valid_get(scan);
835 if (scan) {
836 return &scan->lll;
844 struct ll_scan_set *scan; local
846 scan = ull_scan_set_get(handle);
847 if (!scan || !scan->is_enabled) {
851 return scan;
856 struct ll_scan_set *scan; local
858 scan = ull_scan_set_get(handle);
859 if (!scan || scan->is_enabled) {
863 return scan;
868 struct ll_scan_set *scan; local
870 scan = ull_scan_is_enabled_get(handle);
871 if (!scan) {
873 scan = ull_scan_set_get(handle);
875 return scan->periodic.sync ? ULL_SCAN_IS_SYNC : 0U;
881 return (((uint32_t)scan->is_enabled << scan->lll.type) |
883 (scan->lll.conn ? ULL_SCAN_IS_INITIATOR : 0U) |
886 (scan->periodic.sync ? ULL_SCAN_IS_SYNC : 0U) |
893 struct ll_scan_set *scan; local
895 scan = ull_scan_is_enabled_get(handle);
896 if (!scan) {
900 return scan->lll.filter_policy;
920 struct ll_scan_set *scan; local
927 scan = param;
928 lll = &scan->lll;
931 ref = ull_ref_inc(&scan->ull);
955 if (scan->duration_lazy) {
960 scan->duration_lazy - elapsed;
962 handle = ull_scan_handle_get(scan);
980 handle = ull_scan_handle_get(scan);
998 uint16_t period, struct ll_scan_set **scan, argument
1001 *scan = ull_scan_set_get(handle);
1002 *node_rx_scan_term = (*scan)->node_rx_scan_term;
1003 return duration && period && (*scan)->lll.duration_reload &&
1004 (*scan)->duration_lazy;
1007 static uint8_t duration_period_setup(struct ll_scan_set *scan, argument
1013 lll = &scan->lll;
1017 scan->lll.interval);
1024 scan->duration_lazy =
1026 scan->lll.interval);
1027 scan->duration_lazy -= lll->duration_reload;
1028 scan->node_rx_scan_term = NULL;
1033 scan->duration_lazy = 0U;
1036 scan->node_rx_scan_term = *node_rx_scan_term;
1041 /* The alloc here used for ext scan termination event */
1055 scan->node_rx_scan_term = node_rx;
1060 scan->duration_lazy = 0U;
1061 scan->node_rx_scan_term = NULL;
1067 static uint8_t duration_period_update(struct ll_scan_set *scan, argument
1074 scan->lll.duration_expire = 0U;
1080 ull_scan_handle_get(scan)),
1090 scan->lll.duration_expire = scan->lll.duration_reload;
1118 struct ll_scan_set *scan; local
1122 scan = param;
1123 hdr = &scan->ull;
1129 mfy.param = &scan->lll;
1144 ext_disabled_cb(&scan->lll);
1151 struct ll_scan_set *scan; local
1158 scan = HDR_LLL2ULL(lll);
1159 rx = scan->node_rx_scan_term;
1173 struct ll_scan_set *scan; local
1176 scan = ull_scan_is_enabled_get(handle);
1177 if (!scan) {
1182 if (scan->lll.conn) {
1187 ret = ull_scan_disable(handle, scan);
1192 scan->is_enabled = 0U;
1195 if (scan->node_rx_scan_term) {
1196 struct node_rx_pdu *node_rx_scan_term = scan->node_rx_scan_term;
1198 scan->node_rx_scan_term = NULL;