From 89981b07c8376e16fbc16df8ec401a822df3f9a9 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Fri, 10 Jan 2020 09:34:16 +0100 Subject: [PATCH] Bluetooth: host: Lower the size of the num_complete buffer Set the size of the num complete buffer to the maximum possible size it can be. Signed-off-by: Joakim Andersson --- subsys/bluetooth/host/hci_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 815a08df2ce..761ca22fa19 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -159,12 +159,15 @@ NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, CONFIG_BT_RX_BUF_COUNT, BT_BUF_RX_SIZE, NULL); #if defined(CONFIG_BT_CONN) +#define NUM_COMLETE_EVENT_SIZE BT_BUF_SIZE( \ + sizeof(struct bt_hci_cp_host_num_completed_packets) + \ + CONFIG_BT_MAX_CONN * sizeof(struct bt_hci_handle_count)) /* Dedicated pool for HCI_Number_of_Completed_Packets. This event is always * consumed synchronously by bt_recv_prio() so a single buffer is enough. * Having a dedicated pool for it ensures that exhaustion of the RX pool * cannot block the delivery of this priority event. */ -NET_BUF_POOL_FIXED_DEFINE(num_complete_pool, 1, BT_BUF_RX_SIZE, NULL); +NET_BUF_POOL_FIXED_DEFINE(num_complete_pool, 1, NUM_COMLETE_EVENT_SIZE, NULL); #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_DISCARDABLE_BUF_COUNT)