|
@@ -646,6 +646,26 @@ static inline unsigned int hci_conn_count(struct hci_dev *hdev)
|
|
|
return c->acl_num + c->amp_num + c->sco_num + c->le_num;
|
|
|
}
|
|
|
|
|
|
+static inline __u8 hci_conn_lookup_type(struct hci_dev *hdev, __u16 handle)
|
|
|
+{
|
|
|
+ struct hci_conn_hash *h = &hdev->conn_hash;
|
|
|
+ struct hci_conn *c;
|
|
|
+ __u8 type = INVALID_LINK;
|
|
|
+
|
|
|
+ rcu_read_lock();
|
|
|
+
|
|
|
+ list_for_each_entry_rcu(c, &h->list, list) {
|
|
|
+ if (c->handle == handle) {
|
|
|
+ type = c->type;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ rcu_read_unlock();
|
|
|
+
|
|
|
+ return type;
|
|
|
+}
|
|
|
+
|
|
|
static inline struct hci_conn *hci_conn_hash_lookup_handle(struct hci_dev *hdev,
|
|
|
__u16 handle)
|
|
|
{
|