Re: [PATCH 2/4] Bluetooth: Add functions to initialize the SMP workqueue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux