Skip to content

Commit

Permalink
Bluetooth: Add convenience function for getting total connection count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hedberg authored and Marcel Holtmann committed Feb 24, 2014
1 parent 4518bb0 commit f4f0750
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/net/bluetooth/hci_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,13 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type)
}
}

static inline unsigned int hci_conn_count(struct hci_dev *hdev)
{
struct hci_conn_hash *c = &hdev->conn_hash;

return c->acl_num + c->amp_num + c->sco_num + c->le_num;
}

static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
__u16 handle)
{
Expand Down

0 comments on commit f4f0750

Please sign in to comment.