Bluetooth: Disallow LE scanning and connecting in peripheral role
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / bluetooth / hci_core.c
index 5a3400d8a6e5c078e37c154daa2bdb376086fbb8..515d0c394f35e29820801444e3a9d4510e549f2d 100644 (file)
@@ -1577,6 +1577,9 @@ int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
 
        BT_DBG("%s", hdev->name);
 
+       if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags))
+               return -ENOTSUPP;
+
        if (work_busy(&hdev->le_scan))
                return -EINPROGRESS;