Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Bluetooth: Fix checks for LE support on LE-only controllers

LE-only controllers do not support extended features so any kind of host
feature bit checks do not make sense for them. This patch fixes code
used for both single-mode (LE-only) and dual-mode (BR/EDR/LE) to use the
HCI_LE_ENABLED flag instead of the "Host LE supported" feature bit for
LE support tests.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johan Hedberg and committed by
John W. Linville
757aee0f add295a4

+3 -3
+1 -1
net/bluetooth/mgmt.c
··· 2700 2700 break; 2701 2701 2702 2702 case DISCOV_TYPE_LE: 2703 - if (!lmp_host_le_capable(hdev)) { 2703 + if (!test_bit(HCI_LE_ENABLED, &hdev->dev_flags)) { 2704 2704 err = cmd_status(sk, hdev->id, MGMT_OP_START_DISCOVERY, 2705 2705 MGMT_STATUS_NOT_SUPPORTED); 2706 2706 mgmt_pending_remove(cmd);
+2 -2
net/bluetooth/smp.c
··· 770 770 771 771 BT_DBG("conn %p hcon %p level 0x%2.2x", conn, hcon, sec_level); 772 772 773 - if (!lmp_host_le_capable(hcon->hdev)) 773 + if (!test_bit(HCI_LE_ENABLED, &hcon->hdev->dev_flags)) 774 774 return 1; 775 775 776 776 if (sec_level == BT_SECURITY_LOW) ··· 851 851 __u8 reason; 852 852 int err = 0; 853 853 854 - if (!lmp_host_le_capable(conn->hcon->hdev)) { 854 + if (!test_bit(HCI_LE_ENABLED, &conn->hcon->hdev->dev_flags)) { 855 855 err = -ENOTSUPP; 856 856 reason = SMP_PAIRING_NOTSUPP; 857 857 goto done;