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

Unverified Commit 1b14f272 authored by Alexander Grund's avatar Alexander Grund
Browse files

Bluetooth: MGMT: Fix not checking if BT_HS is enabled

This checks if BT_HS is enabled relecting it on MGMT_SETTING_HS instead
of always reporting it as supported.

From https://lore.kernel.org/linux-bluetooth/20200806181714.3216076-4-luiz.dentz@gmail.com/
By Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Change-Id: I8a622e760317ee0ae3e669911b0950e274f2859f
parent 9f69b5f9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -628,6 +628,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)

		if (lmp_ssp_capable(hdev)) {
			settings |= MGMT_SETTING_SSP;
			if (IS_ENABLED(CONFIG_BT_HS))
				settings |= MGMT_SETTING_HS;
		}

@@ -2430,6 +2431,10 @@ static int set_hs(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)

	BT_DBG("request for %s", hdev->name);

	if (!IS_ENABLED(CONFIG_BT_HS))
		return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS,
				       MGMT_STATUS_NOT_SUPPORTED);

	status = mgmt_bredr_support(hdev);
	if (status)
		return mgmt_cmd_status(sk, hdev->id, MGMT_OP_SET_HS, status);