aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Gix <bgix@codeaurora.org>2011-11-16 16:53:14 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-11-21 11:44:52 -0500
commit47c15e2b332dd51048170915ad8c4ab4b47e3bf2 (patch)
tree712c342cb9891f4cf6def93a60edbfc18518539a
parent0df4c185ed84d914fa2671fa5f4cec2f8dee2d2e (diff)
Bluetooth: Differentiate LE User Pairing Responses
Low Energy (LE) pairing responses must be recognized and handled differently from BR/EDR pairing responses. BR/EDR responses are handled via HCI commands by the LMP layer, and LE responses are handled by the Host. Signed-off-by: Brian Gix <bgix@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
-rw-r--r--net/bluetooth/mgmt.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 394222ef67a..c06a05c09a9 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -1587,6 +1587,30 @@ static int user_pairing_resp(struct sock *sk, u16 index, bdaddr_t *bdaddr,
1587 goto done; 1587 goto done;
1588 } 1588 }
1589 1589
1590 /*
1591 * Check for an existing ACL link, if present pair via
1592 * HCI commands.
1593 *
1594 * If no ACL link is present, check for an LE link and if
1595 * present, pair via the SMP engine.
1596 *
1597 * If neither ACL nor LE links are present, fail with error.
1598 */
1599 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, bdaddr);
1600 if (!conn) {
1601 conn = hci_conn_hash_lookup_ba(hdev, LE_LINK, bdaddr);
1602 if (!conn) {
1603 err = cmd_status(sk, index, mgmt_op,
1604 MGMT_STATUS_NOT_CONNECTED);
1605 goto done;
1606 }
1607
1608 /* Continue with pairing via SMP */
1609
1610 err = cmd_status(sk, index, mgmt_op, MGMT_STATUS_SUCCESS);
1611 goto done;
1612 }
1613
1590 cmd = mgmt_pending_add(sk, mgmt_op, hdev, bdaddr, sizeof(*bdaddr)); 1614 cmd = mgmt_pending_add(sk, mgmt_op, hdev, bdaddr, sizeof(*bdaddr));
1591 if (!cmd) { 1615 if (!cmd) {
1592 err = -ENOMEM; 1616 err = -ENOMEM;