* [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket
@ 2022-05-06 22:31 Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID Luiz Augusto von Dentz
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-05-06 22:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
v2: Fix CI findings.
v3: Add patch fixing mgmt-tester Read EXP Features tests
Makefile.am | 2 +-
lib/bluetooth.h | 38 +++++++++++++++++++++++++++++++++++++-
lib/iso.h | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 80 insertions(+), 2 deletions(-)
create mode 100644 lib/iso.h
diff --git a/Makefile.am b/Makefile.am
index 82125c482..c7b369606 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -69,7 +69,7 @@ lib_headers = lib/bluetooth.h lib/hci.h lib/hci_lib.h \
lib/sco.h lib/l2cap.h lib/sdp.h lib/sdp_lib.h \
lib/rfcomm.h lib/bnep.h lib/cmtp.h lib/hidp.h
-extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h
+extra_headers = lib/mgmt.h lib/uuid.h lib/a2mp.h lib/amp.h lib/iso.h
extra_sources = lib/uuid.c
local_headers = $(foreach file,$(lib_headers), lib/bluetooth/$(notdir $(file)))
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 0fcf412c6..73297c147 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -37,6 +37,7 @@ extern "C" {
#define BTPROTO_CMTP 5
#define BTPROTO_HIDP 6
#define BTPROTO_AVDTP 7
+#define BTPROTO_ISO 8
#define SOL_HCI 0
#define SOL_L2CAP 6
@@ -140,7 +141,39 @@ struct bt_voice {
#define BT_SCM_PKT_STATUS 0x03
-#define BT_CODEC 19
+#define BT_ISO_QOS 17
+
+#define BT_ISO_QOS_CIG_UNSET 0xff
+#define BT_ISO_QOS_CIS_UNSET 0xff
+
+struct bt_iso_io_qos {
+ uint32_t interval;
+ uint16_t latency;
+ uint16_t sdu;
+ uint8_t phy;
+ 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;
+ };
+ uint8_t packing;
+ uint8_t framing;
+ struct bt_iso_io_qos in;
+ struct bt_iso_io_qos out;
+};
+
+#define BT_CODEC 19
struct bt_codec {
uint8_t id;
uint16_t cid;
@@ -158,6 +191,7 @@ struct bt_codecs {
struct bt_codec codecs[];
} __attribute__((packed));
+
/* Connection and socket states */
enum {
BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */
@@ -171,6 +205,8 @@ enum {
BT_CLOSED
};
+#define BT_ISO_BASE 20
+
/* Byte order conversions */
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htobs(d) (d)
diff --git a/lib/iso.h b/lib/iso.h
new file mode 100644
index 000000000..1e9f79ce5
--- /dev/null
+++ b/lib/iso.h
@@ -0,0 +1,42 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2022 Intel Corporation.
+ *
+ */
+
+#ifndef __ISO_H
+#define __ISO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* ISO defaults */
+#define ISO_DEFAULT_MTU 251
+#define ISO_MAX_NUM_BIS 0x1f
+
+/* ISO socket broadcast address */
+struct sockaddr_iso_bc {
+ bdaddr_t bc_bdaddr;
+ uint8_t bc_bdaddr_type;
+ uint8_t bc_sid;
+ uint8_t bc_num_bis;
+ uint8_t bc_bis[ISO_MAX_NUM_BIS];
+};
+
+/* ISO socket address */
+struct sockaddr_iso {
+ sa_family_t iso_family;
+ bdaddr_t iso_bdaddr;
+ uint8_t iso_bdaddr_type;
+ struct sockaddr_iso_bc iso_bc[];
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __ISO_H */
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID
2022-05-06 22:31 [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Luiz Augusto von Dentz
@ 2022-05-06 22:31 ` Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v2 BlueZ 3/7] adapter: Add support for setting ISO Socket experimental feature Luiz Augusto von Dentz
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-05-06 22:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds BlueZ experimental ISO Socket UUID to uuid128_table so it is
decoded by the likes of btmon.
---
src/shared/util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/shared/util.c b/src/shared/util.c
index 33196bf8b..b74a005ce 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1149,6 +1149,8 @@ static const struct {
{ "330859bc-7506-492d-9370-9a6f0614037f",
"BlueZ Experimental Bluetooth Quality Report" },
{ "a6695ace-ee7f-4fb9-881a-5fac66c629af", "BlueZ Offload Codecs"},
+ { "6fbaf188-05e0-496a-9885-d6ddfdb4e03e",
+ "BlueZ Experimental ISO Socket"},
{ }
};
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 BlueZ 3/7] adapter: Add support for setting ISO Socket experimental feature
2022-05-06 22:31 [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID Luiz Augusto von Dentz
@ 2022-05-06 22:31 ` Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Luiz Augusto von Dentz
2022-05-07 0:41 ` bluez.test.bot
3 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-05-06 22:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds support for setting ISO Socket experimental UUID which
enables the use of BTPROTO_ISO on the system.
---
src/adapter.c | 42 ++++++++++++++++++++++++++++++++++++++++++
src/main.c | 1 +
src/main.conf | 1 +
3 files changed, 44 insertions(+)
diff --git a/src/adapter.c b/src/adapter.c
index db2624c60..1ede58494 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -141,6 +141,13 @@ static const struct mgmt_exp_uuid codec_offload_uuid = {
.str = "a6695ace-ee7f-4fb9-881a-5fac66c629af"
};
+/* 6fbaf188-05e0-496a-9885-d6ddfdb4e03e */
+static const struct mgmt_exp_uuid iso_socket_uuid = {
+ .val = { 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, 0x85, 0x98,
+ 0x6a, 0x49, 0xe0, 0x05, 0x88, 0xf1, 0xba, 0x6f },
+ .str = "6fbaf188-05e0-496a-9885-d6ddfdb4e03e"
+};
+
static DBusConnection *dbus_conn = NULL;
static uint32_t kernel_features = 0;
@@ -9691,6 +9698,40 @@ static void codec_offload_func(struct btd_adapter *adapter, uint8_t action)
btd_error(adapter->dev_id, "Failed to set Codec Offload");
}
+static void iso_socket_complete(uint8_t status, uint16_t len,
+ const void *param, void *user_data)
+{
+ struct btd_adapter *adapter = user_data;
+ uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+
+ if (status != 0) {
+ error("Set ISO Socket failed with status 0x%02x (%s)",
+ status, mgmt_errstr(status));
+ return;
+ }
+
+ DBG("ISO Socket successfully set");
+
+ if (action)
+ queue_push_tail(adapter->exps, (void *)iso_socket_uuid.val);
+}
+
+static void iso_socket_func(struct btd_adapter *adapter, uint8_t action)
+{
+ struct mgmt_cp_set_exp_feature cp;
+
+ memset(&cp, 0, sizeof(cp));
+ memcpy(cp.uuid, iso_socket_uuid.val, 16);
+ cp.action = action;
+
+ if (mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE,
+ MGMT_INDEX_NONE, sizeof(cp), &cp,
+ iso_socket_complete, adapter, NULL) > 0)
+ return;
+
+ btd_error(adapter->dev_id, "Failed to set ISO Socket");
+}
+
static const struct exp_feat {
const struct mgmt_exp_uuid *uuid;
void (*func)(struct btd_adapter *adapter, uint8_t action);
@@ -9701,6 +9742,7 @@ static const struct exp_feat {
EXP_FEAT(&quality_report_uuid, quality_report_func),
EXP_FEAT(&rpa_resolution_uuid, rpa_resolution_func),
EXP_FEAT(&codec_offload_uuid, codec_offload_func),
+ EXP_FEAT(&iso_socket_uuid, iso_socket_func),
};
static void read_exp_features_complete(uint8_t status, uint16_t length,
diff --git a/src/main.c b/src/main.c
index 12cc21372..011d66d5a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -606,6 +606,7 @@ static const char *valid_uuids[] = {
"15c0a148-c273-11ea-b3de-0242ac130004",
"330859bc-7506-492d-9370-9a6f0614037f",
"a6695ace-ee7f-4fb9-881a-5fac66c629af",
+ "6fbaf188-05e0-496a-9885-d6ddfdb4e03e",
"*"
};
diff --git a/src/main.conf b/src/main.conf
index 91b98b8c4..9d0319318 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -120,6 +120,7 @@
# 15c0a148-c273-11ea-b3de-0242ac130004 (BlueZ Experimental LL privacy)
# 330859bc-7506-492d-9370-9a6f0614037f (BlueZ Experimental Bluetooth Quality Report)
# a6695ace-ee7f-4fb9-881a-5fac66c629af (BlueZ Experimental Offload Codecs)
+# 6fbaf188-05e0-496a-9885-d6ddfdb4e03e (BlueZ Experimental ISO socket)
# Defaults to false.
#Experimental = false
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests
2022-05-06 22:31 [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v2 BlueZ 3/7] adapter: Add support for setting ISO Socket experimental feature Luiz Augusto von Dentz
@ 2022-05-06 22:31 ` Luiz Augusto von Dentz
2022-05-07 1:33 ` [v3,BlueZ,1/8] lib: Add definitions for ISO socket bluez.test.bot
2022-05-07 0:41 ` bluez.test.bot
3 siblings, 1 reply; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-05-06 22:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds ISO Socket UUID as response to Read Exp Feature.
---
tools/mgmt-tester.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index e5319d123..bfa5905e0 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -9798,7 +9798,7 @@ static const struct generic_data set_dev_flags_fail_3 = {
};
static const uint8_t read_exp_feat_param_success[] = {
- 0x03, 0x00, /* Feature Count */
+ 0x04, 0x00, /* Feature Count */
0xd6, 0x49, 0xb0, 0xd1, 0x28, 0xeb, /* UUID - Simultaneous */
0x27, 0x92, 0x96, 0x46, 0xc0, 0x42, /* Central Peripheral */
0xb5, 0x10, 0x1b, 0x67,
@@ -9810,7 +9810,11 @@ static const uint8_t read_exp_feat_param_success[] = {
0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */
0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee,
0xce, 0x5a, 0x69, 0xa6,
- 0x00, 0x00, 0x00, 0x00 /* Flags */
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
+ 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */
+ 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05,
+ 0x88, 0xf1, 0xba, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
};
static const struct generic_data read_exp_feat_success = {
@@ -9822,11 +9826,15 @@ static const struct generic_data read_exp_feat_success = {
static const uint8_t read_exp_feat_param_success_index_none[] = {
- 0x01, 0x00, /* Feature Count */
+ 0x02, 0x00, /* Feature Count */
0x1c, 0xda, 0x47, 0x1c, 0x48, 0x6c, /* UUID - Debug */
0x01, 0xab, 0x9f, 0x46, 0xec, 0xb9,
0x30, 0x25, 0x99, 0xd4,
0x00, 0x00, 0x00, 0x00, /* Flags */
+ 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */
+ 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05,
+ 0x88, 0xf1, 0xba, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
};
static const struct generic_data read_exp_feat_success_index_none = {
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* RE: [v3,BlueZ,1/8] lib: Add definitions for ISO socket
2022-05-06 22:31 [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Luiz Augusto von Dentz
` (2 preceding siblings ...)
2022-05-06 22:31 ` [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Luiz Augusto von Dentz
@ 2022-05-07 0:41 ` bluez.test.bot
3 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2022-05-07 0:41 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 998 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=639258
---Test result---
Test Summary:
CheckPatch PASS 4.35 seconds
GitLint PASS 2.96 seconds
Prep - Setup ELL PASS 41.52 seconds
Build - Prep PASS 0.69 seconds
Build - Configure PASS 8.13 seconds
Build - Make PASS 1206.06 seconds
Make Check PASS 11.90 seconds
Make Check w/Valgrind PASS 443.89 seconds
Make Distcheck PASS 232.72 seconds
Build w/ext ELL - Configure PASS 8.41 seconds
Build w/ext ELL - Make PASS 1272.91 seconds
Incremental Build with patchesPASS 3690.84 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [v3,BlueZ,1/8] lib: Add definitions for ISO socket
2022-05-06 22:31 ` [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Luiz Augusto von Dentz
@ 2022-05-07 1:33 ` bluez.test.bot
0 siblings, 0 replies; 7+ messages in thread
From: bluez.test.bot @ 2022-05-07 1:33 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 1000 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=639259
---Test result---
Test Summary:
CheckPatch PASS 5.95 seconds
GitLint PASS 4.07 seconds
Prep - Setup ELL PASS 53.17 seconds
Build - Prep PASS 0.76 seconds
Build - Configure PASS 10.73 seconds
Build - Make PASS 1522.68 seconds
Make Check PASS 12.25 seconds
Make Check w/Valgrind PASS 535.82 seconds
Make Distcheck PASS 282.86 seconds
Build w/ext ELL - Configure PASS 10.65 seconds
Build w/ext ELL - Make PASS 1484.76 seconds
Incremental Build with patchesPASS 6094.60 seconds
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests
2022-05-06 22:32 [PATCH v3 BlueZ 1/8] " Luiz Augusto von Dentz
@ 2022-05-06 22:32 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 7+ messages in thread
From: Luiz Augusto von Dentz @ 2022-05-06 22:32 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This adds ISO Socket UUID as response to Read Exp Feature.
---
tools/mgmt-tester.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index e5319d123..bfa5905e0 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -9798,7 +9798,7 @@ static const struct generic_data set_dev_flags_fail_3 = {
};
static const uint8_t read_exp_feat_param_success[] = {
- 0x03, 0x00, /* Feature Count */
+ 0x04, 0x00, /* Feature Count */
0xd6, 0x49, 0xb0, 0xd1, 0x28, 0xeb, /* UUID - Simultaneous */
0x27, 0x92, 0x96, 0x46, 0xc0, 0x42, /* Central Peripheral */
0xb5, 0x10, 0x1b, 0x67,
@@ -9810,7 +9810,11 @@ static const uint8_t read_exp_feat_param_success[] = {
0xaf, 0x29, 0xc6, 0x66, 0xac, 0x5f, /* UUID - Codec Offload */
0x1a, 0x88, 0xb9, 0x4f, 0x7f, 0xee,
0xce, 0x5a, 0x69, 0xa6,
- 0x00, 0x00, 0x00, 0x00 /* Flags */
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
+ 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */
+ 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05,
+ 0x88, 0xf1, 0xba, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
};
static const struct generic_data read_exp_feat_success = {
@@ -9822,11 +9826,15 @@ static const struct generic_data read_exp_feat_success = {
static const uint8_t read_exp_feat_param_success_index_none[] = {
- 0x01, 0x00, /* Feature Count */
+ 0x02, 0x00, /* Feature Count */
0x1c, 0xda, 0x47, 0x1c, 0x48, 0x6c, /* UUID - Debug */
0x01, 0xab, 0x9f, 0x46, 0xec, 0xb9,
0x30, 0x25, 0x99, 0xd4,
0x00, 0x00, 0x00, 0x00, /* Flags */
+ 0x3e, 0xe0, 0xb4, 0xfd, 0xdd, 0xd6, /* UUID - ISO Socket */
+ 0x85, 0x98, 0x6a, 0x49, 0xe0, 0x05,
+ 0x88, 0xf1, 0xba, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, /* Flags */
};
static const struct generic_data read_exp_feat_success_index_none = {
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-05-07 1:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 22:31 [PATCH v3 BlueZ 1/8] lib: Add definitions for ISO socket Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 2/8] shared/util: Decode BlueZ Experimental ISO Socket UUID Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v2 BlueZ 3/7] adapter: Add support for setting ISO Socket experimental feature Luiz Augusto von Dentz
2022-05-06 22:31 ` [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Luiz Augusto von Dentz
2022-05-07 1:33 ` [v3,BlueZ,1/8] lib: Add definitions for ISO socket bluez.test.bot
2022-05-07 0:41 ` bluez.test.bot
2022-05-06 22:32 [PATCH v3 BlueZ 1/8] " Luiz Augusto von Dentz
2022-05-06 22:32 ` [PATCH v3 BlueZ 3/8] mgmt-tester: Fix Read Exp Feature tests Luiz Augusto von Dentz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).