|
@@ -1254,41 +1254,6 @@ failed:
|
|
|
return err;
|
|
|
}
|
|
|
|
|
|
-static void write_fast_connectable(struct hci_request *req, bool enable)
|
|
|
-{
|
|
|
- struct hci_dev *hdev = req->hdev;
|
|
|
- struct hci_cp_write_page_scan_activity acp;
|
|
|
- u8 type;
|
|
|
-
|
|
|
- if (!hci_dev_test_flag(hdev, HCI_BREDR_ENABLED))
|
|
|
- return;
|
|
|
-
|
|
|
- if (hdev->hci_ver < BLUETOOTH_VER_1_2)
|
|
|
- return;
|
|
|
-
|
|
|
- if (enable) {
|
|
|
- type = PAGE_SCAN_TYPE_INTERLACED;
|
|
|
-
|
|
|
- /* 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);
|
|
|
- }
|
|
|
-
|
|
|
- acp.window = cpu_to_le16(0x0012);
|
|
|
-
|
|
|
- if (__cpu_to_le16(hdev->page_scan_interval) != acp.interval ||
|
|
|
- __cpu_to_le16(hdev->page_scan_window) != acp.window)
|
|
|
- hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_ACTIVITY,
|
|
|
- sizeof(acp), &acp);
|
|
|
-
|
|
|
- if (hdev->page_scan_type != type)
|
|
|
- hci_req_add(req, HCI_OP_WRITE_PAGE_SCAN_TYPE, 1, &type);
|
|
|
-}
|
|
|
-
|
|
|
void mgmt_set_connectable_complete(struct hci_dev *hdev, u8 status)
|
|
|
{
|
|
|
struct mgmt_pending_cmd *cmd;
|
|
@@ -4094,7 +4059,7 @@ static int set_fast_connectable(struct sock *sk, struct hci_dev *hdev,
|
|
|
|
|
|
hci_req_init(&req, hdev);
|
|
|
|
|
|
- write_fast_connectable(&req, cp->val);
|
|
|
+ __hci_req_write_fast_connectable(&req, cp->val);
|
|
|
|
|
|
err = hci_req_run(&req, fast_connectable_complete);
|
|
|
if (err < 0) {
|
|
@@ -4236,7 +4201,7 @@ static int set_bredr(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
|
|
|
|
|
|
hci_req_init(&req, hdev);
|
|
|
|
|
|
- write_fast_connectable(&req, false);
|
|
|
+ __hci_req_write_fast_connectable(&req, false);
|
|
|
__hci_req_update_scan(&req);
|
|
|
|
|
|
/* Since only the advertising data flags will change, there
|
|
@@ -6566,9 +6531,9 @@ static int powered_update_hci(struct hci_dev *hdev)
|
|
|
|
|
|
if (lmp_bredr_capable(hdev)) {
|
|
|
if (hci_dev_test_flag(hdev, HCI_FAST_CONNECTABLE))
|
|
|
- write_fast_connectable(&req, true);
|
|
|
+ __hci_req_write_fast_connectable(&req, true);
|
|
|
else
|
|
|
- write_fast_connectable(&req, false);
|
|
|
+ __hci_req_write_fast_connectable(&req, false);
|
|
|
__hci_req_update_scan(&req);
|
|
|
__hci_req_update_class(&req);
|
|
|
__hci_req_update_name(&req);
|