Bluetooth: Enable new LE meta event
authorAndre Guedes <andre.guedes@openbossa.org>
Tue, 1 Jul 2014 21:10:10 +0000 (18:10 -0300)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 3 Jul 2014 15:42:55 +0000 (17:42 +0200)
The Bluetooth 4.1 introduces a new LE meta event called "LE Remote
Connection Parameter Request" event. In order to the controller
sends this event to host, we should enable it during controller
initialization.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
include/net/bluetooth/hci.h
net/bluetooth/hci_core.c

index 95b754785a7d0a90b9fa450ead8218023e5f6704..66358af6b1fc4bb513981abb8f6d73ea7d597736 100644 (file)
@@ -307,6 +307,9 @@ enum {
 #define LMP_HOST_LE_BREDR      0x04
 #define LMP_HOST_SC            0x08
 
+/* LE features */
+#define HCI_LE_CONN_PARAM_REQ_PROC     0x02
+
 /* Connection modes */
 #define HCI_CM_ACTIVE  0x0000
 #define HCI_CM_HOLD    0x0001
index 5788e031b869c41472235da7a830ce7d3354164d..615d0cf5e511225285c946b69d1f6503377e7793 100644 (file)
@@ -1611,6 +1611,15 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
 
                memset(events, 0, sizeof(events));
                events[0] = 0x1f;
+
+               /* If controller supports the Connection Parameters Request
+                * Link Layer Procedure, enable the corresponding event.
+                */
+               if (hdev->le_features[0] & HCI_LE_CONN_PARAM_REQ_PROC)
+                       events[0] |= 0x20;      /* LE Remote Connection
+                                                * Parameter Request
+                                                */
+
                hci_req_add(req, HCI_OP_LE_SET_EVENT_MASK, sizeof(events),
                            events);