diff --git a/include/bluetooth/buf.h b/include/bluetooth/buf.h index 9f0910a6554..03855daf6b3 100644 --- a/include/bluetooth/buf.h +++ b/include/bluetooth/buf.h @@ -79,8 +79,22 @@ struct bt_buf_data { /** Data size needed for HCI Event RX buffers */ #define BT_BUF_EVT_RX_SIZE BT_BUF_EVT_SIZE(CONFIG_BT_BUF_EVT_RX_SIZE) -/** Data size needed for HCI ACL or Event RX buffers */ -#define BT_BUF_RX_SIZE (MAX(BT_BUF_ACL_RX_SIZE, BT_BUF_EVT_RX_SIZE)) +#if defined(CONFIG_BT_ISO) +#define BT_BUF_ISO_RX_SIZE BT_BUF_ISO_SIZE(CONFIG_BT_ISO_RX_MTU) +#define BT_BUF_ISO_RX_COUNT CONFIG_BT_ISO_RX_BUF_COUNT +#else +#define BT_BUF_ISO_RX_SIZE 0 +#define BT_BUF_ISO_RX_COUNT 0 +#endif /* CONFIG_BT_ISO */ + +/** Data size needed for HCI ACL, HCI ISO or Event RX buffers */ +#define BT_BUF_RX_SIZE (MAX(MAX(BT_BUF_ACL_RX_SIZE, BT_BUF_EVT_RX_SIZE), \ + BT_BUF_ISO_RX_SIZE)) + +/** Buffer count needed for HCI ACL, HCI ISO or Event RX buffers */ +#define BT_BUF_RX_COUNT (MAX(MAX(CONFIG_BT_BUF_EVT_RX_COUNT, \ + CONFIG_BT_BUF_ACL_RX_COUNT), \ + BT_BUF_ISO_RX_COUNT)) /** Data size needed for HCI Command buffers. */ #define BT_BUF_CMD_TX_SIZE BT_BUF_CMD_SIZE(CONFIG_BT_BUF_CMD_TX_SIZE) diff --git a/subsys/bluetooth/host/buf.c b/subsys/bluetooth/host/buf.c index 8171502d2fb..159a60065c2 100644 --- a/subsys/bluetooth/host/buf.c +++ b/subsys/bluetooth/host/buf.c @@ -53,7 +53,6 @@ NET_BUF_POOL_FIXED_DEFINE(evt_pool, CONFIG_BT_BUF_EVT_RX_COUNT, BT_BUF_EVT_RX_SIZE, 8, NULL); #else -#define BT_BUF_RX_COUNT MAX(CONFIG_BT_BUF_EVT_RX_COUNT, CONFIG_BT_BUF_ACL_RX_COUNT) NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, BT_BUF_RX_COUNT, BT_BUF_RX_SIZE, 8, NULL); diff --git a/subsys/bluetooth/host/hci_raw.c b/subsys/bluetooth/host/hci_raw.c index 7036e23cd01..e3d765bed02 100644 --- a/subsys/bluetooth/host/hci_raw.c +++ b/subsys/bluetooth/host/hci_raw.c @@ -38,7 +38,6 @@ static uint8_t raw_mode = BT_HCI_RAW_MODE_H4; static uint8_t raw_mode; #endif -#define BT_BUF_RX_COUNT MAX(CONFIG_BT_BUF_EVT_RX_COUNT, CONFIG_BT_BUF_ACL_RX_COUNT) NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, BT_BUF_RX_COUNT, BT_BUF_RX_SIZE, 8, NULL); NET_BUF_POOL_FIXED_DEFINE(hci_cmd_pool, CONFIG_BT_BUF_CMD_TX_COUNT,