fix(ble/bluedroid): optimize bluedroid host code

(cherry picked from commit 3b18da2bde)

Co-authored-by: zhiweijian <zhiweijian@espressif.com>
This commit is contained in:
Zhi Wei Jian
2026-01-07 17:24:33 +08:00
parent 016cd78b30
commit 04f4602a6a
7 changed files with 51 additions and 20 deletions
@@ -331,15 +331,15 @@ typedef struct {
** BLE Inquiry
*****************************************************/
tBTM_BLE_INQ_CB inq_var;
#if (BLE_42_SCAN_EN == TRUE)
#if (BLE_ADV_REPORT_FLOW_CONTROL == TRUE)
// /* observer callback and timer */
tBTM_INQ_DIS_CB *p_obs_discard_cb;
#endif // (BLE_ADV_REPORT_FLOW_CONTROL == TRUE)
/* scan callback and timer */
tBTM_INQ_RESULTS_CB *p_scan_results_cb;
tBTM_CMPL_CB *p_scan_cmpl_cb;
TIMER_LIST_ENT scan_timer_ent;
#if (BLE_42_SCAN_EN == TRUE)
struct pkt_queue *adv_rpt_queue;
struct osi_event *adv_rpt_ready;
#endif // #if (BLE_42_SCAN_EN == TRUE)
@@ -384,11 +384,15 @@ typedef struct {
#if (BLE_TOPOLOGY_CHECK == TRUE)
/* current BLE link state */
tBTM_BLE_STATE_MASK cur_states; /* bit mask of tBTM_BLE_STATE */
#endif // (BLE_TOPOLOGY_CHECK == TRUE)
UINT8 link_count[2]; /* total link count master and slave*/
#endif // (BLE_TOPOLOGY_CHECK == TRUE)
#if ((BLE_42_SCAN_EN == TRUE) || (BLE_50_EXTEND_SCAN_EN == TRUE))
tBTM_UPDATE_DUPLICATE_EXCEPTIONAL_LIST_CMPL_CBACK *update_exceptional_list_cmp_cb;
#endif // ((BLE_42_SCAN_EN == TRUE) || (BLE_50_EXTEND_SCAN_EN == TRUE))
#if (BLE_VENDOR_HCI_EN == TRUE)
tBTM_SET_CSA_SUPPORT_CMPL_CBACK *set_csa_support_cmpl_cb;
tBTM_SET_VENDOR_EVT_MASK_CBACK *set_vendor_evt_mask_cmpl_cb;
#endif // (BLE_VENDOR_HCI_EN == TRUE)
} tBTM_BLE_CB;
#ifdef __cplusplus
@@ -867,8 +867,9 @@ typedef struct {
list_t *p_acl_db_list;
#if (CLASSIC_BT_INCLUDED == TRUE)
UINT8 btm_scn[BTM_MAX_SCN]; /* current SCNs: TRUE if SCN is in use */
#endif ///CLASSIC_BT_INCLUDED == TRUE
UINT16 btm_def_link_policy;
#endif ///CLASSIC_BT_INCLUDED == TRUE
UINT16 btm_def_link_super_tout;
tBTM_ACL_LINK_STAT_CB *p_acl_link_stat_cb; /* Callback for when ACL link related events came */
@@ -894,12 +895,15 @@ typedef struct {
*****************************************************/
#if (BLE_INCLUDED == TRUE)
tBTM_BLE_CB ble_ctr_cb;
#if (SMP_INCLUDED == TRUE)
UINT16 enc_handle;
BT_OCTET8 enc_rand; /* received rand value from LTK request*/
UINT16 ediv; /* received ediv value from LTK request */
UINT8 key_size;
#endif // (SMP_INCLUDED == TRUE)
#if ((SMP_INCLUDED == TRUE) || (BLE_PRIVACY_SPT == TRUE))
BOOLEAN addr_res_en; /* internal use for test: address resolution enable/disable */
#endif // ((SMP_INCLUDED == TRUE) || (BLE_PRIVACY_SPT == TRUE))
#endif
/* Packet types supported by the local device */
@@ -982,8 +986,12 @@ typedef struct {
fixed_queue_t *page_queue;
BOOLEAN paging;
#endif // #if (CLASSIC_BT_INCLUDED == TRUE)
#if (SMP_INCLUDED == TRUE && CLASSIC_BT_INCLUDED == TRUE)
BOOLEAN discing;
#endif // (SMP_INCLUDED == TRUE && CLASSIC_BT_INCLUDED == TRUE)
#if (SMP_INCLUDED == TRUE)
fixed_queue_t *sec_pending_q; /* pending sequrity requests in tBTM_SEC_QUEUE_ENTRY format */
#endif // (SMP_INCLUDED == TRUE)
#if (!defined(BT_TRACE_VERBOSE) || (BT_TRACE_VERBOSE == FALSE))
char state_temp_buffer[BTM_STATE_BUFFER_SIZE];
#endif