diff options
author | Zach Johnson <zachoverflow@google.com> | 2014-09-30 00:09:55 -0700 |
---|---|---|
committer | Andre Eisenbach <eisenbach@google.com> | 2015-03-16 16:51:35 -0700 |
commit | 832bc91593813839d4b3d70548841e2ed29fa637 (patch) | |
tree | 4d8d407f755e1c5d592396a2fbd949afcc448b9f | |
parent | 3c511e667e593c8ea594ca24b1d7712214245863 (diff) | |
download | android_system_bt-832bc91593813839d4b3d70548841e2ed29fa637.tar.gz android_system_bt-832bc91593813839d4b3d70548841e2ed29fa637.tar.bz2 android_system_bt-832bc91593813839d4b3d70548841e2ed29fa637.zip |
Prune BTM_SetSecurityMode and GAP_SetSecurityMode
BTM_SetSecurityMode was only used from GAP_SetSecurityMode,
and GAP_SetSecurityMode was never used.
-rw-r--r-- | stack/btm/btm_sec.c | 71 | ||||
-rw-r--r-- | stack/gap/gap_api.c | 16 | ||||
-rw-r--r-- | stack/include/btm_api.h | 13 | ||||
-rw-r--r-- | stack/include/gap_api.h | 11 |
4 files changed, 0 insertions, 111 deletions
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c index aa06e4146..029161aa8 100644 --- a/stack/btm/btm_sec.c +++ b/stack/btm/btm_sec.c @@ -367,77 +367,6 @@ BOOLEAN BTM_GetSecurityFlagsByTransport (BD_ADDR bd_addr, UINT8 * p_sec_flags, /******************************************************************************* ** -** Function BTM_SetSecurityMode -** -** Description Set security mode for the device -** -** Returns void -** -*******************************************************************************/ -void BTM_SetSecurityMode (UINT8 security_mode) -{ - UINT8 old_mode = btm_cb.security_mode; - - UINT8 sp_mode = HCI_SP_MODE_ENABLED; - UINT8 sp_debug_mode = HCI_SPD_MODE_DISABLED; - - switch (security_mode) - { -#if (BTM_PRE_LISBON_INCLUDED == TRUE) - case BTM_SEC_MODE_NONE: - case BTM_SEC_MODE_SERVICE: - case BTM_SEC_MODE_LINK: - break; -#endif - - case BTM_SEC_MODE_SP_DEBUG: - sp_debug_mode = HCI_SPD_MODE_ENABLED; - break; - case BTM_SEC_MODE_SP: - /* the default is enabled */ - break; - default: - BTM_TRACE_ERROR ("BTM_SetSecurityMode: unknown mode:%d", security_mode); - return; - } - btm_cb.security_mode = security_mode; - - if (HCI_SIMPLE_PAIRING_SUPPORTED(btm_cb.devcb.local_lmp_features[HCI_EXT_FEATURES_PAGE_0])) - { - /* Lisbon devices and only use BTM_SEC_MODE_SP */ - btm_cb.security_mode = BTM_SEC_MODE_SP; - BTM_TRACE_DEBUG("BTM_SetSecurityMode: SP:%d, debug:%d", sp_mode, sp_debug_mode); - btsnd_hcic_write_simple_pairing_mode(sp_mode); - btsnd_hcic_write_simp_pair_debug_mode(sp_debug_mode); - return; - } - - /* must be a pre-Lisbon device */ -#if (BTM_PRE_LISBON_INCLUDED == TRUE) - /* If previously security mode was Link Level and now lesser notify */ - /* controller not to perform authentication, encryption on startup */ - if ((old_mode == BTM_SEC_MODE_LINK) - && ( security_mode != BTM_SEC_MODE_LINK)) - { - BTM_TRACE_DEBUG("BTM_SetSecurityMode: Authen Enable -> FALSE"); - btsnd_hcic_write_auth_enable (FALSE); - btsnd_hcic_write_encr_mode (HCI_ENCRYPT_MODE_DISABLED); - } - - /* If previously security is increased to Link Level notify */ - /* controller to perform authentication, encryption on startup */ - if ((old_mode != BTM_SEC_MODE_LINK) - && ( security_mode == BTM_SEC_MODE_LINK)) - { - BTM_TRACE_DEBUG("BTM_SetSecurityMode: Authen Enable -> TRUE"); - btsnd_hcic_write_auth_enable (TRUE); - btsnd_hcic_write_encr_mode (HCI_ENCRYPT_MODE_POINT_TO_POINT); - } -#endif /* BTM_PRE_LISBON_INCLUDED == TRUE */ -} - -/******************************************************************************* -** ** Function BTM_SetPinType ** ** Description Set PIN type for the device. diff --git a/stack/gap/gap_api.c b/stack/gap/gap_api.c index 530d1413a..450118aca 100644 --- a/stack/gap/gap_api.c +++ b/stack/gap/gap_api.c @@ -225,22 +225,6 @@ UINT16 GAP_ReadConnectableMode (UINT16 *duration, UINT16 *interval) return (BTM_ReadConnectability(duration, interval)); } - -/******************************************************************************* -** -** Function GAP_SetSecurityMode -** -** Description Set security mode for the device -** -** Returns void -** -*******************************************************************************/ -void GAP_SetSecurityMode (UINT8 sec_mode) -{ - BTM_SetSecurityMode (sec_mode); -} - - /******************************************************************************* ** ** Function GAP_Bond diff --git a/stack/include/btm_api.h b/stack/include/btm_api.h index 081969e04..424f5bac2 100644 --- a/stack/include/btm_api.h +++ b/stack/include/btm_api.h @@ -3592,19 +3592,6 @@ extern BOOLEAN BTM_GetSecurityFlagsByTransport (BD_ADDR bd_addr, *******************************************************************************/ extern UINT32 * BTM_ReadTrustedMask (BD_ADDR bd_addr); - -/******************************************************************************* -** -** Function BTM_SetSecurityMode -** -** Description Set security mode for the device -** -** Returns void -** -*******************************************************************************/ -extern void BTM_SetSecurityMode (UINT8 sec_mode); - - /******************************************************************************* ** ** Function BTM_SetPinType diff --git a/stack/include/gap_api.h b/stack/include/gap_api.h index 1a0cc5ef0..6e2ad43a7 100644 --- a/stack/include/gap_api.h +++ b/stack/include/gap_api.h @@ -401,17 +401,6 @@ extern UINT16 GAP_ReadConnectableMode (UINT16 *duration, UINT16 *interval); /******************************************************************************* ** -** Function GAP_SetSecurityMode -** -** Description Set security mode for the device (Service or Link level) -** -** Returns void -** -*******************************************************************************/ -extern void GAP_SetSecurityMode (UINT8 sec_mode); - -/******************************************************************************* -** ** Function GAP_SecRegister ** ** Description Application calls this function to register for |