aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/bluetooth/mgmt.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 98f6295edbec..7783b8d8e1d4 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1002,6 +1002,7 @@ failed:
1002 1002
1003static void write_fast_connectable(struct hci_request *req, bool enable) 1003static void write_fast_connectable(struct hci_request *req, bool enable)
1004{ 1004{
1005 struct hci_dev *hdev = req->hdev;
1005 struct hci_cp_write_page_scan_activity acp; 1006 struct hci_cp_write_page_scan_activity acp;
1006 u8 type; 1007 u8 type;
1007 1008
@@ -1019,8 +1020,13 @@ static void write_fast_connectable(struct hci_request *req, bool enable)
1019 1020
1020 acp.window = __constant_cpu_to_le16(0x0012); 1021 acp.window = __constant_cpu_to_le16(0x0012);
1021 1022
1022 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY, sizeof(acp), &acp); 1023 if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval ||
1023 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_TYPE, 1, &type); 1024 __cpu_to_le16(hdev->page_scan_window) != acp.window)
1025 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY,
1026 sizeof(acp), &acp);
1027
1028 if (hdev->page_scan_type != type)
1029 hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_TYPE, 1, &type);
1024} 1030}
1025 1031
1026static void set_connectable_complete(struct hci_dev *hdev, u8 status) 1032static void set_connectable_complete(struct hci_dev *hdev, u8 status)