Merge branch 'exynos-drm' of git://git.infradead.org/users/kmpark/linux-samsung into...
[pandora-kernel.git] / net / bluetooth / hci_conn.c
index ea7f031..e0af723 100644 (file)
@@ -56,15 +56,15 @@ static void hci_le_connect(struct hci_conn *conn)
        conn->sec_level = BT_SECURITY_LOW;
 
        memset(&cp, 0, sizeof(cp));
-       cp.scan_interval = cpu_to_le16(0x0004);
-       cp.scan_window = cpu_to_le16(0x0004);
+       cp.scan_interval = cpu_to_le16(0x0060);
+       cp.scan_window = cpu_to_le16(0x0030);
        bacpy(&cp.peer_addr, &conn->dst);
        cp.peer_addr_type = conn->dst_type;
-       cp.conn_interval_min = cpu_to_le16(0x0008);
-       cp.conn_interval_max = cpu_to_le16(0x0100);
-       cp.supervision_timeout = cpu_to_le16(0x0064);
-       cp.min_ce_len = cpu_to_le16(0x0001);
-       cp.max_ce_len = cpu_to_le16(0x0001);
+       cp.conn_interval_min = cpu_to_le16(0x0028);
+       cp.conn_interval_max = cpu_to_le16(0x0038);
+       cp.supervision_timeout = cpu_to_le16(0x002a);
+       cp.min_ce_len = cpu_to_le16(0x0000);
+       cp.max_ce_len = cpu_to_le16(0x0000);
 
        hci_send_cmd(hdev, HCI_OP_LE_CREATE_CONN, sizeof(cp), &cp);
 }
@@ -218,7 +218,7 @@ void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
        cp.handle = cpu_to_le16(conn->handle);
        memcpy(cp.ltk, ltk, sizeof(cp.ltk));
        cp.ediv = ediv;
-       memcpy(cp.rand, rand, sizeof(rand));
+       memcpy(cp.rand, rand, sizeof(cp.rand));
 
        hci_send_cmd(hdev, HCI_OP_LE_START_ENC, sizeof(cp), &cp);
 }
@@ -673,7 +673,7 @@ int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
                goto encrypt;
 
 auth:
-       if (test_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
+       if (test_and_set_bit(HCI_CONN_ENCRYPT_PEND, &conn->pend))
                return 0;
 
        if (!hci_conn_auth(conn, sec_level, auth_type))