Thread (39 messages) 39 messages, 4 authors, 2012-01-19

Re: [PATCH 10/15] Bluetooth: Add a convenience function to check for SSP enabled

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-01-18 19:14:03

Hi Johan,
quoted hunk ↗ jump to hunk
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 <redacted>
---
 include/net/bluetooth/hci_core.h |    7 +++++++
 net/bluetooth/hci_conn.c         |    8 ++------
 net/bluetooth/hci_event.c        |    9 +++------
 3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 5f6cb35..f2ccdae 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_support(struct hci_conn *conn)
+{
+	struct hci_dev *hdev = conn->hdev;
+	return (hdev->ssp_mode > 0 &&
+				test_bit(HCI_CONN_SSP_SUPPORT, &conn->flags));
+}
why is hdev->ssp_mode not converted into a flag first?

Regards

Marcel

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help