Bluetooth: centralize default value initialization.

This patch centralized the initialization of default parameters.  This
is required to allow clients to more easily customize the default
system parameters.

Signed-off-by: Alain Michaud <alainm@chromium.org>
Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
Alain Michaud
2020-06-11 02:01:56 +00:00
committed by Marcel Holtmann
parent 7e90de4ac1
commit 10873f99ce
4 changed files with 40 additions and 21 deletions

View File

@@ -34,9 +34,6 @@
#define HCI_REQ_PEND 1
#define HCI_REQ_CANCELED 2
#define LE_SUSPEND_SCAN_WINDOW 0x0012
#define LE_SUSPEND_SCAN_INTERVAL 0x0400
void hci_req_init(struct hci_request *req, struct hci_dev *hdev)
{
skb_queue_head_init(&req->cmd_q);
@@ -366,13 +363,11 @@ void __hci_req_write_fast_connectable(struct hci_request *req, bool enable)
/* 160 msec page scan interval */
acp.interval = cpu_to_le16(0x0100);
} else {
type = PAGE_SCAN_TYPE_STANDARD; /* default */
/* default 1.28 sec page scan */
acp.interval = cpu_to_le16(0x0800);
type = hdev->def_page_scan_type;
acp.interval = cpu_to_le16(hdev->def_page_scan_int);
}
acp.window = cpu_to_le16(0x0012);
acp.window = cpu_to_le16(hdev->def_page_scan_window);
if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval ||
__cpu_to_le16(hdev->page_scan_window) != acp.window)
@@ -927,8 +922,8 @@ void hci_req_add_le_passive_scan(struct hci_request *req)
filter_policy |= 0x02;
if (hdev->suspended) {
window = LE_SUSPEND_SCAN_WINDOW;
interval = LE_SUSPEND_SCAN_INTERVAL;
window = hdev->le_scan_window_suspend;
interval = hdev->le_scan_int_suspend;
} else {
window = hdev->le_scan_window;
interval = hdev->le_scan_interval;