Bluetooth: Fix hci_raw's RX buffer alloc

The APIs for allocating RX buffers were modified recently and hci_raw
had not reflected those changes properly.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This commit is contained in:
Carles Cufi 2017-05-08 18:03:02 +02:00 committed by Johan Hedberg
commit 6821df1ef0

View file

@ -47,7 +47,15 @@ int bt_hci_driver_register(const struct bt_hci_driver *drv)
struct net_buf *bt_buf_get_rx(enum bt_buf_type type, s32_t timeout)
{
return net_buf_alloc(&hci_rx_pool, timeout);
struct net_buf *buf;
buf = net_buf_alloc(&hci_rx_pool, timeout);
if (buf) {
bt_buf_set_type(buf, type);
}
return buf;
}
struct net_buf *bt_buf_get_cmd_complete(s32_t timeout)
@ -62,30 +70,6 @@ struct net_buf *bt_buf_get_cmd_complete(s32_t timeout)
return buf;
}
struct net_buf *bt_buf_get_evt(u8_t opcode, int timeout)
{
struct net_buf *buf;
buf = net_buf_alloc(&hci_rx_pool, timeout);
if (buf) {
bt_buf_set_type(buf, BT_BUF_EVT);
}
return buf;
}
struct net_buf *bt_buf_get_acl(s32_t timeout)
{
struct net_buf *buf;
buf = net_buf_alloc(&hci_rx_pool, timeout);
if (buf) {
bt_buf_set_type(buf, BT_BUF_ACL_IN);
}
return buf;
}
int bt_recv(struct net_buf *buf)
{
BT_DBG("buf %p len %u", buf, buf->len);