Lines Matching refs:p_inq

130 static void         btm_initiate_inquiry (tBTM_INQUIRY_VAR_ST *p_inq);
461 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_SetPeriodicInquiryMode() local
473 if (p_inq->inq_active || p_inq->inqfilt_active) in BTM_SetPeriodicInquiryMode()
496 p_inq->inqparms = *p_inqparms; in BTM_SetPeriodicInquiryMode()
497 p_inq->per_min_delay = min_delay; in BTM_SetPeriodicInquiryMode()
498 p_inq->per_max_delay = max_delay; in BTM_SetPeriodicInquiryMode()
499 p_inq->inq_cmpl_info.num_resp = 0; /* Clear the results counter */ in BTM_SetPeriodicInquiryMode()
500 p_inq->p_inq_results_cb = p_results_cb; in BTM_SetPeriodicInquiryMode()
502 p_inq->inq_active = (UINT8)((p_inqparms->mode == BTM_LIMITED_INQUIRY) ? in BTM_SetPeriodicInquiryMode()
512 p_inq->state = BTM_INQ_CLR_FILT_STATE; in BTM_SetPeriodicInquiryMode()
516 p_inq->state = BTM_INQ_SET_FILT_STATE; in BTM_SetPeriodicInquiryMode()
522 p_inq->p_inq_results_cb = NULL; in BTM_SetPeriodicInquiryMode()
523 p_inq->state = BTM_INQ_INACTIVE_STATE; in BTM_SetPeriodicInquiryMode()
545 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_CancelPeriodicInquiry() local
564 if(p_inq->inqfilt_active) in BTM_CancelPeriodicInquiry()
565 p_inq->pending_filt_complete_event++; in BTM_CancelPeriodicInquiry()
567 p_inq->inqfilt_active = FALSE; in BTM_CancelPeriodicInquiry()
568 p_inq->inq_counter++; in BTM_CancelPeriodicInquiry()
591 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_SetConnectability() local
602 p_inq->connectable_mode &= (~BTM_BLE_CONNECTABLE_MASK); in BTM_SetConnectability()
603 p_inq->connectable_mode |= (page_mode & BTM_BLE_CONNECTABLE_MASK); in BTM_SetConnectability()
643 if ((window != p_inq->page_scan_window) || in BTM_SetConnectability()
644 (interval != p_inq->page_scan_period)) in BTM_SetConnectability()
646 p_inq->page_scan_window = window; in BTM_SetConnectability()
647 p_inq->page_scan_period = interval; in BTM_SetConnectability()
653 if (p_inq->discoverable_mode & BTM_DISCOVERABLE_MASK) in BTM_SetConnectability()
658 p_inq->connectable_mode &= (~BTM_CONNECTABLE_MASK); in BTM_SetConnectability()
659 p_inq->connectable_mode |= page_mode; in BTM_SetConnectability()
729 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_CancelInquiry() local
731 UINT8 active_mode=p_inq->inq_active; in BTM_CancelInquiry()
740 if ((p_inq->inq_active &BTM_INQUIRY_ACTIVE_MASK) != 0 && in BTM_CancelInquiry()
741 (!(p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE))) in BTM_CancelInquiry()
743 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in BTM_CancelInquiry()
744 p_inq->state = BTM_INQ_INACTIVE_STATE; in BTM_CancelInquiry()
745 p_inq->p_inq_results_cb = (tBTM_INQ_RESULTS_CB *) NULL; /* Do not notify caller anymore */ in BTM_CancelInquiry()
746 p_inq->p_inq_cmpl_cb = (tBTM_CMPL_CB *) NULL; /* Do not notify caller anymore */ in BTM_CancelInquiry()
750 if (p_inq->inqfilt_active) in BTM_CancelInquiry()
752 p_inq->inqfilt_active = FALSE; in BTM_CancelInquiry()
753 p_inq->pending_filt_complete_event++; in BTM_CancelInquiry()
758 if (((p_inq->inqparms.mode & BTM_BR_INQUIRY_MASK) != 0) in BTM_CancelInquiry()
768 if (((p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK) != 0) in BTM_CancelInquiry()
782 p_inq->inq_counter++; in BTM_CancelInquiry()
823 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_StartInquiry() local
831 if (p_inq->inq_active || p_inq->inqfilt_active) in BTM_StartInquiry()
835 if(p_inq->scan_type==INQ_LE_OBSERVE && p_inq->p_inq_ble_results_cb!=NULL) in BTM_StartInquiry()
838 p_inq->scan_type = INQ_GENERAL; in BTM_StartInquiry()
839 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in BTM_StartInquiry()
851 p_inq->scan_type = INQ_GENERAL; in BTM_StartInquiry()
867 if(p_inq->next_state==BTM_FINISH) in BTM_StartInquiry()
873 p_inq->inqparms = *p_inqparms; in BTM_StartInquiry()
876 p_inq->state = BTM_INQ_ACTIVE_STATE; in BTM_StartInquiry()
877 p_inq->p_inq_cmpl_cb = p_cmpl_cb; in BTM_StartInquiry()
878 p_inq->p_inq_results_cb = p_results_cb; in BTM_StartInquiry()
879 p_inq->inq_cmpl_info.num_resp = 0; /* Clear the results counter */ in BTM_StartInquiry()
880 p_inq->inq_active = p_inqparms->mode; in BTM_StartInquiry()
882 BTM_TRACE_DEBUG("BTM_StartInquiry: p_inq->inq_active = 0x%02x", p_inq->inq_active); in BTM_StartInquiry()
891 p_inqparms->duration=p_inqparms->intl_duration[p_inq->next_state]; in BTM_StartInquiry()
892 p_inq->inqparms.duration=p_inqparms->duration; in BTM_StartInquiry()
897 p_inq->next_state=BTM_NO_INTERLEAVING; in BTM_StartInquiry()
907 &&(p_inq->next_state==BTM_BLE_ONE || p_inq->next_state==BTM_BLE_TWO || in BTM_StartInquiry()
908 p_inq->next_state==BTM_NO_INTERLEAVING) in BTM_StartInquiry()
914 p_inq->inq_active = (p_inqparms->mode & BTM_BLE_INQUIRY_MASK); in BTM_StartInquiry()
920 p_inq->inqparms.mode &= ~ BTM_BLE_INQUIRY_MASK; in BTM_StartInquiry()
928 p_inq->inqparms.mode &= ~ BTM_BLE_INQUIRY_MASK; in BTM_StartInquiry()
935 if(p_inq->next_state==BTM_NO_INTERLEAVING) in BTM_StartInquiry()
937 p_inq->next_state=BTM_FINISH; in BTM_StartInquiry()
942 p_inq->next_state+1); in BTM_StartInquiry()
943 p_inq->next_state+=1; in BTM_StartInquiry()
947 p_inq->next_state=BTM_BR_ONE; in BTM_StartInquiry()
964 if((p_inq->next_state==BTM_BR_ONE || p_inq->next_state==BTM_BR_TWO || in BTM_StartInquiry()
965 p_inq->next_state==BTM_NO_INTERLEAVING )) in BTM_StartInquiry()
967 p_inq->inq_active = (p_inqparms->mode & BTM_BR_INQUIRY_MASK); in BTM_StartInquiry()
976 p_inq->state = BTM_INQ_SET_FILT_STATE; in BTM_StartInquiry()
983 p_inq->state = BTM_INQ_CLR_FILT_STATE; in BTM_StartInquiry()
995 p_inq->state = BTM_INQ_INACTIVE_STATE; in BTM_StartInquiry()
998 if (p_inq->next_state==BTM_NO_INTERLEAVING) in BTM_StartInquiry()
999 p_inq->next_state=BTM_FINISH; in BTM_StartInquiry()
1003 p_inq->next_state+1); in BTM_StartInquiry()
1004 p_inq->next_state+=1; in BTM_StartInquiry()
1013 p_inq->next_state=BTM_BR_ONE; in BTM_StartInquiry()
1091 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_CancelRemoteDeviceName() local
1096 if (p_inq->remname_active) in BTM_CancelRemoteDeviceName()
1099 if (BTM_UseLeLink(p_inq->remname_bda)) in BTM_CancelRemoteDeviceName()
1101 if (btm_ble_cancel_remote_name(p_inq->remname_bda)) in BTM_CancelRemoteDeviceName()
1108 if (btsnd_hcic_rmt_name_req_cancel (p_inq->remname_bda)) in BTM_CancelRemoteDeviceName()
1220 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in BTM_ClearInqDb() local
1223 if (p_inq->inq_active != BTM_INQUIRY_INACTIVE || in BTM_ClearInqDb()
1224 p_inq->inqfilt_active) in BTM_ClearInqDb()
1283 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_inq_db_reset() local
1288 btu_stop_timer (&p_inq->inq_timer_ent); in btm_inq_db_reset()
1291 if (p_inq->inq_active != BTM_INQUIRY_INACTIVE) in btm_inq_db_reset()
1293 temp_inq_active = p_inq->inq_active; /* Save so state can change BEFORE in btm_inq_db_reset()
1295 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in btm_inq_db_reset()
1301 if (p_inq->p_inq_cmpl_cb) in btm_inq_db_reset()
1304 (*p_inq->p_inq_cmpl_cb)(&num_responses); in btm_inq_db_reset()
1310 if (p_inq->remname_active ) in btm_inq_db_reset()
1312 btu_stop_timer (&p_inq->rmt_name_timer_ent); in btm_inq_db_reset()
1313 p_inq->remname_active = FALSE; in btm_inq_db_reset()
1314 memset(p_inq->remname_bda, 0, BD_ADDR_LEN); in btm_inq_db_reset()
1316 if (p_inq->p_remname_cmpl_cb) in btm_inq_db_reset()
1320 (*p_inq->p_remname_cmpl_cb)(&rem_name); in btm_inq_db_reset()
1321 p_inq->p_remname_cmpl_cb = NULL; in btm_inq_db_reset()
1326 if (p_inq->inqfilt_active) in btm_inq_db_reset()
1328 p_inq->inqfilt_active = FALSE; in btm_inq_db_reset()
1330 if (p_inq->p_inqfilter_cmpl_cb) in btm_inq_db_reset()
1333 (*p_inq->p_inqfilter_cmpl_cb)(&status); in btm_inq_db_reset()
1337 p_inq->state = BTM_INQ_INACTIVE_STATE; in btm_inq_db_reset()
1338 p_inq->pending_filt_complete_event = 0; in btm_inq_db_reset()
1339 p_inq->p_inq_results_cb = NULL; in btm_inq_db_reset()
1343 p_inq->discoverable_mode = BTM_NON_DISCOVERABLE; in btm_inq_db_reset()
1344 p_inq->connectable_mode = BTM_NON_CONNECTABLE; in btm_inq_db_reset()
1345 p_inq->page_scan_type = BTM_SCAN_TYPE_STANDARD; in btm_inq_db_reset()
1346 p_inq->inq_scan_type = BTM_SCAN_TYPE_STANDARD; in btm_inq_db_reset()
1349 p_inq->discoverable_mode |= BTM_BLE_NON_DISCOVERABLE; in btm_inq_db_reset()
1350 p_inq->connectable_mode |= BTM_BLE_NON_CONNECTABLE; in btm_inq_db_reset()
1439 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_clr_inq_db() local
1440 tINQ_DB_ENT *p_ent = p_inq->inq_db; in btm_clr_inq_db()
1478 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_clr_inq_result_flt() local
1480 if (p_inq->p_bd_db) in btm_clr_inq_result_flt()
1482 GKI_freebuf(p_inq->p_bd_db); in btm_clr_inq_result_flt()
1483 p_inq->p_bd_db = NULL; in btm_clr_inq_result_flt()
1485 p_inq->num_bd_entries = 0; in btm_clr_inq_result_flt()
1486 p_inq->max_bd_entries = 0; in btm_clr_inq_result_flt()
1501 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_inq_find_bdaddr() local
1502 tINQ_BDADDR *p_db = &p_inq->p_bd_db[0]; in btm_inq_find_bdaddr()
1506 if ((p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE) || !p_db) in btm_inq_find_bdaddr()
1509 for (xx = 0; xx < p_inq->num_bd_entries; xx++, p_db++) in btm_inq_find_bdaddr()
1512 && p_db->inq_count == p_inq->inq_counter) in btm_inq_find_bdaddr()
1516 if (xx < p_inq->max_bd_entries) in btm_inq_find_bdaddr()
1518 p_db->inq_count = p_inq->inq_counter; in btm_inq_find_bdaddr()
1520 p_inq->num_bd_entries++; in btm_inq_find_bdaddr()
1689 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_event_filter_complete() local
1690 tBTM_CMPL_CB *p_cb = p_inq->p_inqfilter_cmpl_cb; in btm_event_filter_complete()
1697 if(p_inq->pending_filt_complete_event) in btm_event_filter_complete()
1699 p_inq->pending_filt_complete_event--; in btm_event_filter_complete()
1705 if (p_inq->inqfilt_active == TRUE ) in btm_event_filter_complete()
1720 if (p_inq->state == BTM_INQ_INACTIVE_STATE) in btm_event_filter_complete()
1722 p_inq->inqfilt_active = FALSE; in btm_event_filter_complete()
1732 …btm_process_inq_complete (BTM_ERR_PROCESSING, (UINT8)(p_inq->inqparms.mode & BTM_BR_INQUIRY_MASK)); in btm_event_filter_complete()
1735 p_inq->inqfilt_active = FALSE; in btm_event_filter_complete()
1736 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in btm_event_filter_complete()
1737 p_inq->state = BTM_INQ_INACTIVE_STATE; in btm_event_filter_complete()
1743 if (p_inq->state == BTM_INQ_CLR_FILT_STATE) in btm_event_filter_complete()
1745 …if ((status = btm_set_inq_event_filter (p_inq->inqparms.filter_cond_type, &p_inq->inqparms.filter_… in btm_event_filter_complete()
1747 p_inq->state = BTM_INQ_SET_FILT_STATE; in btm_event_filter_complete()
1751 p_inq->inqfilt_active = FALSE; in btm_event_filter_complete()
1754 …btm_process_inq_complete (BTM_ERR_PROCESSING, (UINT8)(p_inq->inqparms.mode & BTM_BR_INQUIRY_MASK)); in btm_event_filter_complete()
1759 p_inq->state = BTM_INQ_ACTIVE_STATE; in btm_event_filter_complete()
1760 p_inq->inqfilt_active = FALSE; in btm_event_filter_complete()
1761 btm_initiate_inquiry (p_inq); in btm_event_filter_complete()
1786 static void btm_initiate_inquiry (tBTM_INQUIRY_VAR_ST *p_inq) in btm_initiate_inquiry() argument
1789 tBTM_INQ_PARMS *p_inqparms = &p_inq->inqparms; in btm_initiate_inquiry()
1797 if (p_inq->inq_active & BTM_SSP_INQUIRY_ACTIVE) in btm_initiate_inquiry()
1806 lap = (p_inq->inq_active & BTM_LIMITED_INQUIRY_ACTIVE) ? &limited_inq_lap : &general_inq_lap; in btm_initiate_inquiry()
1808 if (p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE) in btm_initiate_inquiry()
1810 if (!btsnd_hcic_per_inq_mode (p_inq->per_max_delay, in btm_initiate_inquiry()
1811 p_inq->per_min_delay, in btm_initiate_inquiry()
1821 if ((p_inq->p_bd_db = (tINQ_BDADDR *)GKI_getbuf(GKI_MAX_BUF_SIZE)) != NULL) in btm_initiate_inquiry()
1823 p_inq->max_bd_entries = (UINT16)(GKI_MAX_BUF_SIZE / sizeof(tINQ_BDADDR)); in btm_initiate_inquiry()
1824 memset(p_inq->p_bd_db, 0, GKI_MAX_BUF_SIZE); in btm_initiate_inquiry()
1858 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_process_inq_results() local
1859 tBTM_INQ_RESULTS_CB *p_inq_results_cb = p_inq->p_inq_results_cb; in btm_process_inq_results()
1873 if (!(p_inq->inq_active & BTM_BR_INQ_ACTIVE_MASK)) in btm_process_inq_results()
1905 if (p_inq->inqparms.max_resps && in btm_process_inq_results()
1906 p_inq->inq_cmpl_info.num_resp >= p_inq->inqparms.max_resps in btm_process_inq_results()
1930 if(p_inq->inqparms.report_dup && (rssi != 0) && in btm_process_inq_results()
1966 else if (p_i->inq_count == p_inq->inq_counter in btm_process_inq_results()
1993 if (p_i->inq_count != p_inq->inq_counter) in btm_process_inq_results()
1994 p_inq->inq_cmpl_info.num_resp++; /* A new response was found */ in btm_process_inq_results()
1998 if (p_i->inq_count != p_inq->inq_counter) in btm_process_inq_results()
2006 p_i->inq_count = p_inq->inq_counter; /* Mark entry for current inquiry */ in btm_process_inq_results()
2009 if (!(p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE) && in btm_process_inq_results()
2010 p_inq->inqparms.max_resps && in btm_process_inq_results()
2011 p_inq->inq_cmpl_info.num_resp == p_inq->inqparms.max_resps in btm_process_inq_results()
2014 && ((((p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK) != 0) && in btm_process_inq_results()
2016 (p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK) == 0) in btm_process_inq_results()
2024 if ((p_inq->inqparms.mode & BTM_BLE_INQUIRY_MASK) != 0) in btm_process_inq_results()
2110 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_process_inq_complete() local
2116 if(status!=HCI_SUCCESS || p_inq->next_state==BTM_FINISH || !p_inq->inq_active) in btm_process_inq_complete()
2119 p_inq->next_state=BTM_BR_ONE; in btm_process_inq_complete()
2121 p_inq->inqparms.mode &= ~(p_inq->inqparms.mode); in btm_process_inq_complete()
2127 p_inq->inqparms.mode &= ~(mode); in btm_process_inq_complete()
2130 if(p_inq->scan_type == INQ_LE_OBSERVE && !p_inq->inq_active) in btm_process_inq_complete()
2133 p_inq->p_inq_ble_results_cb = (tBTM_INQ_RESULTS_CB *) NULL; in btm_process_inq_complete()
2134 p_inq->p_inq_ble_cmpl_cb = (tBTM_CMPL_CB *) NULL; in btm_process_inq_complete()
2135 p_inq->scan_type=INQ_NONE; in btm_process_inq_complete()
2145 if (p_inq->inq_active) in btm_process_inq_complete()
2147p_inq->inq_cmpl_info.status = (tBTM_STATUS)((status == HCI_SUCCESS) ? BTM_SUCCESS : BTM_ERR_PROCES… in btm_process_inq_complete()
2150 if (!(p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE) && p_inq->inqparms.mode == 0) in btm_process_inq_complete()
2155 p_inq->state = BTM_INQ_INACTIVE_STATE; in btm_process_inq_complete()
2158 p_inq->inq_counter++; in btm_process_inq_complete()
2162 if((p_inq->inq_cmpl_info.status == BTM_SUCCESS) && in btm_process_inq_complete()
2169 p_inq->p_inq_results_cb = (tBTM_INQ_RESULTS_CB *) NULL; in btm_process_inq_complete()
2170 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in btm_process_inq_complete()
2171 p_inq->p_inq_cmpl_cb = (tBTM_CMPL_CB *) NULL; in btm_process_inq_complete()
2175 p_inq->inq_cmpl_info.status, p_inq->inq_cmpl_info.num_resp); in btm_process_inq_complete()
2178 (p_inq_cb)((tBTM_INQUIRY_CMPL *) &p_inq->inq_cmpl_info); in btm_process_inq_complete()
2181 if(p_inq->inqparms.mode != 0 && !(p_inq->inq_active & BTM_PERIODIC_INQUIRY_ACTIVE)) in btm_process_inq_complete()
2184 p_inq->inq_active = BTM_INQUIRY_INACTIVE; in btm_process_inq_complete()
2186 BTM_StartInquiry(&p_inq->inqparms,p_inq->p_inq_results_cb,p_inq->p_inq_cmpl_cb); in btm_process_inq_complete()
2190 if(p_inq->inqparms.mode == 0 && p_inq->scan_type == INQ_GENERAL)//this inquiry is complete in btm_process_inq_complete()
2192 p_inq->scan_type = INQ_NONE; in btm_process_inq_complete()
2195 if(p_inq->p_inq_ble_results_cb != NULL) in btm_process_inq_complete()
2198 BTM_BleObserve(1,0, p_inq->p_inq_ble_results_cb, p_inq->p_inq_ble_cmpl_cb); in btm_process_inq_complete()
2248 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_initiate_rem_name() local
2269 if (p_inq->remname_active) in btm_initiate_rem_name()
2276 p_inq->p_remname_cmpl_cb = p_cb; in btm_initiate_rem_name()
2277 memcpy(p_inq->remname_bda, remote_bda, BD_ADDR_LEN); in btm_initiate_rem_name()
2278 btu_start_timer (&p_inq->rmt_name_timer_ent, in btm_initiate_rem_name()
2298 p_inq->remname_active = TRUE; in btm_initiate_rem_name()
2325 tBTM_INQUIRY_VAR_ST *p_inq = &btm_cb.btm_inq_vars; in btm_process_remote_name() local
2326 tBTM_CMPL_CB *p_cb = p_inq->p_remname_cmpl_cb; in btm_process_remote_name()
2338 …BTM_TRACE_EVENT("Inquire BDA %02x:%02x:%02x:%02x:%02x:%02x",p_inq->remname_bda[0], p_inq->remname_… in btm_process_remote_name()
2339 p_inq->remname_bda[2], p_inq->remname_bda[3], in btm_process_remote_name()
2340 p_inq->remname_bda[4], p_inq->remname_bda[5]); in btm_process_remote_name()
2345 if ((p_inq->remname_active ==TRUE)&& in btm_process_remote_name()
2347 (memcmp(bda, p_inq->remname_bda,BD_ADDR_LEN)==0)) || bda == NULL)) in btm_process_remote_name()
2351 if (BTM_UseLeLink(p_inq->remname_bda)) in btm_process_remote_name()
2354 btm_ble_cancel_remote_name(p_inq->remname_bda); in btm_process_remote_name()
2357 btu_stop_timer (&p_inq->rmt_name_timer_ent); in btm_process_remote_name()
2358 p_inq->remname_active = FALSE; in btm_process_remote_name()
2391 memset(p_inq->remname_bda, 0, BD_ADDR_LEN); in btm_process_remote_name()
2393 p_inq->p_remname_cmpl_cb = NULL; in btm_process_remote_name()