| From 3a697ca1937a91c5f949bd0948eff716236799b5 Mon Sep 17 00:00:00 2001 |
| From: Zhengping Jiang <jiangzp@google.com> |
| Date: Tue, 9 Aug 2022 00:53:04 +0000 |
| Subject: [PATCH] Revert "UPSTREAM: Bluetooth: MGMT: Add conditions for setting |
| HCI_CONN_FLAG_REMOTE_WAKEUP" |
| |
| This reverts commit 32d6aec5820f89ceee30d59d21c9482cd8262c25. |
| |
| Reason: cause LE devices which advertise with a static address not able |
| to wake up device if an IRK was exchanged during pairing, if ll privacy |
| is not enabled. |
| |
| Conflict: Keep WRITE_ONCE(params->flags, current_flags). |
| |
| BUG=b:239500755,b:241811725,b:241716680,b:240890140,b/294177074 |
| TEST=Test in volteer with kernel 5.4 the following: |
| - Use a mouse which advertises with random static address |
| - Mouse sends IRK during pairing |
| - Pair device and check in bluetoothctl WakeAllowed: yes |
| - Suspend device and move BT mouse, which wakes up the device |
| |
| Signed-off-by: Zhengping Jiang <jiangzp@google.com> |
| Change-Id: I684be7c4455e59e5cc64b1afb028647d801112c4 |
| Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/4755959 |
| Reviewed-by: Yun-Hao Chung <howardchung@chromium.org> |
| --- |
| net/bluetooth/mgmt.c | 18 ++---------------- |
| 1 file changed, 2 insertions(+), 16 deletions(-) |
| |
| diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c |
| index 79041796f882b16b5032cec2b78d795c93d59709..4b65d507359302cc41965cf5644870c0cb4b4525 100644 |
| --- a/net/bluetooth/mgmt.c |
| +++ b/net/bluetooth/mgmt.c |
| @@ -5166,21 +5166,8 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, |
| params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr, |
| le_addr_type(cp->addr.type)); |
| if (params) { |
| - /* Devices using RPAs can only be programmed in the |
| - * acceptlist LL Privacy has been enable otherwise they |
| - * cannot mark HCI_CONN_FLAG_REMOTE_WAKEUP. |
| - */ |
| - if ((current_flags & HCI_CONN_FLAG_REMOTE_WAKEUP) && |
| - !use_ll_privacy(hdev) && |
| - hci_find_irk_by_addr(hdev, ¶ms->addr, |
| - params->addr_type)) { |
| - bt_dev_warn(hdev, |
| - "Cannot set wakeable for RPA"); |
| - goto unlock; |
| - } |
| - |
| - WRITE_ONCE(params->flags, current_flags); |
| - status = MGMT_STATUS_SUCCESS; |
| + WRITE_ONCE(params->flags, current_flags); |
| + status = MGMT_STATUS_SUCCESS; |
| |
| /* Update passive scan if HCI_CONN_FLAG_DEVICE_PRIVACY |
| * has been set. |
| @@ -5194,7 +5181,6 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, |
| } |
| } |
| |
| -unlock: |
| hci_dev_unlock(hdev); |
| |
| done: |
| -- |
| 2.34.1 |
| |