• Home
  • Raw
  • Download

Lines Matching refs:conn

43 static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent);
81 struct sco_conn *conn = hcon->sco_data; in sco_conn_add() local
83 if (conn) in sco_conn_add()
84 return conn; in sco_conn_add()
86 conn = kzalloc(sizeof(struct sco_conn), GFP_KERNEL); in sco_conn_add()
87 if (!conn) in sco_conn_add()
90 spin_lock_init(&conn->lock); in sco_conn_add()
92 hcon->sco_data = conn; in sco_conn_add()
93 conn->hcon = hcon; in sco_conn_add()
95 conn->src = &hdev->bdaddr; in sco_conn_add()
96 conn->dst = &hcon->dst; in sco_conn_add()
99 conn->mtu = hdev->sco_mtu; in sco_conn_add()
101 conn->mtu = 60; in sco_conn_add()
103 BT_DBG("hcon %p conn %p", hcon, conn); in sco_conn_add()
105 return conn; in sco_conn_add()
108 static struct sock *sco_chan_get(struct sco_conn *conn) in sco_chan_get() argument
111 sco_conn_lock(conn); in sco_chan_get()
112 sk = conn->sk; in sco_chan_get()
113 sco_conn_unlock(conn); in sco_chan_get()
119 struct sco_conn *conn = hcon->sco_data; in sco_conn_del() local
122 if (!conn) in sco_conn_del()
125 BT_DBG("hcon %p conn %p, err %d", hcon, conn, err); in sco_conn_del()
128 sk = sco_chan_get(conn); in sco_conn_del()
138 kfree(conn); in sco_conn_del()
142 static int sco_chan_add(struct sco_conn *conn, struct sock *sk, in sco_chan_add() argument
147 sco_conn_lock(conn); in sco_chan_add()
148 if (conn->sk) in sco_chan_add()
151 __sco_chan_add(conn, sk, parent); in sco_chan_add()
153 sco_conn_unlock(conn); in sco_chan_add()
162 struct sco_conn *conn; in sco_connect() local
189 conn = sco_conn_add(hcon); in sco_connect()
190 if (!conn) { in sco_connect()
197 bacpy(src, conn->src); in sco_connect()
199 err = sco_chan_add(conn, sk, NULL); in sco_connect()
219 struct sco_conn *conn = sco_pi(sk)->conn; in sco_send_frame() local
224 if (len > conn->mtu) in sco_send_frame()
238 hci_send_sco(conn->hcon, skb); in sco_send_frame()
243 static void sco_recv_frame(struct sco_conn *conn, struct sk_buff *skb) in sco_recv_frame() argument
245 struct sock *sk = sco_chan_get(conn); in sco_recv_frame()
356 if (sco_pi(sk)->conn->hcon) { in __sco_sock_close()
359 hci_conn_drop(sco_pi(sk)->conn->hcon); in __sco_sock_close()
360 sco_pi(sk)->conn->hcon = NULL; in __sco_sock_close()
672 static void sco_conn_defer_accept(struct hci_conn *conn, int mask) in sco_conn_defer_accept() argument
674 struct hci_dev *hdev = conn->hdev; in sco_conn_defer_accept()
676 BT_DBG("conn %p", conn); in sco_conn_defer_accept()
678 conn->state = BT_CONFIG; in sco_conn_defer_accept()
683 bacpy(&cp.bdaddr, &conn->dst); in sco_conn_defer_accept()
694 bacpy(&cp.bdaddr, &conn->dst); in sco_conn_defer_accept()
695 cp.pkt_type = cpu_to_le16(conn->pkt_type); in sco_conn_defer_accept()
718 sco_conn_defer_accept(pi->conn->hcon, 0); in sco_sock_recvmsg()
790 opts.mtu = sco_pi(sk)->conn->mtu; in sco_sock_getsockopt_old()
807 cinfo.hci_handle = sco_pi(sk)->conn->hcon->handle; in sco_sock_getsockopt_old()
808 memcpy(cinfo.dev_class, sco_pi(sk)->conn->hcon->dev_class, 3); in sco_sock_getsockopt_old()
910 static void __sco_chan_add(struct sco_conn *conn, struct sock *sk, struct sock *parent) in __sco_chan_add() argument
912 BT_DBG("conn %p", conn); in __sco_chan_add()
914 sco_pi(sk)->conn = conn; in __sco_chan_add()
915 conn->sk = sk; in __sco_chan_add()
925 struct sco_conn *conn; in sco_chan_del() local
927 conn = sco_pi(sk)->conn; in sco_chan_del()
929 BT_DBG("sk %p, conn %p, err %d", sk, conn, err); in sco_chan_del()
931 if (conn) { in sco_chan_del()
932 sco_conn_lock(conn); in sco_chan_del()
933 conn->sk = NULL; in sco_chan_del()
934 sco_pi(sk)->conn = NULL; in sco_chan_del()
935 sco_conn_unlock(conn); in sco_chan_del()
937 if (conn->hcon) in sco_chan_del()
938 hci_conn_drop(conn->hcon); in sco_chan_del()
948 static void sco_conn_ready(struct sco_conn *conn) in sco_conn_ready() argument
951 struct sock *sk = conn->sk; in sco_conn_ready()
953 BT_DBG("conn %p", conn); in sco_conn_ready()
962 sco_conn_lock(conn); in sco_conn_ready()
964 parent = sco_get_sock_listen(conn->src); in sco_conn_ready()
966 sco_conn_unlock(conn); in sco_conn_ready()
976 sco_conn_unlock(conn); in sco_conn_ready()
982 bacpy(&bt_sk(sk)->src, conn->src); in sco_conn_ready()
983 bacpy(&bt_sk(sk)->dst, conn->dst); in sco_conn_ready()
985 hci_conn_hold(conn->hcon); in sco_conn_ready()
986 __sco_chan_add(conn, sk, parent); in sco_conn_ready()
998 sco_conn_unlock(conn); in sco_conn_ready()
1034 struct sco_conn *conn; in sco_connect_cfm() local
1036 conn = sco_conn_add(hcon); in sco_connect_cfm()
1037 if (conn) in sco_connect_cfm()
1038 sco_conn_ready(conn); in sco_connect_cfm()
1052 struct sco_conn *conn = hcon->sco_data; in sco_recv_scodata() local
1054 if (!conn) in sco_recv_scodata()
1057 BT_DBG("conn %p len %d", conn, skb->len); in sco_recv_scodata()
1060 sco_recv_frame(conn, skb); in sco_recv_scodata()