Lines Matching full:if

46  * 1) I think I can guarantee that we dont process things out of order if
56 #if MYNEWT_VAL(BLE_LL_NUM_SCAN_DUP_ADVS) > 255
59 #if MYNEWT_VAL(BLE_LL_NUM_SCAN_RSP_ADVS) > 255
63 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
65 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY)
149 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
172 if (!scansm->scan_enabled || scansm->cur_aux_data) { in ble_ll_aux_scan_cb()
177 /* Check if there is no aux connect sent. If so drop the sched item */ in ble_ll_aux_scan_cb()
178 if (lls == BLE_LL_STATE_INITIATING && ble_ll_conn_init_pending_aux_conn_rsp()) { in ble_ll_aux_scan_cb()
189 if (lls != BLE_LL_STATE_STANDBY) { in ble_ll_aux_scan_cb()
200 if (ble_ll_scan_start(scansm, sch)) { in ble_ll_aux_scan_cb()
223 if (!e) { in ble_ll_scan_ext_adv_init()
246 if (success) { in ble_ll_scan_req_backoff()
249 if (scansm->scan_rsp_cons_ok == 2) { in ble_ll_scan_req_backoff()
251 if (scansm->upper_limit > 1) { in ble_ll_scan_req_backoff()
259 if (scansm->scan_rsp_cons_fails == 2) { in ble_ll_scan_req_backoff()
261 if (scansm->upper_limit < 256) { in ble_ll_scan_req_backoff()
273 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1)
280 if ((ble_npl_stime_t)(now - scansm->scan_nrpa_timer) >= 0) { in ble_ll_scan_refresh_nrpa()
298 * @param addr_type 0 if public; non-zero if random. This is the addr type of
309 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_req_pdu_make()
316 if (adv_addr_type) { in ble_ll_scan_req_pdu_make()
325 if ((scansm->own_addr_type & 1) == 0) { in ble_ll_scan_req_pdu_make()
332 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_req_pdu_make()
333 if (scansm->own_addr_type > BLE_HCI_ADV_OWN_ADDR_RANDOM) { in ble_ll_scan_req_pdu_make()
335 if (ble_ll_is_rpa(adv_addr, adv_addr_type)) { in ble_ll_scan_req_pdu_make()
336 if (scansm->scan_rpa_index >= 0) { in ble_ll_scan_req_pdu_make()
341 if (ble_ll_resolv_enabled()) { in ble_ll_scan_req_pdu_make()
347 * If advertising device is on our resolving list, we use RPA generated in ble_ll_scan_req_pdu_make()
353 if (rl) { in ble_ll_scan_req_pdu_make()
374 * Checks to see if an advertiser is on the duplicate address list.
391 if (!memcmp(&adv->adv_addr, addr, BLE_DEV_ADDR_LEN)) { in ble_ll_scan_find_dup_adv()
393 if (txadd) { in ble_ll_scan_find_dup_adv()
394 if ((adv->sc_adv_flags & BLE_LL_SC_ADV_F_RANDOM_ADDR) == 0) { in ble_ll_scan_find_dup_adv()
398 if (adv->sc_adv_flags & BLE_LL_SC_ADV_F_RANDOM_ADDR) { in ble_ll_scan_find_dup_adv()
414 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
422 if (!evt) { in ble_ll_scan_init_ext_adv_report()
426 if (copy_from) { in ble_ll_scan_init_ext_adv_report()
453 if (!ble_ll_hci_is_le_event_enabled(BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) { in ble_ll_scan_send_truncated_if_chained()
459 if (!BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_CHAIN_BIT)) { in ble_ll_scan_send_truncated_if_chained()
460 /* if not chained, there is nothing to do here */ in ble_ll_scan_send_truncated_if_chained()
464 if (aux_data->evt) { in ble_ll_scan_send_truncated_if_chained()
469 if (!evt) { in ble_ll_scan_send_truncated_if_chained()
479 if (BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_HAS_ADDRA)) { in ble_ll_scan_send_truncated_if_chained()
484 if (BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_HAS_DIR_ADDRA)) { in ble_ll_scan_send_truncated_if_chained()
500 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_end_adv_evt()
502 * Check if tuncated has been sent in ble_ll_scan_end_adv_evt()
505 * complete event and one for ongoing scanning. If there is only 1 in ble_ll_scan_end_adv_evt()
510 if (!BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_TRUNCATED_SENT)) { in ble_ll_scan_end_adv_evt()
514 if (ble_ll_scan_aux_data_unref(aux_data) > 0) { in ble_ll_scan_end_adv_evt()
527 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_clean_cur_aux_data()
530 /* If scanner was reading aux ptr, we need to clean it up */ in ble_ll_scan_clean_cur_aux_data()
531 if (scansm && scansm->cur_aux_data) { in ble_ll_scan_clean_cur_aux_data()
539 * Check if a packet is a duplicate advertising packet.
552 if (adv) { in ble_ll_scan_is_dup_adv()
554 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_DIRECT_IND) { in ble_ll_scan_is_dup_adv()
555 if (adv->sc_adv_flags & BLE_LL_SC_ADV_F_DIRECT_RPT_SENT) { in ble_ll_scan_is_dup_adv()
558 } else if (pdu_type == BLE_ADV_PDU_TYPE_SCAN_RSP) { in ble_ll_scan_is_dup_adv()
559 if (adv->sc_adv_flags & BLE_LL_SC_ADV_F_SCAN_RSP_SENT) { in ble_ll_scan_is_dup_adv()
563 if (adv->sc_adv_flags & BLE_LL_SC_ADV_F_ADV_RPT_SENT) { in ble_ll_scan_is_dup_adv()
589 /* Check to see if on list. */ in ble_ll_scan_add_dup_adv()
591 if (!adv) { in ble_ll_scan_add_dup_adv()
592 /* XXX: for now, if we dont have room, just leave */ in ble_ll_scan_add_dup_adv()
594 if (num_advs == MYNEWT_VAL(BLE_LL_NUM_SCAN_DUP_ADVS)) { in ble_ll_scan_add_dup_adv()
604 if (txadd) { in ble_ll_scan_add_dup_adv()
609 if (subev == BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT) { in ble_ll_scan_add_dup_adv()
612 if (evtype == BLE_HCI_ADV_RPT_EVTYPE_SCAN_RSP) { in ble_ll_scan_add_dup_adv()
621 * Checks to see if we have received a scan response from this advertiser.
639 if (!memcmp(&adv->adv_addr, addr, BLE_DEV_ADDR_LEN)) { in ble_ll_scan_have_rxd_scan_rsp()
641 if (txadd) { in ble_ll_scan_have_rxd_scan_rsp()
642 if (adv->sc_adv_flags & BLE_LL_SC_ADV_F_RANDOM_ADDR) { in ble_ll_scan_have_rxd_scan_rsp()
643 if (ext_adv) { in ble_ll_scan_have_rxd_scan_rsp()
644 if (adi == adv->adi) { in ble_ll_scan_have_rxd_scan_rsp()
652 if ((adv->sc_adv_flags & BLE_LL_SC_ADV_F_RANDOM_ADDR) == 0) { in ble_ll_scan_have_rxd_scan_rsp()
653 if (ext_adv) { in ble_ll_scan_have_rxd_scan_rsp()
654 if (adi == adv->adi) { in ble_ll_scan_have_rxd_scan_rsp()
678 /* XXX: for now, if we dont have room, just leave */ in ble_ll_scan_add_scan_rsp_adv()
680 if (num_advs == MYNEWT_VAL(BLE_LL_NUM_SCAN_RSP_ADVS)) { in ble_ll_scan_add_scan_rsp_adv()
684 /* Check if address is already on the list */ in ble_ll_scan_add_scan_rsp_adv()
685 if (ble_ll_scan_have_rxd_scan_rsp(addr, txadd, ext_adv, adi)) { in ble_ll_scan_add_scan_rsp_adv()
693 if (txadd) { in ble_ll_scan_add_scan_rsp_adv()
702 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
712 if (!ble_ll_hci_is_le_event_enabled(BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) { in ble_ll_hci_send_legacy_ext_adv_report()
716 /* Drop packet if it does not fit into event buffer */ in ble_ll_hci_send_legacy_ext_adv_report()
717 if ((sizeof(*evt) + adv_data_len) + 1 > MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)) { in ble_ll_hci_send_legacy_ext_adv_report()
723 if (!evt) { in ble_ll_hci_send_legacy_ext_adv_report()
753 if (inita) { in ble_ll_hci_send_legacy_ext_adv_report()
758 } else if (adv_data_len <= (MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE) - sizeof(*evt))) { in ble_ll_hci_send_legacy_ext_adv_report()
780 if (!ble_ll_hci_is_le_event_enabled(subev)) { in ble_ll_hci_send_adv_report()
784 /* Drop packet if it does not fit into event buffer */ in ble_ll_hci_send_adv_report()
785 if (event_len + 1 > MYNEWT_VAL(BLE_HCI_EVT_BUF_SIZE)) { in ble_ll_hci_send_adv_report()
791 if (!evbuf) { in ble_ll_hci_send_adv_report()
804 if (subev == BLE_HCI_LE_SUBEV_DIRECT_ADV_RPT) { in ble_ll_hci_send_adv_report()
809 } else if (subev == BLE_HCI_LE_SUBEV_ADV_RPT) { in ble_ll_hci_send_adv_report()
848 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_DIRECT_IND) { in ble_ll_scan_send_adv_report()
849 if (ble_ll_is_rpa(inita, inita_type)) { in ble_ll_scan_send_adv_report()
862 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_IND) { in ble_ll_scan_send_adv_report()
864 } else if (pdu_type == BLE_ADV_PDU_TYPE_ADV_SCAN_IND) { in ble_ll_scan_send_adv_report()
866 } else if (pdu_type == BLE_ADV_PDU_TYPE_ADV_NONCONN_IND) { in ble_ll_scan_send_adv_report()
877 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) in ble_ll_scan_send_adv_report()
878 if (BLE_MBUF_HDR_RESOLVED(hdr)) { in ble_ll_scan_send_adv_report()
888 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_send_adv_report()
889 if (scansm->ext_scanning) { in ble_ll_scan_send_adv_report()
909 if (!rc) { in ble_ll_scan_send_adv_report()
910 /* If filtering, add it to list of duplicate addresses */ in ble_ll_scan_send_adv_report()
911 if (scansm->scan_filt_dups) { in ble_ll_scan_send_adv_report()
918 * Checks the scanner filter policy to determine if we should allow or discard
945 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_chk_filter_policy()
946 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_EXT_IND && adv_addr == NULL) { in ble_ll_scan_chk_filter_policy()
947 /* Note: adv_addr can be NULL (but don't have to) for ext adv. If NULL in ble_ll_scan_chk_filter_policy()
971 /* If we are using the whitelist, check that first */ in ble_ll_scan_chk_filter_policy()
972 if (use_whitelist && (pdu_type != BLE_ADV_PDU_TYPE_SCAN_RSP)) { in ble_ll_scan_chk_filter_policy()
973 /* If device does not match let us skip this PDU. in ble_ll_scan_chk_filter_policy()
974 * If device matches, lets check for InitA further in the code in ble_ll_scan_chk_filter_policy()
976 if (!devmatch) { in ble_ll_scan_chk_filter_policy()
981 /* If this is a directed advertisement, init_addr is not NULL. in ble_ll_scan_chk_filter_policy()
983 if (init_addr) { in ble_ll_scan_chk_filter_policy()
984 /* Is this for us? If not, is it resolvable */ in ble_ll_scan_chk_filter_policy()
985 if (!ble_ll_is_our_devaddr(init_addr, init_addr_type)) { in ble_ll_scan_chk_filter_policy()
986 if (!chk_inita || !ble_ll_is_rpa(adv_addr, adv_addr_type)) { in ble_ll_scan_chk_filter_policy()
1000 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_get_chan_to_scan()
1003 if (!scansm->ext_scanning || !aux_data || !aux_data->scanning) { in ble_ll_get_chan_to_scan()
1031 #if (BLE_LL_BT5_PHY_SUPPORTED == 1) in ble_ll_scan_start()
1038 /* XXX: right now scheduled item is only present if we schedule for aux in ble_ll_scan_start()
1055 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION) == 1) in ble_ll_scan_start()
1059 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_start()
1060 if (ble_ll_resolv_enabled()) { in ble_ll_scan_start()
1067 #if (BLE_LL_BT5_PHY_SUPPORTED == 1) in ble_ll_scan_start()
1074 if (sch) { in ble_ll_scan_start()
1082 if (!rc || rc == BLE_PHY_ERR_RX_LATE) { in ble_ll_scan_start()
1083 /* If we are late here, it is still OK because we keep scanning. in ble_ll_scan_start()
1089 if (scanphy->scan_filt_policy & 1) { in ble_ll_scan_start()
1096 if (scanphy->scan_type == BLE_SCAN_TYPE_INITIATE) { in ble_ll_scan_start()
1103 /* If there is a still a scan response pending, we have failed! */ in ble_ll_scan_start()
1104 if (scansm->scan_rsp_pending) { in ble_ll_scan_start()
1122 if (ble_ll_sched_next_time(&next_time)) { in ble_ll_scan_rfclk_chk_stop()
1124 * If the time until the next event is too close, dont bother to turn in ble_ll_scan_rfclk_chk_stop()
1128 if (time_till_next > g_ble_ll_data.ll_xtal_ticks) { in ble_ll_scan_rfclk_chk_stop()
1134 if (stop) { in ble_ll_scan_rfclk_chk_stop()
1145 if (chan == BLE_PHY_NUM_CHANS) { in ble_ll_scan_get_next_adv_prim_chan()
1164 /* If we missed scan window, make sure we update scan channel */ in ble_ll_scan_get_current_scan_win()
1172 * Called to determine if we are inside or outside the scan window. If we
1192 if (scanphy->scan_window != scanphy->scan_itvl) { in ble_ll_scan_window_chk()
1195 if (dt >= win) { in ble_ll_scan_window_chk()
1197 if (dt < (scanphy->scan_itvl - g_ble_ll_data.ll_xtal_ticks)) { in ble_ll_scan_window_chk()
1207 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
1211 if (aux_scan) { in ble_ll_scan_aux_data_free()
1212 if (aux_scan->evt) { in ble_ll_scan_aux_data_free()
1226 if (!aux_data) { in ble_ll_scan_aux_data_ref()
1243 if (!aux_data) { in ble_ll_scan_aux_data_unref()
1252 if (aux_data->ref_cnt == 0) { in ble_ll_scan_aux_data_unref()
1285 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_sm_stop()
1296 /* Only set state if we are currently in a scan window */ in ble_ll_scan_sm_stop()
1297 if (chk_disable) { in ble_ll_scan_sm_stop()
1301 if ((lls == BLE_LL_STATE_SCANNING) || in ble_ll_scan_sm_stop()
1323 * command disallowed error if no random address has been sent by the in ble_ll_scan_sm_start()
1328 if (scansm->own_addr_type == BLE_HCI_ADV_OWN_ADDR_RANDOM) { in ble_ll_scan_sm_start()
1329 if (!ble_ll_is_valid_random_addr(g_random_addr)) { in ble_ll_scan_sm_start()
1344 if (scansm->next_phy != PHY_NOT_CONFIGURED && in ble_ll_scan_sm_start()
1368 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
1374 if (scansm->next_phy == PHY_NOT_CONFIGURED) { in ble_ll_scan_switch_phy()
1386 * Called to change PHY if needed and set new event time
1401 /* Lets check if we want to switch to other PHY */ in ble_ll_scan_start_next_phy()
1402 if (scansm->cur_phy == scansm->next_phy || in ble_ll_scan_start_next_phy()
1418 /* Start with new channel only if PHY was scanning already */ in ble_ll_scan_start_next_phy()
1419 if (next_phy->next_event_start != 0) { in ble_ll_scan_start_next_phy()
1468 * Get the scanning state machine. If not enabled (this is possible), just in ble_ll_scan_event_proc()
1475 if (!scansm->scan_enabled) { in ble_ll_scan_event_proc()
1481 if (scansm->cur_aux_data) { in ble_ll_scan_event_proc()
1493 /* Check if we are in scan window */ in ble_ll_scan_event_proc()
1496 if (scanphy->scan_window != scanphy->scan_itvl) { in ble_ll_scan_event_proc()
1509 if (win != 0 && inside_window) { in ble_ll_scan_event_proc()
1515 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_event_proc()
1516 if (inside_window == 0 && in ble_ll_scan_event_proc()
1518 /* Check if we should start next phy. If so let's say we are inside in ble_ll_scan_event_proc()
1526 * If we are not in the standby state it means that the scheduled in ble_ll_scan_event_proc()
1539 if (!inside_window) { in ble_ll_scan_event_proc()
1548 if (!inside_window) { in ble_ll_scan_event_proc()
1559 if (start_scan && inside_window) { in ble_ll_scan_event_proc()
1562 if (xtal_state != BLE_RFCLK_STATE_SETTLED) { in ble_ll_scan_event_proc()
1563 if (xtal_state == BLE_RFCLK_STATE_OFF) { in ble_ll_scan_event_proc()
1570 * Only bother if we have enough time to receive anything in ble_ll_scan_event_proc()
1573 if (win != 0) { in ble_ll_scan_event_proc()
1574 if ((win - dt) <= xtal_ticks) { in ble_ll_scan_event_proc()
1580 * If clock off, start clock. Set next event time to now plus in ble_ll_scan_event_proc()
1583 if (xtal_state == BLE_RFCLK_STATE_OFF) { in ble_ll_scan_event_proc()
1595 if (inside_window == 0) { in ble_ll_scan_event_proc()
1598 * to make sure the rfclock is on. If we are close to being on, in ble_ll_scan_event_proc()
1599 * enable the rfclock. If not, set wakeup time. in ble_ll_scan_event_proc()
1601 if (dt >= (scan_itvl - g_ble_ll_data.ll_xtal_ticks)) { in ble_ll_scan_event_proc()
1602 /* Start the clock if necessary */ in ble_ll_scan_event_proc()
1603 if (start_scan) { in ble_ll_scan_event_proc()
1604 if (ble_ll_xcvr_rfclk_state() == BLE_RFCLK_STATE_OFF) { in ble_ll_scan_event_proc()
1611 if (start_scan) { in ble_ll_scan_event_proc()
1651 /* If adv ind or scan ind, we may send scan request */ in ble_ll_scan_rx_isr_start()
1652 if ((pdu_type == BLE_ADV_PDU_TYPE_ADV_IND) || in ble_ll_scan_rx_isr_start()
1657 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_start()
1658 if ((pdu_type == BLE_ADV_PDU_TYPE_ADV_EXT_IND && scansm->ext_scanning)) { in ble_ll_scan_rx_isr_start()
1665 * If this is the first PDU after we sent the scan response (as in ble_ll_scan_rx_isr_start()
1667 * header so the link layer can check to see if the scan request in ble_ll_scan_rx_isr_start()
1669 * work for successful scan requests. If failed, we do the work here. in ble_ll_scan_rx_isr_start()
1671 if (scansm->scan_rsp_pending) { in ble_ll_scan_rx_isr_start()
1672 if (pdu_type == BLE_ADV_PDU_TYPE_SCAN_RSP) { in ble_ll_scan_rx_isr_start()
1674 } else if (pdu_type == BLE_ADV_PDU_TYPE_AUX_SCAN_RSP) { in ble_ll_scan_rx_isr_start()
1678 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_start()
1684 if (scansm->cur_aux_data && !scansm->scan_rsp_pending ) { in ble_ll_scan_rx_isr_start()
1688 /* Disable wfr if running */ in ble_ll_scan_rx_isr_start()
1699 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
1721 if (aux_data->chan >= BLE_PHY_NUM_DATA_CHANS) { in ble_ll_ext_scan_parse_aux_ptr()
1729 if ((aux_ptr_field >> 7) & 0x01) { in ble_ll_ext_scan_parse_aux_ptr()
1734 if (aux_data->offset < BLE_LL_MAFS) { in ble_ll_ext_scan_parse_aux_ptr()
1740 if (aux_data->aux_phy == 0) { in ble_ll_ext_scan_parse_aux_ptr()
1793 if (pdu_len == 0) { in ble_ll_scan_get_aux_data()
1800 if (ext_hdr_len < BLE_LL_EXT_ADV_AUX_PTR_SIZE && !ble_hdr->rxinfo.user_data) { in ble_ll_scan_get_aux_data()
1809 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_ADVA_BIT)) { in ble_ll_scan_get_aux_data()
1817 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_TARGETA_BIT)) { in ble_ll_scan_get_aux_data()
1825 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_RFU_BIT)) { in ble_ll_scan_get_aux_data()
1829 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_DATA_INFO_BIT)) { in ble_ll_scan_get_aux_data()
1835 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_AUX_PTR_BIT)) { in ble_ll_scan_get_aux_data()
1837 if (ble_ll_ext_scan_parse_aux_ptr(&tmp_aux_data, ext_hdr + i) < 0) { in ble_ll_scan_get_aux_data()
1841 if (current_aux) { in ble_ll_scan_get_aux_data()
1842 /* If we are here that means there is chain advertising. */ in ble_ll_scan_get_aux_data()
1848 if (!(new_aux->evt_type & (BLE_HCI_ADV_SCAN_MASK)) in ble_ll_scan_get_aux_data()
1857 if (ble_ll_scan_ext_adv_init(&new_aux) < 0) { in ble_ll_scan_get_aux_data()
1865 if (!current_aux) { in ble_ll_scan_get_aux_data()
1882 if (!current_aux) { in ble_ll_scan_get_aux_data()
1887 /*If there is no new aux ptr, just get current one */ in ble_ll_scan_get_aux_data()
1897 if (has_adi) { in ble_ll_scan_get_aux_data()
1902 if (has_addr) { in ble_ll_scan_get_aux_data()
1908 if (has_dir_addr) { in ble_ll_scan_get_aux_data()
1944 if (!out_evt) { in ble_ll_scan_parse_ext_hdr()
1950 if (!scansm->ext_scanning) { in ble_ll_scan_parse_ext_hdr()
1951 /* Ignore ext adv if host does not want it*/ in ble_ll_scan_parse_ext_hdr()
1956 if (pdu_len == 0) { in ble_ll_scan_parse_ext_hdr()
1961 if (out_evt->evt_type > BLE_LL_EXT_ADV_MODE_SCAN) { in ble_ll_scan_parse_ext_hdr()
1965 if (BLE_MBUF_HDR_SCAN_RSP_RCV(ble_hdr)) { in ble_ll_scan_parse_ext_hdr()
1976 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_ADVA_BIT)) { in ble_ll_scan_parse_ext_hdr()
1980 if (adva) { in ble_ll_scan_parse_ext_hdr()
1985 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_TARGETA_BIT)) { in ble_ll_scan_parse_ext_hdr()
1989 if (inita) { in ble_ll_scan_parse_ext_hdr()
1995 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_RFU_BIT)) { in ble_ll_scan_parse_ext_hdr()
2000 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_DATA_INFO_BIT)) { in ble_ll_scan_parse_ext_hdr()
2003 } else if (out_evt->evt_type & BLE_HCI_ADV_SCAN_RSP_MASK) { in ble_ll_scan_parse_ext_hdr()
2008 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_AUX_PTR_BIT)) { in ble_ll_scan_parse_ext_hdr()
2012 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_SYNC_INFO_BIT)) { in ble_ll_scan_parse_ext_hdr()
2017 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_TX_POWER_BIT)) { in ble_ll_scan_parse_ext_hdr()
2022 /* Skip ADAC if it is there */ in ble_ll_scan_parse_ext_hdr()
2028 if (!aux_data) { in ble_ll_scan_parse_ext_hdr()
2064 if (pdu_len == 0) { in ble_ll_scan_get_addr_from_ext_adv()
2069 if (*ext_mode > BLE_LL_EXT_ADV_MODE_SCAN) { in ble_ll_scan_get_addr_from_ext_adv()
2073 if (aux_data) { in ble_ll_scan_get_addr_from_ext_adv()
2074 /* If address has been provided, we do have it already in aux_data.*/ in ble_ll_scan_get_addr_from_ext_adv()
2075 if (aux_data->flags & BLE_LL_AUX_HAS_ADDRA) { in ble_ll_scan_get_addr_from_ext_adv()
2080 if (!inita) { in ble_ll_scan_get_addr_from_ext_adv()
2084 if (aux_data->flags & BLE_LL_AUX_HAS_DIR_ADDRA) { in ble_ll_scan_get_addr_from_ext_adv()
2092 /* If this is just becon with no aux data, lets get address from the packet */ in ble_ll_scan_get_addr_from_ext_adv()
2100 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_ADVA_BIT)) { in ble_ll_scan_get_addr_from_ext_adv()
2101 if (ext_hdr_len < BLE_LL_EXT_ADV_ADVA_SIZE) { in ble_ll_scan_get_addr_from_ext_adv()
2111 if (!inita) { in ble_ll_scan_get_addr_from_ext_adv()
2115 if (ext_hdr_flags & (1 << BLE_LL_EXT_ADV_TARGETA_BIT)) { in ble_ll_scan_get_addr_from_ext_adv()
2128 if (!aux_data) { in ble_ll_scan_get_adi()
2132 if (!BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_HAS_ADI)) { in ble_ll_scan_get_adi()
2149 if (pdu_type != BLE_ADV_PDU_TYPE_ADV_EXT_IND && in ble_ll_scan_adv_decode_addr()
2155 if (!inita) { in ble_ll_scan_adv_decode_addr()
2159 if (pdu_type != BLE_ADV_PDU_TYPE_ADV_DIRECT_IND) { in ble_ll_scan_adv_decode_addr()
2172 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_adv_decode_addr()
2173 if (ble_ll_scan_get_addr_from_ext_adv(rxbuf, ble_hdr, addr, addr_type, in ble_ll_scan_adv_decode_addr()
2214 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2229 if (rxpdu == NULL) { in ble_ll_scan_rx_isr_end()
2230 if (scansm->scan_rsp_pending) { in ble_ll_scan_rx_isr_end()
2232 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2244 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2245 if (scansm->cur_aux_data) { in ble_ll_scan_rx_isr_end()
2248 if (ble_ll_scan_aux_data_unref(ble_hdr->rxinfo.user_data) == 0) { in ble_ll_scan_rx_isr_end()
2256 /* Just leave if the CRC is not OK. */ in ble_ll_scan_rx_isr_end()
2257 if (!crcok) { in ble_ll_scan_rx_isr_end()
2258 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2268 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2269 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_EXT_IND) { in ble_ll_scan_rx_isr_end()
2270 if (!scansm->ext_scanning) { in ble_ll_scan_rx_isr_end()
2275 if (rc < 0) { in ble_ll_scan_rx_isr_end()
2281 if (rc == 0) { in ble_ll_scan_rx_isr_end()
2291 if (ble_ll_scan_adv_decode_addr(pdu_type, rxbuf, ble_hdr, in ble_ll_scan_rx_isr_end()
2297 /* Determine if request may be sent and if whitelist needs to be checked */ in ble_ll_scan_rx_isr_end()
2300 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2302 if (!peer) { in ble_ll_scan_rx_isr_end()
2307 if ((ext_adv_mode == BLE_LL_EXT_ADV_MODE_SCAN) && in ble_ll_scan_rx_isr_end()
2316 if (scanphy->scan_type == BLE_SCAN_TYPE_ACTIVE) { in ble_ll_scan_rx_isr_end()
2336 if ((scanphy->scan_filt_policy & 1) == 0) { in ble_ll_scan_rx_isr_end()
2342 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_rx_isr_end()
2343 if (ble_ll_is_rpa(peer, peer_addr_type) && ble_ll_resolv_enabled()) { in ble_ll_scan_rx_isr_end()
2345 if (index >= 0) { in ble_ll_scan_rx_isr_end()
2351 if (chk_wl) { in ble_ll_scan_rx_isr_end()
2359 /* If whitelist enabled, check to see if device is in the white list */ in ble_ll_scan_rx_isr_end()
2360 if (chk_wl && !ble_ll_whitelist_match(peer, peer_addr_type, resolved)) { in ble_ll_scan_rx_isr_end()
2366 if (chk_send_req) { in ble_ll_scan_rx_isr_end()
2367 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2368 if (pdu_type == BLE_ADV_PDU_TYPE_ADV_EXT_IND) { in ble_ll_scan_rx_isr_end()
2369 if (ble_ll_scan_get_adi(ble_hdr->rxinfo.user_data, &adi) < 0) { in ble_ll_scan_rx_isr_end()
2375 if (ble_ll_scan_have_rxd_scan_rsp(peer, peer_addr_type, 1, adi)) { in ble_ll_scan_rx_isr_end()
2379 /* Dont send scan request if we have sent one to this advertiser */ in ble_ll_scan_rx_isr_end()
2380 if (ble_ll_scan_have_rxd_scan_rsp(peer, peer_addr_type, 0, 0)) { in ble_ll_scan_rx_isr_end()
2385 /* Dont send scan request if we have sent one to this advertiser */ in ble_ll_scan_rx_isr_end()
2386 if (ble_ll_scan_have_rxd_scan_rsp(peer, peer_addr_type, 0, 0)) { in ble_ll_scan_rx_isr_end()
2393 /* We want to send a request. See if backoff allows us */ in ble_ll_scan_rx_isr_end()
2395 if (scansm->backoff_count == 0) { in ble_ll_scan_rx_isr_end()
2396 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2399 if (ble_ll_sched_scan_req_over_aux_ptr(ble_hdr->rxinfo.channel, in ble_ll_scan_rx_isr_end()
2409 if (rc == 0) { in ble_ll_scan_rx_isr_end()
2412 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2413 if (ble_hdr->rxinfo.channel < BLE_PHY_NUM_DATA_CHANS) { in ble_ll_scan_rx_isr_end()
2425 if (rc) { in ble_ll_scan_rx_isr_end()
2428 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_isr_end()
2430 if (ble_hdr->rxinfo.user_data) { in ble_ll_scan_rx_isr_end()
2439 * connection event has ended. It is also called if we receive a packet while
2451 if (scansm->scan_enabled) { in ble_ll_scan_chk_resume()
2453 if (scansm->restart_timer_needed) { in ble_ll_scan_chk_resume()
2461 if (ble_ll_state_get() == BLE_LL_STATE_STANDBY && in ble_ll_scan_chk_resume()
2499 * If we timed out waiting for a response, the scan response pending in ble_ll_scan_wfr_timer_exp()
2503 if (scansm->scan_rsp_pending) { in ble_ll_scan_wfr_timer_exp()
2505 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_wfr_timer_exp()
2511 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_wfr_timer_exp()
2512 if (scansm->cur_aux_data) { in ble_ll_scan_wfr_timer_exp()
2523 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
2546 if (!ble_ll_hci_is_le_event_enabled(BLE_HCI_LE_SUBEV_EXT_ADV_RPT)) { in ble_ll_hci_send_ext_adv_report()
2553 * properly in case of error. If there is no event in aux_data it means this in ble_ll_hci_send_ext_adv_report()
2556 if (aux_data && aux_data->evt) { in ble_ll_hci_send_ext_adv_report()
2561 if (!evt) { in ble_ll_hci_send_ext_adv_report()
2568 if (datalen < 0) { in ble_ll_hci_send_ext_adv_report()
2592 if (offset < datalen) { in ble_ll_hci_send_ext_adv_report()
2595 } else if (aux_data && BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_INCOMPLETE_ERR_BIT)) { in ble_ll_hci_send_ext_adv_report()
2597 } else if (aux_data && BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_INCOMPLETE_BIT)) { in ble_ll_hci_send_ext_adv_report()
2605 if (need_event) { in ble_ll_hci_send_ext_adv_report()
2607 * We will need another event so let's try to allocate one now. If in ble_ll_hci_send_ext_adv_report()
2612 if (next_evt) { in ble_ll_hci_send_ext_adv_report()
2619 } else if (aux_data ) { in ble_ll_hci_send_ext_adv_report()
2620 if (BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_INCOMPLETE_ERR_BIT)) { in ble_ll_hci_send_ext_adv_report()
2623 } else if (BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_INCOMPLETE_BIT)) { in ble_ll_hci_send_ext_adv_report()
2639 if (aux_data){ in ble_ll_hci_send_ext_adv_report()
2643 /* If it is empty beacon, evt shall be NULL */ in ble_ll_hci_send_ext_adv_report()
2648 /* If advertising event is completed or failed, we can drop the reference */ in ble_ll_hci_send_ext_adv_report()
2649 if (rc <= 0) { in ble_ll_hci_send_ext_adv_report()
2650 if (aux_data){ in ble_ll_hci_send_ext_adv_report()
2651 if ((rc == 0) && (aux_data->evt_type & BLE_HCI_ADV_SCAN_RSP_MASK)) { in ble_ll_hci_send_ext_adv_report()
2674 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) in ble_ll_scan_rx_pkt_in()
2691 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2701 if (!BLE_MBUF_HDR_CRC_OK(hdr)) { in ble_ll_scan_rx_pkt_in()
2702 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2703 if (BLE_MBUF_HDR_AUX_INVALID(hdr)) { in ble_ll_scan_rx_pkt_in()
2710 if ((ptype == BLE_ADV_PDU_TYPE_SCAN_REQ) || (ptype == BLE_ADV_PDU_TYPE_CONNECT_REQ)) { in ble_ll_scan_rx_pkt_in()
2714 if (ble_ll_scan_adv_decode_addr(ptype, rxbuf, hdr, in ble_ll_scan_rx_pkt_in()
2718 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2727 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_rx_pkt_in()
2729 if (index >= 0) { in ble_ll_scan_rx_pkt_in()
2733 if (ble_ll_is_rpa(init_addr, init_addr_type)) { in ble_ll_scan_rx_pkt_in()
2735 if (ble_ll_resolv_rpa(init_addr, g_ble_ll_resolv_list[index].rl_local_irk)) { in ble_ll_scan_rx_pkt_in()
2740 } else if (init_addr && ble_ll_resolv_enabled() && ble_ll_is_rpa(init_addr, init_addr_type)) { in ble_ll_scan_rx_pkt_in()
2741 /* If we are here it means AdvA is identity. Check if initA is RPA */ in ble_ll_scan_rx_pkt_in()
2743 if (rl && ble_ll_resolv_rpa(init_addr, rl->rl_local_irk)) { in ble_ll_scan_rx_pkt_in()
2751 if (ble_ll_scan_chk_filter_policy(ptype, adv_addr, txadd, init_addr, in ble_ll_scan_rx_pkt_in()
2754 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2761 * XXX: The BLE spec is a bit unclear here. What if we get a scan in ble_ll_scan_rx_pkt_in()
2766 if (ptype == BLE_ADV_PDU_TYPE_SCAN_RSP) { in ble_ll_scan_rx_pkt_in()
2768 * If this is a scan response in reply to a request we sent we need in ble_ll_scan_rx_pkt_in()
2771 if (scansm->scan_rsp_pending && scan_rsp_chk) { in ble_ll_scan_rx_pkt_in()
2780 if (((txadd && rxadd) || ((txadd + rxadd) == 0)) && in ble_ll_scan_rx_pkt_in()
2789 /* Ignore if this is not ours */ in ble_ll_scan_rx_pkt_in()
2795 if (scansm->scan_filt_dups) { in ble_ll_scan_rx_pkt_in()
2796 if (ble_ll_scan_is_dup_adv(ptype, ident_addr_type, ident_addr)) { in ble_ll_scan_rx_pkt_in()
2797 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2798 if (ptype == BLE_ADV_PDU_TYPE_ADV_EXT_IND) { in ble_ll_scan_rx_pkt_in()
2806 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2807 if (ptype == BLE_ADV_PDU_TYPE_ADV_EXT_IND) { in ble_ll_scan_rx_pkt_in()
2808 if (!scansm->ext_scanning) { in ble_ll_scan_rx_pkt_in()
2813 if (BLE_MBUF_HDR_AUX_INVALID(hdr)) { in ble_ll_scan_rx_pkt_in()
2818 /* If it is ignore it means event is already truncated, just unref aux */ in ble_ll_scan_rx_pkt_in()
2819 if (aux_data && BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_IGNORE_BIT)) { in ble_ll_scan_rx_pkt_in()
2824 /* Let's see if that packet contains aux ptr*/ in ble_ll_scan_rx_pkt_in()
2825 if (BLE_MBUF_HDR_WAIT_AUX(hdr)) { in ble_ll_scan_rx_pkt_in()
2827 if (ble_ll_sched_aux_scan(hdr, scansm, hdr->rxinfo.user_data)) { in ble_ll_scan_rx_pkt_in()
2833 * below if we failed to schedule for the very first aux packet. in ble_ll_scan_rx_pkt_in()
2841 * If this is ext adv, there is nothing to do here but just leave and wait in ble_ll_scan_rx_pkt_in()
2842 * for aux packet. However, if we was not able to schedule for first aux packet, in ble_ll_scan_rx_pkt_in()
2845 if (!BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_CHAIN_BIT)) { in ble_ll_scan_rx_pkt_in()
2846 if (BLE_LL_CHECK_AUX_FLAG(aux_data, BLE_LL_AUX_INCOMPLETE_ERR_BIT)) { in ble_ll_scan_rx_pkt_in()
2859 if (rc < 0) { in ble_ll_scan_rx_pkt_in()
2865 if (BLE_MBUF_HDR_WAIT_AUX(hdr)) { in ble_ll_scan_rx_pkt_in()
2867 if (ble_ll_sched_rmv_elem(&aux_data->sch) == 0) { in ble_ll_scan_rx_pkt_in()
2877 if (scansm->scan_rsp_pending) { in ble_ll_scan_rx_pkt_in()
2878 if (!scan_rsp_chk) { in ble_ll_scan_rx_pkt_in()
2906 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_rx_pkt_in()
2907 if (aux_data) { in ble_ll_scan_rx_pkt_in()
2908 if (evt_possibly_truncated) { in ble_ll_scan_rx_pkt_in()
2917 * If the scan response check bit is set and we are pending a response, in ble_ll_scan_rx_pkt_in()
2919 * pending flag if we received a valid response in ble_ll_scan_rx_pkt_in()
2921 if (scansm->scan_rsp_pending && scan_rsp_chk) { in ble_ll_scan_rx_pkt_in()
2939 /* If already enabled, we return an error */ in ble_ll_scan_set_scan_params()
2941 if (scansm->scan_enabled) { in ble_ll_scan_set_scan_params()
2953 if ((scan_type != BLE_HCI_SCAN_TYPE_PASSIVE) && in ble_ll_scan_set_scan_params()
2959 if ((scan_itvl < BLE_HCI_SCAN_ITVL_MIN) || in ble_ll_scan_set_scan_params()
2968 if (own_addr_type > BLE_HCI_ADV_OWN_ADDR_MAX) { in ble_ll_scan_set_scan_params()
2973 if (filter_policy > BLE_HCI_SCAN_FILT_MAX) { in ble_ll_scan_set_scan_params()
2986 #if (BLE_LL_SCAN_PHY_NUMBER == 2) in ble_ll_scan_set_scan_params()
2993 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
2998 if ((type != BLE_HCI_SCAN_TYPE_PASSIVE) && in ble_ll_check_scan_params()
3004 if ((itvl < BLE_HCI_SCAN_ITVL_MIN) || in ble_ll_check_scan_params()
3024 if (cmdlen < 3) { in ble_ll_set_ext_scan_params()
3028 /* If already enabled, we return an error */ in ble_ll_set_ext_scan_params()
3029 if (g_ble_ll_scan_sm.scan_enabled) { in ble_ll_set_ext_scan_params()
3034 if (cmd[0] > BLE_HCI_ADV_OWN_ADDR_MAX) { in ble_ll_set_ext_scan_params()
3042 if (cmd[1] > BLE_HCI_SCAN_FILT_MAX) { in ble_ll_set_ext_scan_params()
3049 /* Check if no reserved bits in PHYS are set and that at least one valid PHY in ble_ll_set_ext_scan_params()
3052 if (!(cmd[2] & ble_ll_valid_scan_phy_mask) || in ble_ll_set_ext_scan_params()
3058 if (cmd[2] & BLE_HCI_LE_PHY_1M_PREF_MASK) { in ble_ll_set_ext_scan_params()
3059 if (cmdlen < idx + 5) { in ble_ll_set_ext_scan_params()
3073 if (rc) { in ble_ll_set_ext_scan_params()
3081 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_CODED_PHY) in ble_ll_set_ext_scan_params()
3082 if (cmd[2] & BLE_HCI_LE_PHY_CODED_PREF_MASK) { in ble_ll_set_ext_scan_params()
3083 if (cmdlen < idx + 5) { in ble_ll_set_ext_scan_params()
3097 if (rc) { in ble_ll_set_ext_scan_params()
3106 /* If host requests continuous scan for 2 PHYs, we double scan interval in ble_ll_set_ext_scan_params()
3109 if ((coded->configured && uncoded->configured) && in ble_ll_set_ext_scan_params()
3125 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
3136 if (scansm->duration_ticks) { in ble_ll_scan_duration_period_timers_restart()
3140 if (scansm->period_ticks) { in ble_ll_scan_duration_period_timers_restart()
3156 /* if period is set both timers get started from period cb */ in ble_ll_scan_duration_timer_cb()
3157 if (!scansm->period_ticks) { in ble_ll_scan_duration_timer_cb()
3170 * if it failed will restart in next period in ble_ll_scan_period_timer_cb()
3197 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_set_enable()
3207 if ((filter_dups > 1) || (enable > 1)) { in ble_ll_scan_set_enable()
3213 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_set_enable()
3217 if (ext) { in ble_ll_scan_set_enable()
3221 if (dur) { in ble_ll_scan_set_enable()
3230 if (period > 3355) { in ble_ll_scan_set_enable()
3238 if (dur_ticks && period_ticks && (dur_ticks >= period_ticks)) { in ble_ll_scan_set_enable()
3245 if (!enable) { in ble_ll_scan_set_enable()
3246 if (scansm->scan_enabled) { in ble_ll_scan_set_enable()
3249 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_set_enable()
3257 /* if already enable we just need to update parameters */ in ble_ll_scan_set_enable()
3258 if (scansm->scan_enabled) { in ble_ll_scan_set_enable()
3262 if (scanphy->configured && in ble_ll_scan_set_enable()
3271 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_set_enable()
3293 if (!scanp->configured) { in ble_ll_scan_set_enable()
3304 if (scansm->cur_phy == PHY_NOT_CONFIGURED) { in ble_ll_scan_set_enable()
3317 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_set_enable()
3318 if (rc == BLE_ERR_SUCCESS) { in ble_ll_scan_set_enable()
3329 * Checks if controller can change the whitelist. If scanning is enabled and
3343 if (scansm->scan_enabled && (params->scan_filt_policy & 1)) { in ble_ll_scan_can_chg_whitelist()
3362 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_initiator_start()
3375 if (sm == NULL) { in ble_ll_scan_initiator_start()
3379 if (rc == BLE_ERR_SUCCESS) { in ble_ll_scan_initiator_start()
3388 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV)
3405 if (hcc->init_phy_mask & BLE_PHY_MASK_1M) { in ble_ll_scan_ext_initiator_start()
3416 if (hcc->init_phy_mask & BLE_PHY_MASK_CODED) { in ble_ll_scan_ext_initiator_start()
3424 if (scansm->cur_phy == PHY_NOT_CONFIGURED) { in ble_ll_scan_ext_initiator_start()
3431 /* If host request for continuous scan if 2 PHYs are requested, we split in ble_ll_scan_ext_initiator_start()
3434 if ((scansm->next_phy != PHY_NOT_CONFIGURED) && in ble_ll_scan_ext_initiator_start()
3444 if (sm == NULL) { in ble_ll_scan_ext_initiator_start()
3448 if (rc == BLE_ERR_SUCCESS) { in ble_ll_scan_ext_initiator_start()
3459 * Checks to see if the scanner is enabled.
3531 /* Returns true if whitelist is enabled for scanning */
3566 #if (BLE_LL_SCAN_PHY_NUMBER == 2) in ble_ll_scan_common_init()
3570 #if (MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_PRIVACY) == 1) in ble_ll_scan_common_init()
3571 /* Make sure we'll generate new NRPA if necessary */ in ble_ll_scan_common_init()
3579 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_common_init()
3605 /* If enabled, stop it. */ in ble_ll_scan_reset()
3606 if (scansm->scan_enabled) { in ble_ll_scan_reset()
3611 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_reset()
3626 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_reset()
3644 #if MYNEWT_VAL(BLE_LL_CFG_FEAT_LL_EXT_ADV) in ble_ll_scan_init()