summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2013-04-19 17:35:21 +0200
committerGustavo Padovan2013-04-24 01:20:12 +0200
commitc73eee9172bf061202c75ad4d16506a7efd04d1c (patch)
tree6141b15c1eeddd09cf1a7324cc6974f75cd41189 /net/bluetooth/hci_core.c
parentBluetooth: Fix HCI command send functions to use const specifier (diff)
downloadkernel-qcow2-linux-c73eee9172bf061202c75ad4d16506a7efd04d1c.tar.gz
kernel-qcow2-linux-c73eee9172bf061202c75ad4d16506a7efd04d1c.tar.xz
kernel-qcow2-linux-c73eee9172bf061202c75ad4d16506a7efd04d1c.zip
Bluetooth: Fix sending write_le_host_supporte for LE-only controllers
The Bluetooth Core Specification (4.0) defines the Write LE Host Supported HCI command as only available for controllers supporting BR/EDR. This is further reflected in the Read Local Extended Features HCI command also not being available for LE-only controllers. In other words, host-side LE support is implicit for single-mode LE controllers and doesn't have explicit HCI-level enablement. This patch ensures that the LE setting is always exposed as enabled through mgmt and returns a "rejected" response if user space tries to toggle the setting. The patch also ensures that Write LE Host Supported is never sent for LE-only controllers. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 215db0801a65..b04ac355f118 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -377,6 +377,8 @@ static void bredr_setup(struct hci_request *req)
static void le_setup(struct hci_request *req)
{
+ struct hci_dev *hdev = req->hdev;
+
/* Read LE Buffer Size */
hci_req_add(req, HCI_OP_LE_READ_BUFFER_SIZE, 0, NULL);
@@ -391,6 +393,10 @@ static void le_setup(struct hci_request *req)
/* Read LE Supported States */
hci_req_add(req, HCI_OP_LE_READ_SUPPORTED_STATES, 0, NULL);
+
+ /* LE-only controllers have LE implicitly enabled */
+ if (!lmp_bredr_capable(hdev))
+ set_bit(HCI_LE_ENABLED, &hdev->dev_flags);
}
static u8 hci_get_inquiry_mode(struct hci_dev *hdev)
@@ -574,6 +580,10 @@ static void hci_set_le_support(struct hci_request *req)
struct hci_dev *hdev = req->hdev;
struct hci_cp_write_le_host_supported cp;
+ /* LE-only devices do not support explicit enablement */
+ if (!lmp_bredr_capable(hdev))
+ return;
+
memset(&cp, 0, sizeof(cp));
if (test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {