Merge tag 'stable/for-linus-3.18-rc0-tag' of git://git.kernel.org/pub/scm/linux/kerne...
[cascardo/linux.git] / net / bluetooth / smp.h
index cf10946..86a683a 100644 (file)
@@ -102,6 +102,8 @@ struct smp_cmd_security_req {
        __u8    auth_req;
 } __packed;
 
+#define SMP_CMD_MAX            0x0b
+
 #define SMP_PASSKEY_ENTRY_FAILED       0x01
 #define SMP_OOB_NOT_AVAIL              0x02
 #define SMP_AUTH_REQUIREMENTS          0x03
@@ -123,6 +125,14 @@ enum {
        SMP_LTK_SLAVE,
 };
 
+static inline u8 smp_ltk_sec_level(struct smp_ltk *key)
+{
+       if (key->authenticated)
+               return BT_SECURITY_HIGH;
+
+       return BT_SECURITY_MEDIUM;
+}
+
 /* SMP Commands */
 bool smp_sufficient_security(struct hci_conn *hcon, u8 sec_level);
 int smp_conn_security(struct hci_conn *hcon, __u8 sec_level);