diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-10-18 15:04:47 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-10-19 09:22:52 -0400 |
commit | 57af75a8cfec8e3c338a8542e54fe26376ea14cf (patch) | |
tree | d43c42ee0a98a599205b2b2ba3fb0a1cf20428f6 /net | |
parent | dfb826a8b07f23ca31156979a7effec7b1f1daa8 (diff) |
Bluetooth: Add workaround for buggy max_page features page value
Some controllers list the max_page value from the extended features
response as 0 when SSP has not yet been enabled. To workaround this
issue, force the max_page value to 1 when SSP support has been
detected.
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 | 8 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 47fcb4983dbb..e445f353353e 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
@@ -834,6 +834,14 @@ static void hci_init2_req(struct hci_request *req, unsigned long opt) | |||
834 | hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); | 834 | hci_req_add(req, HCI_OP_READ_LOCAL_COMMANDS, 0, NULL); |
835 | 835 | ||
836 | if (lmp_ssp_capable(hdev)) { | 836 | if (lmp_ssp_capable(hdev)) { |
837 | /* When SSP is available, then the host features page | ||
838 | * should also be available as well. However some | ||
839 | * controllers list the max_page as 0 as long as SSP | ||
840 | * has not been enabled. To achieve proper debugging | ||
841 | * output, force the minimum max_page to 1 at least. | ||
842 | */ | ||
843 | hdev->max_page = 0x01; | ||
844 | |||
837 | if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) { | 845 | if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) { |
838 | u8 mode = 0x01; | 846 | u8 mode = 0x01; |
839 | hci_req_add(req, HCI_OP_WRITE_SSP_MODE, | 847 | hci_req_add(req, HCI_OP_WRITE_SSP_MODE, |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index e43de9876aa0..c171c0798499 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -555,7 +555,8 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev, | |||
555 | if (rp->status) | 555 | if (rp->status) |
556 | return; | 556 | return; |
557 | 557 | ||
558 | hdev->max_page = rp->max_page; | 558 | if (hdev->max_page < rp->max_page) |
559 | hdev->max_page = rp->max_page; | ||
559 | 560 | ||
560 | if (rp->page < HCI_MAX_PAGES) | 561 | if (rp->page < HCI_MAX_PAGES) |
561 | memcpy(hdev->features[rp->page], rp->features, 8); | 562 | memcpy(hdev->features[rp->page], rp->features, 8); |