summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArman Uguray <armansito@chromium.org>2015-03-25 18:53:43 -0700
committerMarcel Holtmann <marcel@holtmann.org>2015-03-26 03:30:29 +0100
commit67e0c0cd8f5afea17689f7688041e9d215df6875 (patch)
treeed062a72a76a661ad08ac8e3628876fd2c1bce90
parent807ec772bf484a8e93bc9a2a681e49cb8f2c4d69 (diff)
Bluetooth: Support the "managed-flags" adv flag
This patch adds support for the "managed-flags" flag of the Add Advertising command. Signed-off-by: Arman Uguray <armansito@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--net/bluetooth/mgmt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 797cf6cf958f..cc4e76f8be0e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -986,7 +986,13 @@ static u8 create_instance_adv_data(struct hci_dev *hdev, u8 *ptr)
if (hdev->adv_instance.flags & MGMT_ADV_FLAG_LIMITED_DISCOV)
flags |= LE_AD_LIMITED;
- if (flags) {
+ if (flags || (hdev->adv_instance.flags & MGMT_ADV_FLAG_MANAGED_FLAGS)) {
+ /* If a discovery flag wasn't provided, simply use the global
+ * settings.
+ */
+ if (!flags)
+ flags |= get_adv_discov_flags(hdev);
+
if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED))
flags |= LE_AD_NO_BREDR;
@@ -6582,7 +6588,8 @@ static bool tlv_data_is_valid(struct hci_dev *hdev, u32 adv_flags, u8 *data,
u8 max_len = HCI_MAX_AD_LENGTH;
int i, cur_len;
bool flags_managed = false;
- u32 flags_params = MGMT_ADV_FLAG_DISCOV | MGMT_ADV_FLAG_LIMITED_DISCOV;
+ u32 flags_params = MGMT_ADV_FLAG_DISCOV | MGMT_ADV_FLAG_LIMITED_DISCOV |
+ MGMT_ADV_FLAG_MANAGED_FLAGS;
if (is_adv_data && (adv_flags & flags_params)) {
flags_managed = true;