Bluetooth: controller: split: Fix Rx reserved for conn cmplt

When both central and peripheral are supported, one each Rx
node will be needed by connectable advertising and the
initiator to generate connection complete, hence
conditionally set the count.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
Vinayak Kariappa Chettimada 2019-09-13 17:06:11 +05:30 committed by Carles Cufí
commit 28f46131b3

View file

@ -166,19 +166,30 @@ static MFIFO_DEFINE(pdu_rx_free, sizeof(void *), PDU_RX_CNT);
PDU_RX_USER_PDU_OCTETS_MAX) \
)
#define PDU_RX_POOL_SIZE (PDU_RX_NODE_POOL_ELEMENT_SIZE * (RX_CNT + 1))
/* When both central and peripheral are supported, one each Rx node will be
* needed by connectable advertising and the initiator to generate connection
* complete event, hence conditionally set the count.
*/
#if defined(CONFIG_BT_MAX_CONN)
#if defined(CONFIG_BT_CENTRAL) && defined(CONFIG_BT_PERIPHERAL)
#define BT_CTLR_MAX_CONNECTABLE 2
#else
#define BT_CTLR_MAX_CONNECTABLE 1
#endif
#define BT_CTLR_MAX_CONN CONFIG_BT_MAX_CONN
#else
#define BT_CTLR_MAX_CONNECTABLE 0
#define BT_CTLR_MAX_CONN 0
#endif
#define PDU_RX_POOL_SIZE (PDU_RX_NODE_POOL_ELEMENT_SIZE * \
(RX_CNT + BT_CTLR_MAX_CONNECTABLE))
static struct {
void *free;
u8_t pool[PDU_RX_POOL_SIZE];
} mem_pdu_rx;
#if defined(CONFIG_BT_MAX_CONN)
#define BT_CTLR_MAX_CONN CONFIG_BT_MAX_CONN
#else
#define BT_CTLR_MAX_CONN 0
#endif
#define LINK_RX_POOL_SIZE (sizeof(memq_link_t) * (RX_CNT + 2 + \
BT_CTLR_MAX_CONN))
static struct {