Skip to content

Commit

Permalink
Merge branch 'bugfix/bluedroid_le_coc_compile_error' into 'master'
Browse files Browse the repository at this point in the history
bt: fix Bluedroid compile errors after enable CONFIG_ESP_SYSTEM_USE_EH_FRAME on RISC-V SoCs

Closes BT-2862

See merge request espressif/esp-idf!22321
  • Loading branch information
jack0c committed Feb 20, 2023
2 parents c88efb7 + 3279b4d commit 0591695
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 12 deletions.
13 changes: 13 additions & 0 deletions components/bt/host/bluedroid/common/include/common/bt_target.h
Expand Up @@ -1015,6 +1015,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
Expand Down
3 changes: 3 additions & 0 deletions components/bt/host/bluedroid/stack/include/stack/l2c_api.h
Expand Up @@ -501,6 +501,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
Expand Down Expand Up @@ -568,6 +569,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
Expand Down
7 changes: 4 additions & 3 deletions components/bt/host/bluedroid/stack/l2cap/include/l2c_int.h
Expand Up @@ -694,11 +694,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);
Expand Down Expand Up @@ -751,11 +752,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
************************************
*/
Expand Down
4 changes: 2 additions & 2 deletions components/bt/host/bluedroid/stack/l2cap/l2c_api.c
Expand Up @@ -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
Expand Down Expand Up @@ -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)
/*******************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions components/bt/host/bluedroid/stack/l2cap/l2c_csm.c
Expand Up @@ -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 */
/********************************************************************************/
Expand Down Expand Up @@ -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)
/*******************************************************************************
Expand Down
4 changes: 2 additions & 2 deletions components/bt/host/bluedroid/stack/l2cap/l2c_fcr.c
Expand Up @@ -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
Expand Down Expand Up @@ -2226,4 +2226,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)
5 changes: 2 additions & 3 deletions components/bt/host/bluedroid/stack/l2cap/l2c_utils.c
Expand Up @@ -1927,7 +1927,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
Expand Down Expand Up @@ -2189,7 +2189,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 */
Expand All @@ -2201,7 +2200,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)


/*******************************************************************************
Expand Down

0 comments on commit 0591695

Please sign in to comment.