summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Rymanowski <lukasz.rymanowski@tieto.com>2011-12-09 13:48:17 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 11:07:33 +0200
commitc480d6f6de40ca6eddae262b5f462153dbd567c5 (patch)
tree060cc94eac2b0479c8b822c627cf9b83d39e039c
parentcca20365f85a272c284fc91e901a7da6180ca876 (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 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)