All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition
@ 2022-11-22  9:02 Kiran K
  2022-11-22  9:02 ` [PATCH v3 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2 Kiran K
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kiran K @ 2022-11-22  9:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: ravishankar.srivatsa, Chethan T N, Kiran K

From: Chethan T N <chethan.tumkur.narayan@intel.com>

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

Fixes: 9ae664028a9e ("Bluetooth: Add support for Read Local Supported Codecs V2")
Signed-off-by: Chethan T N <chethan.tumkur.narayan@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
changes in v3:
Add "Fixes" tag in commit message

changes in v2:
Fix typo in commit message

 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v3 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2
  2022-11-22  9:02 [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition Kiran K
@ 2022-11-22  9:02 ` Kiran K
  2022-11-22  9:32 ` [v3,1/2] Bluetooth: Remove codec id field in vendor codec definition bluez.test.bot
  2022-12-01 20:00 ` [PATCH v3 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: Kiran K @ 2022-11-22  9:02 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: ravishankar.srivatsa, Chethan T N, Kiran K

From: Chethan T N <chethan.tumkur.narayan@intel.com>

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 <chethan.tumkur.narayan@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
---
changes in v3:
No change

changes in v2:
Fix typo in commit message

 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [v3,1/2] Bluetooth: Remove codec id field in vendor codec definition
  2022-11-22  9:02 [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition Kiran K
  2022-11-22  9:02 ` [PATCH v3 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2 Kiran K
@ 2022-11-22  9:32 ` bluez.test.bot
  2022-12-01 20:00 ` [PATCH v3 1/2] " patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: bluez.test.bot @ 2022-11-22  9:32 UTC (permalink / raw)
  To: linux-bluetooth, kiran.k

[-- Attachment #1: Type: text/plain, Size: 1259 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=697980

---Test result---

Test Summary:
CheckPatch                    PASS      1.36 seconds
GitLint                       PASS      0.57 seconds
SubjectPrefix                 PASS      0.19 seconds
BuildKernel                   PASS      36.61 seconds
BuildKernel32                 PASS      32.50 seconds
TestRunnerSetup               PASS      457.29 seconds
TestRunner_l2cap-tester       PASS      17.07 seconds
TestRunner_iso-tester         PASS      16.82 seconds
TestRunner_bnep-tester        PASS      5.68 seconds
TestRunner_mgmt-tester        PASS      115.63 seconds
TestRunner_rfcomm-tester      PASS      10.54 seconds
TestRunner_sco-tester         PASS      9.60 seconds
TestRunner_ioctl-tester       PASS      11.14 seconds
TestRunner_mesh-tester        PASS      7.59 seconds
TestRunner_smp-tester         PASS      9.83 seconds
TestRunner_userchan-tester    PASS      6.64 seconds
IncrementalBuild              PASS      44.26 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition
  2022-11-22  9:02 [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition Kiran K
  2022-11-22  9:02 ` [PATCH v3 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2 Kiran K
  2022-11-22  9:32 ` [v3,1/2] Bluetooth: Remove codec id field in vendor codec definition bluez.test.bot
@ 2022-12-01 20:00 ` patchwork-bot+bluetooth
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+bluetooth @ 2022-12-01 20:00 UTC (permalink / raw)
  To: Kiran K; +Cc: linux-bluetooth, ravishankar.srivatsa, chethan.tumkur.narayan

Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue, 22 Nov 2022 14:32:56 +0530 you wrote:
> From: Chethan T N <chethan.tumkur.narayan@intel.com>
> 
> As per the specfication vendor codec id is defined.
> BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2127
> 
> Fixes: 9ae664028a9e ("Bluetooth: Add support for Read Local Supported Codecs V2")
> Signed-off-by: Chethan T N <chethan.tumkur.narayan@intel.com>
> Signed-off-by: Kiran K <kiran.k@intel.com>
> 
> [...]

Here is the summary with links:
  - [v3,1/2] Bluetooth: Remove codec id field in vendor codec definition
    https://git.kernel.org/bluetooth/bluetooth-next/c/f0d0a36e32ab
  - [v3,2/2] Bluetooth: Fix support for Read Local Supported Codecs V2
    https://git.kernel.org/bluetooth/bluetooth-next/c/fb77b0482a8a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-01 20:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22  9:02 [PATCH v3 1/2] Bluetooth: Remove codec id field in vendor codec definition Kiran K
2022-11-22  9:02 ` [PATCH v3 2/2] Bluetooth: Fix support for Read Local Supported Codecs V2 Kiran K
2022-11-22  9:32 ` [v3,1/2] Bluetooth: Remove codec id field in vendor codec definition bluez.test.bot
2022-12-01 20:00 ` [PATCH v3 1/2] " patchwork-bot+bluetooth

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.