aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/mgmt.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index a07b08156dba..48aa23977da3 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3558,6 +3558,26 @@ unlock:
3558 return err; 3558 return err;
3559} 3559}
3560 3560
3561static void set_bredr_scan(struct hci_request *req)
3562{
3563 struct hci_dev *hdev = req->hdev;
3564 u8 scan = 0;
3565
3566 /* Ensure that fast connectable is disabled. This function will
3567 * not do anything if the page scan parameters are already what
3568 * they should be.
3569 */
3570 write_fast_connectable(req, false);
3571
3572 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
3573 scan |= SCAN_PAGE;
3574 if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
3575 scan |= SCAN_INQUIRY;
3576
3577 if (scan)
3578 hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
3579}
3580
3561static void set_bredr_complete(struct hci_dev *hdev, u8 status) 3581static void set_bredr_complete(struct hci_dev *hdev, u8 status)
3562{ 3582{
3563 struct pending_cmd *cmd; 3583 struct pending_cmd *cmd;
@@ -3917,26 +3937,6 @@ void mgmt_index_removed(struct hci_dev *hdev)
3917 mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL); 3937 mgmt_event(MGMT_EV_INDEX_REMOVED, hdev, NULL, 0, NULL);
3918} 3938}
3919 3939
3920static void set_bredr_scan(struct hci_request *req)
3921{
3922 struct hci_dev *hdev = req->hdev;
3923 u8 scan = 0;
3924
3925 /* Ensure that fast connectable is disabled. This function will
3926 * not do anything if the page scan parameters are already what
3927 * they should be.
3928 */
3929 write_fast_connectable(req, false);
3930
3931 if (test_bit(HCI_CONNECTABLE, &hdev->dev_flags))
3932 scan |= SCAN_PAGE;
3933 if (test_bit(HCI_DISCOVERABLE, &hdev->dev_flags))
3934 scan |= SCAN_INQUIRY;
3935
3936 if (scan)
3937 hci_req_add(req, HCI_OP_WRITE_SCAN_ENABLE, 1, &scan);
3938}
3939
3940static void powered_complete(struct hci_dev *hdev, u8 status) 3940static void powered_complete(struct hci_dev *hdev, u8 status)
3941{ 3941{
3942 struct cmd_lookup match = { NULL, hdev }; 3942 struct cmd_lookup match = { NULL, hdev };