aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/mgmt.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2013-10-14 14:15:25 -0400
committerMarcel Holtmann <marcel@holtmann.org>2013-10-14 14:23:28 -0400
commit67e5a7a3d796d88da9662ab90aa23161c6a9f753 (patch)
treed1d23c7f4e66bec8f46393eff9376dd0d85c33c4 /net/bluetooth/mgmt.c
parent1987fdc77f49282efeec76d14eee2ded3ee9b5d2 (diff)
Bluetooth: Move set_bredr_scan() to avoid forward declaration
The set_bredr_scan() function will soon be needed by the set_bredr() function, so move it to a new location to avoid having to add a forward declaration. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-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 };