Merge master.kernel.org:/pub/scm/linux/kernel/git/padovan/bluetooth-2.6
authorGustavo F. Padovan <padovan@profusion.mobi>
Tue, 21 Jun 2011 17:52:56 +0000 (14:52 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Tue, 21 Jun 2011 17:52:56 +0000 (14:52 -0300)
Conflicts:
net/bluetooth/l2cap_core.c

1  2 
net/bluetooth/hci_conn.c
net/bluetooth/l2cap_core.c

Simple merge
@@@ -4207,20 -3997,29 +4207,29 @@@ static int l2cap_security_cfm(struct hc
                                l2cap_send_cmd(conn, chan->ident,
                                        L2CAP_CONN_REQ, sizeof(req), &req);
                        } else {
 -                              l2cap_sock_clear_timer(sk);
 -                              l2cap_sock_set_timer(sk, HZ / 10);
 +                              __clear_chan_timer(chan);
 +                              __set_chan_timer(chan, HZ / 10);
                        }
 -              } else if (sk->sk_state == BT_CONNECT2) {
 +              } else if (chan->state == BT_CONNECT2) {
                        struct l2cap_conn_rsp rsp;
-                       __u16 result;
+                       __u16 res, stat;
  
                        if (!status) {
-                               l2cap_state_change(chan, BT_CONFIG);
-                               result = L2CAP_CR_SUCCESS;
+                               if (bt_sk(sk)->defer_setup) {
+                                       struct sock *parent = bt_sk(sk)->parent;
+                                       res = L2CAP_CR_PEND;
+                                       stat = L2CAP_CS_AUTHOR_PEND;
+                                       parent->sk_data_ready(parent, 0);
+                               } else {
 -                                      sk->sk_state = BT_CONFIG;
++                                      l2cap_state_change(chan, BT_CONFIG);
+                                       res = L2CAP_CR_SUCCESS;
+                                       stat = L2CAP_CS_NO_INFO;
+                               }
                        } else {
 -                              sk->sk_state = BT_DISCONN;
 -                              l2cap_sock_set_timer(sk, HZ / 10);
 +                              l2cap_state_change(chan, BT_DISCONN);
 +                              __set_chan_timer(chan, HZ / 10);
-                               result = L2CAP_CR_SEC_BLOCK;
+                               res = L2CAP_CR_SEC_BLOCK;
+                               stat = L2CAP_CS_NO_INFO;
                        }
  
                        rsp.scid   = cpu_to_le16(chan->dcid);
@@@ -4362,10 -4161,10 +4371,10 @@@ static int l2cap_debugfs_show(struct se
                seq_printf(f, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d %d\n",
                                        batostr(&bt_sk(sk)->src),
                                        batostr(&bt_sk(sk)->dst),
 -                                      sk->sk_state, __le16_to_cpu(c->psm),
 +                                      c->state, __le16_to_cpu(c->psm),
                                        c->scid, c->dcid, c->imtu, c->omtu,
                                        c->sec_level, c->mode);
--      }
++}
  
        read_unlock_bh(&chan_list_lock);