[Bluetooth] Use ACL config stage to retrieve remote features
[pandora-kernel.git] / net / bluetooth / hci_conn.c
index 69c64ce..6f22533 100644 (file)
@@ -65,16 +65,22 @@ void hci_acl_connect(struct hci_conn *conn)
 
        conn->attempt++;
 
+       conn->link_policy = hdev->link_policy;
+
        memset(&cp, 0, sizeof(cp));
        bacpy(&cp.bdaddr, &conn->dst);
        cp.pscan_rep_mode = 0x02;
 
-       if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst)) &&
-                       inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
-               cp.pscan_rep_mode = ie->data.pscan_rep_mode;
-               cp.pscan_mode     = ie->data.pscan_mode;
-               cp.clock_offset   = ie->data.clock_offset | cpu_to_le16(0x8000);
+       if ((ie = hci_inquiry_cache_lookup(hdev, &conn->dst))) {
+               if (inquiry_entry_age(ie) <= INQUIRY_ENTRY_AGE_MAX) {
+                       cp.pscan_rep_mode = ie->data.pscan_rep_mode;
+                       cp.pscan_mode     = ie->data.pscan_mode;
+                       cp.clock_offset   = ie->data.clock_offset |
+                                                       cpu_to_le16(0x8000);
+               }
+
                memcpy(conn->dev_class, ie->data.dev_class, 3);
+               conn->ssp_mode = ie->data.ssp_mode;
        }
 
        cp.pkt_type = cpu_to_le16(conn->pkt_type);
@@ -164,11 +170,13 @@ static void hci_conn_timeout(unsigned long arg)
 
        switch (conn->state) {
        case BT_CONNECT:
+       case BT_CONNECT2:
                if (conn->type == ACL_LINK)
                        hci_acl_connect_cancel(conn);
                else
                        hci_acl_disconn(conn, 0x13);
                break;
+       case BT_CONFIG:
        case BT_CONNECTED:
                hci_acl_disconn(conn, 0x13);
                break;