Commit 8a595619 authored by Alain Michaud's avatar Alain Michaud Committed by Marcel Holtmann

Bluetooth: fix off by one in err_data_reporting cmd masks.

This change fixes the off by one error in the erroneous command bit
masks which can lead to the erroneous data commands being sent to a
controller that doesn't support them.
Signed-off-by: default avatarAlain Michaud <alainm@chromium.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent bb0084ec
...@@ -603,7 +603,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) ...@@ -603,7 +603,7 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt)
if (hdev->commands[8] & 0x01) if (hdev->commands[8] & 0x01)
hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL); hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL);
if (hdev->commands[18] & 0x02) if (hdev->commands[18] & 0x04)
hci_req_add(req, HCI_OP_READ_DEF_ERR_DATA_REPORTING, 0, NULL); hci_req_add(req, HCI_OP_READ_DEF_ERR_DATA_REPORTING, 0, NULL);
/* Some older Broadcom based Bluetooth 1.2 controllers do not /* Some older Broadcom based Bluetooth 1.2 controllers do not
...@@ -844,7 +844,7 @@ static int hci_init4_req(struct hci_request *req, unsigned long opt) ...@@ -844,7 +844,7 @@ static int hci_init4_req(struct hci_request *req, unsigned long opt)
/* Set erroneous data reporting if supported to the wideband speech /* Set erroneous data reporting if supported to the wideband speech
* setting value * setting value
*/ */
if (hdev->commands[18] & 0x04) { if (hdev->commands[18] & 0x08) {
bool enabled = hci_dev_test_flag(hdev, bool enabled = hci_dev_test_flag(hdev,
HCI_WIDEBAND_SPEECH_ENABLED); HCI_WIDEBAND_SPEECH_ENABLED);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment