Hi Vinicius, * Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxxxxxx> [2011-08-19 21:00:13 -0300]: > SMP crypto function crypto_blkcypher_setkey() may sleep, so we need > to move that part of the SMP procedure inside a workqueue. > > Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@xxxxxxxxxxxxx> > --- > include/net/bluetooth/smp.h | 3 +++ > net/bluetooth/smp.c | 24 ++++++++++++++++++++++++ > 2 files changed, 27 insertions(+), 0 deletions(-) > > diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h > index 46c4576..884ed41 100644 > --- a/include/net/bluetooth/smp.h > +++ b/include/net/bluetooth/smp.h > @@ -120,4 +120,7 @@ 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); > > +int smp_crypto_init(void); > +void smp_crypto_exit(void); > + > #endif /* __SMP_H */ > diff --git a/net/bluetooth/smp.c b/net/bluetooth/smp.c > index f911930..9edd317 100644 > --- a/net/bluetooth/smp.c > +++ b/net/bluetooth/smp.c > @@ -20,6 +20,7 @@ > SOFTWARE IS DISCLAIMED. > */ > > +#include <linux/errno.h> > #include <net/bluetooth/bluetooth.h> > #include <net/bluetooth/hci_core.h> > #include <net/bluetooth/l2cap.h> > @@ -30,6 +31,8 @@ > > #define SMP_TIMEOUT 30000 /* 30 seconds */ > > +static struct workqueue_struct *crypto_wq; > + Let's use hdev->workqueue instead of creating a new one. Gustavo -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html