summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_core.c
diff options
context:
space:
mode:
authorJohan Hedberg2013-10-02 15:02:24 +0200
committerMarcel Holtmann2013-10-02 15:18:18 +0200
commit11802b299f3337441d649dcb035a98ec1ff67ade (patch)
tree3a5b1551be0060d5c9fe93020306c5be697b7e6e /net/bluetooth/hci_core.c
parentBluetooth: Fix REJECTED vs NOT_SUPPORTED mgmt responses (diff)
downloadkernel-qcow2-linux-11802b299f3337441d649dcb035a98ec1ff67ade.tar.gz
kernel-qcow2-linux-11802b299f3337441d649dcb035a98ec1ff67ade.tar.xz
kernel-qcow2-linux-11802b299f3337441d649dcb035a98ec1ff67ade.zip
Bluetooth: Fix advertising data flags with disabled BR/EDR
We shouldn't include the simultaneous LE & BR/EDR flags in the LE advertising data if BR/EDR is disabled on a dual-mode controller. This patch fixes this issue and ensures that the create_ad function generates the correct flags when BR/EDR is disabled. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_core.c')
-rw-r--r--net/bluetooth/hci_core.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 14df032543b2..82dbdc6a7e9e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1108,14 +1108,14 @@ static u8 create_ad(struct hci_dev *hdev, u8 *ptr)
if (test_bit(HCI_LE_PERIPHERAL, &hdev->dev_flags))
flags |= LE_AD_GENERAL;
- if (!test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags))
+ if (test_bit(HCI_BREDR_ENABLED, &hdev->dev_flags)) {
+ if (lmp_le_br_capable(hdev))
+ flags |= LE_AD_SIM_LE_BREDR_CTRL;
+ if (lmp_host_le_br_capable(hdev))
+ flags |= LE_AD_SIM_LE_BREDR_HOST;
+ } else {
flags |= LE_AD_NO_BREDR;
-
- if (lmp_le_br_capable(hdev))
- flags |= LE_AD_SIM_LE_BREDR_CTRL;
-
- if (lmp_host_le_br_capable(hdev))
- flags |= LE_AD_SIM_LE_BREDR_HOST;
+ }
if (flags) {
BT_DBG("adv flags 0x%02x", flags);