* [PATCH BlueZ v2 0/1] Split bt_iso_qos into dedicated structures
@ 2023-03-28 7:26 Iulia Tanasescu
2023-03-28 7:26 ` [PATCH BlueZ v2 1/1] " Iulia Tanasescu
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-28 7:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
This patch adds support for additional ISO broadcast QoS parameters,
that the user can set before performing broadcast procedures
using an ISO socket.
This patch splits the "bt_iso_qos" structure into dedicated
unicast and broadcast structures, so that ISO sockets
can be configured with dedicated QoS options depending
on the type of ISO procedures to run.
This patch depends on the bluetooth-next patch
[v2,1/1] Bluetooth: Split bt_iso_qos into dedicated structures.
Iulia Tanasescu (1):
Split bt_iso_qos into dedicated structures
btio/btio.c | 7 +-
client/player.c | 7 +-
emulator/bthost.c | 3 +-
emulator/bthost.h | 3 +-
lib/bluetooth.h | 59 +++++++++++----
profiles/audio/bap.c | 19 ++---
tools/btiotest.c | 17 +++--
tools/iso-tester.c | 144 +++++++++++++++++++++++++++++++----
tools/isotest.c | 177 +++++++++++++++++++++++++++++++------------
9 files changed, 336 insertions(+), 100 deletions(-)
base-commit: 338ba4352b6cadafe61808c21302c0abe2168e02
--
2.34.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH BlueZ v2 1/1] Split bt_iso_qos into dedicated structures
2023-03-28 7:26 [PATCH BlueZ v2 0/1] Split bt_iso_qos into dedicated structures Iulia Tanasescu
@ 2023-03-28 7:26 ` Iulia Tanasescu
2023-03-28 8:46 ` bluez.test.bot
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-28 7:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
Split bt_iso_qos into dedicated unicast and broadcast
structures and add additional broadcast parameters.
---
btio/btio.c | 7 +-
client/player.c | 7 +-
emulator/bthost.c | 3 +-
emulator/bthost.h | 3 +-
lib/bluetooth.h | 59 +++++++++++----
profiles/audio/bap.c | 19 ++---
tools/btiotest.c | 17 +++--
tools/iso-tester.c | 144 +++++++++++++++++++++++++++++++----
tools/isotest.c | 177 +++++++++++++++++++++++++++++++------------
9 files changed, 336 insertions(+), 100 deletions(-)
diff --git a/btio/btio.c b/btio/btio.c
index 1ad42728d..6f6d76dc8 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -1608,13 +1609,13 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
*(va_arg(args, uint8_t *)) = dst.iso_bdaddr_type;
break;
case BT_IO_OPT_MTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_IMTU:
- *(va_arg(args, uint16_t *)) = qos.in.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.in.sdu;
break;
case BT_IO_OPT_OMTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_PHY:
if (get_phy(sock, &phy) < 0) {
diff --git a/client/player.c b/client/player.c
index 63e11db09..5572cc566 100644
--- a/client/player.c
+++ b/client/player.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2020 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -3534,7 +3535,7 @@ static bool transport_timer_read(struct io *io, void *user_data)
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (qos.ucast.out.latency * 1000 / qos.ucast.out.interval);
ret = transport_send_seq(transport, transport->fd, num);
if (ret < 0) {
@@ -3570,8 +3571,8 @@ static int transport_send(struct transport *transport, int fd,
return -errno;
memset(&ts, 0, sizeof(ts));
- ts.it_value.tv_nsec = qos->out.latency * 1000000;
- ts.it_interval.tv_nsec = qos->out.latency * 1000000;
+ ts.it_value.tv_nsec = qos->ucast.out.latency * 1000000;
+ ts.it_interval.tv_nsec = qos->ucast.out.latency * 1000000;
if (timerfd_settime(timer_fd, TFD_TIMER_ABSTIME, &ts, NULL) < 0)
return -errno;
diff --git a/emulator/bthost.c b/emulator/bthost.c
index 4671fe17d..1b6847b81 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2011-2012 Intel Corporation
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -3171,7 +3172,7 @@ bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr)
}
void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
- uint8_t cis_id, const struct bt_iso_qos *qos)
+ uint8_t cis_id, const struct bt_iso_ucast_qos *qos)
{
struct bt_hci_cmd_le_set_cig_params *cp;
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 92182687f..779ca7d06 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -5,6 +5,7 @@
*
* Copyright (C) 2011-2012 Intel Corporation
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -106,7 +107,7 @@ void bthost_create_big(struct bthost *bthost, uint8_t num_bis);
bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr);
void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
- uint8_t cis_id, const struct bt_iso_qos *qos);
+ uint8_t cis_id, const struct bt_iso_ucast_qos *qos);
void bthost_create_cis(struct bthost *bthost, uint16_t cis_handle,
uint16_t acl_handle);
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index af5fbcfbc..660a529d8 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -6,6 +6,7 @@
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -146,6 +147,9 @@ struct bt_voice {
#define BT_ISO_QOS_CIG_UNSET 0xff
#define BT_ISO_QOS_CIS_UNSET 0xff
+#define BT_ISO_QOS_BIG_UNSET 0xff
+#define BT_ISO_QOS_BIS_UNSET 0xff
+
struct bt_iso_io_qos {
uint32_t interval;
uint16_t latency;
@@ -154,25 +158,54 @@ struct bt_iso_io_qos {
uint8_t rtn;
};
-struct bt_iso_qos {
- union {
- uint8_t cig;
- uint8_t big;
- };
- union {
- uint8_t cis;
- uint8_t bis;
- };
- union {
- uint8_t sca;
- uint8_t sync_interval;
- };
+struct bt_iso_ucast_qos {
+ uint8_t cig;
+ uint8_t cis;
+ uint8_t sca;
uint8_t packing;
uint8_t framing;
struct bt_iso_io_qos in;
struct bt_iso_io_qos out;
};
+struct bt_iso_bcast_src_qos {
+ uint8_t sync_interval;
+ uint8_t big;
+ uint8_t bis;
+ uint8_t packing;
+ uint8_t framing;
+ uint8_t encryption;
+ uint8_t bcode[16];
+ struct bt_iso_io_qos out;
+};
+
+struct bt_iso_bcast_snk_qos {
+ uint8_t options;
+ uint16_t skip;
+ uint16_t sync_timeout;
+ uint8_t sync_cte_type;
+ uint8_t big;
+ uint8_t encryption;
+ uint8_t bcode[16];
+ uint8_t mse;
+ uint16_t timeout;
+ struct bt_iso_io_qos in;
+};
+
+struct bt_iso_bcast_qos {
+ union {
+ struct bt_iso_bcast_src_qos bsrc;
+ struct bt_iso_bcast_snk_qos bsnk;
+ };
+};
+
+struct bt_iso_qos {
+ union {
+ struct bt_iso_ucast_qos ucast;
+ struct bt_iso_bcast_qos bcast;
+ };
+};
+
#define BT_CODEC 19
struct bt_codec {
uint8_t id;
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index dfdf87255..afc87d85f 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -746,10 +747,10 @@ static bool match_stream_qos(const void *data, const void *user_data)
qos = bt_bap_stream_get_qos((void *)stream);
- if (iso_qos->cig != qos->cig_id)
+ if (iso_qos->ucast.cig != qos->cig_id)
return false;
- return iso_qos->cis == qos->cis_id;
+ return iso_qos->ucast.cis == qos->cis_id;
}
static void iso_confirm_cb(GIOChannel *io, void *user_data)
@@ -771,7 +772,7 @@ static void iso_confirm_cb(GIOChannel *io, void *user_data)
}
DBG("ISO: incoming connect from %s (CIG 0x%02x CIS 0x%02x)",
- address, qos.cig, qos.cis);
+ address, qos.ucast.cig, qos.ucast.cis);
stream = queue_remove_if(data->streams, match_stream_qos, &qos);
if (!stream) {
@@ -990,11 +991,11 @@ static void bap_create_io(struct bap_data *data, struct bap_ep *ep,
}
memset(&iso_qos, 0, sizeof(iso_qos));
- iso_qos.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
- iso_qos.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
+ iso_qos.ucast.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
+ iso_qos.ucast.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
- bap_iso_qos(qos[0], &iso_qos.in);
- bap_iso_qos(qos[1], &iso_qos.out);
+ bap_iso_qos(qos[0], &iso_qos.ucast.in);
+ bap_iso_qos(qos[1], &iso_qos.ucast.out);
if (ep)
bap_connect_io(data, ep, stream, &iso_qos, defer);
@@ -1189,8 +1190,8 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
return;
}
- ep->qos.cig_id = qos.cig;
- ep->qos.cis_id = qos.cis;
+ ep->qos.cig_id = qos.ucast.cig;
+ ep->qos.cis_id = qos.ucast.cis;
}
DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd,
diff --git a/tools/btiotest.c b/tools/btiotest.c
index 193e1395b..75af90543 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -39,13 +40,15 @@ static int opt_update_sec = 0;
}
struct bt_iso_qos qos = {
- .cig = BT_ISO_QOS_CIG_UNSET,
- .cis = BT_ISO_QOS_CIG_UNSET,
- .sca = 0x07,
- .packing = 0x00,
- .framing = 0x00,
- .in = DEFAULT_IO_QOS,
- .out = DEFAULT_IO_QOS,
+ .ucast = {
+ .cig = BT_ISO_QOS_CIG_UNSET,
+ .cis = BT_ISO_QOS_CIG_UNSET,
+ .sca = 0x07,
+ .packing = 0x00,
+ .framing = 0x00,
+ .in = DEFAULT_IO_QOS,
+ .out = DEFAULT_IO_QOS,
+ },
};
struct io_data {
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index e4582573a..2dd90c14e 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -42,13 +43,15 @@
#define QOS_FULL(_cig, _cis, _in, _out) \
{ \
- .cig = _cig, \
- .cis = _cis, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .in = _in, \
- .out = _out, \
+ .ucast = { \
+ .cig = _cig, \
+ .cis = _cis, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .in = _in, \
+ .out = _out, \
+ },\
}
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
@@ -119,10 +122,56 @@
#define QOS_48_5_2 QOS_OUT(7500, 75, 117, 0x02, 13)
#define QOS_48_6_2 QOS_OUT(10000, 100, 155, 0x02, 13)
-#define QOS_OUT_16_2_1 QOS_OUT(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_16_2_1 QOS_OUT_1(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_1_16_2_1 QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
-#define QOS_IN_16_2_1 QOS_IN(10000, 10, 40, 0x02, 2)
+#define QOS_SINK_FULL(_big, _in) \
+{ \
+ .bcast.bsnk = { \
+ .options = 0x00, \
+ .skip = 0x0000, \
+ .sync_timeout = 0x4000, \
+ .sync_cte_type = 0x00, \
+ .big = _big, \
+ .encryption = 0x00, \
+ .bcode = {0}, \
+ .mse = 0x00, \
+ .timeout = 0x4000, \
+ .in = _in, \
+ }, \
+}
+
+#define QOS_SOURCE_FULL(_big, _bis, _out) \
+{ \
+ .bcast.bsrc = { \
+ .sync_interval = 0x07, \
+ .big = _big, \
+ .bis = _bis, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .encryption = 0x00, \
+ .bcode = {0}, \
+ .out = _out, \
+ }, \
+}
+
+#define BCAST_QOS_OUT(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(BT_ISO_QOS_BIG_UNSET, BT_ISO_QOS_BIS_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(0x01, BT_ISO_QOS_BIS_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(0x01, 0x01, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_IN(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SINK_FULL(BT_ISO_QOS_BIG_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define QOS_OUT_16_2_1 BCAST_QOS_OUT(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_16_2_1 BCAST_QOS_OUT_1(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_1_16_2_1 BCAST_QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
+#define QOS_IN_16_2_1 BCAST_QOS_IN(10000, 10, 40, 0x02, 2)
struct test_data {
const void *test_data;
@@ -670,6 +719,7 @@ static const struct iso_client_data bcast_16_2_1_recv = {
.expect_err = 0,
.recv = &send_16_2_1,
.bcast = true,
+ .server = true,
};
static void client_connectable_complete(uint16_t opcode, uint8_t status,
@@ -1080,8 +1130,8 @@ static bool check_io_qos(const struct bt_iso_io_qos *io1,
return true;
}
-static bool check_qos(const struct bt_iso_qos *qos1,
- const struct bt_iso_qos *qos2)
+static bool check_ucast_qos(const struct bt_iso_ucast_qos *qos1,
+ const struct bt_iso_ucast_qos *qos2)
{
if (qos1->cig != BT_ISO_QOS_CIG_UNSET &&
qos2->cig != BT_ISO_QOS_CIG_UNSET &&
@@ -1124,6 +1174,63 @@ static bool check_qos(const struct bt_iso_qos *qos1,
return true;
}
+static bool check_bcast_src_qos(const struct bt_iso_bcast_src_qos *qos1,
+ const struct bt_iso_bcast_src_qos *qos2)
+{
+ if (qos1->sync_interval != qos2->sync_interval) {
+ tester_warn("Unexpected QoS sync interval: 0x%02x != 0x%02x",
+ qos1->sync_interval, qos2->sync_interval);
+ return false;
+ }
+
+ if (qos1->big != BT_ISO_QOS_BIG_UNSET &&
+ qos2->big != BT_ISO_QOS_BIG_UNSET &&
+ qos1->big != qos2->big) {
+ tester_warn("Unexpected BIG ID: 0x%02x != 0x%02x",
+ qos1->big, qos2->big);
+ return false;
+ }
+
+ if (qos1->bis != BT_ISO_QOS_BIS_UNSET &&
+ qos2->bis != BT_ISO_QOS_BIS_UNSET &&
+ qos1->bis != qos2->bis) {
+ tester_warn("Unexpected BIS ID: 0x%02x != 0x%02x",
+ qos1->bis, qos2->bis);
+ return false;
+ }
+
+ if (qos1->packing != qos2->packing) {
+ tester_warn("Unexpected QoS packing: 0x%02x != 0x%02x",
+ qos1->packing, qos2->packing);
+ return false;
+ }
+
+ if (qos1->framing != qos2->framing) {
+ tester_warn("Unexpected QoS framing: 0x%02x != 0x%02x",
+ qos1->framing, qos2->framing);
+ return false;
+ }
+
+ if (qos1->encryption != qos2->encryption) {
+ tester_warn("Unexpected QoS encryption: 0x%02x != 0x%02x",
+ qos1->encryption, qos2->encryption);
+ return false;
+ }
+
+
+ if (memcmp(qos1->bcode, qos2->bcode, sizeof(qos1->bcode))) {
+ tester_warn("Unexpected QoS Broadcast Code");
+ return false;
+ }
+
+ if (!check_io_qos(&qos1->out, &qos2->out)) {
+ tester_warn("Unexpected Output QoS");
+ return false;
+ }
+
+ return true;
+}
+
static gboolean iso_recv_data(GIOChannel *io, GIOCondition cond,
gpointer user_data)
{
@@ -1250,6 +1357,7 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
int err, sk_err, sk;
socklen_t len;
struct bt_iso_qos qos;
+ bool ret = true;
sk = g_io_channel_unix_get_fd(io);
@@ -1264,7 +1372,13 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
return FALSE;
}
- if (!check_qos(&qos, &isodata->qos)) {
+ if (!isodata->bcast)
+ ret = check_ucast_qos(&qos.ucast, &isodata->qos.ucast);
+ else if (!isodata->server)
+ ret = check_bcast_src_qos(&qos.bcast.bsrc,
+ &isodata->qos.bcast.bsrc);
+
+ if (!ret) {
tester_warn("Unexpected QoS parameter");
tester_test_failed();
return FALSE;
@@ -1579,7 +1693,7 @@ static void setup_listen(struct test_data *data, uint8_t num, GIOFunc func)
client = hciemu_get_client(data->hciemu, 0);
host = hciemu_client_host(client);
- bthost_set_cig_params(host, 0x01, 0x01, &isodata->qos);
+ bthost_set_cig_params(host, 0x01, 0x01, &isodata->qos.ucast);
bthost_create_cis(host, 257, data->acl_handle);
}
}
diff --git a/tools/isotest.c b/tools/isotest.c
index 2b5f164de..f00f03249 100644
--- a/tools/isotest.c
+++ b/tools/isotest.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -239,7 +240,7 @@ fail:
return err < 0 ? err : 0;
}
-static void print_qos(int sk, struct sockaddr_iso *addr)
+static void print_ucast_qos(int sk)
{
struct bt_iso_qos qos;
socklen_t len;
@@ -254,21 +255,83 @@ static void print_qos(int sk, struct sockaddr_iso *addr)
return;
}
- if (!bacmp(&addr->iso_bdaddr, BDADDR_ANY)) {
- syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.big, qos.bis, qos.packing,
- qos.framing);
- } else {
- syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.cig, qos.cis, qos.packing,
- qos.framing);
- syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval,
- qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn);
+ syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.ucast.cig, qos.ucast.cis,
+ qos.ucast.packing, qos.ucast.framing);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.in.interval,
+ qos.ucast.in.latency, qos.ucast.in.sdu, qos.ucast.in.phy,
+ qos.ucast.in.rtn);
+
+ syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.out.interval,
+ qos.ucast.out.latency, qos.ucast.out.sdu, qos.ucast.out.phy,
+ qos.ucast.out.rtn);
+}
+
+static void print_bcast_src_qos(int sk)
+{
+ struct bt_iso_qos qos;
+ socklen_t len;
+
+ /* Read Out QOS */
+ memset(&qos, 0, sizeof(qos));
+ len = sizeof(qos);
+
+ if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
+ syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)",
+ strerror(errno), errno);
+ return;
}
+
+ syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.bcast.bsrc.big, qos.bcast.bsrc.bis,
+ qos.bcast.bsrc.packing, qos.bcast.bsrc.framing);
+
syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.out.interval,
- qos.out.latency, qos.out.sdu, qos.out.phy, qos.out.rtn);
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.bsrc.out.interval,
+ qos.bcast.bsrc.out.latency, qos.bcast.bsrc.out.sdu,
+ qos.bcast.bsrc.out.phy, qos.bcast.bsrc.out.rtn);
+}
+
+static void print_bcast_snk_qos(int sk)
+{
+ struct bt_iso_qos qos;
+ socklen_t len;
+
+ /* Read Out QOS */
+ memset(&qos, 0, sizeof(qos));
+ len = sizeof(qos);
+
+ if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
+ syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)",
+ strerror(errno), errno);
+ return;
+ }
+
+ syslog(LOG_INFO, "QoS BIG 0x%02x", qos.bcast.bsnk.big);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.bsnk.in.interval,
+ qos.bcast.bsnk.in.latency, qos.bcast.bsnk.in.sdu,
+ qos.bcast.bsnk.in.phy, qos.bcast.bsnk.in.rtn);
+}
+
+static void ucast_qos_to_bcast_src(struct bt_iso_qos *qos)
+{
+ struct bt_iso_qos src_qos;
+
+ memset(&src_qos, 0, sizeof(src_qos));
+
+ src_qos.bcast.bsrc.sync_interval = qos->ucast.sca;
+ src_qos.bcast.bsrc.big = qos->ucast.cig;
+ src_qos.bcast.bsrc.bis = qos->ucast.cis;
+ src_qos.bcast.bsrc.packing = qos->ucast.packing;
+ src_qos.bcast.bsrc.framing = qos->ucast.framing;
+ src_qos.bcast.bsrc.out = qos->ucast.out;
+
+ *qos = src_qos;
}
static int do_connect(char *peer)
@@ -301,9 +364,13 @@ static int do_connect(char *peer)
/* Set QoS if available */
if (iso_qos) {
- if (!inout || !strcmp(peer, "00:00:00:00:00:00")) {
- iso_qos->in.phy = 0x00;
- iso_qos->in.sdu = 0;
+ if (!strcmp(peer, "00:00:00:00:00:00")) {
+ ucast_qos_to_bcast_src(iso_qos);
+ } else {
+ if (!inout) {
+ iso_qos->ucast.in.phy = 0x00;
+ iso_qos->ucast.in.sdu = 0;
+ }
}
if (setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, iso_qos,
@@ -338,7 +405,10 @@ static int do_connect(char *peer)
syslog(LOG_INFO, "Connected [%s]", peer);
- print_qos(sk, &addr);
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ print_bcast_src_qos(sk);
+ else
+ print_ucast_qos(sk);
return sk;
@@ -441,7 +511,10 @@ static void do_listen(char *filename, void (*handler)(int fd, int sk),
ba2str(&addr->iso_bdaddr, ba);
syslog(LOG_INFO, "Connected [%s]", ba);
- print_qos(nsk, addr);
+ if (peer)
+ print_bcast_snk_qos(nsk);
+ else
+ print_ucast_qos(nsk);
/* Handle deferred setup */
if (defer_setup) {
@@ -648,7 +721,7 @@ static int read_file(int fd, ssize_t count, bool rewind)
return len;
}
-static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
+static void do_send(int sk, int fd, struct bt_iso_io_qos *out, uint32_t num,
bool repeat)
{
uint32_t seq;
@@ -662,14 +735,14 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
for (seq = 0; ; seq++) {
if (fd >= 0) {
- len = read_file(fd, qos->out.sdu, repeat);
+ len = read_file(fd, out->sdu, repeat);
if (len < 0) {
syslog(LOG_ERR, "read failed: %s (%d)",
strerror(-len), -len);
exit(1);
}
} else
- len = qos->out.sdu;
+ len = out->sdu;
len = send(sk, buf, len, 0);
if (len <= 0) {
@@ -686,7 +759,7 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
seq, len, used / len, used);
if (seq && !((seq + 1) % num))
- send_wait(&t_start, num * qos->out.interval);
+ send_wait(&t_start, num * out->interval);
}
}
@@ -696,6 +769,7 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
socklen_t len;
int sk, fd = -1;
uint32_t num;
+ struct bt_iso_io_qos *out;
if (filename) {
char altername[PATH_MAX];
@@ -728,16 +802,21 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
syslog(LOG_INFO, "Sending ...");
/* Read QoS */
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ out = &qos.bcast.bsrc.out;
+ else
+ out = &qos.ucast.out;
+
memset(&qos, 0, sizeof(qos));
len = sizeof(qos);
if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
syslog(LOG_ERR, "Can't get Output QoS socket option: %s (%d)",
strerror(errno), errno);
- qos.out.sdu = ISO_DEFAULT_MTU;
+ out->sdu = ISO_DEFAULT_MTU;
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (out->latency * 1000 / out->interval);
syslog(LOG_INFO, "Number of packets: %d", num);
@@ -746,8 +825,8 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
* latency:
* jitter buffer = 2 * (SDU * subevents)
*/
- sndbuf = 2 * ((qos.out.latency * 1000 / qos.out.interval) *
- qos.out.sdu);
+ sndbuf = 2 * ((out->latency * 1000 / out->interval) *
+ out->sdu);
len = sizeof(sndbuf);
if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &sndbuf, len) < 0) {
@@ -768,10 +847,10 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
}
}
- for (i = 6; i < qos.out.sdu; i++)
+ for (i = 6; i < out->sdu; i++)
buf[i] = 0x7f;
- do_send(sk, fd, &qos, num, repeat);
+ do_send(sk, fd, out, num, repeat);
}
static void reconnect_mode(char *peer)
@@ -826,12 +905,14 @@ static void multy_connect_mode(char *peer)
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
{ \
- .cig = BT_ISO_QOS_CIG_UNSET, \
- .cis = BT_ISO_QOS_CIS_UNSET, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ .ucast = { \
+ .cig = BT_ISO_QOS_CIG_UNSET, \
+ .cis = BT_ISO_QOS_CIS_UNSET, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ }, \
}
#define QOS_PRESET(_name, _inout, _interval, _latency, _sdu, _phy, _rtn) \
@@ -1057,43 +1138,43 @@ int main(int argc, char *argv[])
case 'M':
if (optarg)
- iso_qos->out.sdu = atoi(optarg);
+ iso_qos->ucast.out.sdu = atoi(optarg);
break;
case 'S':
if (optarg)
- iso_qos->sca = atoi(optarg);
+ iso_qos->ucast.sca = atoi(optarg);
break;
case 'P':
if (optarg)
- iso_qos->packing = atoi(optarg);
+ iso_qos->ucast.packing = atoi(optarg);
break;
case 'F':
if (optarg)
- iso_qos->framing = atoi(optarg);
+ iso_qos->ucast.framing = atoi(optarg);
break;
case 'I':
if (optarg)
- iso_qos->out.interval = atoi(optarg);
+ iso_qos->ucast.out.interval = atoi(optarg);
break;
case 'L':
if (optarg)
- iso_qos->out.latency = atoi(optarg);
+ iso_qos->ucast.out.latency = atoi(optarg);
break;
case 'Y':
if (optarg)
- iso_qos->out.phy = atoi(optarg);
+ iso_qos->ucast.out.phy = atoi(optarg);
break;
case 'R':
if (optarg)
- iso_qos->out.rtn = atoi(optarg);
+ iso_qos->ucast.out.rtn = atoi(optarg);
break;
case 'B':
@@ -1112,12 +1193,12 @@ int main(int argc, char *argv[])
case 'G':
if (optarg)
- iso_qos->cig = atoi(optarg);
+ iso_qos->ucast.cig = atoi(optarg);
break;
case 'T':
if (optarg)
- iso_qos->cis = atoi(optarg);
+ iso_qos->ucast.cis = atoi(optarg);
break;
/* fall through */
@@ -1128,11 +1209,11 @@ int main(int argc, char *argv[])
}
if (inout) {
- iso_qos->in = iso_qos->out;
+ iso_qos->ucast.in = iso_qos->ucast.out;
} else {
/* Align interval and latency even if is unidirectional */
- iso_qos->in.interval = iso_qos->out.interval;
- iso_qos->in.latency = iso_qos->out.latency;
+ iso_qos->ucast.in.interval = iso_qos->ucast.out.interval;
+ iso_qos->ucast.in.latency = iso_qos->ucast.out.latency;
}
buf = malloc(data_size);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Split bt_iso_qos into dedicated structures
2023-03-28 7:26 ` [PATCH BlueZ v2 1/1] " Iulia Tanasescu
@ 2023-03-28 8:46 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2023-03-28 8:46 UTC (permalink / raw)
To: linux-bluetooth, iulia.tanasescu
[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=734492
---Test result---
Test Summary:
CheckPatch PASS 0.81 seconds
GitLint PASS 0.26 seconds
BuildEll PASS 32.97 seconds
BluezMake PASS 1004.38 seconds
MakeCheck PASS 12.64 seconds
MakeDistcheck PASS 182.43 seconds
CheckValgrind PASS 296.33 seconds
CheckSmatch WARNING 392.58 seconds
bluezmakeextell PASS 118.78 seconds
IncrementalBuild PASS 815.07 seconds
ScanBuild PASS 1224.98 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/bthost.c:584:28: warning: Variable length array is used.emulator/bthost.c:741:28: warning: Variable length array is used.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH BlueZ v3 1/1] Split bt_iso_qos into dedicated structures
@ 2023-03-31 15:39 Iulia Tanasescu
2023-03-31 17:10 ` bluez.test.bot
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-31 15:39 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
Split bt_iso_qos into dedicated unicast and broadcast
structures and add additional broadcast parameters.
---
btio/btio.c | 7 +-
client/player.c | 7 +-
emulator/bthost.c | 31 ++++---
lib/bluetooth.h | 46 +++++++---
profiles/audio/bap.c | 19 +++--
tools/btiotest.c | 17 ++--
tools/iso-tester.c | 199 +++++++++++++++++++++++++++++++++++++------
tools/isotest.c | 157 +++++++++++++++++++++++-----------
8 files changed, 359 insertions(+), 124 deletions(-)
diff --git a/btio/btio.c b/btio/btio.c
index 1ad42728d..6f6d76dc8 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -1608,13 +1609,13 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
*(va_arg(args, uint8_t *)) = dst.iso_bdaddr_type;
break;
case BT_IO_OPT_MTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_IMTU:
- *(va_arg(args, uint16_t *)) = qos.in.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.in.sdu;
break;
case BT_IO_OPT_OMTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_PHY:
if (get_phy(sock, &phy) < 0) {
diff --git a/client/player.c b/client/player.c
index 63e11db09..5572cc566 100644
--- a/client/player.c
+++ b/client/player.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2020 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -3534,7 +3535,7 @@ static bool transport_timer_read(struct io *io, void *user_data)
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (qos.ucast.out.latency * 1000 / qos.ucast.out.interval);
ret = transport_send_seq(transport, transport->fd, num);
if (ret < 0) {
@@ -3570,8 +3571,8 @@ static int transport_send(struct transport *transport, int fd,
return -errno;
memset(&ts, 0, sizeof(ts));
- ts.it_value.tv_nsec = qos->out.latency * 1000000;
- ts.it_interval.tv_nsec = qos->out.latency * 1000000;
+ ts.it_value.tv_nsec = qos->ucast.out.latency * 1000000;
+ ts.it_interval.tv_nsec = qos->ucast.out.latency * 1000000;
if (timerfd_settime(timer_fd, TFD_TIMER_ABSTIME, &ts, NULL) < 0)
return -errno;
diff --git a/emulator/bthost.c b/emulator/bthost.c
index 4671fe17d..8cdfa0c06 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2011-2012 Intel Corporation
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -3178,22 +3179,24 @@ void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
cp = malloc(sizeof(*cp) + sizeof(*cp->cis));
memset(cp, 0, sizeof(*cp) + sizeof(*cp->cis));
cp->cig_id = cig_id;
- put_le24(qos->in.interval ? qos->in.interval : qos->out.interval,
- cp->c_interval);
- put_le24(qos->out.interval ? qos->out.interval : qos->in.interval,
- cp->p_interval);
- cp->c_latency = cpu_to_le16(qos->in.latency ? qos->in.latency :
- qos->out.latency);
- cp->p_latency = cpu_to_le16(qos->out.latency ? qos->out.latency :
- qos->in.latency);
+ put_le24(qos->ucast.in.interval ? qos->ucast.in.interval :
+ qos->ucast.out.interval, cp->c_interval);
+ put_le24(qos->ucast.out.interval ? qos->ucast.out.interval :
+ qos->ucast.in.interval, cp->p_interval);
+ cp->c_latency = cpu_to_le16(qos->ucast.in.latency ?
+ qos->ucast.in.latency : qos->ucast.out.latency);
+ cp->p_latency = cpu_to_le16(qos->ucast.out.latency ?
+ qos->ucast.out.latency : qos->ucast.in.latency);
cp->num_cis = 0x01;
cp->cis[0].cis_id = cis_id;
- cp->cis[0].c_sdu = qos->in.sdu;
- cp->cis[0].p_sdu = qos->out.sdu;
- cp->cis[0].c_phy = qos->in.phy ? qos->in.phy : qos->out.phy;
- cp->cis[0].p_phy = qos->out.phy ? qos->out.phy : qos->in.phy;
- cp->cis[0].c_rtn = qos->in.rtn;
- cp->cis[0].p_rtn = qos->out.rtn;
+ cp->cis[0].c_sdu = qos->ucast.in.sdu;
+ cp->cis[0].p_sdu = qos->ucast.out.sdu;
+ cp->cis[0].c_phy = qos->ucast.in.phy ? qos->ucast.in.phy :
+ qos->ucast.out.phy;
+ cp->cis[0].p_phy = qos->ucast.out.phy ? qos->ucast.out.phy :
+ qos->ucast.in.phy;
+ cp->cis[0].c_rtn = qos->ucast.in.rtn;
+ cp->cis[0].p_rtn = qos->ucast.out.rtn;
send_command(bthost, BT_HCI_CMD_LE_SET_CIG_PARAMS, cp,
sizeof(*cp) + sizeof(*cp->cis));
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index af5fbcfbc..b4bb6748f 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -6,6 +6,7 @@
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -146,6 +147,9 @@ struct bt_voice {
#define BT_ISO_QOS_CIG_UNSET 0xff
#define BT_ISO_QOS_CIS_UNSET 0xff
+#define BT_ISO_QOS_BIG_UNSET 0xff
+#define BT_ISO_QOS_BIS_UNSET 0xff
+
struct bt_iso_io_qos {
uint32_t interval;
uint16_t latency;
@@ -154,25 +158,41 @@ struct bt_iso_io_qos {
uint8_t rtn;
};
-struct bt_iso_qos {
- union {
- uint8_t cig;
- uint8_t big;
- };
- union {
- uint8_t cis;
- uint8_t bis;
- };
- union {
- uint8_t sca;
- uint8_t sync_interval;
- };
+struct bt_iso_ucast_qos {
+ uint8_t cig;
+ uint8_t cis;
+ uint8_t sca;
uint8_t packing;
uint8_t framing;
struct bt_iso_io_qos in;
struct bt_iso_io_qos out;
};
+struct bt_iso_bcast_qos {
+ uint8_t big;
+ uint8_t bis;
+ uint8_t sync_interval;
+ uint8_t packing;
+ uint8_t framing;
+ struct bt_iso_io_qos in;
+ struct bt_iso_io_qos out;
+ uint8_t encryption;
+ uint8_t bcode[16];
+ uint8_t options;
+ uint16_t skip;
+ uint16_t sync_timeout;
+ uint8_t sync_cte_type;
+ uint8_t mse;
+ uint16_t timeout;
+};
+
+struct bt_iso_qos {
+ union {
+ struct bt_iso_ucast_qos ucast;
+ struct bt_iso_bcast_qos bcast;
+ };
+};
+
#define BT_CODEC 19
struct bt_codec {
uint8_t id;
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index cfe685466..a5e253577 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -748,10 +749,10 @@ static bool match_stream_qos(const void *data, const void *user_data)
qos = bt_bap_stream_get_qos((void *)stream);
- if (iso_qos->cig != qos->cig_id)
+ if (iso_qos->ucast.cig != qos->cig_id)
return false;
- return iso_qos->cis == qos->cis_id;
+ return iso_qos->ucast.cis == qos->cis_id;
}
static void iso_confirm_cb(GIOChannel *io, void *user_data)
@@ -773,7 +774,7 @@ static void iso_confirm_cb(GIOChannel *io, void *user_data)
}
DBG("ISO: incoming connect from %s (CIG 0x%02x CIS 0x%02x)",
- address, qos.cig, qos.cis);
+ address, qos.ucast.cig, qos.ucast.cis);
stream = queue_remove_if(data->streams, match_stream_qos, &qos);
if (!stream) {
@@ -992,11 +993,11 @@ static void bap_create_io(struct bap_data *data, struct bap_ep *ep,
}
memset(&iso_qos, 0, sizeof(iso_qos));
- iso_qos.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
- iso_qos.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
+ iso_qos.ucast.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
+ iso_qos.ucast.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
- bap_iso_qos(qos[0], &iso_qos.in);
- bap_iso_qos(qos[1], &iso_qos.out);
+ bap_iso_qos(qos[0], &iso_qos.ucast.in);
+ bap_iso_qos(qos[1], &iso_qos.ucast.out);
if (ep)
bap_connect_io(data, ep, stream, &iso_qos, defer);
@@ -1191,8 +1192,8 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
return;
}
- ep->qos.cig_id = qos.cig;
- ep->qos.cis_id = qos.cis;
+ ep->qos.cig_id = qos.ucast.cig;
+ ep->qos.cis_id = qos.ucast.cis;
}
DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd,
diff --git a/tools/btiotest.c b/tools/btiotest.c
index 193e1395b..75af90543 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -39,13 +40,15 @@ static int opt_update_sec = 0;
}
struct bt_iso_qos qos = {
- .cig = BT_ISO_QOS_CIG_UNSET,
- .cis = BT_ISO_QOS_CIG_UNSET,
- .sca = 0x07,
- .packing = 0x00,
- .framing = 0x00,
- .in = DEFAULT_IO_QOS,
- .out = DEFAULT_IO_QOS,
+ .ucast = {
+ .cig = BT_ISO_QOS_CIG_UNSET,
+ .cis = BT_ISO_QOS_CIG_UNSET,
+ .sca = 0x07,
+ .packing = 0x00,
+ .framing = 0x00,
+ .in = DEFAULT_IO_QOS,
+ .out = DEFAULT_IO_QOS,
+ },
};
struct io_data {
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index e4582573a..0f10f8940 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -42,13 +43,15 @@
#define QOS_FULL(_cig, _cis, _in, _out) \
{ \
- .cig = _cig, \
- .cis = _cis, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .in = _in, \
- .out = _out, \
+ .ucast = { \
+ .cig = _cig, \
+ .cis = _cis, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .in = _in, \
+ .out = _out, \
+ },\
}
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
@@ -119,10 +122,47 @@
#define QOS_48_5_2 QOS_OUT(7500, 75, 117, 0x02, 13)
#define QOS_48_6_2 QOS_OUT(10000, 100, 155, 0x02, 13)
-#define QOS_OUT_16_2_1 QOS_OUT(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_16_2_1 QOS_OUT_1(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_1_16_2_1 QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
-#define QOS_IN_16_2_1 QOS_IN(10000, 10, 40, 0x02, 2)
+#define QOS_BCAST_FULL(_big, _bis, _in, _out) \
+{ \
+ .bcast = { \
+ .big = _big, \
+ .bis = _bis, \
+ .sync_interval = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .in = _in, \
+ .out = _out, \
+ .encryption = 0x00, \
+ .bcode = {0}, \
+ .options = 0x00, \
+ .skip = 0x0000, \
+ .sync_timeout = 0x4000, \
+ .sync_cte_type = 0x00, \
+ .mse = 0x00, \
+ .timeout = 0x4000, \
+ }, \
+}
+
+#define BCAST_QOS_OUT(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_BCAST_FULL(BT_ISO_QOS_BIG_UNSET, BT_ISO_QOS_BIS_UNSET, \
+ {}, QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_BCAST_FULL(0x01, BT_ISO_QOS_BIS_UNSET, \
+ {}, QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_BCAST_FULL(0x01, 0x01, \
+ {}, QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_IN(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_BCAST_FULL(BT_ISO_QOS_BIG_UNSET, BT_ISO_QOS_BIS_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn), {})
+
+#define QOS_OUT_16_2_1 BCAST_QOS_OUT(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_16_2_1 BCAST_QOS_OUT_1(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_1_16_2_1 BCAST_QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
+#define QOS_IN_16_2_1 BCAST_QOS_IN(10000, 10, 40, 0x02, 2)
struct test_data {
const void *test_data;
@@ -670,6 +710,7 @@ static const struct iso_client_data bcast_16_2_1_recv = {
.expect_err = 0,
.recv = &send_16_2_1,
.bcast = true,
+ .server = true,
};
static void client_connectable_complete(uint16_t opcode, uint8_t status,
@@ -1080,43 +1121,43 @@ static bool check_io_qos(const struct bt_iso_io_qos *io1,
return true;
}
-static bool check_qos(const struct bt_iso_qos *qos1,
+static bool check_ucast_qos(const struct bt_iso_qos *qos1,
const struct bt_iso_qos *qos2)
{
- if (qos1->cig != BT_ISO_QOS_CIG_UNSET &&
- qos2->cig != BT_ISO_QOS_CIG_UNSET &&
- qos1->cig != qos2->cig) {
+ if (qos1->ucast.cig != BT_ISO_QOS_CIG_UNSET &&
+ qos2->ucast.cig != BT_ISO_QOS_CIG_UNSET &&
+ qos1->ucast.cig != qos2->ucast.cig) {
tester_warn("Unexpected CIG ID: 0x%02x != 0x%02x",
- qos1->cig, qos2->cig);
+ qos1->ucast.cig, qos2->ucast.cig);
return false;
}
- if (qos1->cis != BT_ISO_QOS_CIS_UNSET &&
- qos2->cis != BT_ISO_QOS_CIS_UNSET &&
- qos1->cis != qos2->cis) {
+ if (qos1->ucast.cis != BT_ISO_QOS_CIS_UNSET &&
+ qos2->ucast.cis != BT_ISO_QOS_CIS_UNSET &&
+ qos1->ucast.cis != qos2->ucast.cis) {
tester_warn("Unexpected CIS ID: 0x%02x != 0x%02x",
- qos1->cis, qos2->cis);
+ qos1->ucast.cis, qos2->ucast.cis);
return false;
}
- if (qos1->packing != qos2->packing) {
+ if (qos1->ucast.packing != qos2->ucast.packing) {
tester_warn("Unexpected QoS packing: 0x%02x != 0x%02x",
- qos1->packing, qos2->packing);
+ qos1->ucast.packing, qos2->ucast.packing);
return false;
}
- if (qos1->framing != qos2->framing) {
+ if (qos1->ucast.framing != qos2->ucast.framing) {
tester_warn("Unexpected QoS framing: 0x%02x != 0x%02x",
- qos1->framing, qos2->framing);
+ qos1->ucast.framing, qos2->ucast.framing);
return false;
}
- if (!check_io_qos(&qos1->in, &qos2->in)) {
+ if (!check_io_qos(&qos1->ucast.in, &qos2->ucast.in)) {
tester_warn("Unexpected Input QoS");
return false;
}
- if (!check_io_qos(&qos1->out, &qos2->out)) {
+ if (!check_io_qos(&qos1->ucast.out, &qos2->ucast.out)) {
tester_warn("Unexpected Output QoS");
return false;
}
@@ -1124,6 +1165,104 @@ static bool check_qos(const struct bt_iso_qos *qos1,
return true;
}
+static bool check_bcast_qos(const struct bt_iso_qos *qos1,
+ const struct bt_iso_qos *qos2)
+{
+ if (qos1->bcast.big != BT_ISO_QOS_BIG_UNSET &&
+ qos2->bcast.big != BT_ISO_QOS_BIG_UNSET &&
+ qos1->bcast.big != qos2->bcast.big) {
+ tester_warn("Unexpected BIG ID: 0x%02x != 0x%02x",
+ qos1->bcast.big, qos2->bcast.big);
+ return false;
+ }
+
+ if (qos1->bcast.bis != BT_ISO_QOS_BIS_UNSET &&
+ qos2->bcast.bis != BT_ISO_QOS_BIS_UNSET &&
+ qos1->bcast.bis != qos2->bcast.bis) {
+ tester_warn("Unexpected BIS ID: 0x%02x != 0x%02x",
+ qos1->bcast.bis, qos2->bcast.bis);
+ return false;
+ }
+
+ if (qos1->bcast.sync_interval != qos2->bcast.sync_interval) {
+ tester_warn("Unexpected QoS sync interval: 0x%02x != 0x%02x",
+ qos1->bcast.sync_interval, qos2->bcast.sync_interval);
+ return false;
+ }
+
+ if (qos1->bcast.packing != qos2->bcast.packing) {
+ tester_warn("Unexpected QoS packing: 0x%02x != 0x%02x",
+ qos1->bcast.packing, qos2->bcast.packing);
+ return false;
+ }
+
+ if (qos1->bcast.framing != qos2->bcast.framing) {
+ tester_warn("Unexpected QoS framing: 0x%02x != 0x%02x",
+ qos1->bcast.framing, qos2->bcast.framing);
+ return false;
+ }
+
+ if (!check_io_qos(&qos1->ucast.in, &qos2->ucast.in)) {
+ tester_warn("Unexpected Input QoS");
+ return false;
+ }
+
+ if (!check_io_qos(&qos1->ucast.out, &qos2->ucast.out)) {
+ tester_warn("Unexpected Output QoS");
+ return false;
+ }
+
+ if (qos1->bcast.encryption != qos2->bcast.encryption) {
+ tester_warn("Unexpected QoS encryption: 0x%02x != 0x%02x",
+ qos1->bcast.encryption, qos2->bcast.encryption);
+ return false;
+ }
+
+ if (memcmp(qos1->bcast.bcode, qos2->bcast.bcode,
+ sizeof(qos1->bcast.bcode))) {
+ tester_warn("Unexpected QoS Broadcast Code");
+ return false;
+ }
+
+ if (qos1->bcast.options != qos2->bcast.options) {
+ tester_warn("Unexpected QoS options: 0x%02x != 0x%02x",
+ qos1->bcast.options, qos2->bcast.options);
+ return false;
+ }
+
+ if (qos1->bcast.skip != qos2->bcast.skip) {
+ tester_warn("Unexpected QoS skip: 0x%04x != 0x%04x",
+ qos1->bcast.skip, qos2->bcast.skip);
+ return false;
+ }
+
+ if (qos1->bcast.sync_timeout != qos2->bcast.sync_timeout) {
+ tester_warn("Unexpected QoS sync timeout: 0x%04x != 0x%04x",
+ qos1->bcast.sync_timeout, qos2->bcast.sync_timeout);
+ return false;
+ }
+
+ if (qos1->bcast.sync_cte_type != qos2->bcast.sync_cte_type) {
+ tester_warn("Unexpected QoS sync cte type: 0x%02x != 0x%02x",
+ qos1->bcast.sync_cte_type, qos2->bcast.sync_cte_type);
+ return false;
+ }
+
+ if (qos1->bcast.mse != qos2->bcast.mse) {
+ tester_warn("Unexpected QoS MSE: 0x%02x != 0x%02x",
+ qos1->bcast.mse, qos2->bcast.mse);
+ return false;
+ }
+
+ if (qos1->bcast.timeout != qos2->bcast.timeout) {
+ tester_warn("Unexpected QoS MSE: 0x%04x != 0x%04x",
+ qos1->bcast.timeout, qos2->bcast.timeout);
+ return false;
+ }
+
+ return true;
+}
+
static gboolean iso_recv_data(GIOChannel *io, GIOCondition cond,
gpointer user_data)
{
@@ -1250,6 +1389,7 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
int err, sk_err, sk;
socklen_t len;
struct bt_iso_qos qos;
+ bool ret = true;
sk = g_io_channel_unix_get_fd(io);
@@ -1264,7 +1404,12 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
return FALSE;
}
- if (!check_qos(&qos, &isodata->qos)) {
+ if (!isodata->bcast)
+ ret = check_ucast_qos(&qos, &isodata->qos);
+ else if (!isodata->server)
+ ret = check_bcast_qos(&qos, &isodata->qos);
+
+ if (!ret) {
tester_warn("Unexpected QoS parameter");
tester_test_failed();
return FALSE;
diff --git a/tools/isotest.c b/tools/isotest.c
index 2b5f164de..cd7094b1c 100644
--- a/tools/isotest.c
+++ b/tools/isotest.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -239,7 +240,7 @@ fail:
return err < 0 ? err : 0;
}
-static void print_qos(int sk, struct sockaddr_iso *addr)
+static void print_ucast_qos(int sk)
{
struct bt_iso_qos qos;
socklen_t len;
@@ -254,21 +255,63 @@ static void print_qos(int sk, struct sockaddr_iso *addr)
return;
}
- if (!bacmp(&addr->iso_bdaddr, BDADDR_ANY)) {
- syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.big, qos.bis, qos.packing,
- qos.framing);
- } else {
- syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.cig, qos.cis, qos.packing,
- qos.framing);
- syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval,
- qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn);
+ syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.ucast.cig, qos.ucast.cis,
+ qos.ucast.packing, qos.ucast.framing);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.in.interval,
+ qos.ucast.in.latency, qos.ucast.in.sdu, qos.ucast.in.phy,
+ qos.ucast.in.rtn);
+
+ syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.out.interval,
+ qos.ucast.out.latency, qos.ucast.out.sdu, qos.ucast.out.phy,
+ qos.ucast.out.rtn);
+}
+
+static void print_bcast_qos(int sk)
+{
+ struct bt_iso_qos qos;
+ socklen_t len;
+
+ /* Read Out QOS */
+ memset(&qos, 0, sizeof(qos));
+ len = sizeof(qos);
+
+ if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
+ syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)",
+ strerror(errno), errno);
+ return;
}
+
+ syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.bcast.big, qos.bcast.bis,
+ qos.bcast.packing, qos.bcast.framing);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.in.interval,
+ qos.bcast.in.latency, qos.bcast.in.sdu,
+ qos.bcast.in.phy, qos.bcast.in.rtn);
+
syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.out.interval,
- qos.out.latency, qos.out.sdu, qos.out.phy, qos.out.rtn);
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.out.interval,
+ qos.bcast.out.latency, qos.bcast.out.sdu,
+ qos.bcast.out.phy, qos.bcast.out.rtn);
+}
+
+static void convert_ucast_qos_to_bcast(struct bt_iso_qos *qos)
+{
+ iso_qos->bcast.in.phy = 0x00;
+ iso_qos->bcast.in.sdu = 0;
+ qos->bcast.encryption = 0x00;
+ memset(qos->bcast.bcode, 0, sizeof(qos->bcast.bcode));
+ qos->bcast.options = 0x00;
+ qos->bcast.skip = 0x0000;
+ qos->bcast.sync_timeout = 0x4000;
+ qos->bcast.sync_cte_type = 0x00;
+ qos->bcast.mse = 0x00;
+ qos->bcast.timeout = 0x4000;
}
static int do_connect(char *peer)
@@ -301,9 +344,13 @@ static int do_connect(char *peer)
/* Set QoS if available */
if (iso_qos) {
- if (!inout || !strcmp(peer, "00:00:00:00:00:00")) {
- iso_qos->in.phy = 0x00;
- iso_qos->in.sdu = 0;
+ if (!strcmp(peer, "00:00:00:00:00:00")) {
+ convert_ucast_qos_to_bcast(iso_qos);
+ } else {
+ if (!inout) {
+ iso_qos->ucast.in.phy = 0x00;
+ iso_qos->ucast.in.sdu = 0;
+ }
}
if (setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, iso_qos,
@@ -338,7 +385,10 @@ static int do_connect(char *peer)
syslog(LOG_INFO, "Connected [%s]", peer);
- print_qos(sk, &addr);
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ print_bcast_qos(sk);
+ else
+ print_ucast_qos(sk);
return sk;
@@ -441,7 +491,10 @@ static void do_listen(char *filename, void (*handler)(int fd, int sk),
ba2str(&addr->iso_bdaddr, ba);
syslog(LOG_INFO, "Connected [%s]", ba);
- print_qos(nsk, addr);
+ if (peer)
+ print_bcast_qos(nsk);
+ else
+ print_ucast_qos(nsk);
/* Handle deferred setup */
if (defer_setup) {
@@ -648,7 +701,7 @@ static int read_file(int fd, ssize_t count, bool rewind)
return len;
}
-static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
+static void do_send(int sk, int fd, struct bt_iso_io_qos *out, uint32_t num,
bool repeat)
{
uint32_t seq;
@@ -662,14 +715,14 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
for (seq = 0; ; seq++) {
if (fd >= 0) {
- len = read_file(fd, qos->out.sdu, repeat);
+ len = read_file(fd, out->sdu, repeat);
if (len < 0) {
syslog(LOG_ERR, "read failed: %s (%d)",
strerror(-len), -len);
exit(1);
}
} else
- len = qos->out.sdu;
+ len = out->sdu;
len = send(sk, buf, len, 0);
if (len <= 0) {
@@ -686,7 +739,7 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
seq, len, used / len, used);
if (seq && !((seq + 1) % num))
- send_wait(&t_start, num * qos->out.interval);
+ send_wait(&t_start, num * out->interval);
}
}
@@ -696,6 +749,7 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
socklen_t len;
int sk, fd = -1;
uint32_t num;
+ struct bt_iso_io_qos *out;
if (filename) {
char altername[PATH_MAX];
@@ -728,16 +782,21 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
syslog(LOG_INFO, "Sending ...");
/* Read QoS */
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ out = &qos.bcast.out;
+ else
+ out = &qos.ucast.out;
+
memset(&qos, 0, sizeof(qos));
len = sizeof(qos);
if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
syslog(LOG_ERR, "Can't get Output QoS socket option: %s (%d)",
strerror(errno), errno);
- qos.out.sdu = ISO_DEFAULT_MTU;
+ out->sdu = ISO_DEFAULT_MTU;
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (out->latency * 1000 / out->interval);
syslog(LOG_INFO, "Number of packets: %d", num);
@@ -746,8 +805,8 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
* latency:
* jitter buffer = 2 * (SDU * subevents)
*/
- sndbuf = 2 * ((qos.out.latency * 1000 / qos.out.interval) *
- qos.out.sdu);
+ sndbuf = 2 * ((out->latency * 1000 / out->interval) *
+ out->sdu);
len = sizeof(sndbuf);
if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &sndbuf, len) < 0) {
@@ -768,10 +827,10 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
}
}
- for (i = 6; i < qos.out.sdu; i++)
+ for (i = 6; i < out->sdu; i++)
buf[i] = 0x7f;
- do_send(sk, fd, &qos, num, repeat);
+ do_send(sk, fd, out, num, repeat);
}
static void reconnect_mode(char *peer)
@@ -826,12 +885,14 @@ static void multy_connect_mode(char *peer)
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
{ \
- .cig = BT_ISO_QOS_CIG_UNSET, \
- .cis = BT_ISO_QOS_CIS_UNSET, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ .ucast = { \
+ .cig = BT_ISO_QOS_CIG_UNSET, \
+ .cis = BT_ISO_QOS_CIS_UNSET, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ }, \
}
#define QOS_PRESET(_name, _inout, _interval, _latency, _sdu, _phy, _rtn) \
@@ -1057,43 +1118,43 @@ int main(int argc, char *argv[])
case 'M':
if (optarg)
- iso_qos->out.sdu = atoi(optarg);
+ iso_qos->ucast.out.sdu = atoi(optarg);
break;
case 'S':
if (optarg)
- iso_qos->sca = atoi(optarg);
+ iso_qos->ucast.sca = atoi(optarg);
break;
case 'P':
if (optarg)
- iso_qos->packing = atoi(optarg);
+ iso_qos->ucast.packing = atoi(optarg);
break;
case 'F':
if (optarg)
- iso_qos->framing = atoi(optarg);
+ iso_qos->ucast.framing = atoi(optarg);
break;
case 'I':
if (optarg)
- iso_qos->out.interval = atoi(optarg);
+ iso_qos->ucast.out.interval = atoi(optarg);
break;
case 'L':
if (optarg)
- iso_qos->out.latency = atoi(optarg);
+ iso_qos->ucast.out.latency = atoi(optarg);
break;
case 'Y':
if (optarg)
- iso_qos->out.phy = atoi(optarg);
+ iso_qos->ucast.out.phy = atoi(optarg);
break;
case 'R':
if (optarg)
- iso_qos->out.rtn = atoi(optarg);
+ iso_qos->ucast.out.rtn = atoi(optarg);
break;
case 'B':
@@ -1112,12 +1173,12 @@ int main(int argc, char *argv[])
case 'G':
if (optarg)
- iso_qos->cig = atoi(optarg);
+ iso_qos->ucast.cig = atoi(optarg);
break;
case 'T':
if (optarg)
- iso_qos->cis = atoi(optarg);
+ iso_qos->ucast.cis = atoi(optarg);
break;
/* fall through */
@@ -1128,11 +1189,11 @@ int main(int argc, char *argv[])
}
if (inout) {
- iso_qos->in = iso_qos->out;
+ iso_qos->ucast.in = iso_qos->ucast.out;
} else {
/* Align interval and latency even if is unidirectional */
- iso_qos->in.interval = iso_qos->out.interval;
- iso_qos->in.latency = iso_qos->out.latency;
+ iso_qos->ucast.in.interval = iso_qos->ucast.out.interval;
+ iso_qos->ucast.in.latency = iso_qos->ucast.out.latency;
}
buf = malloc(data_size);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Split bt_iso_qos into dedicated structures
2023-03-31 15:39 [PATCH BlueZ v3 1/1] " Iulia Tanasescu
@ 2023-03-31 17:10 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2023-03-31 17:10 UTC (permalink / raw)
To: linux-bluetooth, iulia.tanasescu
[-- Attachment #1: Type: text/plain, Size: 1185 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=735877
---Test result---
Test Summary:
CheckPatch PASS 0.87 seconds
GitLint PASS 0.33 seconds
BuildEll PASS 26.26 seconds
BluezMake PASS 761.90 seconds
MakeCheck PASS 10.89 seconds
MakeDistcheck PASS 150.00 seconds
CheckValgrind PASS 240.87 seconds
CheckSmatch WARNING 323.20 seconds
bluezmakeextell PASS 97.50 seconds
IncrementalBuild PASS 609.39 seconds
ScanBuild PASS 964.60 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/bthost.c:584:28: warning: Variable length array is used.emulator/bthost.c:741:28: warning: Variable length array is used.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH BlueZ 1/1] Split bt_iso_qos into dedicated structures
@ 2023-03-27 13:46 Iulia Tanasescu
2023-03-27 15:19 ` bluez.test.bot
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-27 13:46 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
Split bt_iso_qos into dedicated unicast and broadcast
structures and add additional broadcast parameters.
---
btio/btio.c | 7 +-
client/player.c | 7 +-
emulator/bthost.c | 3 +-
emulator/bthost.h | 3 +-
lib/bluetooth.h | 59 +++++++++++----
profiles/audio/bap.c | 19 ++---
tools/btiotest.c | 17 +++--
tools/iso-tester.c | 144 +++++++++++++++++++++++++++++++----
tools/isotest.c | 177 +++++++++++++++++++++++++++++++------------
9 files changed, 336 insertions(+), 100 deletions(-)
diff --git a/btio/btio.c b/btio/btio.c
index 1ad42728d..6f6d76dc8 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -1608,13 +1609,13 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
*(va_arg(args, uint8_t *)) = dst.iso_bdaddr_type;
break;
case BT_IO_OPT_MTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_IMTU:
- *(va_arg(args, uint16_t *)) = qos.in.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.in.sdu;
break;
case BT_IO_OPT_OMTU:
- *(va_arg(args, uint16_t *)) = qos.out.sdu;
+ *(va_arg(args, uint16_t *)) = qos.ucast.out.sdu;
break;
case BT_IO_OPT_PHY:
if (get_phy(sock, &phy) < 0) {
diff --git a/client/player.c b/client/player.c
index 63e11db09..5572cc566 100644
--- a/client/player.c
+++ b/client/player.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2020 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -3534,7 +3535,7 @@ static bool transport_timer_read(struct io *io, void *user_data)
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (qos.ucast.out.latency * 1000 / qos.ucast.out.interval);
ret = transport_send_seq(transport, transport->fd, num);
if (ret < 0) {
@@ -3570,8 +3571,8 @@ static int transport_send(struct transport *transport, int fd,
return -errno;
memset(&ts, 0, sizeof(ts));
- ts.it_value.tv_nsec = qos->out.latency * 1000000;
- ts.it_interval.tv_nsec = qos->out.latency * 1000000;
+ ts.it_value.tv_nsec = qos->ucast.out.latency * 1000000;
+ ts.it_interval.tv_nsec = qos->ucast.out.latency * 1000000;
if (timerfd_settime(timer_fd, TFD_TIMER_ABSTIME, &ts, NULL) < 0)
return -errno;
diff --git a/emulator/bthost.c b/emulator/bthost.c
index 4671fe17d..1b6847b81 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2011-2012 Intel Corporation
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -3171,7 +3172,7 @@ bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr)
}
void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
- uint8_t cis_id, const struct bt_iso_qos *qos)
+ uint8_t cis_id, const struct bt_iso_ucast_qos *qos)
{
struct bt_hci_cmd_le_set_cig_params *cp;
diff --git a/emulator/bthost.h b/emulator/bthost.h
index 92182687f..779ca7d06 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -5,6 +5,7 @@
*
* Copyright (C) 2011-2012 Intel Corporation
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -106,7 +107,7 @@ void bthost_create_big(struct bthost *bthost, uint8_t num_bis);
bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr);
void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id,
- uint8_t cis_id, const struct bt_iso_qos *qos);
+ uint8_t cis_id, const struct bt_iso_ucast_qos *qos);
void bthost_create_cis(struct bthost *bthost, uint16_t cis_handle,
uint16_t acl_handle);
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index af5fbcfbc..660a529d8 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -6,6 +6,7 @@
* Copyright (C) 2000-2001 Qualcomm Incorporated
* Copyright (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
* Copyright (C) 2002-2010 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright 2023 NXP
*
*
*/
@@ -146,6 +147,9 @@ struct bt_voice {
#define BT_ISO_QOS_CIG_UNSET 0xff
#define BT_ISO_QOS_CIS_UNSET 0xff
+#define BT_ISO_QOS_BIG_UNSET 0xff
+#define BT_ISO_QOS_BIS_UNSET 0xff
+
struct bt_iso_io_qos {
uint32_t interval;
uint16_t latency;
@@ -154,25 +158,54 @@ struct bt_iso_io_qos {
uint8_t rtn;
};
-struct bt_iso_qos {
- union {
- uint8_t cig;
- uint8_t big;
- };
- union {
- uint8_t cis;
- uint8_t bis;
- };
- union {
- uint8_t sca;
- uint8_t sync_interval;
- };
+struct bt_iso_ucast_qos {
+ uint8_t cig;
+ uint8_t cis;
+ uint8_t sca;
uint8_t packing;
uint8_t framing;
struct bt_iso_io_qos in;
struct bt_iso_io_qos out;
};
+struct bt_iso_bcast_src_qos {
+ uint8_t sync_interval;
+ uint8_t big;
+ uint8_t bis;
+ uint8_t packing;
+ uint8_t framing;
+ uint8_t encryption;
+ uint8_t bcode[16];
+ struct bt_iso_io_qos out;
+};
+
+struct bt_iso_bcast_snk_qos {
+ uint8_t options;
+ uint16_t skip;
+ uint16_t sync_timeout;
+ uint8_t sync_cte_type;
+ uint8_t big;
+ uint8_t encryption;
+ uint8_t bcode[16];
+ uint8_t mse;
+ uint16_t timeout;
+ struct bt_iso_io_qos in;
+};
+
+struct bt_iso_bcast_qos {
+ union {
+ struct bt_iso_bcast_src_qos bsrc;
+ struct bt_iso_bcast_snk_qos bsnk;
+ };
+};
+
+struct bt_iso_qos {
+ union {
+ struct bt_iso_ucast_qos ucast;
+ struct bt_iso_bcast_qos bcast;
+ };
+};
+
#define BT_CODEC 19
struct bt_codec {
uint8_t id;
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index dfdf87255..afc87d85f 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation. All rights reserved.
+ * Copyright 2023 NXP
*
*
*/
@@ -746,10 +747,10 @@ static bool match_stream_qos(const void *data, const void *user_data)
qos = bt_bap_stream_get_qos((void *)stream);
- if (iso_qos->cig != qos->cig_id)
+ if (iso_qos->ucast.cig != qos->cig_id)
return false;
- return iso_qos->cis == qos->cis_id;
+ return iso_qos->ucast.cis == qos->cis_id;
}
static void iso_confirm_cb(GIOChannel *io, void *user_data)
@@ -771,7 +772,7 @@ static void iso_confirm_cb(GIOChannel *io, void *user_data)
}
DBG("ISO: incoming connect from %s (CIG 0x%02x CIS 0x%02x)",
- address, qos.cig, qos.cis);
+ address, qos.ucast.cig, qos.ucast.cis);
stream = queue_remove_if(data->streams, match_stream_qos, &qos);
if (!stream) {
@@ -990,11 +991,11 @@ static void bap_create_io(struct bap_data *data, struct bap_ep *ep,
}
memset(&iso_qos, 0, sizeof(iso_qos));
- iso_qos.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
- iso_qos.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
+ iso_qos.ucast.cig = qos[0] ? qos[0]->cig_id : qos[1]->cig_id;
+ iso_qos.ucast.cis = qos[0] ? qos[0]->cis_id : qos[1]->cis_id;
- bap_iso_qos(qos[0], &iso_qos.in);
- bap_iso_qos(qos[1], &iso_qos.out);
+ bap_iso_qos(qos[0], &iso_qos.ucast.in);
+ bap_iso_qos(qos[1], &iso_qos.ucast.out);
if (ep)
bap_connect_io(data, ep, stream, &iso_qos, defer);
@@ -1189,8 +1190,8 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd,
return;
}
- ep->qos.cig_id = qos.cig;
- ep->qos.cis_id = qos.cis;
+ ep->qos.cig_id = qos.ucast.cig;
+ ep->qos.cis_id = qos.ucast.cis;
}
DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd,
diff --git a/tools/btiotest.c b/tools/btiotest.c
index 193e1395b..75af90543 100644
--- a/tools/btiotest.c
+++ b/tools/btiotest.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -39,13 +40,15 @@ static int opt_update_sec = 0;
}
struct bt_iso_qos qos = {
- .cig = BT_ISO_QOS_CIG_UNSET,
- .cis = BT_ISO_QOS_CIG_UNSET,
- .sca = 0x07,
- .packing = 0x00,
- .framing = 0x00,
- .in = DEFAULT_IO_QOS,
- .out = DEFAULT_IO_QOS,
+ .ucast = {
+ .cig = BT_ISO_QOS_CIG_UNSET,
+ .cis = BT_ISO_QOS_CIG_UNSET,
+ .sca = 0x07,
+ .packing = 0x00,
+ .framing = 0x00,
+ .in = DEFAULT_IO_QOS,
+ .out = DEFAULT_IO_QOS,
+ },
};
struct io_data {
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index e4582573a..2dd90c14e 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -42,13 +43,15 @@
#define QOS_FULL(_cig, _cis, _in, _out) \
{ \
- .cig = _cig, \
- .cis = _cis, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .in = _in, \
- .out = _out, \
+ .ucast = { \
+ .cig = _cig, \
+ .cis = _cis, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .in = _in, \
+ .out = _out, \
+ },\
}
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
@@ -119,10 +122,56 @@
#define QOS_48_5_2 QOS_OUT(7500, 75, 117, 0x02, 13)
#define QOS_48_6_2 QOS_OUT(10000, 100, 155, 0x02, 13)
-#define QOS_OUT_16_2_1 QOS_OUT(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_16_2_1 QOS_OUT_1(10000, 10, 40, 0x02, 2)
-#define QOS_OUT_1_1_16_2_1 QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
-#define QOS_IN_16_2_1 QOS_IN(10000, 10, 40, 0x02, 2)
+#define QOS_SINK_FULL(_big, _in) \
+{ \
+ .bcast.bsnk = { \
+ .options = 0x00, \
+ .skip = 0x0000, \
+ .sync_timeout = 0x4000, \
+ .sync_cte_type = 0x00, \
+ .big = _big, \
+ .encryption = 0x00, \
+ .bcode = {0}, \
+ .mse = 0x00, \
+ .timeout = 0x4000, \
+ .in = _in, \
+ }, \
+}
+
+#define QOS_SOURCE_FULL(_big, _bis, _out) \
+{ \
+ .bcast.bsrc = { \
+ .sync_interval = 0x07, \
+ .big = _big, \
+ .bis = _bis, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .encryption = 0x00, \
+ .bcode = {0}, \
+ .out = _out, \
+ }, \
+}
+
+#define BCAST_QOS_OUT(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(BT_ISO_QOS_BIG_UNSET, BT_ISO_QOS_BIS_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(0x01, BT_ISO_QOS_BIS_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_OUT_1_1(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SOURCE_FULL(0x01, 0x01, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define BCAST_QOS_IN(_interval, _latency, _sdu, _phy, _rtn) \
+ QOS_SINK_FULL(BT_ISO_QOS_BIG_UNSET, \
+ QOS_IO(_interval, _latency, _sdu, _phy, _rtn))
+
+#define QOS_OUT_16_2_1 BCAST_QOS_OUT(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_16_2_1 BCAST_QOS_OUT_1(10000, 10, 40, 0x02, 2)
+#define QOS_OUT_1_1_16_2_1 BCAST_QOS_OUT_1_1(10000, 10, 40, 0x02, 2)
+#define QOS_IN_16_2_1 BCAST_QOS_IN(10000, 10, 40, 0x02, 2)
struct test_data {
const void *test_data;
@@ -670,6 +719,7 @@ static const struct iso_client_data bcast_16_2_1_recv = {
.expect_err = 0,
.recv = &send_16_2_1,
.bcast = true,
+ .server = true,
};
static void client_connectable_complete(uint16_t opcode, uint8_t status,
@@ -1080,8 +1130,8 @@ static bool check_io_qos(const struct bt_iso_io_qos *io1,
return true;
}
-static bool check_qos(const struct bt_iso_qos *qos1,
- const struct bt_iso_qos *qos2)
+static bool check_ucast_qos(const struct bt_iso_ucast_qos *qos1,
+ const struct bt_iso_ucast_qos *qos2)
{
if (qos1->cig != BT_ISO_QOS_CIG_UNSET &&
qos2->cig != BT_ISO_QOS_CIG_UNSET &&
@@ -1124,6 +1174,63 @@ static bool check_qos(const struct bt_iso_qos *qos1,
return true;
}
+static bool check_bcast_src_qos(const struct bt_iso_bcast_src_qos *qos1,
+ const struct bt_iso_bcast_src_qos *qos2)
+{
+ if (qos1->sync_interval != qos2->sync_interval) {
+ tester_warn("Unexpected QoS sync interval: 0x%02x != 0x%02x",
+ qos1->sync_interval, qos2->sync_interval);
+ return false;
+ }
+
+ if (qos1->big != BT_ISO_QOS_BIG_UNSET &&
+ qos2->big != BT_ISO_QOS_BIG_UNSET &&
+ qos1->big != qos2->big) {
+ tester_warn("Unexpected BIG ID: 0x%02x != 0x%02x",
+ qos1->big, qos2->big);
+ return false;
+ }
+
+ if (qos1->bis != BT_ISO_QOS_BIS_UNSET &&
+ qos2->bis != BT_ISO_QOS_BIS_UNSET &&
+ qos1->bis != qos2->bis) {
+ tester_warn("Unexpected BIS ID: 0x%02x != 0x%02x",
+ qos1->bis, qos2->bis);
+ return false;
+ }
+
+ if (qos1->packing != qos2->packing) {
+ tester_warn("Unexpected QoS packing: 0x%02x != 0x%02x",
+ qos1->packing, qos2->packing);
+ return false;
+ }
+
+ if (qos1->framing != qos2->framing) {
+ tester_warn("Unexpected QoS framing: 0x%02x != 0x%02x",
+ qos1->framing, qos2->framing);
+ return false;
+ }
+
+ if (qos1->encryption != qos2->encryption) {
+ tester_warn("Unexpected QoS encryption: 0x%02x != 0x%02x",
+ qos1->encryption, qos2->encryption);
+ return false;
+ }
+
+
+ if (memcmp(qos1->bcode, qos2->bcode, sizeof(qos1->bcode))) {
+ tester_warn("Unexpected QoS Broadcast Code");
+ return false;
+ }
+
+ if (!check_io_qos(&qos1->out, &qos2->out)) {
+ tester_warn("Unexpected Output QoS");
+ return false;
+ }
+
+ return true;
+}
+
static gboolean iso_recv_data(GIOChannel *io, GIOCondition cond,
gpointer user_data)
{
@@ -1250,6 +1357,7 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
int err, sk_err, sk;
socklen_t len;
struct bt_iso_qos qos;
+ bool ret = true;
sk = g_io_channel_unix_get_fd(io);
@@ -1264,7 +1372,13 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
return FALSE;
}
- if (!check_qos(&qos, &isodata->qos)) {
+ if (!isodata->bcast)
+ ret = check_ucast_qos(&qos.ucast, &isodata->qos.ucast);
+ else if (!isodata->server)
+ ret = check_bcast_src_qos(&qos.bcast.bsrc,
+ &isodata->qos.bcast.bsrc);
+
+ if (!ret) {
tester_warn("Unexpected QoS parameter");
tester_test_failed();
return FALSE;
@@ -1579,7 +1693,7 @@ static void setup_listen(struct test_data *data, uint8_t num, GIOFunc func)
client = hciemu_get_client(data->hciemu, 0);
host = hciemu_client_host(client);
- bthost_set_cig_params(host, 0x01, 0x01, &isodata->qos);
+ bthost_set_cig_params(host, 0x01, 0x01, &isodata->qos.ucast);
bthost_create_cis(host, 257, data->acl_handle);
}
}
diff --git a/tools/isotest.c b/tools/isotest.c
index 2b5f164de..f00f03249 100644
--- a/tools/isotest.c
+++ b/tools/isotest.c
@@ -4,6 +4,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation.
+ * Copyright 2023 NXP
*
*/
@@ -239,7 +240,7 @@ fail:
return err < 0 ? err : 0;
}
-static void print_qos(int sk, struct sockaddr_iso *addr)
+static void print_ucast_qos(int sk)
{
struct bt_iso_qos qos;
socklen_t len;
@@ -254,21 +255,83 @@ static void print_qos(int sk, struct sockaddr_iso *addr)
return;
}
- if (!bacmp(&addr->iso_bdaddr, BDADDR_ANY)) {
- syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.big, qos.bis, qos.packing,
- qos.framing);
- } else {
- syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
- "Framing 0x%02x]", qos.cig, qos.cis, qos.packing,
- qos.framing);
- syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval,
- qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn);
+ syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.ucast.cig, qos.ucast.cis,
+ qos.ucast.packing, qos.ucast.framing);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.in.interval,
+ qos.ucast.in.latency, qos.ucast.in.sdu, qos.ucast.in.phy,
+ qos.ucast.in.rtn);
+
+ syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.ucast.out.interval,
+ qos.ucast.out.latency, qos.ucast.out.sdu, qos.ucast.out.phy,
+ qos.ucast.out.rtn);
+}
+
+static void print_bcast_src_qos(int sk)
+{
+ struct bt_iso_qos qos;
+ socklen_t len;
+
+ /* Read Out QOS */
+ memset(&qos, 0, sizeof(qos));
+ len = sizeof(qos);
+
+ if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
+ syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)",
+ strerror(errno), errno);
+ return;
}
+
+ syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x "
+ "Framing 0x%02x]", qos.bcast.bsrc.big, qos.bcast.bsrc.bis,
+ qos.bcast.bsrc.packing, qos.bcast.bsrc.framing);
+
syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u "
- "ms SDU %u PHY 0x%02x RTN %u]", qos.out.interval,
- qos.out.latency, qos.out.sdu, qos.out.phy, qos.out.rtn);
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.bsrc.out.interval,
+ qos.bcast.bsrc.out.latency, qos.bcast.bsrc.out.sdu,
+ qos.bcast.bsrc.out.phy, qos.bcast.bsrc.out.rtn);
+}
+
+static void print_bcast_snk_qos(int sk)
+{
+ struct bt_iso_qos qos;
+ socklen_t len;
+
+ /* Read Out QOS */
+ memset(&qos, 0, sizeof(qos));
+ len = sizeof(qos);
+
+ if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
+ syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)",
+ strerror(errno), errno);
+ return;
+ }
+
+ syslog(LOG_INFO, "QoS BIG 0x%02x", qos.bcast.bsnk.big);
+
+ syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u "
+ "ms SDU %u PHY 0x%02x RTN %u]", qos.bcast.bsnk.in.interval,
+ qos.bcast.bsnk.in.latency, qos.bcast.bsnk.in.sdu,
+ qos.bcast.bsnk.in.phy, qos.bcast.bsnk.in.rtn);
+}
+
+static void ucast_qos_to_bcast_src(struct bt_iso_qos *qos)
+{
+ struct bt_iso_qos src_qos;
+
+ memset(&src_qos, 0, sizeof(src_qos));
+
+ src_qos.bcast.bsrc.sync_interval = qos->ucast.sca;
+ src_qos.bcast.bsrc.big = qos->ucast.cig;
+ src_qos.bcast.bsrc.bis = qos->ucast.cis;
+ src_qos.bcast.bsrc.packing = qos->ucast.packing;
+ src_qos.bcast.bsrc.framing = qos->ucast.framing;
+ src_qos.bcast.bsrc.out = qos->ucast.out;
+
+ *qos = src_qos;
}
static int do_connect(char *peer)
@@ -301,9 +364,13 @@ static int do_connect(char *peer)
/* Set QoS if available */
if (iso_qos) {
- if (!inout || !strcmp(peer, "00:00:00:00:00:00")) {
- iso_qos->in.phy = 0x00;
- iso_qos->in.sdu = 0;
+ if (!strcmp(peer, "00:00:00:00:00:00")) {
+ ucast_qos_to_bcast_src(iso_qos);
+ } else {
+ if (!inout) {
+ iso_qos->ucast.in.phy = 0x00;
+ iso_qos->ucast.in.sdu = 0;
+ }
}
if (setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, iso_qos,
@@ -338,7 +405,10 @@ static int do_connect(char *peer)
syslog(LOG_INFO, "Connected [%s]", peer);
- print_qos(sk, &addr);
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ print_bcast_src_qos(sk);
+ else
+ print_ucast_qos(sk);
return sk;
@@ -441,7 +511,10 @@ static void do_listen(char *filename, void (*handler)(int fd, int sk),
ba2str(&addr->iso_bdaddr, ba);
syslog(LOG_INFO, "Connected [%s]", ba);
- print_qos(nsk, addr);
+ if (peer)
+ print_bcast_snk_qos(nsk);
+ else
+ print_ucast_qos(nsk);
/* Handle deferred setup */
if (defer_setup) {
@@ -648,7 +721,7 @@ static int read_file(int fd, ssize_t count, bool rewind)
return len;
}
-static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
+static void do_send(int sk, int fd, struct bt_iso_io_qos *out, uint32_t num,
bool repeat)
{
uint32_t seq;
@@ -662,14 +735,14 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
for (seq = 0; ; seq++) {
if (fd >= 0) {
- len = read_file(fd, qos->out.sdu, repeat);
+ len = read_file(fd, out->sdu, repeat);
if (len < 0) {
syslog(LOG_ERR, "read failed: %s (%d)",
strerror(-len), -len);
exit(1);
}
} else
- len = qos->out.sdu;
+ len = out->sdu;
len = send(sk, buf, len, 0);
if (len <= 0) {
@@ -686,7 +759,7 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num,
seq, len, used / len, used);
if (seq && !((seq + 1) % num))
- send_wait(&t_start, num * qos->out.interval);
+ send_wait(&t_start, num * out->interval);
}
}
@@ -696,6 +769,7 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
socklen_t len;
int sk, fd = -1;
uint32_t num;
+ struct bt_iso_io_qos *out;
if (filename) {
char altername[PATH_MAX];
@@ -728,16 +802,21 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
syslog(LOG_INFO, "Sending ...");
/* Read QoS */
+ if (!strcmp(peer, "00:00:00:00:00:00"))
+ out = &qos.bcast.bsrc.out;
+ else
+ out = &qos.ucast.out;
+
memset(&qos, 0, sizeof(qos));
len = sizeof(qos);
if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
syslog(LOG_ERR, "Can't get Output QoS socket option: %s (%d)",
strerror(errno), errno);
- qos.out.sdu = ISO_DEFAULT_MTU;
+ out->sdu = ISO_DEFAULT_MTU;
}
/* num of packets = latency (ms) / interval (us) */
- num = (qos.out.latency * 1000 / qos.out.interval);
+ num = (out->latency * 1000 / out->interval);
syslog(LOG_INFO, "Number of packets: %d", num);
@@ -746,8 +825,8 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
* latency:
* jitter buffer = 2 * (SDU * subevents)
*/
- sndbuf = 2 * ((qos.out.latency * 1000 / qos.out.interval) *
- qos.out.sdu);
+ sndbuf = 2 * ((out->latency * 1000 / out->interval) *
+ out->sdu);
len = sizeof(sndbuf);
if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &sndbuf, len) < 0) {
@@ -768,10 +847,10 @@ static void send_mode(char *filename, char *peer, int i, bool repeat)
}
}
- for (i = 6; i < qos.out.sdu; i++)
+ for (i = 6; i < out->sdu; i++)
buf[i] = 0x7f;
- do_send(sk, fd, &qos, num, repeat);
+ do_send(sk, fd, out, num, repeat);
}
static void reconnect_mode(char *peer)
@@ -826,12 +905,14 @@ static void multy_connect_mode(char *peer)
#define QOS(_interval, _latency, _sdu, _phy, _rtn) \
{ \
- .cig = BT_ISO_QOS_CIG_UNSET, \
- .cis = BT_ISO_QOS_CIS_UNSET, \
- .sca = 0x07, \
- .packing = 0x00, \
- .framing = 0x00, \
- .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ .ucast = { \
+ .cig = BT_ISO_QOS_CIG_UNSET, \
+ .cis = BT_ISO_QOS_CIS_UNSET, \
+ .sca = 0x07, \
+ .packing = 0x00, \
+ .framing = 0x00, \
+ .out = QOS_IO(_interval, _latency, _sdu, _phy, _rtn), \
+ }, \
}
#define QOS_PRESET(_name, _inout, _interval, _latency, _sdu, _phy, _rtn) \
@@ -1057,43 +1138,43 @@ int main(int argc, char *argv[])
case 'M':
if (optarg)
- iso_qos->out.sdu = atoi(optarg);
+ iso_qos->ucast.out.sdu = atoi(optarg);
break;
case 'S':
if (optarg)
- iso_qos->sca = atoi(optarg);
+ iso_qos->ucast.sca = atoi(optarg);
break;
case 'P':
if (optarg)
- iso_qos->packing = atoi(optarg);
+ iso_qos->ucast.packing = atoi(optarg);
break;
case 'F':
if (optarg)
- iso_qos->framing = atoi(optarg);
+ iso_qos->ucast.framing = atoi(optarg);
break;
case 'I':
if (optarg)
- iso_qos->out.interval = atoi(optarg);
+ iso_qos->ucast.out.interval = atoi(optarg);
break;
case 'L':
if (optarg)
- iso_qos->out.latency = atoi(optarg);
+ iso_qos->ucast.out.latency = atoi(optarg);
break;
case 'Y':
if (optarg)
- iso_qos->out.phy = atoi(optarg);
+ iso_qos->ucast.out.phy = atoi(optarg);
break;
case 'R':
if (optarg)
- iso_qos->out.rtn = atoi(optarg);
+ iso_qos->ucast.out.rtn = atoi(optarg);
break;
case 'B':
@@ -1112,12 +1193,12 @@ int main(int argc, char *argv[])
case 'G':
if (optarg)
- iso_qos->cig = atoi(optarg);
+ iso_qos->ucast.cig = atoi(optarg);
break;
case 'T':
if (optarg)
- iso_qos->cis = atoi(optarg);
+ iso_qos->ucast.cis = atoi(optarg);
break;
/* fall through */
@@ -1128,11 +1209,11 @@ int main(int argc, char *argv[])
}
if (inout) {
- iso_qos->in = iso_qos->out;
+ iso_qos->ucast.in = iso_qos->ucast.out;
} else {
/* Align interval and latency even if is unidirectional */
- iso_qos->in.interval = iso_qos->out.interval;
- iso_qos->in.latency = iso_qos->out.latency;
+ iso_qos->ucast.in.interval = iso_qos->ucast.out.interval;
+ iso_qos->ucast.in.latency = iso_qos->ucast.out.latency;
}
buf = malloc(data_size);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Split bt_iso_qos into dedicated structures
2023-03-27 13:46 [PATCH BlueZ 1/1] " Iulia Tanasescu
@ 2023-03-27 15:19 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2023-03-27 15:19 UTC (permalink / raw)
To: linux-bluetooth, iulia.tanasescu
[-- Attachment #1: Type: text/plain, Size: 1187 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=734180
---Test result---
Test Summary:
CheckPatch PASS 0.86 seconds
GitLint PASS 0.31 seconds
BuildEll PASS 32.25 seconds
BluezMake PASS 986.91 seconds
MakeCheck PASS 12.11 seconds
MakeDistcheck PASS 178.58 seconds
CheckValgrind PASS 289.54 seconds
CheckSmatch WARNING 384.64 seconds
bluezmakeextell PASS 117.29 seconds
IncrementalBuild PASS 821.51 seconds
ScanBuild PASS 1166.00 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/bthost.c:584:28: warning: Variable length array is used.emulator/bthost.c:741:28: warning: Variable length array is used.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH BlueZ 1/8] btio: Use unicast structure for ISO QoS options
@ 2023-03-20 14:37 Iulia Tanasescu
2023-03-20 15:11 ` Split bt_iso_qos into dedicated structures bluez.test.bot
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-20 14:37 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
Convert the generic bt_iso_qos structure into the dedicated unicast
structure for ISO QoS options.
---
btio/btio.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/btio/btio.c b/btio/btio.c
index 1ad42728d..017b53a54 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -5,6 +5,7 @@
*
* Copyright (C) 2009-2010 Marcel Holtmann <marcel@holtmann.org>
* Copyright (C) 2009-2010 Nokia Corporation
+ * Copyright 2023 NXP
*
*
*/
@@ -68,7 +69,7 @@ struct set_opts {
int flushable;
uint32_t priority;
uint16_t voice;
- struct bt_iso_qos qos;
+ struct bt_iso_unicast_qos qos;
};
struct connect {
@@ -857,11 +858,11 @@ voice:
return TRUE;
}
-static gboolean iso_set(int sock, struct bt_iso_qos *qos, GError **err)
+static gboolean iso_set(int sock, struct bt_iso_unicast_qos *qos, GError **err)
{
- if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_QOS, qos,
+ if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
sizeof(*qos)) < 0) {
- ERROR_FAILED(err, "setsockopt(BT_ISO_QOS)", errno);
+ ERROR_FAILED(err, "setsockopt(BT_ISO_UNICAST_QOS)", errno);
return FALSE;
}
@@ -963,7 +964,7 @@ static gboolean parse_set_opts(struct set_opts *opts, GError **err,
opts->voice = va_arg(args, int);
break;
case BT_IO_OPT_QOS:
- opts->qos = *va_arg(args, struct bt_iso_qos *);
+ opts->qos = *va_arg(args, struct bt_iso_unicast_qos *);
break;
case BT_IO_OPT_INVALID:
case BT_IO_OPT_KEY_SIZE:
@@ -1570,14 +1571,15 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
{
BtIOOption opt = opt1;
struct sockaddr_iso src, dst;
- struct bt_iso_qos qos;
+ struct bt_iso_unicast_qos qos;
socklen_t len;
uint32_t phy;
len = sizeof(qos);
memset(&qos, 0, len);
- if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) {
- ERROR_FAILED(err, "getsockopt(BT_ISO_QOS)", errno);
+ if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
+ &len) < 0) {
+ ERROR_FAILED(err, "getsockopt(BT_ISO_UNICAST_QOS)", errno);
return FALSE;
}
@@ -1624,7 +1626,7 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args)
*(va_arg(args, uint32_t *)) = phy;
break;
case BT_IO_OPT_QOS:
- *(va_arg(args, struct bt_iso_qos *)) = qos;
+ *(va_arg(args, struct bt_iso_unicast_qos *)) = qos;
break;
case BT_IO_OPT_HANDLE:
case BT_IO_OPT_CLASS:
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Split bt_iso_qos into dedicated structures
2023-03-20 14:37 [PATCH BlueZ 1/8] btio: Use unicast structure for ISO QoS options Iulia Tanasescu
@ 2023-03-20 15:11 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2023-03-20 15:11 UTC (permalink / raw)
To: linux-bluetooth, iulia.tanasescu
[-- Attachment #1: Type: text/plain, Size: 41970 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=731872
---Test result---
Test Summary:
CheckPatch PASS 0.75 seconds
GitLint PASS 0.46 seconds
BuildEll PASS 28.31 seconds
BluezMake FAIL 77.31 seconds
MakeCheck FAIL 5.39 seconds
MakeDistcheck FAIL 51.41 seconds
CheckValgrind FAIL 59.55 seconds
CheckSmatch FAIL 158.92 seconds
bluezmakeextell FAIL 44.20 seconds
IncrementalBuild FAIL 688.93 seconds
ScanBuild FAIL 680.61 seconds
Details
##############################
Test: BluezMake - FAIL
Desc: Build BlueZ
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12514:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12514 | int main(int argc, char *argv[])
| ^~~~
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8630: btio/android_avdtptest-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4506: all] Error 2
##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:
client/player.c: In function ‘transport_timer_read’:
client/player.c:3510:28: error: storage size of ‘qos’ isn’t known
3510 | struct bt_iso_unicast_qos qos;
| ^~~
client/player.c:3530:47: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
3530 | if (getsockopt(transport->sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
client/player.c:3530:47: note: each undeclared identifier is reported only once for each function it appears in
client/player.c:3510:28: error: unused variable ‘qos’ [-Werror=unused-variable]
3510 | struct bt_iso_unicast_qos qos;
| ^~~
client/player.c: At top level:
client/player.c:3557:13: error: ‘struct bt_iso_unicast_qos’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
3557 | struct bt_iso_unicast_qos *qos)
| ^~~~~~~~~~~~~~~~~~
client/player.c: In function ‘transport_send’:
client/player.c:3575:27: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
3575 | ts.it_value.tv_nsec = qos->out.latency * 1000000;
| ^~
client/player.c: In function ‘cmd_send_transport’:
client/player.c:3596:28: error: storage size of ‘qos’ isn’t known
3596 | struct bt_iso_unicast_qos qos;
| ^~~
client/player.c:3632:5: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
3632 | BT_ISO_UNICAST_QOS, &qos, &len) < 0)
| ^~~~~~~~~~~~~~~~~~
client/player.c:3596:28: error: unused variable ‘qos’ [-Werror=unused-variable]
3596 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:7591: client/player.o] Error 1
make: *** [Makefile:11779: check] Error 2
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:
../../btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
../../btio/btio.c: In function ‘iso_set’:
../../btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
../../btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
../../btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
../../btio/btio.c: In function ‘iso_get’:
../../btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
../../btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile:8630: btio/android_avdtptest-btio.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:4506: all] Error 2
make: *** [Makefile:11700: distcheck] Error 1
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12514:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12514 | int main(int argc, char *argv[])
| ^~~~
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:8630: btio/android_avdtptest-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:11779: check] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:
src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:275:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:717:25: warning: Variable length array is used.
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
src/shared/shell.c:609:21: warning: non-ANSI function declaration of function 'bt_shell_usage'
src/shared/crypto.c:271:21: warning: Variable length array is used.
src/shared/crypto.c:272:23: warning: Variable length array is used.
src/shared/gatt-helpers.c:768:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:830:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1323:31: warning: Variable length array is used.
src/shared/gatt-helpers.c:1354:23: warning: Variable length array is used.
src/shared/gatt-server.c:275:25: warning: Variable length array is used.
src/shared/gatt-server.c:618:25: warning: Variable length array is used.
src/shared/gatt-server.c:717:25: warning: Variable length array is used.
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
src/shared/shell.c:609:21: warning: non-ANSI function declaration of function 'bt_shell_usage'
tools/mesh-cfgtest.c:1453:17: warning: unknown escape sequence: '\%'
tools/sco-tester.c: note: in included file:
./lib/bluetooth.h:186:15: warning: array of flexible structures
./lib/bluetooth.h:191:31: warning: array of flexible structures
tools/bneptest.c:634:39: warning: unknown escape sequence: '\%'
tools/seq2bseq.c:57:26: warning: Variable length array is used.
tools/obex-client-tool.c: note: in included file (through /usr/include/readline/readline.h):
/usr/include/readline/rltypedefs.h:35:23: warning: non-ANSI function declaration of function 'Function'
/usr/include/readline/rltypedefs.h:36:25: warning: non-ANSI function declaration of function 'VFunction'
/usr/include/readline/rltypedefs.h:37:27: warning: non-ANSI function declaration of function 'CPFunction'
/usr/include/readline/rltypedefs.h:38:29: warning: non-ANSI function declaration of function 'CPPFunction'
android/avctp.c:505:34: warning: Variable length array is used.
android/avctp.c:556:34: warning: Variable length array is used.
unit/test-avrcp.c:373:26: warning: Variable length array is used.
unit/test-avrcp.c:398:26: warning: Variable length array is used.
unit/test-avrcp.c:414:24: warning: Variable length array is used.
android/avrcp-lib.c:1085:34: warning: Variable length array is used.
android/avrcp-lib.c:1583:34: warning: Variable length array is used.
android/avrcp-lib.c:1612:34: warning: Variable length array is used.
android/avrcp-lib.c:1638:34: warning: Variable length array is used.
profiles/input/device.c:165:26: warning: Variable length array is used.
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:10380: btio/bluetoothd-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4506: all] Error 2
##############################
Test: bluezmakeextell - FAIL
Desc: Build Bluez with External ELL
Output:
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:10380: btio/bluetoothd-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4506: all] Error 2
##############################
Test: IncrementalBuild - FAIL
Desc: Incremental build with the patches in the series
Output:
[BlueZ,1/8] btio: Use unicast structure for ISO QoS options
tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12514:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12514 | int main(int argc, char *argv[])
| ^~~~
unit/test-avdtp.c: In function ‘main’:
unit/test-avdtp.c:766:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
766 | int main(int argc, char *argv[])
| ^~~~
unit/test-avrcp.c: In function ‘main’:
unit/test-avrcp.c:989:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
989 | int main(int argc, char *argv[])
| ^~~~
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:10380: btio/bluetoothd-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:4506: all] Error 2
##############################
Test: ScanBuild - FAIL
Desc: Run Scan Build
Output:
src/shared/ad.c:369:19: warning: Use of zero-allocated memory
buf[(*pos)++] = ad_type;
^
1 warning generated.
src/shared/gatt-client.c:451:21: warning: Use of memory after it is freed
gatt_db_unregister(op->client->db, op->db_id);
^~~~~~~~~~
src/shared/gatt-client.c:696:2: warning: Use of memory after it is freed
discovery_op_complete(op, false, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:993:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1099:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1291:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1356:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1631:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1636:2: warning: Use of memory after it is freed
discover_all(op);
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2140:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2148:8: warning: Use of memory after it is freed
discovery_op_ref(op),
^~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3236:2: warning: Use of memory after it is freed
complete_write_long_op(req, success, 0, false);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3258:2: warning: Use of memory after it is freed
request_unref(req);
^~~~~~~~~~~~~~~~~~
12 warnings generated.
src/shared/shell.c:1180:13: warning: Access to field 'options' results in a dereference of a null pointer (loaded from variable 'opt')
if (c != opt->options[index - offset].val) {
^~~~~~~~~~~~
1 warning generated.
src/shared/ad.c:369:19: warning: Use of zero-allocated memory
buf[(*pos)++] = ad_type;
^
1 warning generated.
src/shared/gatt-client.c:451:21: warning: Use of memory after it is freed
gatt_db_unregister(op->client->db, op->db_id);
^~~~~~~~~~
src/shared/gatt-client.c:696:2: warning: Use of memory after it is freed
discovery_op_complete(op, false, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:993:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1099:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1291:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1356:2: warning: Use of memory after it is freed
discovery_op_complete(op, success, att_ecode);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1631:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:1636:2: warning: Use of memory after it is freed
discover_all(op);
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2140:6: warning: Use of memory after it is freed
if (read_db_hash(op)) {
^~~~~~~~~~~~~~~~
src/shared/gatt-client.c:2148:8: warning: Use of memory after it is freed
discovery_op_ref(op),
^~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3236:2: warning: Use of memory after it is freed
complete_write_long_op(req, success, 0, false);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/shared/gatt-client.c:3258:2: warning: Use of memory after it is freed
request_unref(req);
^~~~~~~~~~~~~~~~~~
12 warnings generated.
src/shared/shell.c:1180:13: warning: Access to field 'options' results in a dereference of a null pointer (loaded from variable 'opt')
if (c != opt->options[index - offset].val) {
^~~~~~~~~~~~
1 warning generated.
tools/hciattach.c:816:7: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 10)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach.c:864:7: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 4)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach.c:886:8: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 10)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach.c:908:7: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 4)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach.c:929:7: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 4)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/hciattach.c:973:7: warning: Although the value stored to 'n' is used in the enclosing expression, the value is never actually read from 'n'
if ((n = read_hci_event(fd, resp, 6)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
src/oui.c:50:2: warning: Value stored to 'hwdb' is never read
hwdb = udev_hwdb_unref(hwdb);
^ ~~~~~~~~~~~~~~~~~~~~~
src/oui.c:53:2: warning: Value stored to 'udev' is never read
udev = udev_unref(udev);
^ ~~~~~~~~~~~~~~~~
2 warnings generated.
tools/hcidump.c:180:9: warning: Potential leak of memory pointed to by 'dp'
if (fds[i].fd == sock)
^~~
tools/hcidump.c:248:17: warning: Assigned value is garbage or undefined
dh->ts_sec = htobl(frm.ts.tv_sec);
^ ~~~~~~~~~~~~~~~~~~~~
tools/hcidump.c:326:9: warning: 1st function call argument is an uninitialized value
if (be32toh(dp.flags) & 0x02) {
^~~~~~~~~~~~~~~~~
/usr/include/endian.h:46:22: note: expanded from macro 'be32toh'
# define be32toh(x) __bswap_32 (x)
^~~~~~~~~~~~~~
tools/hcidump.c:341:20: warning: 1st function call argument is an uninitialized value
frm.data_len = be32toh(dp.len);
^~~~~~~~~~~~~~~
/usr/include/endian.h:46:22: note: expanded from macro 'be32toh'
# define be32toh(x) __bswap_32 (x)
^~~~~~~~~~~~~~
tools/hcidump.c:346:14: warning: 1st function call argument is an uninitialized value
opcode = be32toh(dp.flags) & 0xffff;
^~~~~~~~~~~~~~~~~
/usr/include/endian.h:46:22: note: expanded from macro 'be32toh'
# define be32toh(x) __bswap_32 (x)
^~~~~~~~~~~~~~
tools/hcidump.c:384:17: warning: Assigned value is garbage or undefined
frm.data_len = btohs(dh.len);
^ ~~~~~~~~~~~~~
tools/hcidump.c:394:11: warning: Assigned value is garbage or undefined
frm.len = frm.data_len;
^ ~~~~~~~~~~~~
tools/hcidump.c:398:9: warning: 1st function call argument is an uninitialized value
ts = be64toh(ph.ts);
^~~~~~~~~~~~~~
/usr/include/endian.h:51:22: note: expanded from macro 'be64toh'
# define be64toh(x) __bswap_64 (x)
^~~~~~~~~~~~~~
tools/hcidump.c:403:13: warning: 1st function call argument is an uninitialized value
frm.in = be32toh(dp.flags) & 0x01;
^~~~~~~~~~~~~~~~~
/usr/include/endian.h:46:22: note: expanded from macro 'be32toh'
# define be32toh(x) __bswap_32 (x)
^~~~~~~~~~~~~~
tools/hcidump.c:408:11: warning: Assigned value is garbage or undefined
frm.in = dh.in;
^ ~~~~~
tools/hcidump.c:437:7: warning: Null pointer passed to 1st parameter expecting 'nonnull'
fd = open(file, open_flags, 0644);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
11 warnings generated.
tools/rfcomm.c:228:3: warning: Value stored to 'i' is never read
i = execvp(cmdargv[0], cmdargv);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/rfcomm.c:228:7: warning: Null pointer passed to 1st parameter expecting 'nonnull'
i = execvp(cmdargv[0], cmdargv);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/rfcomm.c:348:8: warning: Although the value stored to 'fd' is used in the enclosing expression, the value is never actually read from 'fd'
if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/rfcomm.c:491:14: warning: Assigned value is garbage or undefined
req.channel = raddr.rc_channel;
^ ~~~~~~~~~~~~~~~~
tools/rfcomm.c:509:8: warning: Although the value stored to 'fd' is used in the enclosing expression, the value is never actually read from 'fd'
if ((fd = open(devname, O_RDONLY | O_NOCTTY)) < 0) {
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 warnings generated.
src/sdp-xml.c:126:10: warning: Assigned value is garbage or undefined
buf[1] = data[i + 1];
^ ~~~~~~~~~~~
src/sdp-xml.c:300:11: warning: Assigned value is garbage or undefined
buf[1] = data[i + 1];
^ ~~~~~~~~~~~
src/sdp-xml.c:338:11: warning: Assigned value is garbage or undefined
buf[1] = data[i + 1];
^ ~~~~~~~~~~~
3 warnings generated.
tools/ciptool.c:350:7: warning: 5th function call argument is an uninitialized value
sk = do_connect(ctl, dev_id, &src, &dst, psm, (1 << CMTP_LOOPBACK));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
tools/sdptool.c:941:26: warning: Result of 'malloc' is converted to a pointer of type 'uint32_t', which is incompatible with sizeof operand type 'int'
uint32_t *value_int = malloc(sizeof(int));
~~~~~~~~~~ ^~~~~~ ~~~~~~~~~~~
tools/sdptool.c:980:4: warning: 1st function call argument is an uninitialized value
free(allocArray[i]);
^~~~~~~~~~~~~~~~~~~
tools/sdptool.c:3777:2: warning: Potential leak of memory pointed to by 'si.name'
return add_service(0, &si);
^~~~~~~~~~~~~~~~~~~~~~~~~~
tools/sdptool.c:4112:4: warning: Potential leak of memory pointed to by 'context.svc'
return -1;
^~~~~~~~~
4 warnings generated.
tools/avtest.c:224:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:234:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 4);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:243:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:257:5: warning: Value stored to 'len' is never read
len = write(sk, buf,
^ ~~~~~~~~~~~~~~
tools/avtest.c:264:5: warning: Value stored to 'len' is never read
len = write(sk, buf,
^ ~~~~~~~~~~~~~~
tools/avtest.c:271:5: warning: Value stored to 'len' is never read
len = write(sk, buf,
^ ~~~~~~~~~~~~~~
tools/avtest.c:278:5: warning: Value stored to 'len' is never read
len = write(sk, buf,
^ ~~~~~~~~~~~~~~
tools/avtest.c:289:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 4);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:293:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:302:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:306:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:315:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:322:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:344:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 4);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:348:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:357:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:361:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:374:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 4);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:378:5: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:385:4: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:395:4: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:559:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:567:3: warning: Value stored to 'len' is never read
len = write(sk, buf, invalid ? 2 : 3);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/avtest.c:581:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 4 + sizeof(media_transport));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/avtest.c:594:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:604:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:616:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:631:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:643:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:652:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 3);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:659:3: warning: Value stored to 'len' is never read
len = write(sk, buf, 2);
^ ~~~~~~~~~~~~~~~~~
tools/avtest.c:695:2: warning: Value stored to 'len' is never read
len = write(sk, buf, AVCTP_HEADER_LENGTH + sizeof(play_pressed));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
32 warnings generated.
tools/btproxy.c:836:15: warning: Null pointer passed to 1st parameter expecting 'nonnull'
tcp_port = atoi(optarg);
^~~~~~~~~~~~
tools/btproxy.c:839:8: warning: Null pointer passed to 1st parameter expecting 'nonnull'
if (strlen(optarg) > 3 && !strncmp(optarg, "hci", 3))
^~~~~~~~~~~~~~
2 warnings generated.
tools/create-image.c:76:3: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
tools/create-image.c:84:3: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
tools/create-image.c:92:3: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
tools/create-image.c:105:2: warning: Value stored to 'fd' is never read
fd = -1;
^ ~~
4 warnings generated.
tools/btgatt-client.c:1597:2: warning: Value stored to 'argv' is never read
argv += optind;
^ ~~~~~~
1 warning generated.
tools/btgatt-server.c:1212:2: warning: Value stored to 'argv' is never read
argv -= optind;
^ ~~~~~~
1 warning generated.
tools/check-selftest.c:42:3: warning: Value stored to 'ptr' is never read
ptr = fgets(result, sizeof(result), fp);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
tools/gatt-service.c:294:2: warning: 2nd function call argument is an uninitialized value
chr_write(chr, value, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
tools/obex-server-tool.c:133:13: warning: Null pointer passed to 1st parameter expecting 'nonnull'
data->fd = open(name, O_WRONLY | O_CREAT | O_NOCTTY, 0600);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tools/obex-server-tool.c:192:13: warning: Null pointer passed to 1st parameter expecting 'nonnull'
data->fd = open(name, O_RDONLY | O_NOCTTY, 0);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
tools/btpclientctl.c:402:3: warning: Value stored to 'bit' is never read
bit = 0;
^ ~
tools/btpclientctl.c:1655:2: warning: Null pointer passed to 2nd parameter expecting 'nonnull'
memcpy(cp->data, ad_data, ad_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
src/sdpd-request.c:211:13: warning: Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'uint16_t'
pElem = malloc(sizeof(uint16_t));
^~~~~~ ~~~~~~~~~~~~~~~~
src/sdpd-request.c:239:13: warning: Result of 'malloc' is converted to a pointer of type 'char', which is incompatible with sizeof operand type 'uint32_t'
pElem = malloc(sizeof(uint32_t));
^~~~~~ ~~~~~~~~~~~~~~~~
2 warnings generated.
android/avrcp-lib.c:1968:3: warning: 1st function call argument is an uninitialized value
g_free(text[i]);
^~~~~~~~~~~~~~~
1 warning generated.
unit/test-midi.c:541:82: error: function definition is not allowed here
void compare_events_cb(const struct midi_write_parser *parser, void *user_data) {
^
unit/test-midi.c:587:17: error: use of undeclared identifier 'compare_events_cb'; did you mean 'compare_events'?
compare_events_cb, &midi_data);
^~~~~~~~~~~~~~~~~
compare_events
unit/test-midi.c:237:13: note: 'compare_events' declared here
static void compare_events(const snd_seq_event_t *ev1,
^
2 errors generated.
profiles/health/hdp.c:644:3: warning: Use of memory after it is freed
hdp_tmp_dc_data_unref(dc_data);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
profiles/health/hdp.c:800:19: warning: Use of memory after it is freed
path = g_strdup(chan->path);
^~~~~~~~~~
profiles/health/hdp.c:1779:6: warning: Use of memory after it is freed
hdp_tmp_dc_data_ref(hdp_conn),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
profiles/health/hdp.c:1836:30: warning: Use of memory after it is freed
reply = g_dbus_create_error(data->msg, ERROR_INTERFACE ".HealthError",
^~~~~~~~~
4 warnings generated.
profiles/health/hdp_util.c:1053:2: warning: Use of memory after it is freed
conn_data->func(conn_data->data, gerr);
^~~~~~~~~~~~~~~
1 warning generated.
profiles/midi/midi.c:61:75: error: function definition is not allowed here
void foreach_cb(const struct midi_write_parser *parser, void *user_data) {
^
profiles/midi/midi.c:78:40: error: use of undeclared identifier 'foreach_cb'
midi_read_ev(&midi->midi_out, event, foreach_cb, midi);
^
2 errors generated.
btio/btio.c:72:28: error: field ‘qos’ has incomplete type
72 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c: In function ‘iso_set’:
btio/btio.c:863:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
863 | if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:863:38: note: each undeclared identifier is reported only once for each function it appears in
btio/btio.c:864:12: error: dereferencing pointer to incomplete type ‘struct bt_iso_unicast_qos’
864 | sizeof(*qos)) < 0) {
| ^~~~
btio/btio.c: In function ‘iso_get’:
btio/btio.c:1574:28: error: storage size of ‘qos’ isn’t known
1574 | struct bt_iso_unicast_qos qos;
| ^~~
btio/btio.c:1580:38: error: ‘BT_ISO_UNICAST_QOS’ undeclared (first use in this function)
1580 | if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos,
| ^~~~~~~~~~~~~~~~~~
btio/btio.c:1574:28: error: unused variable ‘qos’ [-Werror=unused-variable]
1574 | struct bt_iso_unicast_qos qos;
| ^~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:10380: btio/bluetoothd-btio.o] Error 1
make[1]: *** Waiting for unfinished jobs....
attrib/gatt.c:970:2: warning: Potential leak of memory pointed to by 'long_write'
return prepare_write(long_write);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
make: *** [Makefile:4506: all] Error 2
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/1] Bluetooth: Split bt_iso_qos into dedicated structures
@ 2023-03-20 14:36 Iulia Tanasescu
2023-03-20 15:03 ` bluez.test.bot
0 siblings, 1 reply; 7+ messages in thread
From: Iulia Tanasescu @ 2023-03-20 14:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Iulia Tanasescu
Split bt_iso_qos into dedicated unicast and broadcast
structures and add missing broadcast parameters
Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
include/net/bluetooth/bluetooth.h | 47 ++++--
include/net/bluetooth/hci_core.h | 21 +--
net/bluetooth/hci_conn.c | 104 ++++++++-----
net/bluetooth/hci_event.c | 38 +++--
net/bluetooth/iso.c | 247 ++++++++++++++++++++++++++----
5 files changed, 346 insertions(+), 111 deletions(-)
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index bcc5a4cd2c17..24d303783ea4 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -1,6 +1,7 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (C) 2000-2001 Qualcomm Incorporated
+ Copyright 2023 NXP
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -155,11 +156,14 @@ struct bt_voice {
#define BT_SCM_PKT_STATUS 0x03
-#define BT_ISO_QOS 17
+#define BT_ISO_UNICAST_QOS 17
#define BT_ISO_QOS_CIG_UNSET 0xff
#define BT_ISO_QOS_CIS_UNSET 0xff
+#define BT_ISO_BCAST_SINK_QOS 18
+#define BT_ISO_BCAST_SOURCE_QOS 19
+
#define BT_ISO_QOS_BIG_UNSET 0xff
#define BT_ISO_QOS_BIS_UNSET 0xff
@@ -171,25 +175,40 @@ struct bt_iso_io_qos {
__u8 rtn;
};
-struct bt_iso_qos {
- union {
- __u8 cig;
- __u8 big;
- };
- union {
- __u8 cis;
- __u8 bis;
- };
- union {
- __u8 sca;
- __u8 sync_interval;
- };
+struct bt_iso_unicast_qos {
+ __u8 cig;
+ __u8 cis;
+ __u8 sca;
__u8 packing;
__u8 framing;
struct bt_iso_io_qos in;
struct bt_iso_io_qos out;
};
+struct bt_iso_bcast_sink_qos {
+ __u8 options;
+ __u16 skip;
+ __u16 sync_timeout;
+ __u8 sync_cte_type;
+ __u8 big;
+ __u8 encryption;
+ __u8 bcode[16];
+ __u8 mse;
+ __u16 timeout;
+ struct bt_iso_io_qos in;
+};
+
+struct bt_iso_bcast_source_qos {
+ __u8 sync_interval;
+ __u8 big;
+ __u8 bis;
+ __u8 packing;
+ __u8 framing;
+ __u8 encryption;
+ __u8 bcode[16];
+ struct bt_iso_io_qos out;
+};
+
#define BT_ISO_PHY_1M 0x01
#define BT_ISO_PHY_2M 0x02
#define BT_ISO_PHY_CODED 0x04
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 53d3328c2b8b..60b6acb1be2b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1,6 +1,7 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
+ Copyright 2023 NXP
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -730,7 +731,9 @@ struct hci_conn {
__s8 rssi;
__s8 tx_power;
__s8 max_tx_power;
- struct bt_iso_qos iso_qos;
+ struct bt_iso_unicast_qos iso_unicast_qos;
+ struct bt_iso_bcast_sink_qos iso_sink_qos;
+ struct bt_iso_bcast_source_qos iso_source_qos;
unsigned long flags;
enum conn_reasons conn_reason;
@@ -1090,7 +1093,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_bis(struct hci_dev *hdev,
if (bacmp(&c->dst, ba) || c->type != ISO_LINK)
continue;
- if (c->iso_qos.big == big && c->iso_qos.bis == bis) {
+ if (c->iso_source_qos.big == big && c->iso_source_qos.bis == bis) {
rcu_read_unlock();
return c;
}
@@ -1199,7 +1202,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_cig(struct hci_dev *hdev,
if (c->type != ISO_LINK)
continue;
- if (handle == c->iso_qos.cig) {
+ if (handle == c->iso_unicast_qos.cig) {
rcu_read_unlock();
return c;
}
@@ -1222,7 +1225,7 @@ static inline struct hci_conn *hci_conn_hash_lookup_big(struct hci_dev *hdev,
if (bacmp(&c->dst, BDADDR_ANY) || c->type != ISO_LINK)
continue;
- if (handle == c->iso_qos.big) {
+ if (handle == c->iso_source_qos.big) {
rcu_read_unlock();
return c;
}
@@ -1324,15 +1327,15 @@ struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
__u16 setting, struct bt_codec *codec);
struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos);
+ __u8 dst_type, struct bt_iso_unicast_qos *qos);
struct hci_conn *hci_connect_cis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos);
+ __u8 dst_type, struct bt_iso_unicast_qos *qos);
struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos,
+ __u8 dst_type, struct bt_iso_bcast_source_qos *qos,
__u8 data_len, __u8 *data);
int hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst, __u8 dst_type,
- __u8 sid);
-int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos,
+ __u8 sid, struct bt_iso_bcast_sink_qos *qos);
+int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_bcast_sink_qos *qos,
__u16 sync_handle, __u8 num_bis, __u8 bis[]);
int hci_conn_check_link_mode(struct hci_conn *conn);
int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 17b946f9ba31..77f0c89a9089 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -1,6 +1,7 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
+ Copyright 2023 NXP
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -771,13 +772,22 @@ struct iso_list_data {
static void bis_list(struct hci_conn *conn, void *data)
{
struct iso_list_data *d = data;
+ u8 check_big;
+ u8 check_bis = BT_ISO_QOS_BIS_UNSET;
/* Skip if not broadcast/ANY address */
if (bacmp(&conn->dst, BDADDR_ANY))
return;
- if (d->big != conn->iso_qos.big || d->bis == BT_ISO_QOS_BIS_UNSET ||
- d->bis != conn->iso_qos.bis)
+ if (conn->role == HCI_ROLE_MASTER) {
+ check_big = conn->iso_source_qos.big;
+ check_bis = conn->iso_source_qos.bis;
+ } else {
+ check_big = conn->iso_sink_qos.big;
+ }
+
+ if (d->big != check_big || d->bis == BT_ISO_QOS_BIS_UNSET ||
+ d->bis != check_bis)
return;
d->count++;
@@ -897,10 +907,10 @@ static void bis_cleanup(struct hci_conn *conn)
if (!test_and_clear_bit(HCI_CONN_PER_ADV, &conn->flags))
return;
- hci_le_terminate_big(hdev, conn->iso_qos.big,
- conn->iso_qos.bis);
+ hci_le_terminate_big(hdev, conn->iso_source_qos.big,
+ conn->iso_source_qos.bis);
} else {
- hci_le_big_terminate(hdev, conn->iso_qos.big,
+ hci_le_big_terminate(hdev, conn->iso_sink_qos.big,
conn->sync_handle);
}
}
@@ -940,7 +950,7 @@ static void cis_cleanup(struct hci_conn *conn)
struct iso_list_data d;
memset(&d, 0, sizeof(d));
- d.cig = conn->iso_qos.cig;
+ d.cig = conn->iso_unicast_qos.cig;
/* Check if ISO connection is a CIS and remove CIG if there are
* no other connections using it.
@@ -949,7 +959,7 @@ static void cis_cleanup(struct hci_conn *conn)
if (d.count)
return;
- hci_le_remove_cig(hdev, conn->iso_qos.cig);
+ hci_le_remove_cig(hdev, conn->iso_unicast_qos.cig);
}
struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
@@ -1398,12 +1408,12 @@ static int hci_explicit_conn_params_set(struct hci_dev *hdev,
return 0;
}
-static int qos_set_big(struct hci_dev *hdev, struct bt_iso_qos *qos)
+static int qos_set_big(struct hci_dev *hdev, uint8_t *big)
{
struct iso_list_data data;
/* Allocate a BIG if not set */
- if (qos->big == BT_ISO_QOS_BIG_UNSET) {
+ if (*big == BT_ISO_QOS_BIG_UNSET) {
for (data.big = 0x00; data.big < 0xef; data.big++) {
data.count = 0;
data.bis = 0xff;
@@ -1418,13 +1428,14 @@ static int qos_set_big(struct hci_dev *hdev, struct bt_iso_qos *qos)
return -EADDRNOTAVAIL;
/* Update BIG */
- qos->big = data.big;
+ *big = data.big;
}
return 0;
}
-static int qos_set_bis(struct hci_dev *hdev, struct bt_iso_qos *qos)
+static int qos_set_bis(struct hci_dev *hdev,
+ struct bt_iso_bcast_source_qos *qos)
{
struct iso_list_data data;
@@ -1455,7 +1466,7 @@ static int qos_set_bis(struct hci_dev *hdev, struct bt_iso_qos *qos)
/* This function requires the caller holds hdev->lock */
static struct hci_conn *hci_add_bis(struct hci_dev *hdev, bdaddr_t *dst,
- struct bt_iso_qos *qos)
+ struct bt_iso_bcast_source_qos *qos)
{
struct hci_conn *conn;
struct iso_list_data data;
@@ -1468,7 +1479,7 @@ static struct hci_conn *hci_add_bis(struct hci_dev *hdev, bdaddr_t *dst,
return ERR_PTR(-EOPNOTSUPP);
}
- err = qos_set_big(hdev, qos);
+ err = qos_set_big(hdev, &qos->big);
if (err)
return ERR_PTR(err);
@@ -1636,7 +1647,7 @@ struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
return sco;
}
-static void cis_add(struct iso_list_data *d, struct bt_iso_qos *qos)
+static void cis_add(struct iso_list_data *d, struct bt_iso_unicast_qos *qos)
{
struct hci_cis_params *cis = &d->pdu.cis[d->pdu.cp.num_cis];
@@ -1659,8 +1670,8 @@ static void cis_list(struct hci_conn *conn, void *data)
if (!bacmp(&conn->dst, BDADDR_ANY))
return;
- if (d->cig != conn->iso_qos.cig || d->cis == BT_ISO_QOS_CIS_UNSET ||
- d->cis != conn->iso_qos.cis)
+ if (d->cig != conn->iso_unicast_qos.cig || d->cis == BT_ISO_QOS_CIS_UNSET ||
+ d->cis != conn->iso_unicast_qos.cis)
return;
d->count++;
@@ -1669,10 +1680,11 @@ static void cis_list(struct hci_conn *conn, void *data)
d->count >= ARRAY_SIZE(d->pdu.cis))
return;
- cis_add(d, &conn->iso_qos);
+ cis_add(d, &conn->iso_unicast_qos);
}
-static int hci_le_create_big(struct hci_conn *conn, struct bt_iso_qos *qos)
+static int hci_le_create_big(struct hci_conn *conn,
+ struct bt_iso_bcast_source_qos *qos)
{
struct hci_dev *hdev = conn->hdev;
struct hci_cp_le_create_big cp;
@@ -1689,13 +1701,14 @@ static int hci_le_create_big(struct hci_conn *conn, struct bt_iso_qos *qos)
cp.bis.phy = qos->out.phy;
cp.bis.packing = qos->packing;
cp.bis.framing = qos->framing;
- cp.bis.encryption = 0x00;
- memset(&cp.bis.bcode, 0, sizeof(cp.bis.bcode));
+ cp.bis.encryption = qos->encryption;
+ memcpy(&cp.bis.bcode, qos->bcode, sizeof(cp.bis.bcode));
return hci_send_cmd(hdev, HCI_OP_LE_CREATE_BIG, sizeof(cp), &cp);
}
-static bool hci_le_set_cig_params(struct hci_conn *conn, struct bt_iso_qos *qos)
+static bool hci_le_set_cig_params(struct hci_conn *conn,
+ struct bt_iso_unicast_qos *qos)
{
struct hci_dev *hdev = conn->hdev;
struct iso_list_data data;
@@ -1779,7 +1792,7 @@ static bool hci_le_set_cig_params(struct hci_conn *conn, struct bt_iso_qos *qos)
}
struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos)
+ __u8 dst_type, struct bt_iso_unicast_qos *qos)
{
struct hci_conn *cis;
@@ -1797,7 +1810,7 @@ struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
/* Check if CIS has been set and the settings matches */
if (cis->state == BT_BOUND &&
- !memcmp(&cis->iso_qos, qos, sizeof(*qos)))
+ !memcmp(&cis->iso_unicast_qos, qos, sizeof(*qos)))
return cis;
/* Update LINK PHYs according to QoS preference */
@@ -1833,7 +1846,7 @@ struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
return ERR_PTR(-EINVAL);
}
- cis->iso_qos = *qos;
+ cis->iso_unicast_qos = *qos;
cis->state = BT_BOUND;
return cis;
@@ -1843,10 +1856,19 @@ bool hci_iso_setup_path(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
struct hci_cp_le_setup_iso_path cmd;
+ struct bt_iso_io_qos *in = NULL;
+ struct bt_iso_io_qos *out = NULL;
memset(&cmd, 0, sizeof(cmd));
- if (conn->iso_qos.out.sdu) {
+ if (bacmp(&conn->dst, BDADDR_ANY)) {
+ in = &conn->iso_unicast_qos.in;
+ out = &conn->iso_unicast_qos.out;
+ } else {
+ out = &conn->iso_source_qos.out;
+ }
+
+ if (out->sdu) {
cmd.handle = cpu_to_le16(conn->handle);
cmd.direction = 0x00; /* Input (Host to Controller) */
cmd.path = 0x00; /* HCI path if enabled */
@@ -1857,7 +1879,7 @@ bool hci_iso_setup_path(struct hci_conn *conn)
return false;
}
- if (conn->iso_qos.in.sdu) {
+ if (in && in->sdu) {
cmd.handle = cpu_to_le16(conn->handle);
cmd.direction = 0x01; /* Output (Controller to Host) */
cmd.path = 0x00; /* HCI path if enabled */
@@ -1884,7 +1906,7 @@ static int hci_create_cis_sync(struct hci_dev *hdev, void *data)
cmd.cis[0].acl_handle = cpu_to_le16(conn->link->handle);
cmd.cis[0].cis_handle = cpu_to_le16(conn->handle);
cmd.cp.num_cis++;
- cig = conn->iso_qos.cig;
+ cig = conn->iso_unicast_qos.cig;
hci_dev_lock(hdev);
@@ -1894,7 +1916,7 @@ static int hci_create_cis_sync(struct hci_dev *hdev, void *data)
struct hci_cis *cis = &cmd.cis[cmd.cp.num_cis];
if (conn == data || conn->type != ISO_LINK ||
- conn->state == BT_CONNECTED || conn->iso_qos.cig != cig)
+ conn->state == BT_CONNECTED || conn->iso_unicast_qos.cig != cig)
continue;
/* Check if all CIS(s) belonging to a CIG are ready */
@@ -1991,19 +2013,19 @@ static void hci_iso_qos_setup(struct hci_dev *hdev, struct hci_conn *conn,
}
static void hci_bind_bis(struct hci_conn *conn,
- struct bt_iso_qos *qos)
+ struct bt_iso_bcast_source_qos *qos)
{
/* Update LINK PHYs according to QoS preference */
conn->le_tx_phy = qos->out.phy;
conn->le_tx_phy = qos->out.phy;
- conn->iso_qos = *qos;
+ conn->iso_source_qos = *qos;
conn->state = BT_BOUND;
}
static int create_big_sync(struct hci_dev *hdev, void *data)
{
struct hci_conn *conn = data;
- struct bt_iso_qos *qos = &conn->iso_qos;
+ struct bt_iso_bcast_source_qos *qos = &conn->iso_source_qos;
u16 interval, sync_interval = 0;
u32 flags = 0;
int err;
@@ -2023,7 +2045,7 @@ static int create_big_sync(struct hci_dev *hdev, void *data)
if (err)
return err;
- return hci_le_create_big(conn, &conn->iso_qos);
+ return hci_le_create_big(conn, &conn->iso_source_qos);
}
static void create_pa_complete(struct hci_dev *hdev, void *data, int err)
@@ -2054,7 +2076,7 @@ static int create_pa_sync(struct hci_dev *hdev, void *data)
}
int hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst, __u8 dst_type,
- __u8 sid)
+ __u8 sid, struct bt_iso_bcast_sink_qos *qos)
{
struct hci_cp_le_pa_create_sync *cp;
@@ -2067,15 +2089,19 @@ int hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst, __u8 dst_type,
return -ENOMEM;
}
+ cp->options = qos->options;
cp->sid = sid;
cp->addr_type = dst_type;
+ cp->skip = qos->skip;
+ cp->sync_timeout = qos->sync_timeout;
+ cp->sync_cte_type = qos->sync_cte_type;
bacpy(&cp->addr, dst);
/* Queue start pa_create_sync and scan */
return hci_cmd_sync_queue(hdev, create_pa_sync, cp, create_pa_complete);
}
-int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos,
+int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_bcast_sink_qos *qos,
__u16 sync_handle, __u8 num_bis, __u8 bis[])
{
struct _packed {
@@ -2087,13 +2113,17 @@ int hci_le_big_create_sync(struct hci_dev *hdev, struct bt_iso_qos *qos,
if (num_bis > sizeof(pdu.bis))
return -EINVAL;
- err = qos_set_big(hdev, qos);
+ err = qos_set_big(hdev, &qos->big);
if (err)
return err;
memset(&pdu, 0, sizeof(pdu));
pdu.cp.handle = qos->big;
pdu.cp.sync_handle = cpu_to_le16(sync_handle);
+ pdu.cp.encryption = qos->encryption;
+ memcpy(pdu.cp.bcode, qos->bcode, sizeof(pdu.cp.bcode));
+ pdu.cp.mse = qos->mse;
+ pdu.cp.timeout = qos->timeout;
pdu.cp.num_bis = num_bis;
memcpy(pdu.bis, bis, num_bis);
@@ -2115,7 +2145,7 @@ static void create_big_complete(struct hci_dev *hdev, void *data, int err)
}
struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos,
+ __u8 dst_type, struct bt_iso_bcast_source_qos *qos,
__u8 base_len, __u8 *base)
{
struct hci_conn *conn;
@@ -2151,7 +2181,7 @@ struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
}
struct hci_conn *hci_connect_cis(struct hci_dev *hdev, bdaddr_t *dst,
- __u8 dst_type, struct bt_iso_qos *qos)
+ __u8 dst_type, struct bt_iso_unicast_qos *qos)
{
struct hci_conn *le;
struct hci_conn *cis;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8d8547fa9032..8428a3f75ef7 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1,6 +1,7 @@
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
+ Copyright 2023 NXP
Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
@@ -3843,7 +3844,7 @@ static u8 hci_cc_le_set_cig_params(struct hci_dev *hdev, void *data,
rcu_read_lock();
list_for_each_entry_rcu(conn, &hdev->conn_hash.list, list) {
- if (conn->type != ISO_LINK || conn->iso_qos.cig != rp->cig_id ||
+ if (conn->type != ISO_LINK || conn->iso_unicast_qos.cig != rp->cig_id ||
conn->state == BT_CONNECTED)
continue;
@@ -3877,6 +3878,7 @@ static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data,
struct hci_rp_le_setup_iso_path *rp = data;
struct hci_cp_le_setup_iso_path *cp;
struct hci_conn *conn;
+ bool cfm;
bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
@@ -3900,12 +3902,14 @@ static u8 hci_cc_le_setup_iso_path(struct hci_dev *hdev, void *data,
/* Input (Host to Controller) */
case 0x00:
/* Only confirm connection if output only */
- if (conn->iso_qos.out.sdu && !conn->iso_qos.in.sdu)
+ cfm = !bacmp(&conn->dst, BDADDR_ANY) ||
+ (conn->iso_unicast_qos.out.sdu && !conn->iso_unicast_qos.in.sdu);
+ if (cfm)
hci_connect_cfm(conn, rp->status);
break;
/* Output (Controller to Host) */
case 0x01:
- /* Confirm connection since conn->iso_qos is always configured
+ /* Confirm connection since Output is always configured
* last.
*/
hci_connect_cfm(conn, rp->status);
@@ -6822,15 +6826,15 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
memset(&interval, 0, sizeof(interval));
memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
- conn->iso_qos.in.interval = le32_to_cpu(interval);
+ conn->iso_unicast_qos.in.interval = le32_to_cpu(interval);
memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
- conn->iso_qos.out.interval = le32_to_cpu(interval);
- conn->iso_qos.in.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.out.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.in.sdu = le16_to_cpu(ev->c_mtu);
- conn->iso_qos.out.sdu = le16_to_cpu(ev->p_mtu);
- conn->iso_qos.in.phy = ev->c_phy;
- conn->iso_qos.out.phy = ev->p_phy;
+ conn->iso_unicast_qos.out.interval = le32_to_cpu(interval);
+ conn->iso_unicast_qos.in.latency = le16_to_cpu(ev->interval);
+ conn->iso_unicast_qos.out.latency = le16_to_cpu(ev->interval);
+ conn->iso_unicast_qos.in.sdu = le16_to_cpu(ev->c_mtu);
+ conn->iso_unicast_qos.out.sdu = le16_to_cpu(ev->p_mtu);
+ conn->iso_unicast_qos.in.phy = ev->c_phy;
+ conn->iso_unicast_qos.out.phy = ev->p_phy;
}
if (!ev->status) {
@@ -6904,8 +6908,8 @@ static void hci_le_cis_req_evt(struct hci_dev *hdev, void *data,
cis->handle = cis_handle;
}
- cis->iso_qos.cig = ev->cig_id;
- cis->iso_qos.cis = ev->cis_id;
+ cis->iso_unicast_qos.cig = ev->cig_id;
+ cis->iso_unicast_qos.cis = ev->cis_id;
if (!(flags & HCI_PROTO_DEFER)) {
hci_le_accept_cis(hdev, ev->cis_handle);
@@ -6992,13 +6996,13 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
bis->handle = handle;
}
- bis->iso_qos.big = ev->handle;
+ bis->iso_sink_qos.big = ev->handle;
memset(&interval, 0, sizeof(interval));
memcpy(&interval, ev->latency, sizeof(ev->latency));
- bis->iso_qos.in.interval = le32_to_cpu(interval);
+ bis->iso_sink_qos.in.interval = le32_to_cpu(interval);
/* Convert ISO Interval (1.25 ms slots) to latency (ms) */
- bis->iso_qos.in.latency = le16_to_cpu(ev->interval) * 125 / 100;
- bis->iso_qos.in.sdu = le16_to_cpu(ev->max_pdu);
+ bis->iso_sink_qos.in.latency = le16_to_cpu(ev->interval) * 125 / 100;
+ bis->iso_sink_qos.in.sdu = le16_to_cpu(ev->max_pdu);
hci_connect_cfm(bis, ev->status);
}
diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 8d136a730163..e660e1c5ea11 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -3,6 +3,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2022 Intel Corporation
+ * Copyright 2023 NXP
*/
#include <linux/module.h>
@@ -58,7 +59,9 @@ struct iso_pinfo {
__u8 bc_bis[ISO_MAX_NUM_BIS];
__u16 sync_handle;
__u32 flags;
- struct bt_iso_qos qos;
+ struct bt_iso_unicast_qos unicast_qos;
+ struct bt_iso_bcast_sink_qos sink_qos;
+ struct bt_iso_bcast_source_qos source_qos;
__u8 base_len;
__u8 base[BASE_MAX_LENGTH];
struct iso_conn *conn;
@@ -265,14 +268,14 @@ static int iso_connect_bis(struct sock *sk)
}
/* Fail if out PHYs are marked as disabled */
- if (!iso_pi(sk)->qos.out.phy) {
+ if (!iso_pi(sk)->source_qos.out.phy) {
err = -EINVAL;
goto unlock;
}
hcon = hci_connect_bis(hdev, &iso_pi(sk)->dst,
le_addr_type(iso_pi(sk)->dst_type),
- &iso_pi(sk)->qos, iso_pi(sk)->base_len,
+ &iso_pi(sk)->source_qos, iso_pi(sk)->base_len,
iso_pi(sk)->base);
if (IS_ERR(hcon)) {
err = PTR_ERR(hcon);
@@ -337,7 +340,7 @@ static int iso_connect_cis(struct sock *sk)
}
/* Fail if either PHYs are marked as disabled */
- if (!iso_pi(sk)->qos.in.phy && !iso_pi(sk)->qos.out.phy) {
+ if (!iso_pi(sk)->unicast_qos.in.phy && !iso_pi(sk)->unicast_qos.out.phy) {
err = -EINVAL;
goto unlock;
}
@@ -346,7 +349,7 @@ static int iso_connect_cis(struct sock *sk)
if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) {
hcon = hci_bind_cis(hdev, &iso_pi(sk)->dst,
le_addr_type(iso_pi(sk)->dst_type),
- &iso_pi(sk)->qos);
+ &iso_pi(sk)->unicast_qos);
if (IS_ERR(hcon)) {
err = PTR_ERR(hcon);
goto unlock;
@@ -354,7 +357,7 @@ static int iso_connect_cis(struct sock *sk)
} else {
hcon = hci_connect_cis(hdev, &iso_pi(sk)->dst,
le_addr_type(iso_pi(sk)->dst_type),
- &iso_pi(sk)->qos);
+ &iso_pi(sk)->unicast_qos);
if (IS_ERR(hcon)) {
err = PTR_ERR(hcon);
goto unlock;
@@ -400,24 +403,40 @@ static int iso_connect_cis(struct sock *sk)
return err;
}
-static struct bt_iso_qos *iso_sock_get_qos(struct sock *sk)
+static struct bt_iso_unicast_qos *iso_sock_get_unicast_qos(struct sock *sk)
{
if (sk->sk_state == BT_CONNECTED || sk->sk_state == BT_CONNECT2)
- return &iso_pi(sk)->conn->hcon->iso_qos;
+ return &iso_pi(sk)->conn->hcon->iso_unicast_qos;
- return &iso_pi(sk)->qos;
+ return &iso_pi(sk)->unicast_qos;
}
-static int iso_send_frame(struct sock *sk, struct sk_buff *skb)
+static struct bt_iso_bcast_sink_qos *iso_sock_get_bcast_sink_qos(struct sock *sk)
+{
+ if (sk->sk_state == BT_CONNECTED || sk->sk_state == BT_CONNECT2)
+ return &iso_pi(sk)->conn->hcon->iso_sink_qos;
+
+ return &iso_pi(sk)->sink_qos;
+}
+
+static struct bt_iso_bcast_source_qos *iso_sock_get_bcast_source_qos(struct sock *sk)
+{
+ if (sk->sk_state == BT_CONNECTED || sk->sk_state == BT_CONNECT2)
+ return &iso_pi(sk)->conn->hcon->iso_source_qos;
+
+ return &iso_pi(sk)->source_qos;
+}
+
+static int iso_send_frame(struct sock *sk, struct sk_buff *skb,
+ struct bt_iso_io_qos *out)
{
struct iso_conn *conn = iso_pi(sk)->conn;
- struct bt_iso_qos *qos = iso_sock_get_qos(sk);
struct hci_iso_data_hdr *hdr;
int len = 0;
BT_DBG("sk %p len %d", sk, skb->len);
- if (skb->len > qos->out.sdu)
+ if (skb->len > out->sdu)
return -EMSGSIZE;
len = skb->len;
@@ -679,7 +698,7 @@ static struct proto iso_proto = {
.rtn = 2u, \
}
-static struct bt_iso_qos default_qos = {
+static struct bt_iso_unicast_qos default_unicast_qos = {
.cig = BT_ISO_QOS_CIG_UNSET,
.cis = BT_ISO_QOS_CIS_UNSET,
.sca = 0x00,
@@ -689,6 +708,30 @@ static struct bt_iso_qos default_qos = {
.out = DEFAULT_IO_QOS,
};
+static struct bt_iso_bcast_sink_qos default_sink_qos = {
+ .options = 0x00,
+ .skip = 0x0000,
+ .sync_timeout = 0x4000,
+ .sync_cte_type = 0x0000,
+ .big = BT_ISO_QOS_BIG_UNSET,
+ .encryption = 0x00,
+ .bcode = {0x00},
+ .mse = 0x00,
+ .timeout = 0x4000,
+ .in = DEFAULT_IO_QOS,
+};
+
+static struct bt_iso_bcast_source_qos default_source_qos = {
+ .sync_interval = 0x07,
+ .big = BT_ISO_QOS_BIG_UNSET,
+ .bis = BT_ISO_QOS_BIS_UNSET,
+ .packing = 0x00,
+ .framing = 0x00,
+ .encryption = 0x00,
+ .bcode = {0x00},
+ .out = DEFAULT_IO_QOS,
+};
+
static struct sock *iso_sock_alloc(struct net *net, struct socket *sock,
int proto, gfp_t prio, int kern)
{
@@ -712,7 +755,9 @@ static struct sock *iso_sock_alloc(struct net *net, struct socket *sock,
/* Set address type as public as default src address is BDADDR_ANY */
iso_pi(sk)->src_type = BDADDR_LE_PUBLIC;
- iso_pi(sk)->qos = default_qos;
+ iso_pi(sk)->unicast_qos = default_unicast_qos;
+ iso_pi(sk)->sink_qos = default_sink_qos;
+ iso_pi(sk)->source_qos = default_source_qos;
bt_sock_link(&iso_sk_list, sk);
return sk;
@@ -895,7 +940,7 @@ static int iso_listen_bis(struct sock *sk)
err = hci_pa_create_sync(hdev, &iso_pi(sk)->dst,
le_addr_type(iso_pi(sk)->dst_type),
- iso_pi(sk)->bc_sid);
+ iso_pi(sk)->bc_sid, &iso_pi(sk)->sink_qos);
hci_dev_put(hdev);
@@ -1086,10 +1131,15 @@ static int iso_sock_sendmsg(struct socket *sock, struct msghdr *msg,
lock_sock(sk);
- if (sk->sk_state == BT_CONNECTED)
- err = iso_send_frame(sk, skb);
- else
+ if (sk->sk_state == BT_CONNECTED) {
+ if (bacmp(&conn->hcon->dst, BDADDR_ANY))
+ err = iso_send_frame(sk, skb, &iso_sock_get_unicast_qos(sk)->out);
+ else
+ err = iso_send_frame(sk, skb,
+ &iso_sock_get_bcast_source_qos(sk)->out);
+ } else {
err = -ENOTCONN;
+ }
release_sock(sk);
@@ -1154,7 +1204,7 @@ static bool check_io_qos(struct bt_iso_io_qos *qos)
return true;
}
-static bool check_qos(struct bt_iso_qos *qos)
+static bool check_unicast_qos(struct bt_iso_unicast_qos *qos)
{
if (qos->sca > 0x07)
return false;
@@ -1174,12 +1224,60 @@ static bool check_qos(struct bt_iso_qos *qos)
return true;
}
+static bool check_bcast_sink_qos(struct bt_iso_bcast_sink_qos *qos)
+{
+ if (qos->options > 0x07)
+ return false;
+
+ if (qos->skip > 0x01f3)
+ return false;
+
+ if (qos->sync_timeout < 0x000a || qos->sync_timeout > 0x4000)
+ return false;
+
+ if (qos->sync_cte_type > 0x1f)
+ return false;
+
+ if (qos->encryption > 0x01)
+ return false;
+
+ if (qos->mse > 0x1f)
+ return false;
+
+ if (qos->timeout < 0x000a || qos->timeout > 0x4000)
+ return false;
+
+ if (!check_io_qos(&qos->in))
+ return false;
+
+ return true;
+}
+
+static bool check_bcast_source_qos(struct bt_iso_bcast_source_qos *qos)
+{
+ if (qos->sync_interval > 0x07)
+ return false;
+
+ if (qos->packing > 0x01)
+ return false;
+
+ if (qos->framing > 0x01)
+ return false;
+
+ if (qos->encryption > 0x01)
+ return false;
+
+ if (!check_io_qos(&qos->out))
+ return false;
+
+ return true;
+}
+
static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
sockptr_t optval, unsigned int optlen)
{
struct sock *sk = sock->sk;
int len, err = 0;
- struct bt_iso_qos qos;
u32 opt;
BT_DBG("sk %p", sk);
@@ -1204,32 +1302,96 @@ static int iso_sock_setsockopt(struct socket *sock, int level, int optname,
clear_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags);
break;
- case BT_ISO_QOS:
+ case BT_ISO_UNICAST_QOS:
+ struct bt_iso_unicast_qos unicast_qos;
+
+ if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND &&
+ sk->sk_state != BT_CONNECT2) {
+ err = -EINVAL;
+ break;
+ }
+
+ len = min_t(unsigned int, sizeof(unicast_qos), optlen);
+ if (len != sizeof(unicast_qos)) {
+ err = -EINVAL;
+ break;
+ }
+
+ memset(&unicast_qos, 0, sizeof(unicast_qos));
+
+ if (copy_from_sockptr(&unicast_qos, optval, len)) {
+ err = -EFAULT;
+ break;
+ }
+
+ if (!check_unicast_qos(&unicast_qos)) {
+ err = -EINVAL;
+ break;
+ }
+
+ iso_pi(sk)->unicast_qos = unicast_qos;
+
+ break;
+
+ case BT_ISO_BCAST_SINK_QOS:
+ struct bt_iso_bcast_sink_qos sink_qos;
+
if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND &&
sk->sk_state != BT_CONNECT2) {
err = -EINVAL;
break;
}
- len = min_t(unsigned int, sizeof(qos), optlen);
- if (len != sizeof(qos)) {
+ len = min_t(unsigned int, sizeof(sink_qos), optlen);
+ if (len != sizeof(sink_qos)) {
err = -EINVAL;
break;
}
- memset(&qos, 0, sizeof(qos));
+ memset(&sink_qos, 0, sizeof(sink_qos));
- if (copy_from_sockptr(&qos, optval, len)) {
+ if (copy_from_sockptr(&sink_qos, optval, len)) {
err = -EFAULT;
break;
}
- if (!check_qos(&qos)) {
+ if (!check_bcast_sink_qos(&sink_qos)) {
err = -EINVAL;
break;
}
- iso_pi(sk)->qos = qos;
+ iso_pi(sk)->sink_qos = sink_qos;
+
+ break;
+
+ case BT_ISO_BCAST_SOURCE_QOS:
+ struct bt_iso_bcast_source_qos source_qos;
+
+ if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND &&
+ sk->sk_state != BT_CONNECT2) {
+ err = -EINVAL;
+ break;
+ }
+
+ len = min_t(unsigned int, sizeof(source_qos), optlen);
+ if (len != sizeof(source_qos)) {
+ err = -EINVAL;
+ break;
+ }
+
+ memset(&source_qos, 0, sizeof(source_qos));
+
+ if (copy_from_sockptr(&source_qos, optval, len)) {
+ err = -EFAULT;
+ break;
+ }
+
+ if (!check_bcast_source_qos(&source_qos)) {
+ err = -EINVAL;
+ break;
+ }
+
+ iso_pi(sk)->source_qos = source_qos;
break;
@@ -1270,7 +1432,6 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
int len, err = 0;
- struct bt_iso_qos *qos;
u8 base_len;
u8 *base;
@@ -1294,11 +1455,29 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname,
break;
- case BT_ISO_QOS:
- qos = iso_sock_get_qos(sk);
+ case BT_ISO_UNICAST_QOS:
+ struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
+
+ len = min_t(unsigned int, len, sizeof(*unicast_qos));
+ if (copy_to_user(optval, unicast_qos, len))
+ err = -EFAULT;
+
+ break;
+
+ case BT_ISO_BCAST_SINK_QOS:
+ struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
+
+ len = min_t(unsigned int, len, sizeof(*sink_qos));
+ if (copy_to_user(optval, sink_qos, len))
+ err = -EFAULT;
+
+ break;
+
+ case BT_ISO_BCAST_SOURCE_QOS:
+ struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
- len = min_t(unsigned int, len, sizeof(*qos));
- if (copy_to_user(optval, qos, len))
+ len = min_t(unsigned int, len, sizeof(*source_qos));
+ if (copy_to_user(optval, source_qos, len))
err = -EFAULT;
break;
@@ -1419,7 +1598,7 @@ static bool iso_match_big(struct sock *sk, void *data)
{
struct hci_evt_le_big_sync_estabilished *ev = data;
- return ev->handle == iso_pi(sk)->qos.big;
+ return ev->handle == iso_pi(sk)->sink_qos.big;
}
static void iso_conn_ready(struct iso_conn *conn)
@@ -1550,7 +1729,7 @@ int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags)
iso_pi(sk)->bc_num_bis = ev2->num_bis;
err = hci_le_big_create_sync(hdev,
- &iso_pi(sk)->qos,
+ &iso_pi(sk)->sink_qos,
iso_pi(sk)->sync_handle,
iso_pi(sk)->bc_num_bis,
iso_pi(sk)->bc_bis);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: Split bt_iso_qos into dedicated structures
2023-03-20 14:36 [PATCH 1/1] Bluetooth: " Iulia Tanasescu
@ 2023-03-20 15:03 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2023-03-20 15:03 UTC (permalink / raw)
To: linux-bluetooth, iulia.tanasescu
[-- Attachment #1: Type: text/plain, Size: 20702 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=731871
---Test result---
Test Summary:
CheckPatch PASS 2.07 seconds
GitLint PASS 0.27 seconds
SubjectPrefix PASS 0.07 seconds
BuildKernel FAIL 44.02 seconds
CheckAllWarning FAIL 48.17 seconds
CheckSparse FAIL 53.05 seconds
CheckSmatch FAIL 141.54 seconds
BuildKernel32 FAIL 42.20 seconds
TestRunnerSetup FAIL 619.41 seconds
TestRunner_l2cap-tester FAIL 0.10 seconds
TestRunner_iso-tester FAIL 0.10 seconds
TestRunner_bnep-tester FAIL 0.10 seconds
TestRunner_mgmt-tester FAIL 0.11 seconds
TestRunner_rfcomm-tester FAIL 0.10 seconds
TestRunner_sco-tester FAIL 0.11 seconds
TestRunner_ioctl-tester FAIL 0.11 seconds
TestRunner_mesh-tester FAIL 0.10 seconds
TestRunner_smp-tester FAIL 0.10 seconds
TestRunner_userchan-tester FAIL 0.10 seconds
IncrementalBuild FAIL 38.91 seconds
Details
##############################
Test: BuildKernel - FAIL
Desc: Build Kernel for Bluetooth
Output:
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: CheckAllWarning - FAIL
Desc: Run linux kernel with all warning enabled
Output:
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: CheckSparse - FAIL
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/af_bluetooth.c:178:25: warning: context imbalance in 'bt_accept_enqueue' - different lock contexts for basic block
drivers/bluetooth/hci_ag6xx.c:257:24: warning: restricted __le32 degrades to integer
net/bluetooth/hci_conn.c:2095:18: warning: incorrect type in assignment (different base types)
net/bluetooth/hci_conn.c:2095:18: expected restricted __le16 [usertype] skip
net/bluetooth/hci_conn.c:2095:18: got unsigned short [usertype] skip
net/bluetooth/hci_conn.c:2096:26: warning: incorrect type in assignment (different base types)
net/bluetooth/hci_conn.c:2096:26: expected restricted __le16 [usertype] sync_timeout
net/bluetooth/hci_conn.c:2096:26: got unsigned short [usertype] sync_timeout
net/bluetooth/hci_conn.c:2126:24: warning: incorrect type in assignment (different base types)
net/bluetooth/hci_conn.c:2126:24: expected restricted __le16 [addressable] [assigned] [usertype] timeout
net/bluetooth/hci_conn.c:2126:24: got unsigned short [usertype] timeout
drivers/bluetooth/hci_mrvl.c:170:23: warning: restricted __le16 degrades to integer
drivers/bluetooth/hci_mrvl.c:203:23: warning: restricted __le16 degrades to integer
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
./include/net/bluetooth/hci.h:2638:47: warning: array of flexible structures
./include/net/bluetooth/hci.h:2724:43: warning: array of flexible structures
drivers/bluetooth/btmtksdio.c:557:63: warning: Using plain integer as NULL pointer
drivers/bluetooth/btmtksdio.c:579:55: warning: Using plain integer as NULL pointer
drivers/bluetooth/btmtksdio.c:611:63: warning: Using plain integer as NULL pointer
drivers/bluetooth/btmtksdio.c:624:63: warning: Using plain integer as NULL pointer
drivers/bluetooth/btrtl.c: note: in included file:
drivers/bluetooth/btrtl.h:52:45: warning: array of flexible structures
drivers/bluetooth/btqca.c:637:24: warning: restricted __le32 degrades to integer
drivers/bluetooth/hci_nokia.c:284:23: warning: incorrect type in assignment (different base types)
drivers/bluetooth/hci_nokia.c:284:23: expected unsigned short [usertype] baud
drivers/bluetooth/hci_nokia.c:284:23: got restricted __le16 [usertype]
drivers/bluetooth/hci_nokia.c:287:26: warning: incorrect type in assignment (different base types)
drivers/bluetooth/hci_nokia.c:287:26: expected unsigned short [usertype] sys_clk
drivers/bluetooth/hci_nokia.c:287:26: got restricted __le16 [usertype]
net/bluetooth/hci_codec.c: note: in included file:
./include/net/bluetooth/hci_core.h:149:35: warning: array of flexible structures
net/bluetooth/sco.c: note: in included file:
./include/net/bluetooth/hci_core.h:149:35: warning: array of flexible structures
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: CheckSmatch - FAIL
Desc: Run smatch tool with source
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):
./include/net/bluetooth/hci.h:2638:47: warning: array of flexible structures
./include/net/bluetooth/hci.h:2724:43: warning: array of flexible structures
drivers/bluetooth/btrtl.c: note: in included file:
drivers/bluetooth/btrtl.h:52:45: warning: array of flexible structures
net/bluetooth/hci_codec.c: note: in included file:
./include/net/bluetooth/hci_core.h:149:35: warning: array of flexible structures
net/bluetooth/sco.c: note: in included file:
./include/net/bluetooth/hci_core.h:149:35: warning: array of flexible structures
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: BuildKernel32 - FAIL
Desc: Build 32bit Kernel for Bluetooth
Output:
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: TestRunnerSetup - FAIL
Desc: Setup kernel and bluez for test-runner
Output:
Kernel:
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
##############################
Test: TestRunner_l2cap-tester - FAIL
Desc: Run l2cap-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_bnep-tester - FAIL
Desc: Run bnep-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_rfcomm-tester - FAIL
Desc: Run rfcomm-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_ioctl-tester - FAIL
Desc: Run ioctl-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_smp-tester - FAIL
Desc: Run smp-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: TestRunner_userchan-tester - FAIL
Desc: Run userchan-tester with test-runner
Output:
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory
qemu-system-x86_64: Back to tcg accelerator
qemu: could not open kernel file '/github/workspace/src/src/arch/x86/boot/bzImage': No such file or directory
##############################
Test: IncrementalBuild - FAIL
Desc: Incremental build with the patches in the series
Output:
[1/1] Bluetooth: Split bt_iso_qos into dedicated structures
net/bluetooth/iso.c: In function ‘iso_sock_setsockopt’:
net/bluetooth/iso.c:1306:3: error: a label can only be part of a statement and a declaration is not a statement
1306 | struct bt_iso_unicast_qos unicast_qos;
| ^~~~~~
net/bluetooth/iso.c:1337:3: error: a label can only be part of a statement and a declaration is not a statement
1337 | struct bt_iso_bcast_sink_qos sink_qos;
| ^~~~~~
net/bluetooth/iso.c:1368:3: error: a label can only be part of a statement and a declaration is not a statement
1368 | struct bt_iso_bcast_source_qos source_qos;
| ^~~~~~
net/bluetooth/iso.c: In function ‘iso_sock_getsockopt’:
net/bluetooth/iso.c:1459:3: error: a label can only be part of a statement and a declaration is not a statement
1459 | struct bt_iso_unicast_qos *unicast_qos = iso_sock_get_unicast_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1468:3: error: a label can only be part of a statement and a declaration is not a statement
1468 | struct bt_iso_bcast_sink_qos *sink_qos = iso_sock_get_bcast_sink_qos(sk);
| ^~~~~~
net/bluetooth/iso.c:1477:3: error: a label can only be part of a statement and a declaration is not a statement
1477 | struct bt_iso_bcast_source_qos *source_qos = iso_sock_get_bcast_source_qos(sk);
| ^~~~~~
make[3]: *** [scripts/Makefile.build:252: net/bluetooth/iso.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [scripts/Makefile.build:504: net/bluetooth] Error 2
make[1]: *** [scripts/Makefile.build:504: net] Error 2
make: *** [Makefile:2021: .] Error 2
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-31 17:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-28 7:26 [PATCH BlueZ v2 0/1] Split bt_iso_qos into dedicated structures Iulia Tanasescu
2023-03-28 7:26 ` [PATCH BlueZ v2 1/1] " Iulia Tanasescu
2023-03-28 8:46 ` bluez.test.bot
-- strict thread matches above, loose matches on Subject: below --
2023-03-31 15:39 [PATCH BlueZ v3 1/1] " Iulia Tanasescu
2023-03-31 17:10 ` bluez.test.bot
2023-03-27 13:46 [PATCH BlueZ 1/1] " Iulia Tanasescu
2023-03-27 15:19 ` bluez.test.bot
2023-03-20 14:37 [PATCH BlueZ 1/8] btio: Use unicast structure for ISO QoS options Iulia Tanasescu
2023-03-20 15:11 ` Split bt_iso_qos into dedicated structures bluez.test.bot
2023-03-20 14:36 [PATCH 1/1] Bluetooth: " Iulia Tanasescu
2023-03-20 15:03 ` bluez.test.bot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.