| From c0f18be80bccbf07c7e252bd160db417660aa9cc Mon Sep 17 00:00:00 2001 |
| From: Daniel Winkler <danielwinkler@google.com> |
| Date: Fri, 20 Nov 2020 17:55:04 -0800 |
| Subject: [PATCH] Revert "UPSTREAM: Bluetooth: Add support for utilizing Fast |
| Advertising Interval" |
| |
| This reverts commit 69fd484ffc300ffe78156646545cf6d99225720e. |
| |
| Reason for revert: The more aggressive advertising intervals configured |
| in this CL causes instability on kukui. Reverting back to the previous |
| defaults resolve the issue. |
| |
| Failure that is corrected: |
| < HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15 |
| Min advertising interval: 62.500 msec (0x0064) |
| Max advertising interval: 93.750 msec (0x0096) |
| Type: Non connectable undirected - ADV_NONCONN_IND (0x03) |
| Own address type: Random (0x01) |
| Direct address type: Public (0x00) |
| Direct address: 00:00:00:00:00:00 (OUI 00-00-00) |
| Channel map: 37, 38, 39 (0x07) |
| Filter policy: Allow Scan Request from Any, |
| Allow Connect Request from Any (0x00) |
| > HCI Event: Command Complete (0x0e) plen 4 |
| LE Set Advertising Parameters (0x08|0x0006) ncmd 1 |
| Status: Invalid HCI Command Parameters (0x12) |
| |
| Conflict was due to some new interval logic in Cros |
| |
| Signed-off-by: Daniel Winkler <danielwinkler@google.com> |
| |
| BUG=b:173797439 |
| TEST=Can successfully register "broadcast" advertisements on kukui |
| |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2552216 |
| Reviewed-by: Miao-chen Chou <mcchou@chromium.org> |
| Tested-by: Daniel Winkler <danielwinkler@google.com> |
| Commit-Queue: Daniel Winkler <danielwinkler@google.com> |
| (cherry picked from commit c25deed4ee12d860ee5cad3abc20157a40672020) |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2595668 |
| Reviewed-by: Alain Michaud <alainm@chromium.org> |
| Change-Id: Ie8f554d98916bb83cd585a58068b813ecf97a6b9 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2780554 |
| --- |
| include/net/bluetooth/hci_core.h | 2 -- |
| net/bluetooth/hci_request.c | 23 ++++++++--------------- |
| 2 files changed, 8 insertions(+), 17 deletions(-) |
| |
| diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h |
| index 73d6ffe8c2ff..7ce05b012b3e 100644 |
| --- a/include/net/bluetooth/hci_core.h |
| +++ b/include/net/bluetooth/hci_core.h |
| @@ -1790,8 +1790,6 @@ void hci_mgmt_chan_unregister(struct hci_mgmt_chan *c); |
| #define DISCOV_INTERLEAVED_INQUIRY_LEN 0x04 |
| #define DISCOV_BREDR_INQUIRY_LEN 0x08 |
| #define DISCOV_LE_RESTART_DELAY msecs_to_jiffies(200) /* msec */ |
| -#define DISCOV_LE_FAST_ADV_INT_MIN 0x00A0 /* 100 msec */ |
| -#define DISCOV_LE_FAST_ADV_INT_MAX 0x00F0 /* 150 msec */ |
| |
| void mgmt_fill_version_info(void *ver); |
| int mgmt_new_settings(struct hci_dev *hdev); |
| diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c |
| index 09a8fa183320..f27c0d7a5604 100644 |
| --- a/net/bluetooth/hci_request.c |
| +++ b/net/bluetooth/hci_request.c |
| @@ -1595,23 +1595,16 @@ void __hci_req_enable_advertising(struct hci_request *req) |
| adv_max_interval = hdev->le_adv_max_interval; |
| } |
| |
| - if (connectable) { |
| - cp.type = LE_ADV_IND; |
| - } else { |
| - if (adv_cur_instance_is_scannable(hdev)) |
| - cp.type = LE_ADV_SCAN_IND; |
| - else |
| - cp.type = LE_ADV_NONCONN_IND; |
| - |
| - if (!hci_dev_test_flag(hdev, HCI_DISCOVERABLE) || |
| - hci_dev_test_flag(hdev, HCI_LIMITED_DISCOVERABLE)) { |
| - adv_min_interval = DISCOV_LE_FAST_ADV_INT_MIN; |
| - adv_max_interval = DISCOV_LE_FAST_ADV_INT_MAX; |
| - } |
| - } |
| - |
| cp.min_interval = cpu_to_le16(adv_min_interval); |
| cp.max_interval = cpu_to_le16(adv_max_interval); |
| + |
| + if (connectable) |
| + cp.type = LE_ADV_IND; |
| + else if (adv_cur_instance_is_scannable(hdev)) |
| + cp.type = LE_ADV_SCAN_IND; |
| + else |
| + cp.type = LE_ADV_NONCONN_IND; |
| + |
| cp.own_address_type = own_addr_type; |
| cp.channel_map = hdev->le_adv_channel_map; |
| |
| -- |
| 2.17.1 |
| |