diff --git a/subsys/bluetooth/host/Kconfig b/subsys/bluetooth/host/Kconfig index bad45101a8e..2e7c47dedac 100644 --- a/subsys/bluetooth/host/Kconfig +++ b/subsys/bluetooth/host/Kconfig @@ -60,6 +60,16 @@ config BT_DISCARDABLE_BUF_COUNT it will not cause the allocation for other critical events to block and may even eliminate deadlocks in some cases. +config BT_DISCARDABLE_BUF_SIZE + int "Size of discardable event buffers" + range 44 257 + default 257 if BT_BREDR + default 44 + help + Size of buffers in the separate discardable event buffer pool. + The minimum size is set based on the Advertising Report. Setting + the buffer size different than BT_RX_BUF_LEN can save memory. + config BT_HCI_TX_STACK_SIZE # NOTE: This value is derived from other symbols and should only be # changed if required by architecture diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index 85586ebcc86..815a08df2ce 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -168,8 +168,9 @@ NET_BUF_POOL_FIXED_DEFINE(num_complete_pool, 1, BT_BUF_RX_SIZE, NULL); #endif /* CONFIG_BT_CONN */ #if defined(CONFIG_BT_DISCARDABLE_BUF_COUNT) +#define DISCARDABLE_EVENT_SIZE BT_BUF_SIZE(CONFIG_BT_DISCARDABLE_BUF_SIZE) NET_BUF_POOL_FIXED_DEFINE(discardable_pool, CONFIG_BT_DISCARDABLE_BUF_COUNT, - BT_BUF_RX_SIZE, NULL); + DISCARDABLE_EVENT_SIZE, NULL); #endif /* CONFIG_BT_DISCARDABLE_BUF_COUNT */ struct event_handler {