bt: fix Bluedroid compile errors after enable CONFIG_ESP_SYSTEM_USE_EH_FRAME on RISC-V SoCs

This root cause is incorrect source code separation by conditonal MACROs for BLE L2CAP COC related functions
This commit is contained in:
wangmengyang 2023-02-10 20:46:29 +08:00
parent 4199164ca1
commit 50015c6047
7 changed files with 28 additions and 12 deletions

View File

@ -984,6 +984,19 @@
#define BLE_MAX_L2CAP_CLIENTS 15
#endif
/* Support status of L2CAP connection-oriented dynamic channels over LE transport with dynamic CID */
#ifndef BLE_L2CAP_COC_INCLUDED
#define BLE_L2CAP_COC_INCLUDED FALSE // LE COC not use by default
#endif
/* Support status of L2CAP connection-oriented dynamic channels over LE or BR/EDR transport with dynamic CID */
#ifndef L2CAP_COC_INCLUDED
#if (CLASSIC_BT_INCLUDED == TRUE || BLE_L2CAP_COC_INCLUDED == TRUE)
#define L2CAP_COC_INCLUDED TRUE
#else
#define L2CAP_COC_INCLUDED FALSE
#endif
#endif
/* The maximum number of simultaneous links that L2CAP can support. Up to 7*/
#ifndef MAX_ACL_CONNECTIONS

View File

@ -500,6 +500,7 @@ extern BOOLEAN L2CA_DisconnectReq (UINT16 cid);
extern BOOLEAN L2CA_DisconnectRsp (UINT16 cid);
#endif ///CLASSIC_BT_INCLUDED == TRUE
#if (BLE_L2CAP_COC_INCLUDED == TRUE)
/*******************************************************************************
**
** Function L2CA_RegisterLECoc
@ -567,6 +568,8 @@ extern BOOLEAN L2CA_ConnectLECocRsp (BD_ADDR p_bd_addr, UINT8 id, UINT16 lcid, U
*******************************************************************************/
extern BOOLEAN L2CA_GetPeerLECocConfig (UINT16 lcid, tL2CAP_LE_CFG_INFO* peer_cfg);
#endif // (BLE_L2CAP_COC_INCLUDED == TRUE)
/*******************************************************************************
**
** Function L2CA_DataWrite

View File

@ -695,11 +695,12 @@ extern void l2cu_release_rcb (tL2C_RCB *p_rcb);
extern tL2C_RCB *l2cu_allocate_ble_rcb (UINT16 psm);
extern tL2C_RCB *l2cu_find_ble_rcb_by_psm (UINT16 psm);
#if (L2CAP_COC_INCLUDED == TRUE)
extern UINT8 l2cu_process_peer_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg);
extern void l2cu_process_peer_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg);
extern void l2cu_process_our_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg);
extern void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg);
#endif // (L2CAP_COC_INCLUDED == TRUE)
extern void l2cu_device_reset (void);
extern tL2C_LCB *l2cu_find_lcb_by_state (tL2C_LINK_STATE state);
@ -752,11 +753,11 @@ extern void l2cu_set_info_rsp_mask (UINT32 mask);
/* Functions provided by l2c_csm.c
************************************
*/
#if (L2CAP_COC_INCLUDED == TRUE)
extern void l2c_csm_execute (tL2C_CCB *p_ccb, UINT16 event, void *p_data);
#endif
extern void l2c_enqueue_peer_data (tL2C_CCB *p_ccb, BT_HDR *p_buf);
/* Functions provided by l2c_fcr.c
************************************
*/

View File

@ -1297,7 +1297,7 @@ UINT8 L2CA_GetChnlFcrMode (UINT16 lcid)
#endif ///CLASSIC_BT_INCLUDED == TRUE
#if (BLE_INCLUDED == TRUE)
#if (BLE_L2CAP_COC_INCLUDED == TRUE)
/*******************************************************************************
**
** Function L2CA_RegisterLECoc
@ -1608,7 +1608,7 @@ BOOLEAN L2CA_GetPeerLECocConfig (UINT16 lcid, tL2CAP_LE_CFG_INFO* peer_cfg)
return TRUE;
}
#endif ///BLE_INCLUDED == TRUE
#endif // (BLE_L2CAP_COC_INCLUDED == TRUE)
#if (L2CAP_NUM_FIXED_CHNLS > 0)
/*******************************************************************************

View File

@ -36,7 +36,7 @@
#include "stack/hcimsgs.h"
#include "osi/allocator.h"
#if (CLASSIC_BT_INCLUDED == TRUE)
#if (L2CAP_COC_INCLUDED == TRUE)
/********************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
/********************************************************************************/
@ -1117,7 +1117,7 @@ static void l2c_csm_w4_l2ca_disconnect_rsp (tL2C_CCB *p_ccb, UINT16 event, void
break;
}
}
#endif ///CLASSIC_BT_INCLUDED == TRUE
#endif /// (L2CAP_COC_INCLUDED == TRUE)
#if (BT_TRACE_VERBOSE == TRUE)
/*******************************************************************************

View File

@ -37,7 +37,7 @@
#include "stack/btu.h"
#include "osi/allocator.h"
#if (CLASSIC_BT_INCLUDED == TRUE)
#if (L2CAP_COC_INCLUDED == TRUE)
/* Flag passed to retransmit_i_frames() when all packets should be retransmitted */
#define L2C_FCR_RETX_ALL_PKTS 0xFF
@ -2223,4 +2223,4 @@ static void l2c_fcr_collect_ack_delay (tL2C_CCB *p_ccb, UINT8 num_bufs_acked)
}
}
#endif
#endif ///CLASSIC_BT_INCLUDED == TRUE
#endif /// (L2CAP_COC_INCLUDED == TRUE)

View File

@ -1958,7 +1958,7 @@ tL2C_RCB *l2cu_find_ble_rcb_by_psm (UINT16 psm)
}
#endif ///BLE_INCLUDED == TRUE
#if (L2CAP_COC_INCLUDED == TRUE)
/*******************************************************************************
**
** Function l2cu_process_peer_cfg_req
@ -2220,7 +2220,6 @@ void l2cu_process_our_cfg_req (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg)
** Returns void
**
*******************************************************************************/
#if (CLASSIC_BT_INCLUDED == TRUE)
void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg)
{
/* If peer wants QoS, we are allowed to change the values in a positive response */
@ -2232,7 +2231,7 @@ void l2cu_process_our_cfg_rsp (tL2C_CCB *p_ccb, tL2CAP_CFG_INFO *p_cfg)
l2c_fcr_adj_our_rsp_options (p_ccb, p_cfg);
}
#endif ///CLASSIC_BT_INCLUDED == TRUE
#endif // (L2CAP_COC_INCLUDED == TRUE)
/*******************************************************************************