mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
change(bt/controller): Adapt BR/EDR controller to new architecture
This commit is contained in:
@@ -399,10 +399,15 @@ const void * const _btdm_coex_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH
|
||||
[1] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
sym_coexHook_WcEp3uxRHd6HYgB0pn0L,
|
||||
),
|
||||
[2] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
sym_coexHook_wiWNhAUWlHyTZ7Z5ZC5Z,
|
||||
),
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
[2] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_coexHook_wiWNhAUWlHyTZ7Z5ZC5Z,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
odm_afh_on_coex_wifi_channel_change,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
);
|
||||
|
||||
void * _btdm_hal_linear_broker_ram[] = BTDM_BROKER_NODE_DEF_RAM(
|
||||
@@ -420,10 +425,14 @@ void * _btdm_hal_linear_broker_ram[] = BTDM_BROKER_NODE_DEF_RAM(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_base_NVN4AbeIskmtcV2PX3N1,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
olc_intc_on_hal_exit_isr,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
);
|
||||
|
||||
const void * const _btdm_hci_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH(
|
||||
[1] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#if UC_BLE_CTRL_CONN_ENABLED
|
||||
sym_conn_eZ0plXo8e56VyJXdcbNn,
|
||||
@@ -443,7 +452,6 @@ const void * const _btdm_hci_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH(
|
||||
hci_tl_bredr_on_rx_cmd_set_c2h_flow_ctrl,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
);
|
||||
|
||||
const void * const _btdm_sched_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH(
|
||||
@@ -457,23 +465,38 @@ const void * const _btdm_sched_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLAS
|
||||
[3] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
sym_scan_0gIKmjMRFT37raN6hnDo,
|
||||
),
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
[6] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_sched_MzeSZzbQ4ZKhWW6Wu5jV,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
btdm_common_sched_bredr_on_sched_hw_list_done,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
[7] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_sched_wfZseauvjWnjfiu10yWN,
|
||||
),
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
olc_sleep_on_sched_get_earlist_ticks,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
);
|
||||
|
||||
void * _btdm_sched_linear_broker_ram[] = BTDM_BROKER_NODE_DEF_RAM(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
[1] = BTDM_BROKER_ENTRY_DEF_RAM(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#if UC_BT_CTRL_LE_ISO_ENABLED
|
||||
sym_iso_qYKZbEBVIsH27HGf5VCS,
|
||||
#endif /* UC_BT_CTRL_LE_ISO_ENABLED */
|
||||
sym_sched_PNMeumLUZPcz8o4UrTLi,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
olc_sleep_on_sched_actual_time_get,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
[2] = BTDM_BROKER_ENTRY_DEF_RAM(
|
||||
sym_scan_b8ogEC3hTjGmqL5oRuyw,
|
||||
),
|
||||
@@ -483,10 +506,15 @@ void * _btdm_sched_linear_broker_ram[] = BTDM_BROKER_NODE_DEF_RAM(
|
||||
[4] = BTDM_BROKER_ENTRY_DEF_RAM(
|
||||
sym_scan_tdX6OLWyRKYxelkB8vZ1,
|
||||
),
|
||||
[6] = BTDM_BROKER_ENTRY_DEF_RAM(
|
||||
sym_sched_hOsJ4rGq1XjiY7GjHycG,
|
||||
),
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
[6] = BTDM_BROKER_ENTRY_DEF_RAM(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_sched_hOsJ4rGq1XjiY7GjHycG,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
btdm_common_sched_bredr_on_sched_check_remaining,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
);
|
||||
|
||||
const void * const _btdm_sleep_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH(
|
||||
@@ -506,8 +534,8 @@ void * _btdm_sleep_linear_broker_ram[] = BTDM_BROKER_NODE_DEF_RAM(
|
||||
);
|
||||
|
||||
const void * const _btdm_task_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
[1] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_arr_CG7zWaZkh7QOTatTjs2v,
|
||||
sym_base_uevmRkB8BjrlJh1c3VnZ,
|
||||
#if UC_BT_CTRL_LE_BIS_BCAST_ENABLED
|
||||
@@ -539,8 +567,13 @@ const void * const _btdm_task_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH
|
||||
sym_pawrSync_k4txvaSWHJBXXqtE62MG,
|
||||
#endif /* UC_BLE_CTRL_PAWR_SYNC_SUPPORTED */
|
||||
sym_scan_1G8QO0lWyTS0nKOqvZOE,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
orca_ctrl_on_task_enable,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
[2] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
sym_arr_SH7I2IviDsjnpqawpi0F,
|
||||
sym_base_uuBMFaiuN71hyzVcBBth,
|
||||
#if UC_BT_CTRL_LE_BIS_BCAST_ENABLED
|
||||
@@ -568,7 +601,12 @@ const void * const _btdm_task_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH
|
||||
sym_pawrSync_2gh2xSEYHokuhQ7UohkM,
|
||||
#endif /* UC_BLE_CTRL_PAWR_SYNC_SUPPORTED */
|
||||
sym_scan_zmw2OczvfXFB4aIFaWkc,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
orca_ctrl_on_task_disable,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
[3] = BTDM_BROKER_ENTRY_DEF_FLASH(
|
||||
sym_base_IdP4ncGWlpNArj2oW20N,
|
||||
sym_coexHook_7UsddOHoZepnYRjYPawG,
|
||||
@@ -614,6 +652,9 @@ const void * const _btdm_task_linear_broker_flash[] = BTDM_BROKER_NODE_DEF_FLASH
|
||||
sym_scan_l1avG2cwTzJAlle4KLdU,
|
||||
sym_sync_NOAs4m6LAUpamsUYHfqm,
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
orca_ctrl_on_task_reset,
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
160
components/bt/include/common/btdm_bredr_vs.h
Normal file
160
components/bt/include/common/btdm_bredr_vs.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "sdkconfig.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// @brief HCI VS Events for Espressif's Bluetooth Classic Host
|
||||
//
|
||||
// @note The following HCI VS events are exclusively for Espressif's Bluetooth Classic Host (ESP-Bluedroid Host).
|
||||
// If you are using a non-ESP host or HCI UART, these events will remain disabled unless enabling the feature in the menuconfig (CONFIG_BT_CTRL_BR_EDR_LEGACY_AUTH_VENDOR_EVT).
|
||||
// Note, these init functions as well as these additional HCI VS events are intended for Espressif's Bluetooth Host use only.
|
||||
// Application developers **should not** call the init functions in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @brief This event indicates legacy authentication is completed by remote device (EVTCODE: 0xFF, SUBCODE: 0x03)
|
||||
*
|
||||
* @note The init function is `bt_stack_enableSecCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LEGACY_REM_AUTH_EVT_SUBCODE (0x03)
|
||||
/**
|
||||
* @brief legacy remote auth event parameters
|
||||
*/
|
||||
struct bt_hci_vs_legacy_rem_auth_evt {
|
||||
uint16_t conhdl; /*!< connection handle */
|
||||
};
|
||||
|
||||
//
|
||||
// @brief HCI VS Commands for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging commands are implemented in Bluetooth Classic controller pre-compiled libraries.
|
||||
// These commands are not linked into the application binary, unless the corresponding initialization function is explicitly called from the application.
|
||||
// They are intended for Espressif's internal use only. Application developers **should not** call the corresponding initialization function in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enablePktCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_WR_DM1_ENABLE_OCF (0x0181)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableClkCtrlVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CLK_UPDATE_OCF (0x0183)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_AFH_OCF (0x0187)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableBasicVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_EVT_MASK_OCF (0x0188)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SET_AFH_REPORTING_MODE_OCF (0x0189)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_MASK_RMT_CHANNEL_CLASSIFICATION_OCF (0x018a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_TX_TEST_START_OCF (0x018c)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_RX_TEST_START_OCF (0x018d)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_TX_TEST_END_OCF (0x018e)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableDTMVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DTM_RX_TEST_END_OCF (0x018f)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_PCA_OCF (0x0190)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_DISCARD_PING_OCF (0x0191)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_ENABLE_OCF (0x019a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_SEND_LMP_OCF (0x019b)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_SAVE_OCF (0x019c)
|
||||
|
||||
//
|
||||
// @brief HCI VS Events for Espressif's Internal-Use Debugging
|
||||
//
|
||||
// @note The following HCI VS debugging events are implemented in Bluetooth Classic controller pre-compiled libraries.
|
||||
// These events are not linked into the application binary, unless the corresponding initialization function is explicitly called from the application.
|
||||
// They are intended for Espressif's internal use only. Application developers **should not** call the corresponding initialization function in their applications.
|
||||
//
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_AFH_CHG_EVT_SUBCODE (0x05)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CH_CLASSIFICATION_EVT_SUBCODE (0x06)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableAfhVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_CH_CLASSIFICATION_REPORTING_MODE_EVT_SUBCODE (0x07)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_RECEIVED_EVT_SUBCODE (0x0a)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_TX_CFM_EVT_SUBCODE (0x0b)
|
||||
|
||||
/**
|
||||
* @note The init function is `bt_stack_enableInternalDbgVsCmd(true)`
|
||||
*/
|
||||
#define ESP_BT_VS_LMP_DBG_ENTERED_EVT_SUBCODE (0x0c)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -126,7 +126,7 @@ extern "C" {
|
||||
.scan_backoff_upperlimitmax = UC_BT_CTRL_LE_SCAN_BACKOFF_UPPERLIMITMAX, \
|
||||
.ble_chan_ass_en = UC_BT_CTRL_LE_CHAN_ASS_ENABLED, \
|
||||
.ble_data_lenth_zero_aux = UC_BT_CTRL_LE_ADV_DATA_LENGTH_ZERO_AUX, \
|
||||
.vhci_enabled = CONFIG_BT_CTRL_HCI_INTERFACE_USE_RAM, \
|
||||
.vhci_enabled = UC_BT_CTRL_HCI_INTERFACE_USE_RAM, \
|
||||
.ptr_check_enabled = UC_BT_CTRL_LE_PTR_CHECK_ENABLED, \
|
||||
.ble_adv_tx_options = UC_BT_CTRL_LE_ADV_TX_OPTIONS, \
|
||||
.skip_unnecessary_checks_en = 0, \
|
||||
@@ -326,4 +326,4 @@ esp_power_level_t esp_ble_tx_power_get_enhanced(esp_ble_enhanced_power_type_t po
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "btdm_user_cfg.h"
|
||||
|
||||
#include "../../common/btdm_le_vs.h"
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#include "../../common/btdm_le_vs.h"
|
||||
#endif // UC_BT_CTRL_BLE_IS_ENABLE
|
||||
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
#include "../../common/btdm_bredr_vs.h"
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
|
||||
@@ -109,6 +109,7 @@ extern int bredr_controller_init(void *cfg);
|
||||
extern void bredr_controller_deinit(void);
|
||||
extern int bredr_controller_enable(void);
|
||||
extern void bredr_controller_disable(void);
|
||||
extern void r_bredr_controller_reset(void);
|
||||
extern int bredr_controller_env_init(void *cfg);
|
||||
extern void bredr_controller_env_deinit(void);
|
||||
extern void bredr_register_setup_callback(bredr_ctrl_callback_t cbk);
|
||||
@@ -824,7 +825,7 @@ static bool bredr_check_tx_pwr(const char *name, int8_t value, int8_t min_power,
|
||||
* The menuconfig limits only describe the maximum possible range, but the achievable range can be narrower depending on the chip.
|
||||
* Returns ESP_ERR_INVALID_ARG if any configured value is out of range so that controller init can be aborted.
|
||||
*/
|
||||
static esp_err_t bredr_validate_tx_pwr_cfg(const esp_bredr_controller_config_t *bredr_cfg)
|
||||
static esp_err_t bredr_validate_tx_pwr_cfg(const esp_bt_ctrl_bredr_config_t *bredr_cfg)
|
||||
{
|
||||
int8_t min_power = 0;
|
||||
int8_t max_power = 0;
|
||||
@@ -906,6 +907,13 @@ void bredr_stack_disable(void)
|
||||
|
||||
}
|
||||
|
||||
int bredr_stack_reset(void)
|
||||
{
|
||||
r_bredr_controller_reset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if CONFIG_FREERTOS_USE_TICKLESS_IDLE
|
||||
esp_err_t sleep_modem_bredr_mac_modem_state_init(void)
|
||||
{
|
||||
|
||||
@@ -77,27 +77,27 @@ hci_driver_mem_evt_free(void *ptr)
|
||||
hci_driver_packet_t *
|
||||
hci_driver_mem_bredr_acl_alloc(uint16_t handle)
|
||||
{
|
||||
return btdm_hci_trans_buf_alloc(HCI_H4_ACL, handle);
|
||||
return bredr_hci_trans_acl_rx_buf_alloc(handle);
|
||||
}
|
||||
|
||||
void
|
||||
hci_driver_mem_bredr_acl_free(void *ptr)
|
||||
{
|
||||
hci_driver_packet_t *pkt = (hci_driver_packet_t *) ptr;
|
||||
bredr_hci_trans_acl_free(pkt);
|
||||
bredr_hci_trans_acl_tx_free(pkt);
|
||||
}
|
||||
|
||||
hci_driver_packet_t *
|
||||
hci_driver_mem_sync_alloc(uint16_t handle)
|
||||
{
|
||||
return btdm_hci_trans_buf_alloc(HCI_H4_SYNC, handle);
|
||||
return bredr_hci_trans_sync_rx_buf_alloc(handle);
|
||||
}
|
||||
|
||||
void
|
||||
hci_driver_mem_sync_free(void *ptr)
|
||||
{
|
||||
hci_driver_packet_t *pkt = (hci_driver_packet_t *) ptr;
|
||||
bredr_hci_trans_sync_free(pkt);
|
||||
bredr_hci_trans_sync_tx_free(pkt);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ hci_driver_util_tx_list_dequeue(uint32_t max_tx_len, void **tx_data, bool *last_
|
||||
}
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else {
|
||||
bredr_hci_trans_acl_free(pkt);
|
||||
bredr_hci_trans_acl_tx_free(pkt);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
} else {
|
||||
@@ -222,7 +222,7 @@ hci_driver_util_tx_list_dequeue(uint32_t max_tx_len, void **tx_data, bool *last_
|
||||
}
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else if (tx_entry->data_source == HCI_DRIVER_BREDR_EVT) {
|
||||
bredr_hci_trans_evt_free(pkt);
|
||||
bredr_hci_trans_evt_tx_free(pkt);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else {
|
||||
@@ -247,7 +247,7 @@ hci_driver_util_tx_list_dequeue(uint32_t max_tx_len, void **tx_data, bool *last_
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else if (tx_entry->data_type == HCI_DRIVER_TYPE_SYNC) {
|
||||
if (s_hci_driver_util_env.cur_tx_off >= data_len) {
|
||||
bredr_hci_trans_sync_free(pkt);
|
||||
bredr_hci_trans_sync_tx_free(pkt);
|
||||
} else {
|
||||
tx_len = min(max_tx_len, data_len - s_hci_driver_util_env.cur_tx_off);
|
||||
*tx_data = &pkt->data[s_hci_driver_util_env.cur_tx_off];
|
||||
@@ -326,7 +326,7 @@ hci_driver_util_deinit(void)
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else if (tx_entry->data_source == HCI_DRIVER_BREDR_EVT) {
|
||||
bredr_hci_trans_evt_tx_done((hci_driver_packet_t *)tx_entry->data);
|
||||
bredr_hci_trans_evt_free((hci_driver_packet_t *)tx_entry->data);
|
||||
bredr_hci_trans_evt_tx_free((hci_driver_packet_t *)tx_entry->data);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else {
|
||||
@@ -341,7 +341,7 @@ hci_driver_util_deinit(void)
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
else {
|
||||
bredr_hci_trans_acl_tx_done((hci_driver_packet_t *)tx_entry->data);
|
||||
bredr_hci_trans_acl_free((hci_driver_packet_t *)tx_entry->data);
|
||||
bredr_hci_trans_acl_tx_free((hci_driver_packet_t *)tx_entry->data);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
} else if (tx_entry->data_type == HCI_DRIVER_TYPE_ISO) {
|
||||
@@ -351,7 +351,7 @@ hci_driver_util_deinit(void)
|
||||
else {
|
||||
// SCO data
|
||||
bredr_hci_trans_sync_tx_done((hci_driver_packet_t *)tx_entry->pkt);
|
||||
bredr_hci_trans_sync_free((hci_driver_packet_t *)tx_entry->pkt);
|
||||
bredr_hci_trans_sync_tx_free((hci_driver_packet_t *)tx_entry->pkt);
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ hci_driver_vhci_controller_tx(hci_driver_data_type_t data_type, uint8_t *data, u
|
||||
*buf = old_value;
|
||||
if (rc >= 0) {
|
||||
bredr_hci_trans_acl_tx_done(pkt);
|
||||
bredr_hci_trans_acl_free(pkt);
|
||||
bredr_hci_trans_acl_tx_free(pkt);
|
||||
}
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
@@ -134,7 +134,7 @@ hci_driver_vhci_controller_tx(hci_driver_data_type_t data_type, uint8_t *data, u
|
||||
*buf = old_value;
|
||||
if (rc >= 0) {
|
||||
bredr_hci_trans_evt_tx_done((hci_driver_packet_t *)data);
|
||||
bredr_hci_trans_evt_free((hci_driver_packet_t *)data);
|
||||
bredr_hci_trans_evt_tx_free((hci_driver_packet_t *)data);
|
||||
}
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
@@ -164,7 +164,7 @@ hci_driver_vhci_controller_tx(hci_driver_data_type_t data_type, uint8_t *data, u
|
||||
*buf = old_value;
|
||||
if (rc >= 0) {
|
||||
bredr_hci_trans_sync_tx_done(pkt);
|
||||
bredr_hci_trans_sync_free(pkt);
|
||||
bredr_hci_trans_sync_tx_free(pkt);
|
||||
}
|
||||
}
|
||||
#endif // UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
@@ -210,7 +210,7 @@ hci_driver_vhci_host_tx(hci_driver_data_type_t data_type, uint8_t *data, uint32_
|
||||
#endif // UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
if (is_bredr) {
|
||||
pkt = btdm_hci_trans_buf_alloc(data_type, conn_handle);
|
||||
pkt = bredr_hci_trans_acl_rx_buf_alloc(conn_handle);
|
||||
assert(pkt);
|
||||
memcpy(pkt->data, &data[1], pkt_len);
|
||||
data = (uint8_t *)pkt;
|
||||
@@ -222,7 +222,7 @@ hci_driver_vhci_host_tx(hci_driver_data_type_t data_type, uint8_t *data, uint32_
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
case HCI_DRIVER_TYPE_SYNC:
|
||||
conn_handle = btdm_get_le16(&data[1]) & HCI_INTERNAL_CONN_MASK;
|
||||
pkt = btdm_hci_trans_buf_alloc(data_type, conn_handle);
|
||||
pkt = bredr_hci_trans_sync_rx_buf_alloc(conn_handle);
|
||||
assert(pkt);
|
||||
memcpy(pkt->data, &data[1], pkt_len);
|
||||
data = (uint8_t *)pkt;
|
||||
|
||||
@@ -167,10 +167,12 @@ void bredr_hci_trans_register_tx(btdm_hci_trans_tx_func_t *acl_tx_func,
|
||||
void bredr_hci_trans_acl_tx_done(hci_driver_packet_t *pkt);
|
||||
void bredr_hci_trans_sync_tx_done(hci_driver_packet_t *pkt);
|
||||
void bredr_hci_trans_evt_tx_done(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_acl_free(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_sync_free(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_evt_free(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_acl_tx_free(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_sync_tx_free(hci_driver_packet_t *pkt);
|
||||
int bredr_hci_trans_evt_tx_free(hci_driver_packet_t *pkt);
|
||||
|
||||
hci_driver_packet_t *bredr_hci_trans_acl_rx_buf_alloc(uint16_t conn_handle);
|
||||
hci_driver_packet_t *bredr_hci_trans_sync_rx_buf_alloc(uint16_t conn_handle);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText 2026 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier Apache-2.0
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include "esp_hci_internal.h"
|
||||
#include "esp_hci_internal.h"
|
||||
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#include "ble_priv.h"
|
||||
#endif /* UC_BT_CTRL_BLE_IS_ENABLE */
|
||||
|
||||
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
#include "bredr_priv.h"
|
||||
#endif /* #if UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
@@ -286,12 +286,13 @@ extern int flushableAclData_hci_writeAutoFlushTmo(const uint8_t *cmdbuf, uint8_t
|
||||
/* Informational (OGF 0x04) - btdm_hci_external / ble */
|
||||
extern int r_btdm_hci_rd_local_version_info_handler(const uint8_t *cmdbuf, uint8_t len,
|
||||
uint8_t *rspbuf, uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supported_cmds_handler(const uint8_t *cmdbuf, uint8_t len,
|
||||
uint8_t *rspbuf, uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supported_cmds_handler(const uint8_t *cmdbuf, uint8_t len, uint8_t *rspbuf,
|
||||
uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supp_features_handler(const uint8_t *cmdbuf, uint8_t len, uint8_t *rspbuf,
|
||||
uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_bdaddr_handler(const uint8_t *cmdbuf, uint8_t len, uint8_t *rspbuf,
|
||||
uint8_t *rsplen);
|
||||
uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_ext_features_handler(const uint8_t *cmdbuf, uint8_t len, uint8_t *rspbuf,
|
||||
uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_bdaddr_handler(const uint8_t *cmdbuf, uint8_t len, uint8_t *rspbuf, uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supp_codecs_handler(uint8_t *rspbuf, uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supp_codecs_v2_handler(uint8_t *rspbuf, uint8_t *rsplen);
|
||||
extern int r_btdm_hci_rd_local_supp_codec_cap_handler(const uint8_t *cmdbuf, uint8_t len,
|
||||
@@ -795,9 +796,6 @@ hci_cmd_proc_controller_baseband_cmds(uint16_t ocf, const uint8_t *cmdbuf, uint8
|
||||
#if UC_BT_CTRL_BLE_IS_ENABLE
|
||||
ble_stack_reset();
|
||||
#endif // UC_BT_CTRL_BLE_IS_ENABLE
|
||||
#if UC_BT_CTRL_BR_EDR_IS_ENABLE
|
||||
bredr_stack_reset();
|
||||
#endif /* UC_BT_CTRL_BR_EDR_IS_ENABLE */
|
||||
}
|
||||
break;
|
||||
case HCI_CMD_OCF_BB_SET_C2H_FLOW_CTRL:
|
||||
@@ -881,6 +879,15 @@ hci_cmd_proc_informational_params_cmds(uint16_t ocf, const uint8_t *cmdbuf, uint
|
||||
case HCI_CMD_OCF_INFO_READ_LOCAL_FEATURES:
|
||||
rc = r_btdm_hci_rd_local_supp_features_handler(cmdbuf, len, rspbuf, rsplen);
|
||||
break;
|
||||
case HCI_CMD_OCF_INFO_READ_LOCAL_EXT_FEATURES:
|
||||
rc = r_btdm_hci_rd_local_ext_features_handler(cmdbuf, len, rspbuf, rsplen);
|
||||
break;
|
||||
// case HCI_CMD_OCF_INFO_READ_BUFFER_SIZE:
|
||||
// rc = r_ble_ll_hci_le_read_bufsize(cmdbuf, len, rspbuf, rsplen);
|
||||
// break;
|
||||
// case HCI_CMD_OCF_INFO_READ_COUNTRY_CODE:
|
||||
// rc = HCI_CMD_ERR_UNKNOWN_HCI_CMD;
|
||||
// break;
|
||||
case HCI_CMD_OCF_INFO_READ_BD_ADDR:
|
||||
rc = r_btdm_hci_rd_bdaddr_handler(cmdbuf, len, rspbuf, rsplen);
|
||||
break;
|
||||
@@ -1600,4 +1607,4 @@ hci_cmd_proc_init(void)
|
||||
{
|
||||
r_btdm_hci_set_cmd_handler_func(hci_cmd_proc_handler);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ INPUT += \
|
||||
$(PROJECT_PATH)/components/bt/include/esp32s31/include/esp_bt.h \
|
||||
$(PROJECT_PATH)/components/bt/include/esp32s31/include/esp_bt_vs.h \
|
||||
$(PROJECT_PATH)/components/bt/include/common/btdm_le_vs.h \
|
||||
$(PROJECT_PATH)/components/bt/include/common/btdm_bredr_vs.h \
|
||||
$(PROJECT_PATH)/components/bt/include/common/btdm_le.h \
|
||||
$(PROJECT_PATH)/components/bt/include/common/btdm_bredr.h \
|
||||
$(PROJECT_PATH)/components/ulp/lp_core/include/lp_core_i2c.h \
|
||||
|
||||
Reference in New Issue
Block a user