aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorFlorian Grandel <fgrandel@gmail.com>2015-06-17 21:16:51 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-06-18 12:11:53 -0400
commiteb6f95f9c38de4cf64600c1ad29fc8e02224b155 (patch)
tree1e4dbb50249960a1f8476311891a019566d2dfc9 /net/bluetooth
parent9d5fc2f23afc842cbb3ee85600cd92bf5120a71d (diff)
Bluetooth: mgmt: multi-adv for mgmt_reenable_advertising()
During service discovery, advertising will be disabled. This patch ensures that it is correctly being re-enabled, both for configuration made via set advertising and add advertising, once the scanning times out. Signed-off-by: Florian Grandel <fgrandel@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/mgmt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f44c6e3be938..b132032f5710 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -8610,13 +8610,24 @@ static void adv_enable_complete(struct hci_dev *hdev, u8 status, u16 opcode)
8610void mgmt_reenable_advertising(struct hci_dev *hdev) 8610void mgmt_reenable_advertising(struct hci_dev *hdev)
8611{ 8611{
8612 struct hci_request req; 8612 struct hci_request req;
8613 u8 instance;
8613 8614
8614 if (!hci_dev_test_flag(hdev, HCI_ADVERTISING) && 8615 if (!hci_dev_test_flag(hdev, HCI_ADVERTISING) &&
8615 !hci_dev_test_flag(hdev, HCI_ADVERTISING_INSTANCE)) 8616 !hci_dev_test_flag(hdev, HCI_ADVERTISING_INSTANCE))
8616 return; 8617 return;
8617 8618
8619 instance = get_current_adv_instance(hdev);
8620
8618 hci_req_init(&req, hdev); 8621 hci_req_init(&req, hdev);
8619 enable_advertising(&req); 8622
8623 if (instance) {
8624 schedule_adv_instance(&req, instance, true);
8625 } else {
8626 update_adv_data(&req);
8627 update_scan_rsp_data(&req);
8628 enable_advertising(&req);
8629 }
8630
8620 hci_req_run(&req, adv_enable_complete); 8631 hci_req_run(&req, adv_enable_complete);
8621} 8632}
8622 8633