Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Andre Guedes <andre.guedes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [RFC v2 1/8] Bluetooth: Setup LE scan with no timeout
Date: Sat, 16 Feb 2013 23:26:31 +0100	[thread overview]
Message-ID: <1361053591.1583.9.camel@aeonflux> (raw)
In-Reply-To: <1360970828-24004-2-git-send-email-andre.guedes@openbossa.org>

Hi Andre,

> This patch modifies hci_do_le_scan and hci_cancel_le_scan helpers so
> we are able to start and stop LE scan with no timeout. This feature
> will be used by the LE connection routine.
> 
> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> ---
>  net/bluetooth/hci_core.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 22e77a7..3aa0345 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -1618,26 +1618,27 @@ static int hci_do_le_scan(struct hci_dev *hdev, u8 type, u16 interval,
>  	if (err < 0)
>  		return err;
>  
> -	queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable,
> -			   msecs_to_jiffies(timeout));
> +	if (timeout > 0)
> +		queue_delayed_work(hdev->workqueue, &hdev->le_scan_disable,
> +				   msecs_to_jiffies(timeout));
>  
>  	return 0;
>  }

I really do not like this magic handling of scan disable. Maybe you
better remove the timeout handling completely and put it into the
discovery functionality.

Doing it like this seems pretty much hacked together. It no longer looks
like the right place to do handle it.

Regards

Marcel



  reply	other threads:[~2013-02-16 22:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 23:27 [RFC v2 0/8] LE Connection Routine Andre Guedes
2013-02-15 23:27 ` [RFC v2 1/8] Bluetooth: Setup LE scan with no timeout Andre Guedes
2013-02-16 22:26   ` Marcel Holtmann [this message]
2013-02-18 22:07     ` Andre Guedes
2013-02-18 22:41       ` Marcel Holtmann
2013-02-19 18:15         ` Andre Guedes
2013-02-15 23:27 ` [RFC v2 2/8] Bluetooth: Add LE scan type macros Andre Guedes
2013-02-15 23:27 ` [RFC v2 3/8] Bluetooth: LE connection state machine Andre Guedes
2013-02-16 22:32   ` Marcel Holtmann
2013-02-18 22:08     ` Andre Guedes
2013-02-18 22:50       ` Marcel Holtmann
2013-02-19 18:15         ` Andre Guedes
2013-02-15 23:27 ` [RFC v2 4/8] Bluetooth: Add hci_conn helpers Andre Guedes
2013-02-15 23:27 ` [RFC v2 5/8] Bluetooth: Change LE connection routine Andre Guedes
2013-02-15 23:27 ` [RFC v2 6/8] Bluetooth: Handle hci_conn timeout in BT_CONNECT Andre Guedes
2013-02-15 23:27 ` [RFC v2 7/8] Bluetooth: Count pending LE connection attempts Andre Guedes
2013-02-15 23:27 ` [RFC v2 8/8] Bluetooth: Initialize some hci_conn fields earlier Andre Guedes

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=1361053591.1583.9.camel@aeonflux \
    --to=marcel@holtmann.org \
    --cc=andre.guedes@openbossa.org \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox