2022-11-16 06:28:03

by K, Kiran

[permalink] [raw]
Subject: [PATCH v2 1/2] Bluetooth: Remove codec id field in vendor codec definition

From: Chethan T N <[email protected]>

As per the specfication vendor codec id is defined.
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2127

Signed-off-by: Chethan T N <[email protected]>
Signed-off-by: Kiran K <[email protected]>
---
Notes:
Changes in v2:
- Fix commit message format

include/net/bluetooth/hci.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 7a8a19bef92c..8d773b042c85 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1455,7 +1455,6 @@ struct hci_std_codecs_v2 {
} __packed;

struct hci_vnd_codec_v2 {
- __u8 id;
__le16 cid;
__le16 vid;
__u8 transport;
--
2.17.1



2022-11-16 06:28:28

by K, Kiran

[permalink] [raw]
Subject: [PATCH v2 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2

From: Chethan T N <[email protected]>

Handling of Read Local Supported Codecs was broken during the
HCI serialization design change patches.

Fixes: d0b137062b2d ("Bluetooth: hci_sync: Rework init stages")
Signed-off-by: Chethan T N <[email protected]>
Signed-off-by: Kiran K <[email protected]>
---
Notes:
changes in v2:
- Fix commit message format

net/bluetooth/hci_codec.c | 19 ++++++++++---------
net/bluetooth/hci_sync.c | 10 ++++++----
2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/net/bluetooth/hci_codec.c b/net/bluetooth/hci_codec.c
index 38201532f58e..3cc135bb1d30 100644
--- a/net/bluetooth/hci_codec.c
+++ b/net/bluetooth/hci_codec.c
@@ -72,9 +72,8 @@ static void hci_read_codec_capabilities(struct hci_dev *hdev, __u8 transport,
continue;
}

- skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_CODEC_CAPS,
- sizeof(*cmd), cmd,
- HCI_CMD_TIMEOUT);
+ skb = __hci_cmd_sync_sk(hdev, HCI_OP_READ_LOCAL_CODEC_CAPS,
+ sizeof(*cmd), cmd, 0, HCI_CMD_TIMEOUT, NULL);
if (IS_ERR(skb)) {
bt_dev_err(hdev, "Failed to read codec capabilities (%ld)",
PTR_ERR(skb));
@@ -127,8 +126,8 @@ void hci_read_supported_codecs(struct hci_dev *hdev)
struct hci_op_read_local_codec_caps caps;
__u8 i;

- skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_CODECS, 0, NULL,
- HCI_CMD_TIMEOUT);
+ skb = __hci_cmd_sync_sk(hdev, HCI_OP_READ_LOCAL_CODECS, 0, NULL,
+ 0, HCI_CMD_TIMEOUT, NULL);

if (IS_ERR(skb)) {
bt_dev_err(hdev, "Failed to read local supported codecs (%ld)",
@@ -158,7 +157,8 @@ void hci_read_supported_codecs(struct hci_dev *hdev)
for (i = 0; i < std_codecs->num; i++) {
caps.id = std_codecs->codec[i];
caps.direction = 0x00;
- hci_read_codec_capabilities(hdev, LOCAL_CODEC_ACL_MASK, &caps);
+ hci_read_codec_capabilities(hdev,
+ LOCAL_CODEC_ACL_MASK | LOCAL_CODEC_SCO_MASK, &caps);
}

skb_pull(skb, flex_array_size(std_codecs, codec, std_codecs->num)
@@ -178,7 +178,8 @@ void hci_read_supported_codecs(struct hci_dev *hdev)
caps.cid = vnd_codecs->codec[i].cid;
caps.vid = vnd_codecs->codec[i].vid;
caps.direction = 0x00;
- hci_read_codec_capabilities(hdev, LOCAL_CODEC_ACL_MASK, &caps);
+ hci_read_codec_capabilities(hdev,
+ LOCAL_CODEC_ACL_MASK | LOCAL_CODEC_SCO_MASK, &caps);
}

error:
@@ -194,8 +195,8 @@ void hci_read_supported_codecs_v2(struct hci_dev *hdev)
struct hci_op_read_local_codec_caps caps;
__u8 i;

- skb = __hci_cmd_sync(hdev, HCI_OP_READ_LOCAL_CODECS_V2, 0, NULL,
- HCI_CMD_TIMEOUT);
+ skb = __hci_cmd_sync_sk(hdev, HCI_OP_READ_LOCAL_CODECS_V2, 0, NULL,
+ 0, HCI_CMD_TIMEOUT, NULL);

if (IS_ERR(skb)) {
bt_dev_err(hdev, "Failed to read local supported codecs (%ld)",
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index d36d72352059..9e2d7e4b850c 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -12,6 +12,7 @@
#include <net/bluetooth/mgmt.h>

#include "hci_request.h"
+#include "hci_codec.h"
#include "hci_debugfs.h"
#include "smp.h"
#include "eir.h"
@@ -4257,11 +4258,12 @@ static int hci_set_event_mask_page_2_sync(struct hci_dev *hdev)
/* Read local codec list if the HCI command is supported */
static int hci_read_local_codecs_sync(struct hci_dev *hdev)
{
- if (!(hdev->commands[29] & 0x20))
- return 0;
+ if (hdev->commands[45] & 0x04)
+ hci_read_supported_codecs_v2(hdev);
+ else if (hdev->commands[29] & 0x20)
+ hci_read_supported_codecs(hdev);

- return __hci_cmd_sync_status(hdev, HCI_OP_READ_LOCAL_CODECS, 0, NULL,
- HCI_CMD_TIMEOUT);
+ return 0;
}

/* Read local pairing options if the HCI command is supported */
--
2.17.1


2022-11-16 07:27:08

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2,1/2] Bluetooth: Remove codec id field in vendor codec definition

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=695805

---Test result---

Test Summary:
CheckPatch PASS 3.39 seconds
GitLint PASS 2.01 seconds
SubjectPrefix PASS 1.70 seconds
BuildKernel PASS 35.36 seconds
BuildKernel32 PASS 31.71 seconds
Incremental Build with patchesPASS 55.47 seconds
TestRunner: Setup PASS 528.98 seconds
TestRunner: l2cap-tester PASS 17.63 seconds
TestRunner: iso-tester PASS 17.38 seconds
TestRunner: bnep-tester PASS 6.74 seconds
TestRunner: mgmt-tester PASS 108.48 seconds
TestRunner: rfcomm-tester PASS 10.64 seconds
TestRunner: sco-tester PASS 10.09 seconds
TestRunner: ioctl-tester PASS 11.46 seconds
TestRunner: mesh-tester PASS 8.16 seconds
TestRunner: smp-tester PASS 10.10 seconds
TestRunner: userchan-tester PASS 7.03 seconds



---
Regards,
Linux Bluetooth

2022-11-18 04:18:03

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2,1/2] Bluetooth: Remove codec id field in vendor codec definition

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=695805

---Test result---

Test Summary:
CheckPatch PASS 1.47 seconds
GitLint PASS 0.67 seconds
SubjectPrefix PASS 0.24 seconds
BuildKernel PASS 33.65 seconds
BuildKernel32 PASS 30.15 seconds
TestRunnerSetup PASS 420.58 seconds
TestRunner_l2cap-tester PASS 15.75 seconds
TestRunner_iso-tester PASS 15.25 seconds
TestRunner_bnep-tester PASS 5.23 seconds
TestRunner_mgmt-tester PASS 103.28 seconds
TestRunner_rfcomm-tester PASS 9.13 seconds
TestRunner_sco-tester PASS 8.60 seconds
TestRunner_ioctl-tester PASS 9.81 seconds
TestRunner_mesh-tester PASS 6.62 seconds
TestRunner_smp-tester PASS 8.43 seconds
TestRunner_userchan-tester PASS 5.52 seconds
IncrementalBuild PASS 37.42 seconds



---
Regards,
Linux Bluetooth

2022-11-18 05:14:52

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2,1/2] Bluetooth: Remove codec id field in vendor codec definition

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=695805

---Test result---

Test Summary:
CheckPatch PASS 1.53 seconds
GitLint PASS 0.62 seconds
SubjectPrefix PASS 0.18 seconds
BuildKernel PASS 44.23 seconds
BuildKernel32 PASS 39.88 seconds
TestRunnerSetup PASS 560.00 seconds
TestRunner_l2cap-tester PASS 19.19 seconds
TestRunner_iso-tester PASS 20.50 seconds
TestRunner_bnep-tester PASS 6.96 seconds
TestRunner_mgmt-tester PASS 131.26 seconds
TestRunner_rfcomm-tester PASS 11.69 seconds
TestRunner_sco-tester PASS 10.87 seconds
TestRunner_ioctl-tester PASS 12.91 seconds
TestRunner_mesh-tester PASS 8.76 seconds
TestRunner_smp-tester PASS 10.43 seconds
TestRunner_userchan-tester PASS 7.37 seconds
IncrementalBuild PASS 49.28 seconds



---
Regards,
Linux Bluetooth

2022-11-18 06:07:09

by bluez.test.bot

[permalink] [raw]
Subject: RE: [v2,1/2] Bluetooth: Remove codec id field in vendor codec definition

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=695805

---Test result---

Test Summary:
CheckPatch PASS 1.08 seconds
GitLint PASS 0.50 seconds
SubjectPrefix PASS 0.19 seconds
BuildKernel PASS 25.26 seconds
BuildKernel32 PASS 22.63 seconds
TestRunnerSetup PASS 313.62 seconds
TestRunner_l2cap-tester PASS 12.86 seconds
TestRunner_iso-tester PASS 11.44 seconds
TestRunner_bnep-tester PASS 4.03 seconds
TestRunner_mgmt-tester PASS 83.17 seconds
TestRunner_rfcomm-tester PASS 7.31 seconds
TestRunner_sco-tester PASS 6.78 seconds
TestRunner_ioctl-tester PASS 7.52 seconds
TestRunner_mesh-tester PASS 5.07 seconds
TestRunner_smp-tester PASS 6.74 seconds
TestRunner_userchan-tester PASS 4.22 seconds
IncrementalBuild PASS 27.25 seconds



---
Regards,
Linux Bluetooth