Skip to content

Commit 3997479

Browse files
cvinayakcarlescufi
authored andcommitted
Bluetooth: HCI: Rename to bt_hci_iso_sdu_hdr and bt_hci_iso_sdu_ts_hdr
Rename struct bt_hci_iso_data_hdr to bt_hci_iso_sdu_hdr, and struct bt_hci_iso_ts_data_hdr to bt_hci_iso_sdu_ts_hdr. Signed-off-by: Vinayak Kariappa Chettimada <[email protected]>
1 parent e32c2ee commit 3997479

File tree

6 files changed

+31
-31
lines changed

6 files changed

+31
-31
lines changed

include/zephyr/bluetooth/buf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ struct bt_buf_data {
6868

6969
/** Helper to calculate needed buffer size for HCI ISO packets. */
7070
#define BT_BUF_ISO_SIZE(size) BT_BUF_SIZE(BT_HCI_ISO_HDR_SIZE + \
71-
BT_HCI_ISO_TS_DATA_HDR_SIZE + \
71+
BT_HCI_ISO_SDU_TS_HDR_SIZE + \
7272
(size))
7373

7474
/** Data size needed for HCI ACL RX buffers */

include/zephyr/bluetooth/hci_types.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,17 @@ struct bt_hci_acl_hdr {
108108
#define bt_iso_pkt_flags(h) ((h) >> 14)
109109
#define bt_iso_pkt_len_pack(h, f) (((h) & BIT_MASK(12)) | ((f) << 14))
110110

111-
struct bt_hci_iso_data_hdr {
111+
struct bt_hci_iso_sdu_hdr {
112112
uint16_t sn;
113113
uint16_t slen; /* 12 bit len, 2 bit RFU, 2 bit packet status */
114114
} __packed;
115-
#define BT_HCI_ISO_DATA_HDR_SIZE 4
115+
#define BT_HCI_ISO_SDU_HDR_SIZE 4
116116

117-
struct bt_hci_iso_ts_data_hdr {
117+
struct bt_hci_iso_sdu_ts_hdr {
118118
uint32_t ts;
119-
struct bt_hci_iso_data_hdr data;
119+
struct bt_hci_iso_sdu_hdr sdu;
120120
} __packed;
121-
#define BT_HCI_ISO_TS_DATA_HDR_SIZE 8
121+
#define BT_HCI_ISO_SDU_TS_HDR_SIZE 8
122122

123123
/* Bluetooth spec v5.4 Vol 4, Part E - 5.4.5 HCI ISO Data Packets */
124124
struct bt_hci_iso_hdr {

subsys/bluetooth/Kconfig.iso

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ config BT_ISO_TX_MTU
110110
help
111111
Maximum MTU for Isochronous channels TX buffers.
112112
This is the actual data payload. It doesn't include the optional
113-
HCI ISO Data packet fields (e.g. `struct bt_hci_iso_ts_data_hdr`).
113+
HCI ISO Data packet fields (e.g. `struct bt_hci_iso_sdu_ts_hdr`).
114114
Set this value to 247 to fit 247 bytes of data within a single
115115
HCI ISO Data packet with a size of 255, without utilizing timestamps.
116116

@@ -128,7 +128,7 @@ config BT_ISO_RX_MTU
128128
help
129129
Maximum MTU for Isochronous channels RX buffers.
130130
This is the actual data payload. It doesn't include the optional
131-
HCI ISO Data packet fields (e.g. `struct bt_hci_iso_ts_data_hdr`)
131+
HCI ISO Data packet fields (e.g. `struct bt_hci_iso_sdu_ts_hdr`)
132132

133133
config BT_ISO_TEST_PARAMS
134134
bool "ISO test parameters support"

subsys/bluetooth/controller/hci/hci.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5709,7 +5709,7 @@ int hci_acl_handle(struct net_buf *buf, struct net_buf **evt)
57095709
#if defined(CONFIG_BT_CTLR_ADV_ISO) || defined(CONFIG_BT_CTLR_CONN_ISO)
57105710
int hci_iso_handle(struct net_buf *buf, struct net_buf **evt)
57115711
{
5712-
struct bt_hci_iso_data_hdr *iso_data_hdr;
5712+
struct bt_hci_iso_sdu_hdr *iso_sdu_hdr;
57135713
struct isoal_sdu_tx sdu_frag_tx;
57145714
struct bt_hci_iso_hdr *iso_hdr;
57155715
uint32_t *time_stamp;
@@ -5719,7 +5719,7 @@ int hci_iso_handle(struct net_buf *buf, struct net_buf **evt)
57195719
uint8_t flags;
57205720
uint16_t len;
57215721

5722-
iso_data_hdr = NULL;
5722+
iso_sdu_hdr = NULL;
57235723
*evt = NULL;
57245724

57255725
if (buf->len < sizeof(*iso_hdr)) {
@@ -5770,11 +5770,11 @@ int hci_iso_handle(struct net_buf *buf, struct net_buf **evt)
57705770

57715771
/* Extract ISO data header if included (PB_Flag 0b00 or 0b10) */
57725772
if ((pb_flag & 0x01) == 0) {
5773-
iso_data_hdr = net_buf_pull_mem(buf, sizeof(*iso_data_hdr));
5774-
len -= sizeof(*iso_data_hdr);
5775-
sdu_frag_tx.packet_sn = sys_le16_to_cpu(iso_data_hdr->sn);
5773+
iso_sdu_hdr = net_buf_pull_mem(buf, sizeof(*iso_sdu_hdr));
5774+
len -= sizeof(*iso_sdu_hdr);
5775+
sdu_frag_tx.packet_sn = sys_le16_to_cpu(iso_sdu_hdr->sn);
57765776
sdu_frag_tx.iso_sdu_length =
5777-
sys_le16_to_cpu(bt_iso_pkt_len(iso_data_hdr->slen));
5777+
sys_le16_to_cpu(bt_iso_pkt_len(iso_sdu_hdr->slen));
57785778
} else {
57795779
sdu_frag_tx.packet_sn = 0;
57805780
sdu_frag_tx.iso_sdu_length = 0;

subsys/bluetooth/controller/hci/hci_driver.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static int bt_recv_prio(struct net_buf *buf)
138138

139139
#if defined(CONFIG_BT_CTLR_ISO)
140140

141-
#define SDU_HCI_HDR_SIZE (BT_HCI_ISO_HDR_SIZE + BT_HCI_ISO_TS_DATA_HDR_SIZE)
141+
#define SDU_HCI_HDR_SIZE (BT_HCI_ISO_HDR_SIZE + BT_HCI_ISO_SDU_TS_HDR_SIZE)
142142

143143
isoal_status_t sink_sdu_alloc_hci(const struct isoal_sink *sink_ctx,
144144
const struct isoal_pdu_rx *valid_pdu,
@@ -167,7 +167,7 @@ isoal_status_t sink_sdu_emit_hci(const struct isoal_sink *sink_ctx,
167167
const struct isoal_emitted_sdu_frag *sdu_frag,
168168
const struct isoal_emitted_sdu *sdu)
169169
{
170-
struct bt_hci_iso_ts_data_hdr *data_hdr;
170+
struct bt_hci_iso_sdu_ts_hdr *sdu_hdr;
171171
uint16_t packet_status_flag;
172172
struct bt_hci_iso_hdr *hdr;
173173
uint16_t handle_packed;
@@ -230,14 +230,14 @@ isoal_status_t sink_sdu_emit_hci(const struct isoal_sink *sink_ctx,
230230
ts = (pb & 0x1) == 0x0;
231231

232232
if (ts) {
233-
data_hdr = net_buf_push(buf, BT_HCI_ISO_TS_DATA_HDR_SIZE);
233+
sdu_hdr = net_buf_push(buf, BT_HCI_ISO_SDU_TS_HDR_SIZE);
234234
slen_packed = bt_iso_pkt_len_pack(total_len, packet_status_flag);
235235

236-
data_hdr->ts = sys_cpu_to_le32((uint32_t) sdu_frag->sdu.timestamp);
237-
data_hdr->data.sn = sys_cpu_to_le16((uint16_t) sdu_frag->sdu.sn);
238-
data_hdr->data.slen = sys_cpu_to_le16(slen_packed);
236+
sdu_hdr->ts = sys_cpu_to_le32((uint32_t) sdu_frag->sdu.timestamp);
237+
sdu_hdr->sdu.sn = sys_cpu_to_le16((uint16_t) sdu_frag->sdu.sn);
238+
sdu_hdr->sdu.slen = sys_cpu_to_le16(slen_packed);
239239

240-
len += BT_HCI_ISO_TS_DATA_HDR_SIZE;
240+
len += BT_HCI_ISO_SDU_TS_HDR_SIZE;
241241
}
242242

243243
hdr = net_buf_push(buf, BT_HCI_ISO_HDR_SIZE);

subsys/bluetooth/host/iso.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ struct net_buf *bt_iso_create_pdu_timeout(struct net_buf_pool *pool,
168168
pool = &iso_tx_pool;
169169
}
170170

171-
reserve += sizeof(struct bt_hci_iso_data_hdr);
171+
reserve += sizeof(struct bt_hci_iso_sdu_hdr);
172172

173173
#if defined(CONFIG_NET_BUF_LOG)
174174
return bt_conn_create_pdu_timeout_debug(pool, reserve, timeout, func,
@@ -585,7 +585,7 @@ struct net_buf *bt_iso_get_rx(k_timeout_t timeout)
585585

586586
void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags)
587587
{
588-
struct bt_hci_iso_data_hdr *hdr;
588+
struct bt_hci_iso_sdu_hdr *hdr;
589589
struct bt_iso_chan *chan;
590590
uint8_t pb, ts;
591591
uint16_t len, pkt_seq_no;
@@ -609,12 +609,12 @@ void bt_iso_recv(struct bt_conn *iso, struct net_buf *buf, uint8_t flags)
609609
* of an SDU or a complete SDU.
610610
*/
611611
if (ts) {
612-
struct bt_hci_iso_ts_data_hdr *ts_hdr;
612+
struct bt_hci_iso_sdu_ts_hdr *ts_hdr;
613613

614614
ts_hdr = net_buf_pull_mem(buf, sizeof(*ts_hdr));
615615
iso_info(buf)->ts = sys_le32_to_cpu(ts_hdr->ts);
616616

617-
hdr = &ts_hdr->data;
617+
hdr = &ts_hdr->sdu;
618618
iso_info(buf)->flags |= BT_ISO_FLAGS_TS;
619619
} else {
620620
hdr = net_buf_pull_mem(buf, sizeof(*hdr));
@@ -791,11 +791,11 @@ static int validate_send(const struct bt_iso_chan *chan, const struct net_buf *b
791791

792792
int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num)
793793
{
794-
struct bt_hci_iso_data_hdr *hdr;
794+
struct bt_hci_iso_sdu_hdr *hdr;
795795
struct bt_conn *iso_conn;
796796
int err;
797797

798-
err = validate_send(chan, buf, BT_HCI_ISO_DATA_HDR_SIZE);
798+
err = validate_send(chan, buf, BT_HCI_ISO_SDU_HDR_SIZE);
799799
if (err != 0) {
800800
return err;
801801
}
@@ -815,11 +815,11 @@ int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq
815815
int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num,
816816
uint32_t ts)
817817
{
818-
struct bt_hci_iso_ts_data_hdr *hdr;
818+
struct bt_hci_iso_sdu_ts_hdr *hdr;
819819
struct bt_conn *iso_conn;
820820
int err;
821821

822-
err = validate_send(chan, buf, BT_HCI_ISO_TS_DATA_HDR_SIZE);
822+
err = validate_send(chan, buf, BT_HCI_ISO_SDU_TS_HDR_SIZE);
823823
if (err != 0) {
824824
return err;
825825
}
@@ -828,8 +828,8 @@ int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t
828828

829829
hdr = net_buf_push(buf, sizeof(*hdr));
830830
hdr->ts = ts;
831-
hdr->data.sn = sys_cpu_to_le16(seq_num);
832-
hdr->data.slen = sys_cpu_to_le16(
831+
hdr->sdu.sn = sys_cpu_to_le16(seq_num);
832+
hdr->sdu.slen = sys_cpu_to_le16(
833833
bt_iso_pkt_len_pack(net_buf_frags_len(buf) - sizeof(*hdr), BT_ISO_DATA_VALID));
834834

835835
iso_conn = chan->iso;

0 commit comments

Comments
 (0)