From 4e65d0aac273137a6adf443581d0f91a14524a23 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 28 Apr 2015 11:08:44 +0300 Subject: [PATCH] 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 --- drivers/bluetooth/uart.c | 4 ++-- include/bluetooth/buf.h | 7 ++++--- net/bluetooth/conn.c | 2 +- net/bluetooth/hci_core.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/bluetooth/uart.c b/drivers/bluetooth/uart.c index 9afb320ece..bed8119037 100644 --- a/drivers/bluetooth/uart.c +++ b/drivers/bluetooth/uart.c @@ -154,7 +154,7 @@ void bt_uart_isr(void *unused) remaining = bt_uart_evt_recv(buf); break; case H4_ACL: - buf->type = BT_ACL; + buf->type = BT_ACL_IN; remaining = bt_uart_acl_recv(buf); break; default: @@ -218,7 +218,7 @@ static int bt_uart_send(struct bt_buf *buf) case BT_CMD: *type = H4_CMD; break; - case BT_ACL: + case BT_ACL_OUT: *type = H4_ACL; break; case BT_EVT: diff --git a/include/bluetooth/buf.h b/include/bluetooth/buf.h index e0f1b3e854..c1a1fd6025 100644 --- a/include/bluetooth/buf.h +++ b/include/bluetooth/buf.h @@ -42,9 +42,10 @@ /* Type of data contained in this buffer */ enum bt_buf_type { - BT_CMD, - BT_EVT, - BT_ACL, + BT_CMD, /* HCI command */ + BT_EVT, /* HCI event */ + BT_ACL_OUT, /* Outgoing ACL data */ + BT_ACL_IN, /* Incoming ACL data */ }; struct bt_buf { diff --git a/net/bluetooth/conn.c b/net/bluetooth/conn.c index 0313ea1453..a3cde08728 100644 --- a/net/bluetooth/conn.c +++ b/net/bluetooth/conn.c @@ -318,7 +318,7 @@ struct bt_buf *bt_conn_create_pdu(struct bt_conn *conn, size_t len) if (!buf) return NULL; - buf->type = BT_ACL; + buf->type = BT_ACL_OUT; hdr = (void *)bt_buf_add(buf, sizeof(*hdr)); hdr->handle = sys_cpu_to_le16(conn->handle); diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 84519393bd..3928550c10 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -467,7 +467,7 @@ static void hci_rx_fiber(void) BT_DBG("buf %p type %u len %u\n", buf, buf->type, buf->len); switch (buf->type) { - case BT_ACL: + case BT_ACL_IN: hci_acl(buf); break; case BT_EVT: