diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2014-12-11 14:21:54 -0500 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-12-11 14:42:11 -0500 |
commit | 417287de88bfbb724bab2f50782395d2606b28e1 (patch) | |
tree | 1d8b447174a01bcefa081c78ba0b2bba460da279 /net | |
parent | 5c1a4c8f28059e592da4fff40c0dc54202fb5cc6 (diff) |
Bluetooth: Fix check for support for page scan related commands
The Read Page Scan Activity and Read Page Scan Type commands are not
supported by all controllers. Move the execution of both commands
into the 3rd phase of the init procedure. And then check the bit
mask of supported commands before adding them to the init sequence.
With this re-ordering of the init sequence, the extra check for
AVM BlueFritz! controllers is no longer needed. They will report
that these two commands are not supported.
This fixes an issue with the Microsoft Corp. Wireless Transceiver
for Bluetooth 2.0 (ID 045e:009c).
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/bluetooth/hci_core.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index ecd7c01317bc..cc60465ea774 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -1373,8 +1373,6 @@ static void hci_init1_req(struct hci_request *req, unsigned long opt) | |||
1373 | 1373 | ||
1374 | static void bredr_setup(struct hci_request *req) | 1374 | static void bredr_setup(struct hci_request *req) |
1375 | { | 1375 | { |
1376 | struct hci_dev *hdev = req->hdev; | ||
1377 | |||
1378 | __le16 param; | 1376 | __le16 param; |
1379 | __u8 flt_type; | 1377 | __u8 flt_type; |
1380 | 1378 | ||
@@ -1403,14 +1401,6 @@ static void bredr_setup(struct hci_request *req) | |||
1403 | /* Connection accept timeout ~20 secs */ | 1401 | /* Connection accept timeout ~20 secs */ |
1404 | param = cpu_to_le16(0x7d00); | 1402 | param = cpu_to_le16(0x7d00); |
1405 | hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, ¶m); | 1403 | hci_req_add(req, HCI_OP_WRITE_CA_TIMEOUT, 2, ¶m); |
1406 | |||
1407 | /* AVM Berlin (31), aka "BlueFRITZ!", reports version 1.2, | ||
1408 | * but it does not support page scan related HCI commands. | ||
1409 | */ | ||
1410 | if (hdev->manufacturer != 31 && hdev->hci_ver > BLUETOOTH_VER_1_1) { | ||
1411 | hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL); | ||
1412 | hci_req_add(req, HCI_OP_READ_PAGE_SCAN_TYPE, 0, NULL); | ||
1413 | } | ||
1414 | } | 1404 | } |
1415 | 1405 | ||
1416 | static void le_setup(struct hci_request *req) | 1406 | static void le_setup(struct hci_request *req) |
@@ -1718,6 +1708,16 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt) | |||
1718 | if (hdev->commands[5] & 0x10) | 1708 | if (hdev->commands[5] & 0x10) |
1719 | hci_setup_link_policy(req); | 1709 | hci_setup_link_policy(req); |
1720 | 1710 | ||
1711 | if (hdev->commands[8] & 0x01) | ||
1712 | hci_req_add(req, HCI_OP_READ_PAGE_SCAN_ACTIVITY, 0, NULL); | ||
1713 | |||
1714 | /* Some older Broadcom based Bluetooth 1.2 controllers do not | ||
1715 | * support the Read Page Scan Type command. Check support for | ||
1716 | * this command in the bit mask of supported commands. | ||
1717 | */ | ||
1718 | if (hdev->commands[13] & 0x01) | ||
1719 | hci_req_add(req, HCI_OP_READ_PAGE_SCAN_TYPE, 0, NULL); | ||
1720 | |||
1721 | if (lmp_le_capable(hdev)) { | 1721 | if (lmp_le_capable(hdev)) { |
1722 | u8 events[8]; | 1722 | u8 events[8]; |
1723 | 1723 | ||