Skip to content

Commit 30527e5

Browse files
jhedbergkartben
authored andcommitted
Bluetooth: Host: Rename acl_data to bt_conn_rx
We already have bt_conn_tx for outgoing buffer user data, so name the struct for incoming (rx) buffers similarly. Also, update ISO to use this struct instead of a custom iso_data struct, since the content and purpose is identical. Signed-off-by: Johan Hedberg <[email protected]>
1 parent 1cb0b6a commit 30527e5

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

subsys/bluetooth/host/buf.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static void evt_pool_destroy(struct net_buf *buf)
8484
}
8585

8686
NET_BUF_POOL_DEFINE(acl_in_pool, (BT_BUF_ACL_RX_COUNT_EXTRA + BT_BUF_HCI_ACL_RX_COUNT),
87-
BT_BUF_ACL_SIZE(CONFIG_BT_BUF_ACL_RX_SIZE), sizeof(struct acl_data),
87+
BT_BUF_ACL_SIZE(CONFIG_BT_BUF_ACL_RX_SIZE), sizeof(struct bt_conn_rx),
8888
acl_in_pool_destroy);
8989

9090
NET_BUF_POOL_FIXED_DEFINE(evt_pool, CONFIG_BT_BUF_EVT_RX_COUNT, BT_BUF_EVT_RX_SIZE, 0,
@@ -101,8 +101,8 @@ static void hci_rx_pool_destroy(struct net_buf *buf)
101101
buf_rx_freed_notify(BT_BUF_EVT | BT_BUF_ACL_IN);
102102
}
103103

104-
NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, BT_BUF_RX_COUNT, BT_BUF_RX_SIZE, sizeof(struct acl_data),
105-
hci_rx_pool_destroy);
104+
NET_BUF_POOL_FIXED_DEFINE(hci_rx_pool, BT_BUF_RX_COUNT, BT_BUF_RX_SIZE,
105+
sizeof(struct bt_conn_rx), hci_rx_pool_destroy);
106106
#endif /* CONFIG_BT_HCI_ACL_FLOW_CONTROL */
107107

108108
struct net_buf *bt_buf_get_rx(enum bt_buf_type type, k_timeout_t timeout)

subsys/bluetooth/host/conn_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,11 @@ struct bt_conn_tx {
207207
void *user_data;
208208
};
209209

210-
struct acl_data {
210+
struct bt_conn_rx {
211211
/* Index into the bt_conn storage array */
212212
uint8_t index;
213213

214-
/** ACL connection handle */
214+
/** Connection handle */
215215
uint16_t handle;
216216
};
217217

subsys/bluetooth/host/hci_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct cmd_data {
160160
static struct cmd_data cmd_data[BT_BUF_CMD_TX_COUNT];
161161

162162
#define cmd(buf) (&cmd_data[net_buf_id(buf)])
163-
#define acl(buf) ((struct acl_data *)net_buf_user_data(buf))
163+
#define acl(buf) ((struct bt_conn_rx *)net_buf_user_data(buf))
164164

165165
static bool drv_quirk_no_reset(void)
166166
{

subsys/bluetooth/host/iso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static void iso_rx_buf_destroy(struct net_buf *buf)
6363
}
6464

6565
NET_BUF_POOL_FIXED_DEFINE(iso_rx_pool, CONFIG_BT_ISO_RX_BUF_COUNT,
66-
BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_RX_MTU), sizeof(struct iso_data),
66+
BT_ISO_SDU_BUF_SIZE(CONFIG_BT_ISO_RX_MTU), sizeof(struct bt_conn_rx),
6767
iso_rx_buf_destroy);
6868

6969
static struct bt_iso_recv_info iso_info_data[CONFIG_BT_ISO_RX_BUF_COUNT];

subsys/bluetooth/host/iso_internal.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@
2020
#include <zephyr/sys/slist.h>
2121
#include <zephyr/sys_clock.h>
2222

23-
struct iso_data {
24-
/* Index into the bt_conn storage array */
25-
uint8_t index;
26-
27-
/** ISO connection handle */
28-
uint16_t handle;
29-
};
30-
3123
enum bt_iso_cig_state {
3224
BT_ISO_CIG_STATE_IDLE,
3325
BT_ISO_CIG_STATE_CONFIGURED,
@@ -76,7 +68,7 @@ struct bt_iso_big {
7668
ATOMIC_DEFINE(flags, BT_BIG_NUM_FLAGS);
7769
};
7870

79-
#define iso(buf) ((struct iso_data *)net_buf_user_data(buf))
71+
#define iso(buf) ((struct bt_conn_rx *)net_buf_user_data(buf))
8072

8173
/* Process ISO buffer */
8274
void hci_iso(struct net_buf *buf);

0 commit comments

Comments
 (0)