public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] Bluetooth: Allow only one LE connection attempt
@ 2012-05-30 13:39 Andrzej Kaczmarek
  2012-05-30 13:39 ` [PATCH 2/3] Bluetooth: Return proper mgmt state when LE pairing connection failed Andrzej Kaczmarek
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Andrzej Kaczmarek @ 2012-05-30 13:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

Only one outgoing LE connection attempt should be possible.
hci_connect() will now return -EBUSY in case there's another pending
outgoing connection.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
---
 net/bluetooth/hci_conn.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 1458667b..2fcced3 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -483,6 +483,11 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
 	if (type == LE_LINK) {
 		le = hci_conn_hash_lookup_ba(hdev, LE_LINK, dst);
 		if (!le) {
+			le = hci_conn_hash_lookup_state(hdev, LE_LINK,
+							BT_CONNECT);
+			if (le)
+				return ERR_PTR(-EBUSY);
+
 			le = hci_conn_add(hdev, LE_LINK, dst);
 			if (!le)
 				return ERR_PTR(-ENOMEM);
-- 
1.7.9.5


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

end of thread, other threads:[~2012-05-31 18:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 13:39 [PATCH 1/3] Bluetooth: Allow only one LE connection attempt Andrzej Kaczmarek
2012-05-30 13:39 ` [PATCH 2/3] Bluetooth: Return proper mgmt state when LE pairing connection failed Andrzej Kaczmarek
2012-05-31 18:52   ` Gustavo Padovan
2012-05-30 13:39 ` [PATCH 3/3] Bluetooth: Fix not removing hci_conn for failed LE connection Andrzej Kaczmarek
2012-05-31 18:55   ` Gustavo Padovan
2012-05-31 14:31 ` [PATCH 1/3] Bluetooth: Allow only one LE connection attempt Gustavo Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox