Bluetooth: Add support for storing the key size
[pandora-kernel.git] / net / bluetooth / hci_core.c
index 4885914..908fcd3 100644 (file)
@@ -1149,7 +1149,7 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
 }
 
 int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
-                                       __le16 ediv, u8 rand[8], u8 ltk[16])
+                       u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16])
 {
        struct link_key *key, *old_key;
        struct key_master_id *id;
@@ -1174,6 +1174,7 @@ int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
        bacpy(&key->bdaddr, bdaddr);
        memcpy(key->val, ltk, sizeof(key->val));
        key->type = HCI_LK_SMP_LTK;
+       key->pin_len = key_size;
 
        id = (void *) &key->data;
        id->ediv = ediv;