Bluetooth: Split ACL buffers into two distinct types

We'll soon want to have dedicated pools for outgoing and incoming ACL
data. To know from which pool to get and put the buffers each buffer
should contain enough information to distinguish the two types. This
patch splits the old BT_ACL type into two new BT_ACL_IN & BT_ACL_OUT
types.

Change-Id: I7d3c05c26d2a70f80fb1229e245aa21673ec378b
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2015-04-28 11:08:44 +03:00 committed by Anas Nashif
parent 550cdd9717
commit 4e65d0aac2
4 changed files with 8 additions and 7 deletions

View file

@ -154,7 +154,7 @@ void bt_uart_isr(void *unused)
remaining = bt_uart_evt_recv(buf); remaining = bt_uart_evt_recv(buf);
break; break;
case H4_ACL: case H4_ACL:
buf->type = BT_ACL; buf->type = BT_ACL_IN;
remaining = bt_uart_acl_recv(buf); remaining = bt_uart_acl_recv(buf);
break; break;
default: default:
@ -218,7 +218,7 @@ static int bt_uart_send(struct bt_buf *buf)
case BT_CMD: case BT_CMD:
*type = H4_CMD; *type = H4_CMD;
break; break;
case BT_ACL: case BT_ACL_OUT:
*type = H4_ACL; *type = H4_ACL;
break; break;
case BT_EVT: case BT_EVT:

View file

@ -42,9 +42,10 @@
/* Type of data contained in this buffer */ /* Type of data contained in this buffer */
enum bt_buf_type { enum bt_buf_type {
BT_CMD, BT_CMD, /* HCI command */
BT_EVT, BT_EVT, /* HCI event */
BT_ACL, BT_ACL_OUT, /* Outgoing ACL data */
BT_ACL_IN, /* Incoming ACL data */
}; };
struct bt_buf { struct bt_buf {

View file

@ -318,7 +318,7 @@ struct bt_buf *bt_conn_create_pdu(struct bt_conn *conn, size_t len)
if (!buf) if (!buf)
return NULL; return NULL;
buf->type = BT_ACL; buf->type = BT_ACL_OUT;
hdr = (void *)bt_buf_add(buf, sizeof(*hdr)); hdr = (void *)bt_buf_add(buf, sizeof(*hdr));
hdr->handle = sys_cpu_to_le16(conn->handle); hdr->handle = sys_cpu_to_le16(conn->handle);

View file

@ -467,7 +467,7 @@ static void hci_rx_fiber(void)
BT_DBG("buf %p type %u len %u\n", buf, buf->type, buf->len); BT_DBG("buf %p type %u len %u\n", buf, buf->type, buf->len);
switch (buf->type) { switch (buf->type) {
case BT_ACL: case BT_ACL_IN:
hci_acl(buf); hci_acl(buf);
break; break;
case BT_EVT: case BT_EVT: