summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-12-20 16:28:39 +0100
committerJohan Hedberg <johan.hedberg@intel.com>2014-12-20 17:52:01 +0200
commita9f6068e0072839594d246089204644bffd2c988 (patch)
tree1d45a98e713f3f913d3806e61a0772fd233b1054 /net/bluetooth/hci_core.c
parent94a3bd02a6b79b98236d9805a1f95a2857e7696a (diff)
downloadop-kernel-dev-a9f6068e0072839594d246089204644bffd2c988.zip
op-kernel-dev-a9f6068e0072839594d246089204644bffd2c988.tar.gz
Bluetooth: Enable basics for LE Data Length Extension feature
When the controller supports the new LE Data Length Extension feature from Bluetooth 4.2 specification, enable the new events and read the values for default and maxmimum data length supported by the controller. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2db071b..01e35ef 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -805,6 +805,12 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
* Parameter Request
*/
+ /* If the controller supports the Data Length Extension
+ * feature, enable the corresponding event.
+ */
+ if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT)
+ events[0] |= 0x40; /* LE Data Length Change */
+
/* If the controller supports Extended Scanner Filter
* Policies, enable the correspondig event.
*/
@@ -835,6 +841,14 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL);
}
+ if (hdev->le_features[0] & HCI_LE_DATA_LEN_EXT) {
+ /* Read LE Maximum Data Length */
+ hci_req_add(req, HCI_OP_LE_READ_MAX_DATA_LEN, 0, NULL);
+
+ /* Read LE Suggested Default Data Length */
+ hci_req_add(req, HCI_OP_LE_READ_DEF_DATA_LEN, 0, NULL);
+ }
+
hci_set_le_support(req);
}
OpenPOWER on IntegriCloud