diff options
author | Vinicius Costa Gomes <vinicius.gomes@openbossa.org> | 2011-09-05 13:31:31 -0400 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-09-21 11:58:12 -0400 |
commit | 8aab47574a7f5b46a4cdbc6fd820ab34e6c5dbf9 (patch) | |
tree | 69f31fec9ff2266d848f5e1f974928a65030c4e4 /include | |
parent | 1c1def09c446aae441410b70e6439ffe44dee866 (diff) |
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')
-rw-r--r-- | include/net/bluetooth/smp.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h index a9ba72c1dc79..15b97d549441 100644 --- a/include/net/bluetooth/smp.h +++ b/include/net/bluetooth/smp.h | |||
@@ -116,13 +116,18 @@ struct smp_cmd_security_req { | |||
116 | #define SMP_MAX_ENC_KEY_SIZE 16 | 116 | #define SMP_MAX_ENC_KEY_SIZE 16 |
117 | 117 | ||
118 | struct smp_chan { | 118 | struct smp_chan { |
119 | struct l2cap_conn *conn; | ||
119 | u8 preq[7]; /* SMP Pairing Request */ | 120 | u8 preq[7]; /* SMP Pairing Request */ |
120 | u8 prsp[7]; /* SMP Pairing Response */ | 121 | u8 prsp[7]; /* SMP Pairing Response */ |
121 | u8 prnd[16]; /* SMP Pairing Random */ | 122 | u8 prnd[16]; /* SMP Pairing Random (local) */ |
123 | u8 rrnd[16]; /* SMP Pairing Random (remote) */ | ||
122 | u8 pcnf[16]; /* SMP Pairing Confirm */ | 124 | u8 pcnf[16]; /* SMP Pairing Confirm */ |
123 | u8 tk[16]; /* SMP Temporary Key */ | 125 | u8 tk[16]; /* SMP Temporary Key */ |
124 | u8 smp_key_size; | 126 | u8 smp_key_size; |
125 | struct crypto_blkcipher *tfm; | 127 | struct crypto_blkcipher *tfm; |
128 | struct work_struct confirm; | ||
129 | struct work_struct random; | ||
130 | |||
126 | }; | 131 | }; |
127 | 132 | ||
128 | /* SMP Commands */ | 133 | /* SMP Commands */ |
@@ -130,4 +135,6 @@ int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level); | |||
130 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); | 135 | int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb); |
131 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); | 136 | int smp_distribute_keys(struct l2cap_conn *conn, __u8 force); |
132 | 137 | ||
138 | void smp_chan_destroy(struct l2cap_conn *conn); | ||
139 | |||
133 | #endif /* __SMP_H */ | 140 | #endif /* __SMP_H */ |