aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-07-12 17:20:50 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2014-07-13 01:49:04 -0400
commit15a49cca98c3380271ced8db2ea69ee95db5c709 (patch)
tree54f8f84ca54cdd38b72234e5e101c7d2f8fc558d
parentc7e0c14115db67063a5f68fd9d4a12a54e649dc7 (diff)
Bluetooth: Read LE Advertising Channel TX Power only when available
The Read LE Advertising Channel TX Power command is not mandatory for a Bluetooth HCI controller only supporting receiption. Move the command to the third stage of the controller initialization and only execute it when support for it has been indicated. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
-rw-r--r--net/bluetooth/hci_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 347f84fb66f9..b29a984f7dd4 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1348,9 +1348,6 @@ static void le_setup(struct hci_request *req)
1348 /* Read LE Supported States */ 1348 /* Read LE Supported States */
1349 hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL); 1349 hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
1350 1350
1351 /* Read LE Advertising Channel TX Power */
1352 hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
1353
1354 /* Read LE White List Size */ 1351 /* Read LE White List Size */
1355 hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL); 1352 hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL);
1356 1353
@@ -1657,6 +1654,11 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
1657 hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK, sizeof(events), 1654 hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK, sizeof(events),
1658 events); 1655 events);
1659 1656
1657 if (hdev->commands[25] & 0x40) {
1658 /* Read LE Advertising Channel TX Power */
1659 hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
1660 }
1661
1660 hci_set_le_support(req); 1662 hci_set_le_support(req);
1661 } 1663 }
1662 1664