From ba57c1880c665c51fe913c1a94c9faa4d4728892 Mon Sep 17 00:00:00 2001 From: Markus Fuchs Date: Fri, 8 Sep 2023 17:40:17 +0200 Subject: [PATCH] drivers: bluetooth: slz_hci: Set Number of Completed Packets threshold Configure the Number of Completed Packets event threshold to 1, so the SiLabs Bluetooth controller will always send the Number of Completed Packets HCI event to the host, even for small numbers of transmitted packets. Fixes #62279 Signed-off-by: Markus Fuchs --- drivers/bluetooth/hci/slz_hci.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/bluetooth/hci/slz_hci.c b/drivers/bluetooth/hci/slz_hci.c index d80de8be998..9fe5cb5981c 100644 --- a/drivers/bluetooth/hci/slz_hci.c +++ b/drivers/bluetooth/hci/slz_hci.c @@ -16,12 +16,14 @@ #include LOG_MODULE_REGISTER(bt_hci_driver_slz); -#define SL_BT_CONFIG_ACCEPT_LIST_SIZE 1 -#define SL_BT_CONFIG_MAX_CONNECTIONS 1 -#define SL_BT_CONFIG_USER_ADVERTISERS 1 -#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_HCI_BUFFER_MEMORY -#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX CONFIG_BT_BUF_ACL_TX_COUNT -#define SL_BT_SILABS_LL_STACK_SIZE 1024 +#define SL_BT_CONFIG_ACCEPT_LIST_SIZE 1 +#define SL_BT_CONFIG_MAX_CONNECTIONS 1 +#define SL_BT_CONFIG_USER_ADVERTISERS 1 +#define SL_BT_CONTROLLER_BUFFER_MEMORY CONFIG_BT_SILABS_HCI_BUFFER_MEMORY +#define SL_BT_CONTROLLER_LE_BUFFER_SIZE_MAX CONFIG_BT_BUF_ACL_TX_COUNT +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD 1 +#define SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT 3 +#define SL_BT_SILABS_LL_STACK_SIZE 1024 static K_KERNEL_STACK_DEFINE(slz_ll_stack, SL_BT_SILABS_LL_STACK_SIZE); static struct k_thread slz_ll_thread; @@ -158,6 +160,10 @@ static int slz_bt_open(void) goto deinit; } + sl_btctrl_configure_completed_packets_reporting( + SL_BT_CONTROLLER_COMPLETED_PACKETS_THRESHOLD, + SL_BT_CONTROLLER_COMPLETED_PACKETS_EVENTS_TIMEOUT); + sl_bthci_init_upper(); sl_btctrl_hci_parser_init_default(); sl_btctrl_hci_parser_init_conn();