linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Change interleaved discovery behavior
@ 2012-02-24 14:41 Andre Guedes
  2012-02-24 14:41 ` [PATCH 2/2] Bluetooth: Trivial code style fix Andre Guedes
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andre Guedes @ 2012-02-24 14:41 UTC (permalink / raw)
  To: linux-bluetooth

According to last discussion on IRC, if an interleaved discovery is
issued, but the device is not dual mode, we should return error
instead of performing a regular BR/EDR or LE-only discovery.

Signed-off-by: Andre Guedes <andre.guedes@openbossa.org>
---
 net/bluetooth/mgmt.c |   29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 07e31f7..8a36e68 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2539,29 +2539,6 @@ unlock:
 	return err;
 }
 
-static int discovery(struct hci_dev *hdev)
-{
-	int err;
-
-	if (lmp_host_le_capable(hdev)) {
-		if (lmp_bredr_capable(hdev)) {
-			err = hci_le_scan(hdev, LE_SCAN_TYPE,
-						LE_SCAN_INT, LE_SCAN_WIN,
-						LE_SCAN_TIMEOUT_BREDR_LE);
-		} else {
-			hdev->discovery.type = DISCOV_TYPE_LE;
-			err = hci_le_scan(hdev, LE_SCAN_TYPE,
-						LE_SCAN_INT, LE_SCAN_WIN,
-						LE_SCAN_TIMEOUT_LE_ONLY);
-		}
-	} else {
-		hdev->discovery.type = DISCOV_TYPE_BREDR;
-		err = hci_do_inquiry(hdev, INQUIRY_LEN_BREDR);
-	}
-
-	return err;
-}
-
 int mgmt_interleaved_discovery(struct hci_dev *hdev)
 {
 	int err;
@@ -2631,7 +2608,11 @@ static int start_discovery(struct sock *sk, u16 index,
 		break;
 
 	case DISCOV_TYPE_INTERLEAVED:
-		err = discovery(hdev);
+		if (lmp_host_le_capable(hdev) && lmp_bredr_capable(hdev))
+			err = hci_le_scan(hdev, LE_SCAN_TYPE, LE_SCAN_INT,
+					LE_SCAN_WIN, LE_SCAN_TIMEOUT_BREDR_LE);
+		else
+			err = -ENOTSUPP;
 		break;
 
 	default:
-- 
1.7.9.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-01  1:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 14:41 [PATCH 1/2] Bluetooth: Change interleaved discovery behavior Andre Guedes
2012-02-24 14:41 ` [PATCH 2/2] Bluetooth: Trivial code style fix Andre Guedes
2012-02-28 17:36   ` Marcel Holtmann
2012-02-28 17:35 ` [PATCH 1/2] Bluetooth: Change interleaved discovery behavior Marcel Holtmann
2012-03-01  1:50 ` Johan Hedberg

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).