summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/smp.h
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-09-05 14:31:31 -0300
committerGustavo F. Padovan <padovan@profusion.mobi>2011-09-21 12:58:12 -0300
commit8aab47574a7f5b46a4cdbc6fd820ab34e6c5dbf9 (patch)
tree69f31fec9ff2266d848f5e1f974928a65030c4e4 /include/net/bluetooth/smp.h
parent1c1def09c446aae441410b70e6439ffe44dee866 (diff)
downloadop-kernel-dev-8aab47574a7f5b46a4cdbc6fd820ab34e6c5dbf9.zip
op-kernel-dev-8aab47574a7f5b46a4cdbc6fd820ab34e6c5dbf9.tar.gz
Bluetooth: Move SMP crypto functions to a workqueue
The function crypto_blkcipher_setkey() called by smp_e() can sleep, so all the crypto work has to be moved to hci_dev workqueue. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/smp.h')
-rw-r--r--include/net/bluetooth/smp.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index a9ba72c..15b97d5 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -116,13 +116,18 @@ struct smp_cmd_security_req {
#define SMP_MAX_ENC_KEY_SIZE 16
struct smp_chan {
+ struct l2cap_conn *conn;
u8 preq[7]; /* SMP Pairing Request */
u8 prsp[7]; /* SMP Pairing Response */
- u8 prnd[16]; /* SMP Pairing Random */
+ u8 prnd[16]; /* SMP Pairing Random (local) */
+ u8 rrnd[16]; /* SMP Pairing Random (remote) */
u8 pcnf[16]; /* SMP Pairing Confirm */
u8 tk[16]; /* SMP Temporary Key */
u8 smp_key_size;
struct crypto_blkcipher *tfm;
+ struct work_struct confirm;
+ struct work_struct random;
+
};
/* SMP Commands */
@@ -130,4 +135,6 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
int smp_distribute_keys(struct l2cap_conn *conn, __u8 force);
+void smp_chan_destroy(struct l2cap_conn *conn);
+
#endif /* __SMP_H */
OpenPOWER on IntegriCloud