[PATCH 1/2] Bluetooth: Change interleaved discovery behavior

Subsystems: bluetooth subsystem, the rest

STALE5317d

5 messages, 3 authors, 2012-03-01 · open the first message on its own page

[PATCH 1/2] Bluetooth: Change interleaved discovery behavior

From: Andre Guedes <hidden>
Date: 2012-02-24 14:41:04

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 <redacted>
---
 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

[PATCH 2/2] Bluetooth: Trivial code style fix

From: Andre Guedes <hidden>
Date: 2012-02-24 14:41:05

Remove unneeded line break.

Signed-off-by: Andre Guedes <redacted>
---
 net/bluetooth/mgmt.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 8a36e68..f71dfc5 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2556,8 +2556,7 @@ int mgmt_interleaved_discovery(struct hci_dev *hdev)
 	return err;
 }
 
-static int start_discovery(struct sock *sk, u16 index,
-						void *data, u16 len)
+static int start_discovery(struct sock *sk, u16 index, void *data, u16 len)
 {
 	struct mgmt_cp_start_discovery *cp = data;
 	struct pending_cmd *cmd;
-- 
1.7.9.2

Re: [PATCH 1/2] Bluetooth: Change interleaved discovery behavior

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-02-28 17:35:57

Hi Andre,
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 <redacted>
---
 net/bluetooth/mgmt.c |   29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

Re: [PATCH 2/2] Bluetooth: Trivial code style fix

From: Marcel Holtmann <marcel@holtmann.org>
Date: 2012-02-28 17:36:25

Hi Andre,
Remove unneeded line break.

Signed-off-by: Andre Guedes <redacted>
---
 net/bluetooth/mgmt.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel

Re: [PATCH 1/2] Bluetooth: Change interleaved discovery behavior

From: Johan Hedberg <hidden>
Date: 2012-03-01 01:50:29

Hi Andre,

On Fri, Feb 24, 2012, Andre Guedes wrote:
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 <redacted>
---
 net/bluetooth/mgmt.c |   29 +++++------------------------
 1 file changed, 5 insertions(+), 24 deletions(-)
Applied. Thanks.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help