Linux bluetooth development
 help / color / mirror / Atom feed
From: Andre Guedes <andre.guedes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Andre Guedes <andre.guedes@openbossa.org>
Subject: [RFC 15/16] Remove inquiry and scanning callbacks from btd_adapter_ops
Date: Fri, 29 Apr 2011 21:27:31 -0300	[thread overview]
Message-ID: <1304123252-14464-16-git-send-email-andre.guedes@openbossa.org> (raw)
In-Reply-To: <1304123252-14464-1-git-send-email-andre.guedes@openbossa.org>

The discovery procedure is implemented in discovery callbacks
(start_discovery and stop_discovery). We don't need inquiry and
scanning specifics callbacks in btd_adapter_ops anymore.
---
 plugins/hciops.c  |    4 ----
 plugins/mgmtops.c |   48 ------------------------------------------------
 src/adapter.h     |    4 ----
 3 files changed, 0 insertions(+), 56 deletions(-)

diff --git a/plugins/hciops.c b/plugins/hciops.c
index c3a28b9..db3ca84 100644
--- a/plugins/hciops.c
+++ b/plugins/hciops.c
@@ -3812,10 +3812,6 @@ static struct btd_adapter_ops hci_ops = {
 	.set_limited_discoverable = hciops_set_limited_discoverable,
 	.start_discovery = hciops_start_discovery,
 	.stop_discovery = hciops_stop_discovery,
-	.start_inquiry = hciops_start_inquiry,
-	.stop_inquiry = hciops_stop_inquiry,
-	.start_scanning = hciops_start_scanning,
-	.stop_scanning = hciops_stop_scanning,
 	.resolve_name = hciops_resolve_name,
 	.cancel_resolve_name = hciops_cancel_resolve_name,
 	.set_name = hciops_set_name,
diff --git a/plugins/mgmtops.c b/plugins/mgmtops.c
index a7a7d67..9e1cfac 100644
--- a/plugins/mgmtops.c
+++ b/plugins/mgmtops.c
@@ -1617,50 +1617,6 @@ static int mgmt_stop_discovery(int index)
 	return 0;
 }
 
-static int mgmt_start_inquiry(int index, uint8_t length, gboolean periodic)
-{
-	struct mgmt_hdr hdr;
-
-	DBG("index %d length %u periodic %d", index, length, periodic);
-
-	memset(&hdr, 0, sizeof(hdr));
-	hdr.opcode = htobs(MGMT_OP_START_DISCOVERY);
-	hdr.index = htobs(index);
-
-	if (write(mgmt_sock, &hdr, sizeof(hdr)) < 0)
-		return -errno;
-
-	return 0;
-}
-
-static int mgmt_stop_inquiry(int index)
-{
-	struct mgmt_hdr hdr;
-
-	DBG("index %d", index);
-
-	memset(&hdr, 0, sizeof(hdr));
-	hdr.opcode = htobs(MGMT_OP_STOP_DISCOVERY);
-	hdr.index = htobs(index);
-
-	if (write(mgmt_sock, &hdr, sizeof(hdr)) < 0)
-		return -errno;
-
-	return 0;
-}
-
-static int mgmt_start_scanning(int index, int timeout)
-{
-	DBG("index %d", index);
-	return -ENOSYS;
-}
-
-static int mgmt_stop_scanning(int index)
-{
-	DBG("index %d", index);
-	return -ENOSYS;
-}
-
 static int mgmt_resolve_name(int index, bdaddr_t *bdaddr)
 {
 	char addr[18];
@@ -2057,10 +2013,6 @@ static struct btd_adapter_ops mgmt_ops = {
 	.set_limited_discoverable = mgmt_set_limited_discoverable,
 	.start_discovery = mgmt_start_discovery,
 	.stop_discovery = mgmt_stop_discovery,
-	.start_inquiry = mgmt_start_inquiry,
-	.stop_inquiry = mgmt_stop_inquiry,
-	.start_scanning = mgmt_start_scanning,
-	.stop_scanning = mgmt_stop_scanning,
 	.resolve_name = mgmt_resolve_name,
 	.cancel_resolve_name = mgmt_cancel_resolve_name,
 	.set_name = mgmt_set_name,
diff --git a/src/adapter.h b/src/adapter.h
index 1db9225..4e15c17 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -187,10 +187,6 @@ struct btd_adapter_ops {
 	int (*set_limited_discoverable) (int index, gboolean limited);
 	int (*start_discovery) (int index);
 	int (*stop_discovery) (int index);
-	int (*start_inquiry) (int index, uint8_t length, gboolean periodic);
-	int (*stop_inquiry) (int index);
-	int (*start_scanning) (int index, int timeout);
-	int (*stop_scanning) (int index);
 
 	int (*resolve_name) (int index, bdaddr_t *bdaddr);
 	int (*cancel_resolve_name) (int index, bdaddr_t *bdaddr);
-- 
1.7.1


  parent reply	other threads:[~2011-04-30  0:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-30  0:27 [RFC 00/16] Discovery procedure refactoring Andre Guedes
2011-04-30  0:27 ` [RFC 01/16] Add discovery callbacks to btd_adapter_ops Andre Guedes
2011-04-30  0:27 ` [RFC 02/16] Replace inquiry/scanning calls by discovery calls Andre Guedes
2011-04-30  0:27 ` [RFC 03/16] Add 'discov_state' field to struct dev_info Andre Guedes
2011-04-30  0:27 ` [RFC 04/16] Code cleanup event.c Andre Guedes
2011-04-30  0:27 ` [RFC 05/16] Remove Periodic Inquiry support in hciops Andre Guedes
2011-05-02  7:38   ` Luiz Augusto von Dentz
2011-05-02 22:35     ` Andre Guedes
2011-04-30  0:27 ` [RFC 06/16] Change DiscoverSchedulerInterval default value Andre Guedes
2011-05-02  7:48   ` Luiz Augusto von Dentz
2011-05-02 22:37     ` Andre Guedes
2011-04-30  0:27 ` [RFC 07/16] Add 'timeout' param to start_scanning callback Andre Guedes
2011-04-30  0:27 ` [RFC 08/16] Refactoring adapter_set_state() Andre Guedes
2011-04-30  0:27 ` [RFC 09/16] Remove 'suspend' param from stop_discovery() Andre Guedes
2011-05-02  8:42   ` Luiz Augusto von Dentz
2011-05-02 22:38     ` Andre Guedes
2011-04-30  0:27 ` [RFC 10/16] Add extfeatures to struct dev_info Andre Guedes
2011-04-30  0:27 ` [RFC 11/16] Implement start_discovery hciops callback Andre Guedes
2011-04-30  0:27 ` [RFC 12/16] Remove obsolete code Andre Guedes
2011-04-30  0:27 ` [RFC 13/16] Implement stop_discovery hciops callback Andre Guedes
2011-04-30  0:27 ` [RFC 14/16] Implement mgmt start and stop discovery Andre Guedes
2011-04-30  0:27 ` Andre Guedes [this message]
2011-04-30  0:27 ` [RFC 16/16] Remove 'periodic' param from hciops_start_inquiry() Andre Guedes
2011-05-02  8:39 ` [RFC 00/16] Discovery procedure refactoring Luiz Augusto von Dentz
2011-05-02 14:01   ` Anderson Lizardo
2011-05-02 22:32   ` Andre Guedes
2011-05-05  8:26 ` Johan Hedberg
2011-05-10 14:03   ` 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=1304123252-14464-16-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