Skip to content

Commit 0fe8c8d

Browse files
iulia-tanasescuVudentz
authored andcommitted
Bluetooth: Split bt_iso_qos into dedicated structures
Split bt_iso_qos into dedicated unicast and broadcast structures and add additional broadcast parameters. Fixes: eca0ae4 ("Bluetooth: Add initial implementation of BIS connections") Signed-off-by: Iulia Tanasescu <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent af39533 commit 0fe8c8d

File tree

5 files changed

+237
-135
lines changed

5 files changed

+237
-135
lines changed

include/net/bluetooth/bluetooth.h

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
BlueZ - Bluetooth protocol stack for Linux
33
Copyright (C) 2000-2001 Qualcomm Incorporated
4+
Copyright 2023 NXP
45
56
Written 2000,2001 by Maxim Krasnyansky <[email protected]>
67
@@ -171,23 +172,39 @@ struct bt_iso_io_qos {
171172
__u8 rtn;
172173
};
173174

174-
struct bt_iso_qos {
175-
union {
176-
__u8 cig;
177-
__u8 big;
178-
};
179-
union {
180-
__u8 cis;
181-
__u8 bis;
182-
};
183-
union {
184-
__u8 sca;
185-
__u8 sync_interval;
186-
};
175+
struct bt_iso_ucast_qos {
176+
__u8 cig;
177+
__u8 cis;
178+
__u8 sca;
179+
__u8 packing;
180+
__u8 framing;
181+
struct bt_iso_io_qos in;
182+
struct bt_iso_io_qos out;
183+
};
184+
185+
struct bt_iso_bcast_qos {
186+
__u8 big;
187+
__u8 bis;
188+
__u8 sync_interval;
187189
__u8 packing;
188190
__u8 framing;
189191
struct bt_iso_io_qos in;
190192
struct bt_iso_io_qos out;
193+
__u8 encryption;
194+
__u8 bcode[16];
195+
__u8 options;
196+
__u16 skip;
197+
__u16 sync_timeout;
198+
__u8 sync_cte_type;
199+
__u8 mse;
200+
__u16 timeout;
201+
};
202+
203+
struct bt_iso_qos {
204+
union {
205+
struct bt_iso_ucast_qos ucast;
206+
struct bt_iso_bcast_qos bcast;
207+
};
191208
};
192209

193210
#define BT_ISO_PHY_1M 0x01

include/net/bluetooth/hci_core.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
BlueZ - Bluetooth protocol stack for Linux
33
Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
4+
Copyright 2023 NXP
45
56
Written 2000,2001 by Maxim Krasnyansky <[email protected]>
67
@@ -1096,7 +1097,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_bis(struct hci_dev *hdev,
10961097
if (bacmp(&c->dst, ba) || c->type != ISO_LINK)
10971098
continue;
10981099

1099-
if (c->iso_qos.big == big && c->iso_qos.bis == bis) {
1100+
if (c->iso_qos.bcast.big == big && c->iso_qos.bcast.bis == bis) {
11001101
rcu_read_unlock();
11011102
return c;
11021103
}
@@ -1205,7 +1206,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_cig(struct hci_dev *hdev,
12051206
if (c->type != ISO_LINK)
12061207
continue;
12071208

1208-
if (handle == c->iso_qos.cig) {
1209+
if (handle == c->iso_qos.ucast.cig) {
12091210
rcu_read_unlock();
12101211
return c;
12111212
}
@@ -1228,7 +1229,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_big(struct hci_dev *hdev,
12281229
if (bacmp(&c->dst, BDADDR_ANY) || c->type != ISO_LINK)
12291230
continue;
12301231

1231-
if (handle == c->iso_qos.big) {
1232+
if (handle == c->iso_qos.bcast.big) {
12321233
rcu_read_unlock();
12331234
return c;
12341235
}
@@ -1337,7 +1338,7 @@ struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
13371338
__u8 dst_type, struct bt_iso_qos *qos,
13381339
__u8 data_len, __u8 *data);
13391340
int hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst, __u8 dst_type,
1340-
__u8 sid);
1341+
__u8 sid, struct bt_iso_qos *qos);
13411342
int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos,
13421343
__u16 sync_handle, __u8 num_bis, __u8 bis[]);
13431344
int hci_conn_check_link_mode(struct hci_conn *conn);

0 commit comments

Comments
 (0)