mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
Merge branch 'bugfix/fix_some_ble_bugs_cjh_v5.0' into 'release/v5.0'
Fixed some BLE bugs 240620 (backport v5.0) See merge request espressif/esp-idf!31648
This commit is contained in:
commit
ef922dd380
@ -112,7 +112,7 @@ do{\
|
|||||||
} while(0)
|
} while(0)
|
||||||
|
|
||||||
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
|
#define OSI_FUNCS_TIME_BLOCKING 0xffffffff
|
||||||
#define OSI_VERSION 0x00010008
|
#define OSI_VERSION 0x00010009
|
||||||
#define OSI_MAGIC_VALUE 0xFADEBEAD
|
#define OSI_MAGIC_VALUE 0xFADEBEAD
|
||||||
|
|
||||||
/* Types definition
|
/* Types definition
|
||||||
@ -140,15 +140,24 @@ typedef struct {
|
|||||||
|
|
||||||
typedef void (* osi_intr_handler)(void);
|
typedef void (* osi_intr_handler)(void);
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int source; /*!< ISR source */
|
||||||
|
int flags; /*!< ISR alloc flag */
|
||||||
|
void (*fn)(void *); /*!< ISR function */
|
||||||
|
void *arg; /*!< ISR function args*/
|
||||||
|
intr_handle_t *handle; /*!< ISR handle */
|
||||||
|
esp_err_t ret;
|
||||||
|
} btdm_isr_alloc_t;
|
||||||
|
|
||||||
/* OSI function */
|
/* OSI function */
|
||||||
struct osi_funcs_t {
|
struct osi_funcs_t {
|
||||||
uint32_t _magic;
|
uint32_t _magic;
|
||||||
uint32_t _version;
|
uint32_t _version;
|
||||||
void (*_interrupt_set)(int cpu_no, int intr_source, int interrupt_no, int interrpt_prio);
|
int (* _interrupt_alloc)(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle);
|
||||||
void (*_interrupt_clear)(int interrupt_source, int interrupt_no);
|
int (* _interrupt_free)(void *handle);
|
||||||
void (*_interrupt_handler_set)(int interrupt_no, intr_handler_t fn, void *arg);
|
void (*_interrupt_handler_set_rsv)(int interrupt_no, intr_handler_t fn, void *arg);
|
||||||
void (*_interrupt_disable)(void);
|
void (*_global_intr_disable)(void);
|
||||||
void (*_interrupt_restore)(void);
|
void (*_global_intr_restore)(void);
|
||||||
void (*_task_yield)(void);
|
void (*_task_yield)(void);
|
||||||
void (*_task_yield_from_isr)(void);
|
void (*_task_yield_from_isr)(void);
|
||||||
void *(*_semphr_create)(uint32_t max, uint32_t init);
|
void *(*_semphr_create)(uint32_t max, uint32_t init);
|
||||||
@ -193,8 +202,8 @@ struct osi_funcs_t {
|
|||||||
uint32_t (* _coex_schm_interval_get)(void);
|
uint32_t (* _coex_schm_interval_get)(void);
|
||||||
uint8_t (* _coex_schm_curr_period_get)(void);
|
uint8_t (* _coex_schm_curr_period_get)(void);
|
||||||
void *(* _coex_schm_curr_phase_get)(void);
|
void *(* _coex_schm_curr_phase_get)(void);
|
||||||
void (* _interrupt_on)(int intr_num);
|
int (* _interrupt_enable)(void *handle);
|
||||||
void (* _interrupt_off)(int intr_num);
|
int (* _interrupt_disable)(void *handle);
|
||||||
void (* _esp_hw_power_down)(void);
|
void (* _esp_hw_power_down)(void);
|
||||||
void (* _esp_hw_power_up)(void);
|
void (* _esp_hw_power_up)(void);
|
||||||
void (* _ets_backup_dma_copy)(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_rem);
|
void (* _ets_backup_dma_copy)(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_rem);
|
||||||
@ -276,11 +285,10 @@ extern uint32_t _bt_controller_data_end;
|
|||||||
/* Local Function Declare
|
/* Local Function Declare
|
||||||
*********************************************************************
|
*********************************************************************
|
||||||
*/
|
*/
|
||||||
static void interrupt_set_wrapper(int cpu_no, int intr_source, int intr_num, int intr_prio);
|
static int interrupt_alloc_wrapper(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle);
|
||||||
static void interrupt_clear_wrapper(int intr_source, int intr_num);
|
static int interrupt_free_wrapper(void *handle);
|
||||||
static void interrupt_handler_set_wrapper(int n, intr_handler_t fn, void *arg);
|
static void global_interrupt_disable(void);
|
||||||
static void interrupt_disable(void);
|
static void global_interrupt_restore(void);
|
||||||
static void interrupt_restore(void);
|
|
||||||
static void task_yield_from_isr(void);
|
static void task_yield_from_isr(void);
|
||||||
static void *semphr_create_wrapper(uint32_t max, uint32_t init);
|
static void *semphr_create_wrapper(uint32_t max, uint32_t init);
|
||||||
static void semphr_delete_wrapper(void *semphr);
|
static void semphr_delete_wrapper(void *semphr);
|
||||||
@ -318,8 +326,8 @@ static void coex_schm_status_bit_clear_wrapper(uint32_t type, uint32_t status);
|
|||||||
static uint32_t coex_schm_interval_get_wrapper(void);
|
static uint32_t coex_schm_interval_get_wrapper(void);
|
||||||
static uint8_t coex_schm_curr_period_get_wrapper(void);
|
static uint8_t coex_schm_curr_period_get_wrapper(void);
|
||||||
static void * coex_schm_curr_phase_get_wrapper(void);
|
static void * coex_schm_curr_phase_get_wrapper(void);
|
||||||
static void interrupt_on_wrapper(int intr_num);
|
static int interrupt_enable_wrapper(void *handle);
|
||||||
static void interrupt_off_wrapper(int intr_num);
|
static int interrupt_disable_wrapper(void *handle);
|
||||||
static void btdm_hw_mac_power_up_wrapper(void);
|
static void btdm_hw_mac_power_up_wrapper(void);
|
||||||
static void btdm_hw_mac_power_down_wrapper(void);
|
static void btdm_hw_mac_power_down_wrapper(void);
|
||||||
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
|
static void btdm_backup_dma_copy_wrapper(uint32_t reg, uint32_t mem_addr, uint32_t num, bool to_mem);
|
||||||
@ -340,11 +348,11 @@ static void bt_controller_deinit_internal(void);
|
|||||||
static const struct osi_funcs_t osi_funcs_ro = {
|
static const struct osi_funcs_t osi_funcs_ro = {
|
||||||
._magic = OSI_MAGIC_VALUE,
|
._magic = OSI_MAGIC_VALUE,
|
||||||
._version = OSI_VERSION,
|
._version = OSI_VERSION,
|
||||||
._interrupt_set = interrupt_set_wrapper,
|
._interrupt_alloc = interrupt_alloc_wrapper,
|
||||||
._interrupt_clear = interrupt_clear_wrapper,
|
._interrupt_free = interrupt_free_wrapper,
|
||||||
._interrupt_handler_set = interrupt_handler_set_wrapper,
|
._interrupt_handler_set_rsv = NULL,
|
||||||
._interrupt_disable = interrupt_disable,
|
._global_intr_disable = global_interrupt_disable,
|
||||||
._interrupt_restore = interrupt_restore,
|
._global_intr_restore = global_interrupt_restore,
|
||||||
._task_yield = vPortYield,
|
._task_yield = vPortYield,
|
||||||
._task_yield_from_isr = task_yield_from_isr,
|
._task_yield_from_isr = task_yield_from_isr,
|
||||||
._semphr_create = semphr_create_wrapper,
|
._semphr_create = semphr_create_wrapper,
|
||||||
@ -389,8 +397,8 @@ static const struct osi_funcs_t osi_funcs_ro = {
|
|||||||
._coex_schm_interval_get = coex_schm_interval_get_wrapper,
|
._coex_schm_interval_get = coex_schm_interval_get_wrapper,
|
||||||
._coex_schm_curr_period_get = coex_schm_curr_period_get_wrapper,
|
._coex_schm_curr_period_get = coex_schm_curr_period_get_wrapper,
|
||||||
._coex_schm_curr_phase_get = coex_schm_curr_phase_get_wrapper,
|
._coex_schm_curr_phase_get = coex_schm_curr_phase_get_wrapper,
|
||||||
._interrupt_on = interrupt_on_wrapper,
|
._interrupt_enable = interrupt_enable_wrapper,
|
||||||
._interrupt_off = interrupt_off_wrapper,
|
._interrupt_disable = interrupt_disable_wrapper,
|
||||||
._esp_hw_power_down = btdm_hw_mac_power_down_wrapper,
|
._esp_hw_power_down = btdm_hw_mac_power_down_wrapper,
|
||||||
._esp_hw_power_up = btdm_hw_mac_power_up_wrapper,
|
._esp_hw_power_up = btdm_hw_mac_power_up_wrapper,
|
||||||
._ets_backup_dma_copy = btdm_backup_dma_copy_wrapper,
|
._ets_backup_dma_copy = btdm_backup_dma_copy_wrapper,
|
||||||
@ -477,36 +485,44 @@ static inline void esp_bt_power_domain_off(void)
|
|||||||
esp_wifi_bt_power_domain_off();
|
esp_wifi_bt_power_domain_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_set_wrapper(int cpu_no, int intr_source, int intr_num, int intr_prio)
|
static void btdm_intr_alloc(void *arg)
|
||||||
{
|
{
|
||||||
esp_rom_route_intr_matrix(cpu_no, intr_source, intr_num);
|
btdm_isr_alloc_t *p = arg;
|
||||||
#if __riscv
|
p->ret = esp_intr_alloc(p->source, p->flags, p->fn, p->arg, p->handle);
|
||||||
esprv_intc_int_set_priority(intr_num, intr_prio);
|
}
|
||||||
//esprv_intc_int_enable_level(1 << intr_num);
|
|
||||||
esprv_intc_int_set_type(intr_num, 0);
|
static int interrupt_alloc_wrapper(int cpu_id, int source, intr_handler_t handler, void *arg, void **ret_handle)
|
||||||
|
{
|
||||||
|
btdm_isr_alloc_t p;
|
||||||
|
p.source = source;
|
||||||
|
p.flags = ESP_INTR_FLAG_LEVEL1 | ESP_INTR_FLAG_IRAM;
|
||||||
|
p.fn = handler;
|
||||||
|
p.arg = arg;
|
||||||
|
p.handle = (intr_handle_t *)ret_handle;
|
||||||
|
#if CONFIG_FREERTOS_UNICORE
|
||||||
|
btdm_intr_alloc(&p);
|
||||||
|
#else
|
||||||
|
esp_ipc_call_blocking(cpu_id, btdm_intr_alloc, &p);
|
||||||
#endif
|
#endif
|
||||||
|
return p.ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_clear_wrapper(int intr_source, int intr_num)
|
static int interrupt_free_wrapper(void *handle)
|
||||||
{
|
{
|
||||||
|
return esp_intr_free((intr_handle_t)handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_handler_set_wrapper(int n, intr_handler_t fn, void *arg)
|
static int interrupt_enable_wrapper(void *handle)
|
||||||
{
|
{
|
||||||
esp_cpu_intr_set_handler(n, fn, arg);
|
return esp_intr_enable((intr_handle_t)handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_on_wrapper(int intr_num)
|
static int interrupt_disable_wrapper(void *handle)
|
||||||
{
|
{
|
||||||
esp_cpu_intr_enable(1 << intr_num);
|
return esp_intr_disable((intr_handle_t)handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void interrupt_off_wrapper(int intr_num)
|
static void IRAM_ATTR global_interrupt_disable(void)
|
||||||
{
|
|
||||||
esp_cpu_intr_disable(1<<intr_num);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void IRAM_ATTR interrupt_disable(void)
|
|
||||||
{
|
{
|
||||||
if (xPortInIsrContext()) {
|
if (xPortInIsrContext()) {
|
||||||
portENTER_CRITICAL_ISR(&global_int_mux);
|
portENTER_CRITICAL_ISR(&global_int_mux);
|
||||||
@ -515,7 +531,7 @@ static void IRAM_ATTR interrupt_disable(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void IRAM_ATTR interrupt_restore(void)
|
static void IRAM_ATTR global_interrupt_restore(void)
|
||||||
{
|
{
|
||||||
if (xPortInIsrContext()) {
|
if (xPortInIsrContext()) {
|
||||||
portEXIT_CRITICAL_ISR(&global_int_mux);
|
portEXIT_CRITICAL_ISR(&global_int_mux);
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 4b1338827fa19fbacc02dd9e46e76be2b0dd17a9
|
Subproject commit 29d5555ca1febeb132f5a13556893f3419d2d640
|
@ -294,6 +294,17 @@ config BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE
|
|||||||
In order to reduce the pairing time, slave actively initiates connection parameters
|
In order to reduce the pairing time, slave actively initiates connection parameters
|
||||||
update during pairing.
|
update during pairing.
|
||||||
|
|
||||||
|
config BT_BLE_SMP_ID_RESET_ENABLE
|
||||||
|
bool "Reset device identity when all bonding records are deleted"
|
||||||
|
depends on BT_BLE_SMP_ENABLE
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
There are tracking risks associated with using a fixed or static IRK.
|
||||||
|
If enabled this option, Bluedroid will assign a new randomly-generated IRK
|
||||||
|
when all pairing and bonding records are deleted. This would decrease the ability
|
||||||
|
of a previously paired peer to be used to determine whether a device
|
||||||
|
with which it previously shared an IRK is within range.
|
||||||
|
|
||||||
config BT_STACK_NO_LOG
|
config BT_STACK_NO_LOG
|
||||||
bool "Disable BT debug logs (minimize bin size)"
|
bool "Disable BT debug logs (minimize bin size)"
|
||||||
depends on BT_BLUEDROID_ENABLED
|
depends on BT_BLUEDROID_ENABLED
|
||||||
|
@ -661,21 +661,55 @@ typedef struct {
|
|||||||
esp_bt_octet16_t oob_r; /*!< the 128 bits of randomizer value */
|
esp_bt_octet16_t oob_r; /*!< the 128 bits of randomizer value */
|
||||||
} esp_ble_local_oob_data_t;
|
} esp_ble_local_oob_data_t;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Definition of the authentication failed reason
|
||||||
|
*/
|
||||||
|
typedef enum {
|
||||||
|
// Failure reason defined in Bluetooth Core Spec 5.0 Vol3, Part H, 3.5.5
|
||||||
|
ESP_AUTH_SMP_PASSKEY_FAIL = 78, /*!< The user input of passkey failed */
|
||||||
|
ESP_AUTH_SMP_OOB_FAIL, /*!< The OOB data is not available */
|
||||||
|
ESP_AUTH_SMP_PAIR_AUTH_FAIL, /*!< The authentication requirements cannot be met */
|
||||||
|
ESP_AUTH_SMP_CONFIRM_VALUE_FAIL, /*!< The confirm value does not match the calculated comparison value */
|
||||||
|
ESP_AUTH_SMP_PAIR_NOT_SUPPORT, /*!< Pairing is not supported by the device */
|
||||||
|
ESP_AUTH_SMP_ENC_KEY_SIZE, /*!< The resultant encryption key size is not long enough */
|
||||||
|
ESP_AUTH_SMP_INVALID_CMD, /*!< The SMP command received is not supported by this device */
|
||||||
|
ESP_AUTH_SMP_UNKNOWN_ERR, /*!< Pairing failed due to an unspecified reason */
|
||||||
|
ESP_AUTH_SMP_REPEATED_ATTEMPT, /*!< Pairing or authentication procedure is disallowed */
|
||||||
|
ESP_AUTH_SMP_INVALID_PARAMETERS, /*!< The command length is invalid or that a parameter is outside the specified range */
|
||||||
|
ESP_AUTH_SMP_DHKEY_CHK_FAIL, /*!< The DHKey Check value received doesn’t match the one calculated by the local device */
|
||||||
|
ESP_AUTH_SMP_NUM_COMP_FAIL, /*!< The confirm values in the numeric comparison protocol do not match */
|
||||||
|
ESP_AUTH_SMP_BR_PARING_IN_PROGR, /*!< Pairing Request sent over the BR/EDR transport is in progress */
|
||||||
|
ESP_AUTH_SMP_XTRANS_DERIVE_NOT_ALLOW, /*!< The BR/EDR Link Key or BLE LTK cannot be used to derive */
|
||||||
|
|
||||||
|
// Failure reason defined in Bluedroid Host
|
||||||
|
ESP_AUTH_SMP_INTERNAL_ERR, /*!< Internal error in pairing procedure */
|
||||||
|
ESP_AUTH_SMP_UNKNOWN_IO, /*!< Unknown IO capability, unable to decide association model */
|
||||||
|
ESP_AUTH_SMP_INIT_FAIL, /*!< SMP pairing initiation failed */
|
||||||
|
ESP_AUTH_SMP_CONFIRM_FAIL, /*!< The confirm value does not match */
|
||||||
|
ESP_AUTH_SMP_BUSY, /*!< Pending security request on going */
|
||||||
|
ESP_AUTH_SMP_ENC_FAIL, /*!< The Controller failed to start encryption */
|
||||||
|
ESP_AUTH_SMP_STARTED, /*!< SMP pairing process started */
|
||||||
|
ESP_AUTH_SMP_RSP_TIMEOUT, /*!< Security Manager timeout due to no SMP command being received */
|
||||||
|
ESP_AUTH_SMP_DIV_NOT_AVAIL, /*!< Encrypted Diversifier value not available */
|
||||||
|
ESP_AUTH_SMP_UNSPEC_ERR, /*!< Unspecified failed reason */
|
||||||
|
ESP_AUTH_SMP_CONN_TOUT, /*!< Pairing process failed due to connection timeout */
|
||||||
|
} esp_ble_auth_fail_rsn_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Structure associated with ESP_AUTH_CMPL_EVT
|
* @brief Structure associated with ESP_AUTH_CMPL_EVT
|
||||||
*/
|
*/
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
esp_bd_addr_t bd_addr; /*!< BD address peer device. */
|
esp_bd_addr_t bd_addr; /*!< BD address of peer device */
|
||||||
bool key_present; /*!< Valid link key value in key element */
|
bool key_present; /*!< True if the link key value is valid; false otherwise */
|
||||||
esp_link_key key; /*!< Link key associated with peer device. */
|
esp_link_key key; /*!< Link key associated with peer device */
|
||||||
uint8_t key_type; /*!< The type of Link Key */
|
uint8_t key_type; /*!< The type of link key */
|
||||||
bool success; /*!< TRUE of authentication succeeded, FALSE if failed. */
|
bool success; /*!< True if authentication succeeded; false otherwise */
|
||||||
uint8_t fail_reason; /*!< The HCI reason/error code for when success=FALSE */
|
esp_ble_auth_fail_rsn_t fail_reason; /*!< The HCI reason/error code for failure when success is false */
|
||||||
esp_ble_addr_type_t addr_type; /*!< Peer device address type */
|
esp_ble_addr_type_t addr_type; /*!< Peer device address type */
|
||||||
esp_bt_dev_type_t dev_type; /*!< Device type */
|
esp_bt_dev_type_t dev_type; /*!< Device type */
|
||||||
esp_ble_auth_req_t auth_mode; /*!< authentication mode */
|
esp_ble_auth_req_t auth_mode; /*!< Authentication mode */
|
||||||
} esp_ble_auth_cmpl_t; /*!< The ble authentication complete cb type */
|
} esp_ble_auth_cmpl_t; /*!< The ble authentication complete cb type */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief union associated with ble security
|
* @brief union associated with ble security
|
||||||
|
@ -216,7 +216,13 @@
|
|||||||
#define UC_BT_SMP_MAX_BONDS 8
|
#define UC_BT_SMP_MAX_BONDS 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Device Nane Maximum Length
|
#ifdef CONFIG_BT_BLE_SMP_ID_RESET_ENABLE
|
||||||
|
#define UC_BT_BLE_SMP_ID_RESET_ENABLE CONFIG_BT_BLE_SMP_ID_RESET_ENABLE
|
||||||
|
#else
|
||||||
|
#define UC_BT_BLE_SMP_ID_RESET_ENABLE FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Device Name Maximum Length
|
||||||
#ifdef CONFIG_BT_MAX_DEVICE_NAME_LEN
|
#ifdef CONFIG_BT_MAX_DEVICE_NAME_LEN
|
||||||
#define UC_MAX_LOC_BD_NAME_LEN CONFIG_BT_MAX_DEVICE_NAME_LEN
|
#define UC_MAX_LOC_BD_NAME_LEN CONFIG_BT_MAX_DEVICE_NAME_LEN
|
||||||
#else
|
#else
|
||||||
|
@ -277,6 +277,12 @@
|
|||||||
#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE
|
#define SMP_SLAVE_CON_PARAMS_UPD_ENABLE FALSE
|
||||||
#endif /* UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE */
|
#endif /* UC_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE */
|
||||||
|
|
||||||
|
#if (UC_BT_BLE_SMP_ID_RESET_ENABLE)
|
||||||
|
#define BLE_SMP_ID_RESET_ENABLE TRUE
|
||||||
|
#else
|
||||||
|
#define BLE_SMP_ID_RESET_ENABLE FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
#ifdef UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP
|
||||||
#define BLE_ADV_REPORT_FLOW_CONTROL (UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP && BLE_INCLUDED)
|
#define BLE_ADV_REPORT_FLOW_CONTROL (UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP && BLE_INCLUDED)
|
||||||
#endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */
|
#endif /* UC_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP */
|
||||||
@ -1372,7 +1378,7 @@
|
|||||||
#define GATT_CONFORMANCE_TESTING FALSE
|
#define GATT_CONFORMANCE_TESTING FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* number of background connection device allowence, ideally to be the same as WL size
|
/* number of background connection device allowance, ideally to be the same as WL size
|
||||||
*/
|
*/
|
||||||
#ifndef GATT_MAX_BG_CONN_DEV
|
#ifndef GATT_MAX_BG_CONN_DEV
|
||||||
#define GATT_MAX_BG_CONN_DEV 8 /*MAX is 32*/
|
#define GATT_MAX_BG_CONN_DEV 8 /*MAX is 32*/
|
||||||
|
@ -330,7 +330,7 @@ void btm_ble_remove_resolving_list_entry_complete(UINT8 *p, UINT16 evt_len)
|
|||||||
BTM_TRACE_DEBUG("%s status = %d", __func__, status);
|
BTM_TRACE_DEBUG("%s status = %d", __func__, status);
|
||||||
|
|
||||||
if (!btm_ble_deq_resolving_pending(pseudo_bda)) {
|
if (!btm_ble_deq_resolving_pending(pseudo_bda)) {
|
||||||
BTM_TRACE_ERROR("%s no pending resolving list operation", __func__);
|
BTM_TRACE_DEBUG("%s no pending resolving list operation", __func__);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1147,6 +1147,9 @@ void btm_ble_add_default_entry_to_resolving_list(void)
|
|||||||
BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
|
BD_ADDR peer_addr = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
|
||||||
BT_OCTET16 peer_irk = {0x0};
|
BT_OCTET16 peer_irk = {0x0};
|
||||||
|
|
||||||
|
// Remove the existing entry in resolving list When resetting the device identity
|
||||||
|
btsnd_hcic_ble_rm_device_resolving_list(BLE_ADDR_PUBLIC, peer_addr);
|
||||||
|
|
||||||
btsnd_hcic_ble_add_device_resolving_list (BLE_ADDR_PUBLIC, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk);
|
btsnd_hcic_ble_add_device_resolving_list (BLE_ADDR_PUBLIC, peer_addr, peer_irk, btm_cb.devcb.id_keys.irk);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -178,20 +178,31 @@ BOOLEAN BTM_SecAddDevice (BD_ADDR bd_addr, DEV_CLASS dev_class, BD_NAME bd_name,
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
BOOLEAN BTM_SecDeleteDevice (BD_ADDR bd_addr, tBT_TRANSPORT transport)
|
||||||
{
|
{
|
||||||
|
|
||||||
tBTM_SEC_DEV_REC *p_dev_rec;
|
tBTM_SEC_DEV_REC *p_dev_rec;
|
||||||
|
|
||||||
if (BTM_IsAclConnectionUp(bd_addr, transport)) {
|
if (BTM_IsAclConnectionUp(bd_addr, transport)) {
|
||||||
BTM_TRACE_WARNING("%s FAILED: Cannot Delete when connection is active\n", __func__);
|
BTM_TRACE_WARNING("%s FAILED: Cannot Delete when connection is active\n", __func__);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
|
if ((p_dev_rec = btm_find_dev(bd_addr)) != NULL) {
|
||||||
/* Tell controller to get rid of the link key, if it has one stored */
|
/* Tell controller to get rid of the link key, if it has one stored */
|
||||||
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
|
BTM_DeleteStoredLinkKey (p_dev_rec->bd_addr, NULL);
|
||||||
|
|
||||||
btm_sec_free_dev(p_dev_rec, transport);
|
btm_sec_free_dev(p_dev_rec, transport);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if (BLE_SMP_ID_RESET_ENABLE == TRUE)
|
||||||
|
/*
|
||||||
|
* There are tracking risks associated with using a fixed or static IRK.
|
||||||
|
* A best-practices approach, when all pairing and bonding records are deleted,
|
||||||
|
* assign a new randomly-generated IRK.
|
||||||
|
*/
|
||||||
|
if (list_is_empty(btm_cb.p_sec_dev_rec_list)) {
|
||||||
|
btm_ble_reset_id();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -639,7 +650,7 @@ tBTM_SEC_DEV_REC *btm_find_oldest_dev (void)
|
|||||||
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
tBTM_SEC_DEV_REC *p_dev_rec = NULL;
|
||||||
tBTM_SEC_DEV_REC *p_oldest = NULL;
|
tBTM_SEC_DEV_REC *p_oldest = NULL;
|
||||||
list_node_t *p_node = NULL;
|
list_node_t *p_node = NULL;
|
||||||
UINT32 ot = 0xFFFFFFFF;
|
UINT32 old_ts = 0xFFFFFFFF;
|
||||||
|
|
||||||
/* First look for the non-paired devices for the oldest entry */
|
/* First look for the non-paired devices for the oldest entry */
|
||||||
for (p_node = list_begin(btm_cb.p_sec_dev_rec_list); p_node; p_node = list_next(p_node)) {
|
for (p_node = list_begin(btm_cb.p_sec_dev_rec_list); p_node; p_node = list_next(p_node)) {
|
||||||
@ -649,13 +660,13 @@ tBTM_SEC_DEV_REC *btm_find_oldest_dev (void)
|
|||||||
continue; /* Device is paired so skip it */
|
continue; /* Device is paired so skip it */
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_dev_rec->timestamp < ot) {
|
if (p_dev_rec->timestamp < old_ts) {
|
||||||
p_oldest = p_dev_rec;
|
p_oldest = p_dev_rec;
|
||||||
ot = p_dev_rec->timestamp;
|
old_ts = p_dev_rec->timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ot != 0xFFFFFFFF) {
|
if (old_ts != 0xFFFFFFFF) {
|
||||||
return (p_oldest);
|
return (p_oldest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -665,9 +676,9 @@ tBTM_SEC_DEV_REC *btm_find_oldest_dev (void)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_dev_rec->timestamp < ot) {
|
if (p_dev_rec->timestamp < old_ts) {
|
||||||
p_oldest = p_dev_rec;
|
p_oldest = p_dev_rec;
|
||||||
ot = p_dev_rec->timestamp;
|
old_ts = p_dev_rec->timestamp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (p_oldest);
|
return (p_oldest);
|
||||||
|
@ -115,7 +115,6 @@ r_lld_con_evt_time_update_eco = 0x40001d0c;
|
|||||||
r_lld_con_start_eco = 0x40001d10;
|
r_lld_con_start_eco = 0x40001d10;
|
||||||
r_lld_con_frm_isr_eco = 0x40001d14;
|
r_lld_con_frm_isr_eco = 0x40001d14;
|
||||||
r_lld_con_tx_eco = 0x40001d18;
|
r_lld_con_tx_eco = 0x40001d18;
|
||||||
r_lld_scan_evt_start_cbk_eco = 0x40001d20;
|
|
||||||
r_lld_ext_scan_dynamic_pti_process_eco = 0x40001d28;
|
r_lld_ext_scan_dynamic_pti_process_eco = 0x40001d28;
|
||||||
r_lld_scan_frm_eof_isr_eco = 0x40001d2c;
|
r_lld_scan_frm_eof_isr_eco = 0x40001d2c;
|
||||||
r_lld_sync_start_eco = 0x40001d30;
|
r_lld_sync_start_eco = 0x40001d30;
|
||||||
@ -142,7 +141,6 @@ r_bt_bb_recorrect_is_dead = 0x40001d84;
|
|||||||
r_bt_bb_restart_hw_recorrect = 0x40001d88;
|
r_bt_bb_restart_hw_recorrect = 0x40001d88;
|
||||||
r_ke_task_handler_pre = 0x40001da0;
|
r_ke_task_handler_pre = 0x40001da0;
|
||||||
r_ke_task_handler_end = 0x40001da4;
|
r_ke_task_handler_end = 0x40001da4;
|
||||||
r_ke_task_handler_get_overwrite = 0x40001da8;
|
|
||||||
r_lld_scan_frm_skip_isr_eco = 0x40001db0;
|
r_lld_scan_frm_skip_isr_eco = 0x40001db0;
|
||||||
r_lld_ext_scan_dynamic_pti_reset = 0x40001db4;
|
r_lld_ext_scan_dynamic_pti_reset = 0x40001db4;
|
||||||
r_llc_rem_phy_upd_proc_continue_eco = 0x40001db8;
|
r_llc_rem_phy_upd_proc_continue_eco = 0x40001db8;
|
||||||
@ -215,6 +213,8 @@ r_lld_scan_start_eco = 0x40001d24;
|
|||||||
r_lld_scan_try_sched_eco = 0x40001dac;
|
r_lld_scan_try_sched_eco = 0x40001dac;
|
||||||
r_lld_scan_start_hook = 0x40001c74;
|
r_lld_scan_start_hook = 0x40001c74;
|
||||||
r_lld_init_start_hook = 0x40001cb8;
|
r_lld_init_start_hook = 0x40001cb8;
|
||||||
|
r_lld_scan_evt_start_cbk_eco = 0x40001d20;
|
||||||
|
r_ke_task_handler_get_overwrite = 0x40001da8;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@ -1107,7 +1107,7 @@ r_lld_res_list_is_empty = 0x40001220;
|
|||||||
r_lld_res_list_local_rpa_get = 0x40001224;
|
r_lld_res_list_local_rpa_get = 0x40001224;
|
||||||
r_lld_res_list_peer_rpa_get = 0x40001228;
|
r_lld_res_list_peer_rpa_get = 0x40001228;
|
||||||
r_lld_res_list_peer_update = 0x4000122c;
|
r_lld_res_list_peer_update = 0x4000122c;
|
||||||
r_lld_res_list_priv_mode_update = 0x40001230;
|
/* r_lld_res_list_priv_mode_update = 0x40001230; */
|
||||||
r_lld_reset_reg = 0x40001238;
|
r_lld_reset_reg = 0x40001238;
|
||||||
r_lld_rpa_renew = 0x4000123c;
|
r_lld_rpa_renew = 0x4000123c;
|
||||||
r_lld_rpa_renew_evt_canceled_cbk = 0x40001240;
|
r_lld_rpa_renew_evt_canceled_cbk = 0x40001240;
|
||||||
@ -1243,10 +1243,10 @@ r_rw_cryto_aes_cmac = 0x4000145c;
|
|||||||
r_rw_v9_init_em_radio_table = 0x40001460;
|
r_rw_v9_init_em_radio_table = 0x40001460;
|
||||||
r_rwble_sleep_enter = 0x40001468;
|
r_rwble_sleep_enter = 0x40001468;
|
||||||
r_rwble_sleep_wakeup_end = 0x4000146c;
|
r_rwble_sleep_wakeup_end = 0x4000146c;
|
||||||
r_rwbtdm_isr_wrapper = 0x40001470;
|
/* r_rwbtdm_isr_wrapper = 0x40001470; */
|
||||||
r_rwip_active_check = 0x40001474;
|
r_rwip_active_check = 0x40001474;
|
||||||
r_rwip_aes_encrypt = 0x40001478;
|
r_rwip_aes_encrypt = 0x40001478;
|
||||||
r_rwip_assert = 0x4000147c;
|
/* r_rwip_assert = 0x4000147c; */
|
||||||
r_rwip_crypt_evt_handler = 0x40001480;
|
r_rwip_crypt_evt_handler = 0x40001480;
|
||||||
r_rwip_crypt_isr_handler = 0x40001484;
|
r_rwip_crypt_isr_handler = 0x40001484;
|
||||||
r_rwip_eif_get = 0x40001488;
|
r_rwip_eif_get = 0x40001488;
|
||||||
|
@ -1380,7 +1380,7 @@ r_lld_res_list_is_empty = 0x40004644;
|
|||||||
r_lld_res_list_local_rpa_get = 0x40004650;
|
r_lld_res_list_local_rpa_get = 0x40004650;
|
||||||
r_lld_res_list_peer_rpa_get = 0x4000465c;
|
r_lld_res_list_peer_rpa_get = 0x4000465c;
|
||||||
r_lld_res_list_peer_update = 0x40004668;
|
r_lld_res_list_peer_update = 0x40004668;
|
||||||
r_lld_res_list_priv_mode_update = 0x40004674;
|
/* r_lld_res_list_priv_mode_update = 0x40004674; */
|
||||||
r_lld_reset_reg = 0x4000468c;
|
r_lld_reset_reg = 0x4000468c;
|
||||||
r_lld_rpa_renew = 0x40004698;
|
r_lld_rpa_renew = 0x40004698;
|
||||||
r_lld_rpa_renew_evt_canceled_cbk = 0x400046a4;
|
r_lld_rpa_renew_evt_canceled_cbk = 0x400046a4;
|
||||||
@ -1516,10 +1516,10 @@ r_rw_cryto_aes_cmac = 0x40004cf8;
|
|||||||
r_rw_v9_init_em_radio_table = 0x40004d04;
|
r_rw_v9_init_em_radio_table = 0x40004d04;
|
||||||
r_rwble_sleep_enter = 0x40004d1c;
|
r_rwble_sleep_enter = 0x40004d1c;
|
||||||
r_rwble_sleep_wakeup_end = 0x40004d28;
|
r_rwble_sleep_wakeup_end = 0x40004d28;
|
||||||
r_rwbtdm_isr_wrapper = 0x40004d34;
|
/* r_rwbtdm_isr_wrapper = 0x40004d34; */
|
||||||
r_rwip_active_check = 0x40004d40;
|
r_rwip_active_check = 0x40004d40;
|
||||||
r_rwip_aes_encrypt = 0x40004d4c;
|
r_rwip_aes_encrypt = 0x40004d4c;
|
||||||
r_rwip_assert = 0x40004d58;
|
/* r_rwip_assert = 0x40004d58; */
|
||||||
r_rwip_crypt_evt_handler = 0x40004d64;
|
r_rwip_crypt_evt_handler = 0x40004d64;
|
||||||
r_rwip_crypt_isr_handler = 0x40004d70;
|
r_rwip_crypt_isr_handler = 0x40004d70;
|
||||||
r_rwip_eif_get = 0x40004d7c;
|
r_rwip_eif_get = 0x40004d7c;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user