Skip to content

Commit 15a49cc

Browse files
holtmannjhedberg
authored andcommitted
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>
1 parent c7e0c14 commit 15a49cc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎net/bluetooth/hci_core.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,9 +1348,6 @@ static void le_setup(struct hci_request *req)
13481348
/* Read LE Supported States */
13491349
hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
13501350

1351-
/* Read LE Advertising Channel TX Power */
1352-
hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
1353-
13541351
/* Read LE White List Size */
13551352
hci_req_add(req, HCI_OP_LE_READ_WHITE_LIST_SIZE, 0, NULL);
13561353

@@ -1657,6 +1654,11 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
16571654
hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK, sizeof(events),
16581655
events);
16591656

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+
16601662
hci_set_le_support(req);
16611663
}
16621664

0 commit comments

Comments
 (0)