All of lore.kernel.org
 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: [PATCH] Bluetooth: Check capabilities in BR/EDR and LE-Only discovery
Date: Thu, 23 Feb 2012 22:14:25 +0100	[thread overview]
Message-ID: <1330031665.3392.4.camel@aeonflux> (raw)
In-Reply-To: <1330031367-10614-1-git-send-email-andre.guedes@openbossa.org>

Hi Andre,

> This patch add an extra check for BR/EDR and LE-Only discovery.
> This way, we are able to return error immediately if the discovery
> type requested is not supported by the device.
> 
> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> ---
>  net/bluetooth/mgmt.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
> index 93f2c13..de40918 100644
> --- a/net/bluetooth/mgmt.c
> +++ b/net/bluetooth/mgmt.c
> @@ -2552,12 +2552,18 @@ static int start_discovery(struct sock *sk, u16 index,
>  
>  	switch (hdev->discovery.type) {
>  	case DISCOV_TYPE_BREDR:
> -		err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
> +		if (lmp_bredr_capable(hdev))
> +			err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
> +		else
> +			err = -ENOTSUPP;
>  		break;
>  
>  	case DISCOV_TYPE_LE:
> -		err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
> +		if (lmp_host_le_capable(hdev))
> +			err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
>  					LE_SCAN_WIN, LE_SCAN_TIMEOUT_LE_ONLY);
> +		else
> +			err = -ENOTSUPP;
>  		break;
>  
>  	case DISCOV_TYPE_INTERLEAVED:

so what about interleaved. Should that actually suceed if LE is not
enabled?

Regards

Marcel



  reply	other threads:[~2012-02-23 21:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 21:09 [PATCH] Bluetooth: Check capabilities in BR/EDR and LE-Only discovery Andre Guedes
2012-02-23 21:14 ` Marcel Holtmann [this message]
2012-02-23 21:23   ` Andre Guedes
2012-02-23 22:00     ` Marcel Holtmann
2012-02-23 22:05 ` Marcel Holtmann
2012-03-01 15:05 ` Johan Hedberg

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=1330031665.3392.4.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 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.