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

Commit 0b60eba1 authored by Johan Hedberg's avatar Johan Hedberg
Browse files

Bluetooth: Don't send unnecessary write_le_enable command



If the local host features indicate that LE is already in the state that
is desired there's no point in sending the HCI command to try to change
the setting.

Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
Acked-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 816a11d5
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1260,7 +1260,7 @@ static int set_le(struct sock *sk, u16 index, void *data, u16 len)
	struct pending_cmd *cmd;
	struct hci_dev *hdev;
	int err;
	u8 val;
	u8 val, enabled;

	BT_DBG("request for hci%u", index);

@@ -1280,8 +1280,9 @@ static int set_le(struct sock *sk, u16 index, void *data, u16 len)
	}

	val = !!cp->val;
	enabled = !!(hdev->host_features[0] & LMP_HOST_LE);

	if (!hdev_is_powered(hdev)) {
	if (!hdev_is_powered(hdev) || val == enabled) {
		bool changed = false;

		if (val != test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) {