diff options
| author | Johan Hedberg <johan.hedberg@intel.com> | 2012-01-18 21:33:12 +0200 |
|---|---|---|
| committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-02-13 17:01:29 +0200 |
| commit | aa64a8b500e61c33c17f1d5e7de0cc154489c59e (patch) | |
| tree | 4cc269f37f27cd9796664fe4987168dfa9f74742 /include | |
| parent | 84bde9d6c0e6830f4a8685a5d237965053118bf9 (diff) | |
Bluetooth: Add a convenience function to check for SSP enabled
It's a very common test to see if both the local and the remote device
have SSP enabled. By creating a simple function to test this we can
shorten many if-statements in the code.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 94ba8693e9d1..25f449fcd693 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h @@ -411,6 +411,13 @@ enum { HCI_CONN_REMOTE_OOB, }; +static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) +{ + struct hci_dev *hdev = conn->hdev; + return (test_bit(HCI_SSP_ENABLED, &hdev->flags) && + test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); +} + static inline void hci_conn_hash_init(struct hci_dev *hdev) { struct hci_conn_hash *h = &hdev->conn_hash; |
