Bluetooth: Add smp_ltk_sec_level() helper function
[sfrench/cifs-2.6.git] / net / bluetooth / smp.h
index 5240537efde3aeab83433c4d62553710ac2efac4..86a683a8b4917fe7ba0567254da8da210909f13c 100644 (file)
@@ -125,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);