Fixed build errors when sniff subrating is enabled.

This commit is contained in:
Jin Cheng 2023-02-06 15:30:35 +08:00
parent 885e501d99
commit 2db423c62b
4 changed files with 10 additions and 25 deletions

View File

@ -54,7 +54,7 @@ static void bta_dm_pm_stop_timer_by_index(tBTA_PM_TIMER *p_timer,
#if (BTM_SSR_INCLUDED == TRUE) #if (BTM_SSR_INCLUDED == TRUE)
#if (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE) #if (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE)
#include "../hh/bta_hh_int.h" #include "bta_hh_int.h"
/* BTA_DM_PM_SSR1 will be dedicated for HH SSR setting entry, no other profile can use it */ /* BTA_DM_PM_SSR1 will be dedicated for HH SSR setting entry, no other profile can use it */
#define BTA_DM_PM_SSR_HH BTA_DM_PM_SSR1 #define BTA_DM_PM_SSR_HH BTA_DM_PM_SSR1
#endif /* (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE) */ #endif /* (defined BTA_HH_INCLUDED && BTA_HH_INCLUDED == TRUE) */

View File

@ -951,7 +951,7 @@
/* TRUE to include Sniff Subrating */ /* TRUE to include Sniff Subrating */
#if (BTA_DM_PM_INCLUDED == TRUE) #if (BTA_DM_PM_INCLUDED == TRUE)
#ifndef BTM_SSR_INCLUDED #ifndef BTM_SSR_INCLUDED
#define BTM_SSR_INCLUDED FALSE #define BTM_SSR_INCLUDED TRUE
#endif #endif
#endif /* BTA_DM_PM_INCLUDED */ #endif /* BTA_DM_PM_INCLUDED */

View File

@ -310,14 +310,10 @@ tBTM_STATUS BTM_SetSsrParams (BD_ADDR remote_bda, UINT16 max_lat,
UINT16 min_rmt_to, UINT16 min_loc_to) UINT16 min_rmt_to, UINT16 min_loc_to)
{ {
#if (BTM_SSR_INCLUDED == TRUE) #if (BTM_SSR_INCLUDED == TRUE)
int acl_ind;
tBTM_PM_MCB *p_cb; tBTM_PM_MCB *p_cb;
tACL_CONN *p_acl_cb = NULL; tACL_CONN *p_acl_cb = NULL;
if ( (acl_ind = btm_pm_find_acl_ind(remote_bda)) == MAX_L2CAP_LINKS) { p_acl_cb = btm_bda_to_acl(remote_bda, BT_TRANSPORT_BR_EDR);
return (BTM_UNKNOWN_ADDR);
}
p_acl_cb = btm_bda_to_acl(remote_bda);
if (!p_acl_cb) { if (!p_acl_cb) {
return (BTM_UNKNOWN_ADDR); return (BTM_UNKNOWN_ADDR);
} }
@ -841,7 +837,7 @@ void btm_pm_proc_ssr_evt (UINT8 *p, UINT16 evt_len)
UINT8 status; UINT8 status;
UINT16 handle; UINT16 handle;
UINT16 max_rx_lat; UINT16 max_rx_lat;
int xx, yy; int xx;
tBTM_PM_MCB *p_cb; tBTM_PM_MCB *p_cb;
tACL_CONN *p_acl = NULL; tACL_CONN *p_acl = NULL;
UINT16 use_ssr = TRUE; UINT16 use_ssr = TRUE;
@ -865,10 +861,10 @@ void btm_pm_proc_ssr_evt (UINT8 *p, UINT16 evt_len)
} }
/* notify registered parties */ /* notify registered parties */
for (yy = 0; yy < BTM_MAX_PM_RECORDS; yy++) { for (xx = 0; xx < BTM_MAX_PM_RECORDS; xx++) {
if (btm_cb.pm_reg_db[yy].mask & BTM_PM_REG_NOTIF) { if (btm_cb.pm_reg_db[xx].mask & BTM_PM_REG_NOTIF) {
if ( p_acl) { if ( p_acl) {
(*btm_cb.pm_reg_db[yy].cback)( p_acl->remote_addr, BTM_PM_STS_SSR, use_ssr, status); (*btm_cb.pm_reg_db[xx].cback)( p_acl->remote_addr, BTM_PM_STS_SSR, use_ssr, status);
} }
} }
} }

View File

@ -118,11 +118,7 @@ static void btu_hcif_link_supv_to_changed_evt (UINT8 *p);
static void btu_hcif_enhanced_flush_complete_evt (void); static void btu_hcif_enhanced_flush_complete_evt (void);
#endif #endif
#if (BTM_SSR_INCLUDED == TRUE)
static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len); static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len);
#else
static void btu_hcif_ssr_evt_dump (UINT8 *p, UINT16 evt_len);
#endif /* BTM_SSR_INCLUDED == TRUE */
#if BLE_INCLUDED == TRUE #if BLE_INCLUDED == TRUE
static void btu_ble_ll_conn_complete_evt (UINT8 *p, UINT16 evt_len); static void btu_ble_ll_conn_complete_evt (UINT8 *p, UINT16 evt_len);
@ -304,11 +300,7 @@ void btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
btu_hcif_esco_connection_chg_evt (p); btu_hcif_esco_connection_chg_evt (p);
break; break;
case HCI_SNIFF_SUB_RATE_EVT: case HCI_SNIFF_SUB_RATE_EVT:
#if (BTM_SSR_INCLUDED == TRUE)
btu_hcif_ssr_evt (p, hci_evt_len); btu_hcif_ssr_evt (p, hci_evt_len);
#else
btu_hcif_ssr_evt_dump (p, hci_evt_len);
#endif /* BTM_SSR_INCLUDED == TRUE */
break; break;
case HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT: case HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT:
btu_hcif_host_support_evt (p); btu_hcif_host_support_evt (p);
@ -1573,14 +1565,12 @@ static void btu_hcif_mode_change_evt (UINT8 *p)
** Returns void ** Returns void
** **
*******************************************************************************/ *******************************************************************************/
#if (BTM_SSR_INCLUDED == TRUE)
static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len) static void btu_hcif_ssr_evt (UINT8 *p, UINT16 evt_len)
{ {
#if (BTM_SSR_INCLUDED == TRUE)
btm_pm_proc_ssr_evt(p, evt_len); btm_pm_proc_ssr_evt(p, evt_len);
} #endif
#else
static void btu_hcif_ssr_evt_dump (UINT8 *p, UINT16 evt_len)
{
UINT8 status; UINT8 status;
UINT16 handle; UINT16 handle;
UINT16 max_tx_lat; UINT16 max_tx_lat;
@ -1598,7 +1588,6 @@ static void btu_hcif_ssr_evt_dump (UINT8 *p, UINT16 evt_len)
HCI_TRACE_WARNING("hcif ssr evt: st 0x%x, hdl 0x%x, tx_lat %d rx_lat %d", status, handle, max_tx_lat, max_rx_lat); HCI_TRACE_WARNING("hcif ssr evt: st 0x%x, hdl 0x%x, tx_lat %d rx_lat %d", status, handle, max_tx_lat, max_rx_lat);
} }
#endif
/******************************************************************************* /*******************************************************************************
** **