All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Add support for sending connection events for LE links
@ 2011-05-06 21:41 Vinicius Costa Gomes
  2011-05-06 21:41 ` [PATCH 2/2] Bluetooth: Add support for disconnecting LE links via mgmt Vinicius Costa Gomes
  0 siblings, 1 reply; 3+ messages in thread
From: Vinicius Costa Gomes @ 2011-05-06 21:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

We need to be able for receive events notifying that the connection
was established, the connection attempt failed or that disconnection
happened.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 net/bluetooth/hci_event.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index d5aa97e..f13ddbf 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1440,7 +1440,7 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
 
 	conn->state = BT_CLOSED;
 
-	if (conn->type == ACL_LINK)
+	if (conn->type == ACL_LINK || conn->type == LE_LINK)
 		mgmt_disconnected(hdev->id, &conn->dst);
 
 	hci_proto_disconn_cfm(conn, ev->reason);
@@ -2659,12 +2659,15 @@ static inline void hci_le_conn_complete_evt(struct hci_dev *hdev, struct sk_buff
 	}
 
 	if (ev->status) {
+		mgmt_connect_failed(hdev->id, &ev->bdaddr, ev->status);
 		hci_proto_connect_cfm(conn, ev->status);
 		conn->state = BT_CLOSED;
 		hci_conn_del(conn);
 		goto unlock;
 	}
 
+	mgmt_connected(hdev->id, &ev->bdaddr);
+
 	conn->handle = __le16_to_cpu(ev->handle);
 	conn->state = BT_CONNECTED;
 
-- 
1.7.4.3


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

* [PATCH 2/2] Bluetooth: Add support for disconnecting LE links via mgmt
  2011-05-06 21:41 [PATCH 1/2] Bluetooth: Add support for sending connection events for LE links Vinicius Costa Gomes
@ 2011-05-06 21:41 ` Vinicius Costa Gomes
  2011-05-11 19:42   ` Gustavo F. Padovan
  0 siblings, 1 reply; 3+ messages in thread
From: Vinicius Costa Gomes @ 2011-05-06 21:41 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Vinicius Costa Gomes

If we can't find a ACL link between the devices, we search
the connection list one second time looking for LE links.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
---
 net/bluetooth/mgmt.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 2481d25..dae382c 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1033,6 +1033,9 @@ static int disconnect(struct sock *sk, u16 index, unsigned char *data, u16 len)
 	}
 
 	conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &cp->bdaddr);
+	if (!conn)
+		conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, &cp->bdaddr);
+
 	if (!conn) {
 		err = cmd_status(sk, index, MGMT_OP_DISCONNECT, ENOTCONN);
 		goto failed;
-- 
1.7.4.3


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

* Re: [PATCH 2/2] Bluetooth: Add support for disconnecting LE links via mgmt
  2011-05-06 21:41 ` [PATCH 2/2] Bluetooth: Add support for disconnecting LE links via mgmt Vinicius Costa Gomes
@ 2011-05-11 19:42   ` Gustavo F. Padovan
  0 siblings, 0 replies; 3+ messages in thread
From: Gustavo F. Padovan @ 2011-05-11 19:42 UTC (permalink / raw)
  To: Vinicius Costa Gomes; +Cc: linux-bluetooth

Hi Vinicius,

* Vinicius Costa Gomes <vinicius.gomes@openbossa.org> [2011-05-06 18:41:44 -0300]:

> If we can't find a ACL link between the devices, we search
> the connection list one second time looking for LE links.

Both patches have been applied. Thanks.

-- 
Gustavo F. Padovan
http://profusion.mobi

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

end of thread, other threads:[~2011-05-11 19:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 21:41 [PATCH 1/2] Bluetooth: Add support for sending connection events for LE links Vinicius Costa Gomes
2011-05-06 21:41 ` [PATCH 2/2] Bluetooth: Add support for disconnecting LE links via mgmt Vinicius Costa Gomes
2011-05-11 19:42   ` Gustavo F. Padovan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.