diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 16eb2468f89..728193f7104 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -87,12 +87,9 @@ static void report_completed_packet(struct net_buf *buf) } static struct nano_fifo avail_acl_in; -static struct nano_fifo avail_acl_out; static NET_BUF_POOL(acl_in_pool, BT_BUF_ACL_IN_MAX, BT_BUF_MAX_DATA, &avail_acl_in, report_completed_packet, sizeof(struct bt_acl_data)); -static NET_BUF_POOL(acl_out_pool, BT_BUF_ACL_OUT_MAX, BT_BUF_MAX_DATA, - &avail_acl_out, NULL, sizeof(struct bt_acl_data)); #endif /* CONFIG_BLUETOOTH_CONN */ struct net_buf *bt_buf_get(enum bt_buf_type type, size_t reserve_head) @@ -108,9 +105,6 @@ struct net_buf *bt_buf_get(enum bt_buf_type type, size_t reserve_head) case BT_ACL_IN: buf = net_buf_get(&avail_acl_in, reserve_head); break; - case BT_ACL_OUT: - buf = net_buf_get(&avail_acl_out, reserve_head); - break; #endif /* CONFIG_BLUETOOTH_CONN */ default: return NULL; @@ -1599,7 +1593,6 @@ int bt_enable(bt_ready_cb_t cb) net_buf_pool_init(hci_pool); #if defined(CONFIG_BLUETOOTH_CONN) net_buf_pool_init(acl_in_pool); - net_buf_pool_init(acl_out_pool); #endif /* CONFIG_BLUETOOTH_CONN */ /* Give cmd_sem allowing to send first HCI_Reset cmd */ diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 7c39dcee433..c737946f75a 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c @@ -62,6 +62,10 @@ struct bt_l2cap { static struct bt_l2cap bt_l2cap_pool[CONFIG_BLUETOOTH_MAX_CONN]; +static struct nano_fifo avail_acl_out; +static NET_BUF_POOL(acl_out_pool, BT_BUF_ACL_OUT_MAX, BT_BUF_MAX_DATA, + &avail_acl_out, NULL, sizeof(struct bt_acl_data)); + static struct bt_l2cap *l2cap_chan_get(struct bt_conn *conn) { struct bt_l2cap_chan *chan; @@ -197,7 +201,7 @@ struct net_buf *bt_l2cap_create_pdu(struct bt_conn *conn) sizeof(struct bt_hci_acl_hdr) + bt_dev.drv->head_reserve; - return bt_buf_get(BT_ACL_OUT, head_reserve); + return net_buf_get(&avail_acl_out, head_reserve); } void bt_l2cap_send(struct bt_conn *conn, uint16_t cid, struct net_buf *buf) @@ -598,6 +602,8 @@ int bt_l2cap_init(void) return err; } + net_buf_pool_init(acl_out_pool); + bt_l2cap_fixed_chan_register(&chan); return 0;