diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 3 | ||||
-rw-r--r-- | net/bluetooth/hci_core.c | 10 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 2 |
3 files changed, 14 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 26822967e29c..80d718a9b31f 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -134,7 +134,7 @@ struct amp_assoc { | |||
134 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | 134 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; |
135 | }; | 135 | }; |
136 | 136 | ||
137 | #define HCI_MAX_PAGES 2 | 137 | #define HCI_MAX_PAGES 3 |
138 | 138 | ||
139 | #define NUM_REASSEMBLY 4 | 139 | #define NUM_REASSEMBLY 4 |
140 | struct hci_dev { | 140 | struct hci_dev { |
@@ -153,6 +153,7 @@ struct hci_dev { | |||
153 | __u8 dev_class[3]; | 153 | __u8 dev_class[3]; |
154 | __u8 major_class; | 154 | __u8 major_class; |
155 | __u8 minor_class; | 155 | __u8 minor_class; |
156 | __u8 max_page; | ||
156 | __u8 features[HCI_MAX_PAGES][8]; | 157 | __u8 features[HCI_MAX_PAGES][8]; |
157 | __u8 le_features[8]; | 158 | __u8 le_features[8]; |
158 | __u8 le_white_list_size; | 159 | __u8 le_white_list_size; |
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) | |||
589 | static void hci_init3_req(struct hci_request *req, unsigned long opt) | 589 | static 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 | ||
602 | static int __hci_init(struct hci_dev *hdev) | 612 | static 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 | } |