aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-04-17 08:00:52 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-04-17 23:26:25 -0400
commitd2c5d77fff6ac0f43fc36f4fde020f726f773c1d (patch)
tree17219324bd7af41a4df3edc194f020c80777eab7 /net/bluetooth
parentcad718ed2f6fd204b2c5cac6b611fc3fcde7b183 (diff)
Bluetooth: Add reading of all local feature pages
With the introduction of CSA4 there is now also a features page number 2 available. This patch increments the maximum supported page number to 2 and adds code for reading all available pages (as long as we have support for them - indicated by HCI_MAX_PAGES). Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c10
-rw-r--r--net/bluetooth/hci_event.c2
2 files changed, 12 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 9570358adb77..e246d3782ac2 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -589,6 +589,7 @@ static void hci_set_le_support(struct hci_request *req)
589static void hci_init3_req(struct hci_request *req, unsigned long opt) 589static void hci_init3_req(struct hci_request *req, unsigned long opt)
590{ 590{
591 struct hci_dev *hdev = req->hdev; 591 struct hci_dev *hdev = req->hdev;
592 u8 p;
592 593
593 if (hdev->commands[5] & 0x10) 594 if (hdev->commands[5] & 0x10)
594 hci_setup_link_policy(req); 595 hci_setup_link_policy(req);
@@ -597,6 +598,15 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
597 hci_set_le_support(req); 598 hci_set_le_support(req);
598 hci_update_ad(req); 599 hci_update_ad(req);
599 } 600 }
601
602 /* Read features beyond page 1 if available */
603 for (p = 2; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) {
604 struct hci_cp_read_local_ext_features cp;
605
606 cp.page = p;
607 hci_req_add(req, HCI_OP_READ_LOCAL_EXT_FEATURES,
608 sizeof(cp), &cp);
609 }
600} 610}
601 611
602static int __hci_init(struct hci_dev *hdev) 612static int __hci_init(struct hci_dev *hdev)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 8adc3915ece4..3b2c0e07b25b 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -544,6 +544,8 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
544 if (rp->status) 544 if (rp->status)
545 return; 545 return;
546 546
547 hdev->max_page = rp->max_page;
548
547 if (rp->page < HCI_MAX_PAGES) 549 if (rp->page < HCI_MAX_PAGES)
548 memcpy(hdev->features[rp->page], rp->features, 8); 550 memcpy(hdev->features[rp->page], rp->features, 8);
549} 551}