Bluetooth: Replace wakeable in hci_conn_params
authorAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Wed, 17 Jun 2020 14:39:10 +0000 (16:39 +0200)
committerJohan Hedberg <johan.hedberg@intel.com>
Thu, 18 Jun 2020 10:11:13 +0000 (13:11 +0300)
Replace the wakeable boolean with flags in hci_conn_params and all users
of this boolean. This will be used by the get/set device flags mgmt op.

Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Reviewed-by: Alain Michaud <alainm@chromium.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_request.c

index 0643c73..6f88e5d 100644 (file)
@@ -660,7 +660,7 @@ struct hci_conn_params {
 
        struct hci_conn *conn;
        bool explicit_connect;
-       bool wakeable;
+       u32 current_flags;
 };
 
 extern struct list_head hci_dev_list;
index a5b53d3..eee9c00 100644 (file)
@@ -710,7 +710,8 @@ static int add_to_white_list(struct hci_request *req,
        }
 
        /* During suspend, only wakeable devices can be in whitelist */
-       if (hdev->suspended && !params->wakeable)
+       if (hdev->suspended && !hci_conn_test_flag(HCI_CONN_FLAG_REMOTE_WAKEUP,
+                                                  params->current_flags))
                return 0;
 
        *num_entries += 1;