From c480d6f6de40ca6eddae262b5f462153dbd567c5 Mon Sep 17 00:00:00 2001 From: Lukasz Rymanowski Date: Fri, 9 Dec 2011 13:48:17 +0100 Subject: BT: Add sec_level to auth_conn_info With this patch it is possible to retrieve sec_level from the kernel by user space. This is needed for SAP working on hciops. This patch missed to be added when moving to kernel 3.0 ST-Ericsson ID: 256270 ST-Ericsson FOSS-OUT ID: FOSS-OUT-10060 Change-Id: Ic569db392e6f6ee2e546003dec86cc2d62a1fcd7 Signed-off-by: Lukasz Rymanowski Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42169 Reviewed-by: Lukasz RYMANOWSKI Tested-by: Lukasz RYMANOWSKI Reviewed-by: Hakan GARDRUP Reviewed-by: Henrik POSSUNG Reviewed-by: Kanak GUPTA --- include/net/bluetooth/hci.h | 1 + net/bluetooth/hci_conn.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 15da4460f24..ac91fbd3bc0 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -1436,6 +1436,7 @@ struct hci_conn_info_req { struct hci_auth_info_req { bdaddr_t bdaddr; __u8 type; + __u8 sec_level; }; struct hci_inquiry_req { diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index c91f6d90793..6226dc4e9ef 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -948,8 +948,10 @@ int hci_get_auth_info(struct hci_dev *hdev, void __user *arg) hci_dev_lock(hdev); conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &req.bdaddr); - if (conn) + if (conn) { req.type = conn->auth_type; + req.sec_level = max(conn->sec_level, conn->pending_sec_level); + } hci_dev_unlock(hdev); if (!conn) -- cgit v1.2.3