Bluetooth: hci_sync: Fix hci_read_buffer_size_sync
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 2 Sep 2022 00:24:13 +0000 (17:24 -0700)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 2 Sep 2022 21:01:28 +0000 (14:01 -0700)
hci_read_buffer_size_sync shall not use HCI_OP_LE_READ_BUFFER_SIZE_V2
sinze that is LE specific, instead it is hci_le_read_buffer_size_sync
version that shall use it.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216382
Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_sync.c

index 1877864..fbd5613 100644 (file)
@@ -3018,12 +3018,6 @@ static const struct hci_init_stage amp_init2[] = {
 /* Read Buffer Size (ACL mtu, max pkt, etc.) */
 static int hci_read_buffer_size_sync(struct hci_dev *hdev)
 {
-       /* Use Read LE Buffer Size V2 if supported */
-       if (hdev->commands[41] & 0x20)
-               return __hci_cmd_sync_status(hdev,
-                                            HCI_OP_LE_READ_BUFFER_SIZE_V2,
-                                            0, NULL, HCI_CMD_TIMEOUT);
-
        return __hci_cmd_sync_status(hdev, HCI_OP_READ_BUFFER_SIZE,
                                     0, NULL, HCI_CMD_TIMEOUT);
 }
@@ -3237,6 +3231,12 @@ static const struct hci_init_stage hci_init2[] = {
 /* Read LE Buffer Size */
 static int hci_le_read_buffer_size_sync(struct hci_dev *hdev)
 {
+       /* Use Read LE Buffer Size V2 if supported */
+       if (hdev->commands[41] & 0x20)
+               return __hci_cmd_sync_status(hdev,
+                                            HCI_OP_LE_READ_BUFFER_SIZE_V2,
+                                            0, NULL, HCI_CMD_TIMEOUT);
+
        return __hci_cmd_sync_status(hdev, HCI_OP_LE_READ_BUFFER_SIZE,
                                     0, NULL, HCI_CMD_TIMEOUT);
 }