diff options
Diffstat (limited to 'stack')
-rw-r--r-- | stack/btm/btm_dev.c | 6 | ||||
-rw-r--r-- | stack/btm/btm_int.h | 7 | ||||
-rw-r--r-- | stack/btm/btm_sec.c | 14 | ||||
-rw-r--r-- | stack/l2cap/l2c_api.c | 4 | ||||
-rw-r--r-- | stack/l2cap/l2c_link.c | 4 | ||||
-rw-r--r-- | stack/l2cap/l2c_main.c | 4 | ||||
-rw-r--r-- | stack/smp/smp_act.c | 3 | ||||
-rw-r--r-- | stack/smp/smp_br_main.c | 4 | ||||
-rw-r--r-- | stack/smp/smp_int.h | 4 |
9 files changed, 37 insertions, 13 deletions
diff --git a/stack/btm/btm_dev.c b/stack/btm/btm_dev.c index faae4f56d..88171013c 100644 --- a/stack/btm/btm_dev.c +++ b/stack/btm/btm_dev.c @@ -441,12 +441,14 @@ tBTM_SEC_DEV_REC *btm_find_dev(BD_ADDR bd_addr) if (!memcmp (p_dev_rec->bd_addr, bd_addr, BD_ADDR_LEN)) return(p_dev_rec); +#if BLE_INCLUDED == TRUE // If a LE random address is looking for device record if (!memcmp(p_dev_rec->ble.pseudo_addr, bd_addr, BD_ADDR_LEN)) return (p_dev_rec); if (btm_ble_addr_resolvable(bd_addr, p_dev_rec)) return(p_dev_rec); +#endif } } } @@ -464,6 +466,7 @@ tBTM_SEC_DEV_REC *btm_find_dev(BD_ADDR bd_addr) *******************************************************************************/ void btm_consolidate_dev(tBTM_SEC_DEV_REC *p_target_rec) { +#if BLE_INCLUDED == TRUE tBTM_SEC_DEV_REC *p_dev_rec = &btm_cb.sec_dev_rec[0]; tBTM_SEC_DEV_REC temp_rec = *p_target_rec; BD_ADDR dummy_bda = {0}; @@ -478,8 +481,8 @@ void btm_consolidate_dev(tBTM_SEC_DEV_REC *p_target_rec) { memcpy(p_target_rec, p_dev_rec, sizeof(tBTM_SEC_DEV_REC)); p_target_rec->ble = temp_rec.ble; - p_target_rec->enc_key_size = temp_rec.enc_key_size; p_target_rec->ble_hci_handle = temp_rec.ble_hci_handle; + p_target_rec->enc_key_size = temp_rec.enc_key_size; p_target_rec->conn_params = temp_rec.conn_params; p_target_rec->device_type |= temp_rec.device_type; p_target_rec->sec_flags |= temp_rec.sec_flags; @@ -504,6 +507,7 @@ void btm_consolidate_dev(tBTM_SEC_DEV_REC *p_target_rec) } } } +#endif } /******************************************************************************* diff --git a/stack/btm/btm_int.h b/stack/btm/btm_int.h index d56d261ab..2f3cea95a 100644 --- a/stack/btm/btm_int.h +++ b/stack/btm/btm_int.h @@ -573,12 +573,9 @@ typedef struct /* HCI_IO_CAPABILITY_REQUEST_EVT from the peer before */ /* it knows peer's support for Secure Connections */ -#if (BLE_INCLUDED == TRUE) UINT16 ble_hci_handle; /* use in DUMO connection */ UINT8 enc_key_size; /* current link encryption key size */ - tBTM_SEC_BLE ble; tBT_DEVICE_TYPE device_type; - tBTM_LE_CONN_PRAMS conn_params; BOOLEAN new_encryption_key_is_p256; /* Set to TRUE when the newly generated LK ** is generated from P-256. ** Link encrypted with such LK can be used @@ -587,6 +584,10 @@ typedef struct BOOLEAN no_smp_on_br; /* if set to TRUE then SMP on BR/EDR doesn't */ /* work, i.e. link keys crosspairing */ /* SC BR/EDR->SC LE doesn't happen */ + +#if BLE_INCLUDED == TRUE + tBTM_SEC_BLE ble; + tBTM_LE_CONN_PRAMS conn_params; #endif // btla-specific ++ diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c index 33d0efc22..309ae8247 100644 --- a/stack/btm/btm_sec.c +++ b/stack/btm/btm_sec.c @@ -5873,9 +5873,11 @@ void btm_sec_dev_rec_cback_event (tBTM_SEC_DEV_REC *p_dev_rec, UINT8 res, BOOLEA { p_dev_rec->p_callback = NULL; +#if BLE_INCLUDED == TRUE if (is_le_transport) (*p_callback) (p_dev_rec->ble.pseudo_addr, BT_TRANSPORT_LE, p_dev_rec->p_ref_data, res); else +#endif (*p_callback) (p_dev_rec->bd_addr, BT_TRANSPORT_BR_EDR, p_dev_rec->p_ref_data, res); } @@ -6131,7 +6133,6 @@ static void btm_sec_check_pending_enc_req (tBTM_SEC_DEV_REC *p_dev_rec, tBT_TRA tBTM_SEC_QUEUE_ENTRY *p_e; BUFFER_Q *bq = &btm_cb.sec_pending_q; UINT8 res = encr_enable ? BTM_SUCCESS : BTM_ERR_PROCESSING; - UINT8 sec_act ; p_e = (tBTM_SEC_QUEUE_ENTRY *)GKI_getfirst(bq); @@ -6143,7 +6144,9 @@ static void btm_sec_check_pending_enc_req (tBTM_SEC_DEV_REC *p_dev_rec, tBT_TRA #endif ) { - sec_act = *(UINT8 *)(p_e->p_ref_data); +#if BLE_INCLUDED == TRUE + UINT8 sec_act = *(UINT8 *)(p_e->p_ref_data); +#endif if (encr_enable == 0 || transport == BT_TRANSPORT_BR_EDR #if BLE_INCLUDED == TRUE @@ -6178,7 +6181,6 @@ static UINT16 btm_sec_set_serv_level4_flags(UINT16 cur_security, BOOLEAN is_orig return cur_security | sec_level4_flags; } -#if (BLE_INCLUDED == TRUE) /******************************************************************************* ** ** Function btm_sec_clear_ble_keys @@ -6220,8 +6222,10 @@ BOOLEAN btm_sec_is_a_bonded_dev (BD_ADDR bda) BOOLEAN is_bonded= FALSE; if (p_dev_rec && -#if (SMP_INCLUDED== TRUE) +#if (SMP_INCLUDED == TRUE) ((p_dev_rec->ble.key_type && (p_dev_rec->sec_flags & BTM_SEC_LE_LINK_KEY_KNOWN))|| +#else + ( #endif (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN))) { @@ -6340,5 +6344,3 @@ static BOOLEAN btm_sec_is_master(tBTM_SEC_DEV_REC *p_dev_rec) return (p && (p->link_role == BTM_ROLE_MASTER)); } -#endif /* BLE_INCLUDED */ - diff --git a/stack/l2cap/l2c_api.c b/stack/l2cap/l2c_api.c index 3a8d5de48..e7dbf36e2 100644 --- a/stack/l2cap/l2c_api.c +++ b/stack/l2cap/l2c_api.c @@ -1420,9 +1420,11 @@ BOOLEAN L2CA_ConnectFixedChnl (UINT16 fixed_cid, BD_ADDR rem_bda) // Fixed channels are mandatory on LE transports so ignore the received // channel mask and use the locally cached LE channel mask. +#if BLE_INCLUDED == TRUE if (transport == BT_TRANSPORT_LE) peer_channel_mask = l2cb.l2c_ble_fixed_chnls_mask; else +#endif peer_channel_mask = p_lcb->peer_chnl_mask[0]; // Check for supported channel @@ -1544,9 +1546,11 @@ UINT16 L2CA_SendFixedChnlData (UINT16 fixed_cid, BD_ADDR rem_bda, BT_HDR *p_buf) tL2C_BLE_FIXED_CHNLS_MASK peer_channel_mask; // Select peer channels mask to use depending on transport +#if BLE_INCLUDED == TRUE if (transport == BT_TRANSPORT_LE) peer_channel_mask = l2cb.l2c_ble_fixed_chnls_mask; else +#endif peer_channel_mask = p_lcb->peer_chnl_mask[0]; if ((peer_channel_mask & (1 << fixed_cid)) == 0) diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c index 97bf58d9b..822257e1c 100644 --- a/stack/l2cap/l2c_link.c +++ b/stack/l2cap/l2c_link.c @@ -1156,11 +1156,13 @@ void l2c_link_check_send_pkts (tL2C_LCB *p_lcb, tL2C_CCB *p_ccb, BT_HDR *p_buf) (l2cb.round_robin_unacked >= l2cb.round_robin_quota)) #if (BLE_INCLUDED == TRUE) && (p_lcb->transport == BT_TRANSPORT_BR_EDR) -#endif ) || (p_lcb->transport == BT_TRANSPORT_LE && (l2cb.ble_round_robin_unacked >= l2cb.ble_round_robin_quota || l2cb.controller_le_xmit_window == 0 ))) +#else + )) +#endif break; diff --git a/stack/l2cap/l2c_main.c b/stack/l2cap/l2c_main.c index 212d5dfcd..fcc53d5b1 100644 --- a/stack/l2cap/l2c_main.c +++ b/stack/l2cap/l2c_main.c @@ -186,10 +186,12 @@ void l2c_rcv_acl_data (BT_HDR *p_msg) STREAM_TO_UINT16 (l2cap_len, p); STREAM_TO_UINT16 (rcv_cid, p); +#if BLE_INCLUDED == TRUE /* for BLE channel, always notify connection when ACL data received on the link */ if (p_lcb && p_lcb->transport == BT_TRANSPORT_LE && p_lcb->link_state != LST_DISCONNECTING) /* only process fixed channel data as channel open indication when link is not in disconnecting mode */ l2cble_notify_le_connection(p_lcb->remote_bd_addr); +#endif /* Find the CCB for this CID */ if (rcv_cid >= L2CAP_BASE_APPL_CID) @@ -894,8 +896,10 @@ void l2c_init (void) l2cb.high_pri_min_xmit_quota = L2CAP_HIGH_PRI_MIN_XMIT_QUOTA; #endif +#if BLE_INCLUDED == TRUE l2cb.l2c_ble_fixed_chnls_mask = L2CAP_FIXED_CHNL_ATT_BIT | L2CAP_FIXED_CHNL_BLE_SIG_BIT | L2CAP_FIXED_CHNL_SMP_BIT; +#endif l2cb.rcv_pending_q = list_new(NULL); if (l2cb.rcv_pending_q == NULL) diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c index f1c6936cc..7c5bd8e71 100644 --- a/stack/smp/smp_act.c +++ b/stack/smp/smp_act.c @@ -23,6 +23,7 @@ #include "l2c_api.h" #include "smp_int.h" +#if SMP_INCLUDED == TRUE const UINT8 smp_association_table[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] = { /* initiator */ @@ -2088,4 +2089,4 @@ void smp_br_pairing_complete(tSMP_CB *p_cb, tSMP_INT_DATA *p_data) smp_proc_pairing_cmpl(p_cb); } - +#endif diff --git a/stack/smp/smp_br_main.c b/stack/smp/smp_br_main.c index 573db7fbc..11039ec20 100644 --- a/stack/smp/smp_br_main.c +++ b/stack/smp/smp_br_main.c @@ -21,6 +21,8 @@ #include <string.h> #include "smp_int.h" +#if BLE_INCLUDED == TRUE + const char *const smp_br_state_name [SMP_BR_STATE_MAX+1] = { "SMP_BR_STATE_IDLE", @@ -394,4 +396,4 @@ void smp_br_state_machine_event(tSMP_CB *p_cb, tSMP_BR_EVENT event, void *p_data SMP_TRACE_DEBUG( "result state = %s", smp_get_br_state_name( p_cb->br_state ) ) ; } - +#endif diff --git a/stack/smp/smp_int.h b/stack/smp/smp_int.h index 52b03019a..a058bab53 100644 --- a/stack/smp/smp_int.h +++ b/stack/smp/smp_int.h @@ -24,6 +24,8 @@ #ifndef SMP_INT_H #define SMP_INT_H +#if BLE_INCLUDED == TRUE + #include "btu.h" #include "btm_ble_api.h" #include "btm_api.h" @@ -536,4 +538,6 @@ extern BOOLEAN aes_cipher_msg_auth_code(BT_OCTET16 key, UINT8 *input, UINT16 len UINT16 tlen, UINT8 *p_signature); extern void print128(BT_OCTET16 x, const UINT8 *key_name); +#endif + #endif /* SMP_INT_H */ |