diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2014-02-24 07:52:16 -0500 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-02-24 14:10:35 -0500 |
commit | f4f07505005932ca5f6c8003323bd38dbd0c769c (patch) | |
tree | f86ed68ac707b0d965e84b7bfac8499f50099898 | |
parent | 4518bb0fb5eda46a9b118a6fbd9661e62a34a5b6 (diff) |
Bluetooth: Add convenience function for getting total connection count
This patch adds a convenience function to return the number of
connections in the conn_hash list. This will be useful once we update
the power off procedure to disconnect any open connections.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-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 fb3b677ff8a6..d2d756753714 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -561,6 +561,13 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | |||
561 | } | 561 | } |
562 | } | 562 | } |
563 | 563 | ||
564 | static inline unsigned int hci_conn_count(struct hci_dev *hdev) | ||
565 | { | ||
566 | struct hci_conn_hash *c = &hdev->conn_hash; | ||
567 | |||
568 | return c->acl_num + c->amp_num + c->sco_num + c->le_num; | ||
569 | } | ||
570 | |||
564 | static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, | 571 | static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev, |
565 | __u16 handle) | 572 | __u16 handle) |
566 | { | 573 | { |