linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Andre Guedes <andre.guedes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2 4/7] Bluetooth: Add helper functions to send LE scan commands
Date: Wed, 11 Jan 2012 15:52:42 +0200	[thread overview]
Message-ID: <20120111135242.GA27506@x220> (raw)
In-Reply-To: <1326230455-9117-5-git-send-email-andre.guedes@openbossa.org>

Hi Andre,

On Tue, Jan 10, 2012, Andre Guedes wrote:
> This patch creates two helper functions to send LE Set Scan
> Parameters and LE Set Scan Enable commands.
> 
> Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
> Acked-by: Marcel Holtmann <marcel@holtmann.org>
> ---
>  net/bluetooth/hci_core.c |   23 +++++++++++++++++++++++
>  1 files changed, 23 insertions(+), 0 deletions(-)
> 
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 29bc1c6..0f8884f 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -89,6 +89,29 @@ static void hci_notify(struct hci_dev *hdev, int event)
>  	atomic_notifier_call_chain(&hci_notifier, event, hdev);
>  }
>  
> +static int send_le_scan_param_cmd(struct hci_dev *hdev, u8 type, u16 interval,
> +								u16 window)
> +{
> +	struct hci_cp_le_set_scan_param cp;
> +
> +	memset(&cp, 0, sizeof(cp));
> +	cp.type = type;
> +	cp.interval = cpu_to_le16(interval);
> +	cp.window = cpu_to_le16(window);
> +
> +	return hci_send_cmd(hdev, HCI_OP_LE_SET_SCAN_PARAM, sizeof(cp), &cp);
> +}
> +
> +static int send_le_scan_enable_cmd(struct hci_dev *hdev, u8 enable)
> +{
> +	struct hci_cp_le_set_scan_enable cp;
> +
> +	memset(&cp, 0, sizeof(cp));
> +	cp.enable = enable;
> +
> +	return hci_send_cmd(hdev, HCI_OP_LE_SET_SCAN_ENABLE, sizeof(cp), &cp);
> +}
> +
>  /* ---- HCI requests ---- */
>  
>  void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result)

This patch generates the following compiler warnings:

net/bluetooth/hci_core.c:92:12: warning: 'send_le_scan_param_cmd' defined but not used [-Wunused-function]
net/bluetooth/hci_core.c:105:12: warning: 'send_le_scan_enable_cmd' defined but not used [-Wunused-function]

I suppose the functions should only be introduced in a patch that also
contains some users for them.

Johan

  reply	other threads:[~2012-01-11 13:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 21:20 [PATCH v2 0/7] MGMT Start Discovery command LE-Only Support Andre Guedes
2012-01-10 21:20 ` [PATCH v2 1/7] Bluetooth: Add 'eir_len' param to mgmt_device_found() Andre Guedes
2012-01-10 21:20 ` [PATCH v2 2/7] Bluetooth: Report LE devices Andre Guedes
2012-01-16 10:36   ` Johan Hedberg
2012-01-10 21:20 ` [PATCH v2 3/7] Bluetooth: LE scan should send Discovering events Andre Guedes
2012-01-10 21:20 ` [PATCH v2 4/7] Bluetooth: Add helper functions to send LE scan commands Andre Guedes
2012-01-11 13:52   ` Johan Hedberg [this message]
2012-01-11 14:13     ` Andre Guedes
2012-01-10 21:20 ` [PATCH v2 5/7] Bluetooth: LE scan infrastructure Andre Guedes
2012-01-10 21:20 ` [PATCH v2 6/7] Bluetooth: Add hci_do_le_scan() to hci_core Andre Guedes
2012-01-10 21:20 ` [PATCH v2 7/7] Bluetooth: MGMT start discovery LE-Only support 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=20120111135242.GA27506@x220 \
    --to=johan.hedberg@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).