linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2 6/7] Bluetooth: Add hci_do_le_scan() to hci_core
Date: Tue, 10 Jan 2012 18:20:54 -0300	[thread overview]
Message-ID: <1326230455-9117-7-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1326230455-9117-1-git-send-email-andre.guedes@openbossa.org>

This patch adds to hci_core the hci_do_le_scan function which should
be used to scan LE devices.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 include/net/bluetooth/hci_core.h |    2 ++
 net/bluetooth/hci_core.c         |   21 +++++++++++++++++++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 07b9681..114d1a5 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -990,5 +990,7 @@ void hci_le_ltk_neg_reply(struct hci_conn *conn);
 
 int hci_do_inquiry(struct hci_dev *hdev, u8 length);
 int hci_cancel_inquiry(struct hci_dev *hdev);
+int hci_do_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
+								int timeout);
 
 #endif /* __HCI_CORE_H */
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 46bb069..a4f33eb 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2798,5 +2798,26 @@ int hci_cancel_inquiry(struct hci_dev *hdev)
 	return hci_send_cmd(hdev, HCI_OP_INQUIRY_CANCEL, 0, NULL);
 }
 
+int hci_do_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window,
+								int timeout)
+{
+	struct le_scan_params *params = &hdev->le_scan_params;
+
+	BT_DBG("%s", hdev->name);
+
+	if (work_busy(&hdev->le_scan_enable) ||
+				test_bit(HCI_LE_SCAN, &hdev->dev_flags))
+		return -EINPROGRESS;
+
+	params->type = type;
+	params->interval = interval;
+	params->window = window;
+	params->timeout = timeout;
+
+	queue_work(system_long_wq, &hdev->le_scan_enable);
+
+	return 0;
+}
+
 module_param(enable_hs, bool, 0644);
 MODULE_PARM_DESC(enable_hs, "Enable High Speed");
-- 
1.7.8.1


  parent reply	other threads:[~2012-01-10 21:20 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
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 ` Andre Guedes [this message]
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=1326230455-9117-7-git-send-email-andre.guedes@openbossa.org \
    --to=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).