Merge changes I9751454d,I4b962ef3 into msm-3.0
* changes:
Bluetooth: Fix l2cap conn failures for ssp devices
Bluetooth: Fix L2CAP connection establishment
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index ca33664..a8e5af9 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -787,6 +787,10 @@
if (!test_and_set_bit(HCI_CONN_AUTH_PEND, &conn->pend)) {
struct hci_cp_auth_requested cp;
+
+ /* encrypt must be pending if auth is also pending */
+ set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend);
+
cp.handle = cpu_to_le16(conn->handle);
hci_send_cmd(conn->hdev, HCI_OP_AUTH_REQUESTED,
sizeof(cp), &cp);
@@ -817,7 +821,7 @@
return 0;
} else if (conn->link_mode & HCI_LM_ENCRYPT) {
return hci_conn_auth(conn, sec_level, auth_type);
- } else if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
+ } else if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend)) {
return 0;
}