aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Guedes <andre.guedes@openbossa.org>2014-07-01 17:10:09 -0400
committerMarcel Holtmann <marcel@holtmann.org>2014-07-03 11:42:55 -0400
commit9193c6e884ae1b403f53ca1370a4b7f8185c547b (patch)
tree8f3e8a43354dd07098a78aceeb10ee2707e32947
parent8e75b46a4f5d2c71b2f3ea632df1b15502514948 (diff)
Bluetooth: Move LE event mask setting into init3 phase
During init2 phase, the LE local features have not be read yet so we aren't able to rely on hdev->le_features to determine if the controller supports the Connection Parameters Request Procedure. For that reason, this patch moves LE event mask setting from init2 into init3 initialization phase. The hdev->le_features mask will be checked by the next patch in order to know if "LE Remote Connection Parameter Request Event" should be enabled. Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/hci_core.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 72eb41424d04..5788e031b869 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1437,13 +1437,6 @@ static void hci_setup_event_mask(struct hci_request *req)
1437 events[7] |= 0x20; /* LE Meta-Event */ 1437 events[7] |= 0x20; /* LE Meta-Event */
1438 1438
1439 hci_req_add(req, HCI_OP_SET_EVENT_MASK, sizeof(events), events); 1439 hci_req_add(req, HCI_OP_SET_EVENT_MASK, sizeof(events), events);
1440
1441 if (lmp_le_capable(hdev)) {
1442 memset(events, 0, sizeof(events));
1443 events[0] = 0x1f;
1444 hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK,
1445 sizeof(events), events);
1446 }
1447} 1440}
1448 1441
1449static void hci_init2_req(struct hci_request *req, unsigned long opt) 1442static void hci_init2_req(struct hci_request *req, unsigned long opt)
@@ -1613,8 +1606,16 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
1613 if (hdev->commands[5] & 0x10) 1606 if (hdev->commands[5] & 0x10)
1614 hci_setup_link_policy(req); 1607 hci_setup_link_policy(req);
1615 1608
1616 if (lmp_le_capable(hdev)) 1609 if (lmp_le_capable(hdev)) {
1610 u8 events[8];
1611
1612 memset(events, 0, sizeof(events));
1613 events[0] = 0x1f;
1614 hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK, sizeof(events),
1615 events);
1616
1617 hci_set_le_support(req); 1617 hci_set_le_support(req);
1618 }
1618 1619
1619 /* Read features beyond page 1 if available */ 1620 /* Read features beyond page 1 if available */
1620 for (p = 2; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) { 1621 for (p = 2; p < HCI_MAX_PAGES && p <= hdev->max_page; p++) {