All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <padovan@profusion.mobi>
To: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/4] Bluetooth: Add functions to initialize the SMP workqueue
Date: Fri, 2 Sep 2011 14:58:40 -0300	[thread overview]
Message-ID: <20110902175840.GD12684@joana> (raw)
In-Reply-To: <1313798415-8555-2-git-send-email-vinicius.gomes@openbossa.org>

Hi Vinicius,

* Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [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@openbossa.org>
> ---
>  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

  reply	other threads:[~2011-09-02 17:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-20  0:00 [PATCH 1/4] Bluetooth: Move SMP fields to a separate structure Vinicius Costa Gomes
2011-08-20  0:00 ` [PATCH 2/4] Bluetooth: Add functions to initialize the SMP workqueue Vinicius Costa Gomes
2011-09-02 17:58   ` Gustavo Padovan [this message]
2011-08-20  0:00 ` [PATCH 3/4] Bluetooth: Initialize " Vinicius Costa Gomes
2011-08-22 14:05   ` Vinicius Costa Gomes
2011-08-25 22:23   ` [PATCH] " Vinicius Costa Gomes
2011-08-20  0:00 ` [PATCH 4/4] Bluetooth: Move SMP crypto functions to a workqueue Vinicius Costa Gomes
2011-09-02 18:01 ` [PATCH 1/4] Bluetooth: Move SMP fields to a separate structure Gustavo Padovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110902175840.GD12684@joana \
    --to=padovan@profusion.mobi \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.