aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_conn.c
diff options
context:
space:
mode:
authorIngo Molnar <[email protected]>2025-05-21 06:42:51 +0000
committerIngo Molnar <[email protected]>2025-05-21 06:45:03 +0000
commit412751aa6991501d7defeadecfede59043d1b5e8 (patch)
treeee5026e79128dd4eacb935f76564d7dcc105b24f /net/bluetooth/hci_conn.c
parentx86/xen/msr: Fix uninitialized variable 'err' (diff)
parentLinux 6.15-rc7 (diff)
downloadkernel-412751aa6991501d7defeadecfede59043d1b5e8.tar.gz
kernel-412751aa6991501d7defeadecfede59043d1b5e8.zip
Merge tag 'v6.15-rc7' into x86/core, to pick up fixes
Pick up build fixes from upstream to make this tree more testable. Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/bluetooth/hci_conn.c')
-rw-r--r--net/bluetooth/hci_conn.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 6533e281ada3..946d2ae551f8 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -3023,3 +3023,27 @@ void hci_conn_tx_dequeue(struct hci_conn *conn)
kfree_skb(skb);
}
+
+u8 *hci_conn_key_enc_size(struct hci_conn *conn)
+{
+ if (conn->type == ACL_LINK) {
+ struct link_key *key;
+
+ key = hci_find_link_key(conn->hdev, &conn->dst);
+ if (!key)
+ return NULL;
+
+ return &key->pin_len;
+ } else if (conn->type == LE_LINK) {
+ struct smp_ltk *ltk;
+
+ ltk = hci_find_ltk(conn->hdev, &conn->dst, conn->dst_type,
+ conn->role);
+ if (!ltk)
+ return NULL;
+
+ return &ltk->enc_size;
+ }
+
+ return NULL;
+}