Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d6c705b authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg
Browse files

Bluetooth: Enable LE Long Term Key Request event only when supported



The support for LE encryption is optional and with that also the
LE Long Term Key Request event. If encryption is not supported, then
do not bother enabling this event.

Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 0da71f1b
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -1644,7 +1644,10 @@ static void hci_init3_req(struct hci_request *req, unsigned long opt)
		u8 events[8];
		u8 events[8];


		memset(events, 0, sizeof(events));
		memset(events, 0, sizeof(events));
		events[0] = 0x1f;
		events[0] = 0x0f;

		if (hdev->le_features[0] & HCI_LE_ENCRYPTION)
			events[0] |= 0x10;	/* LE Long Term Key Request */


		/* If controller supports the Connection Parameters Request
		/* If controller supports the Connection Parameters Request
		 * Link Layer Procedure, enable the corresponding event.
		 * Link Layer Procedure, enable the corresponding event.