summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2011-12-09 13:48:17 +0100
committerPhilippe Langlais <philippe.langlais@linaro.org>2012-03-19 09:03:00 +0100
commit1fb2802cdfe2cb39f59278d482eb298161d3748f (patch)
tree85a8f405288c7c3df41a9b4e3695467af549d70d
parent2b90a9f88fde7954e84203470623beb174cc342c (diff)
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 <lukasz.rymanowski@tieto.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/42169 Reviewed-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Tested-by: Lukasz RYMANOWSKI <lukasz.rymanowski@stericsson.com> Reviewed-by: Hakan GARDRUP <hakan.gardrup@stericsson.com> Reviewed-by: Henrik POSSUNG <henrik.possung@stericsson.com> Reviewed-by: Kanak GUPTA <kanak.gupta@stericsson.com>
-rw-r--r--include/net/bluetooth/hci.h1
-rw-r--r--net/bluetooth/hci_conn.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 14766899355..9aa8301a71f 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1394,6 +1394,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 963ff2d02cf..265f0601c80 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -956,8 +956,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)