[Bluetooth] Track status of remote Simple Pairing mode
[pandora-kernel.git] / net / bluetooth / hci_conn.c
index 69c64ce..41351ba 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);