Lines Matching refs:llcp_sock
71 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_socket_release() local
78 llcp_sock = nfc_llcp_sock(sk); in nfc_llcp_socket_release()
82 nfc_llcp_socket_purge(llcp_sock); in nfc_llcp_socket_release()
85 nfc_put_device(llcp_sock->dev); in nfc_llcp_socket_release()
92 &llcp_sock->accept_queue, in nfc_llcp_socket_release()
127 llcp_sock = nfc_llcp_sock(sk); in nfc_llcp_socket_release()
131 nfc_llcp_socket_purge(llcp_sock); in nfc_llcp_socket_release()
205 struct nfc_llcp_sock *llcp_sock, *tmp_sock; in nfc_llcp_sock_get() local
214 llcp_sock = NULL; in nfc_llcp_sock_get()
220 llcp_sock = tmp_sock; in nfc_llcp_sock_get()
221 sock_hold(&llcp_sock->sk); in nfc_llcp_sock_get()
228 return llcp_sock; in nfc_llcp_sock_get()
364 struct nfc_llcp_sock *llcp_sock, *tmp_sock; in nfc_llcp_sock_from_sn() local
373 llcp_sock = NULL; in nfc_llcp_sock_from_sn()
396 llcp_sock = tmp_sock; in nfc_llcp_sock_from_sn()
398 sock_hold(&llcp_sock->sk); in nfc_llcp_sock_from_sn()
405 pr_debug("Found llcp sock %p\n", llcp_sock); in nfc_llcp_sock_from_sn()
407 return llcp_sock; in nfc_llcp_sock_from_sn()
763 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_tx_work() local
768 llcp_sock = nfc_llcp_sock(sk); in nfc_llcp_tx_work()
770 if (llcp_sock == NULL && nfc_llcp_ptype(skb) == LLCP_PDU_I) { in nfc_llcp_tx_work()
773 } else if (llcp_sock && !llcp_sock->remote_ready) { in nfc_llcp_tx_work()
802 skb_queue_tail(&llcp_sock->tx_pending_queue, in nfc_llcp_tx_work()
818 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_connecting_sock_get() local
823 llcp_sock = nfc_llcp_sock(sk); in nfc_llcp_connecting_sock_get()
825 if (llcp_sock->ssap == ssap) { in nfc_llcp_connecting_sock_get()
826 sock_hold(&llcp_sock->sk); in nfc_llcp_connecting_sock_get()
831 llcp_sock = NULL; in nfc_llcp_connecting_sock_get()
836 return llcp_sock; in nfc_llcp_connecting_sock_get()
872 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_ui() local
886 llcp_sock = nfc_llcp_sock_get(local, dsap, LLCP_SAP_SDP); in nfc_llcp_recv_ui()
887 if (llcp_sock == NULL || llcp_sock->sk.sk_type != SOCK_DGRAM) in nfc_llcp_recv_ui()
892 if (!sock_queue_rcv_skb(&llcp_sock->sk, skb)) { in nfc_llcp_recv_ui()
902 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_ui()
1067 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_hdlc() local
1079 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); in nfc_llcp_recv_hdlc()
1080 if (llcp_sock == NULL) { in nfc_llcp_recv_hdlc()
1085 sk = &llcp_sock->sk; in nfc_llcp_recv_hdlc()
1089 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_hdlc()
1094 pr_debug("I frame, queueing on %p\n", &llcp_sock->sk); in nfc_llcp_recv_hdlc()
1096 if (ns == llcp_sock->recv_n) in nfc_llcp_recv_hdlc()
1097 llcp_sock->recv_n = (llcp_sock->recv_n + 1) % 16; in nfc_llcp_recv_hdlc()
1102 if (!sock_queue_rcv_skb(&llcp_sock->sk, skb)) { in nfc_llcp_recv_hdlc()
1114 if (llcp_sock->send_ack_n != nr) { in nfc_llcp_recv_hdlc()
1118 llcp_sock->send_ack_n = nr; in nfc_llcp_recv_hdlc()
1121 skb_queue_walk_safe(&llcp_sock->tx_pending_queue, s, tmp) { in nfc_llcp_recv_hdlc()
1124 skb_unlink(s, &llcp_sock->tx_pending_queue); in nfc_llcp_recv_hdlc()
1132 skb_queue_reverse_walk_safe(&llcp_sock->tx_pending_queue, in nfc_llcp_recv_hdlc()
1134 skb_unlink(s, &llcp_sock->tx_pending_queue); in nfc_llcp_recv_hdlc()
1140 llcp_sock->remote_ready = true; in nfc_llcp_recv_hdlc()
1142 llcp_sock->remote_ready = false; in nfc_llcp_recv_hdlc()
1144 if (nfc_llcp_queue_i_frames(llcp_sock) == 0 && ptype == LLCP_PDU_I) in nfc_llcp_recv_hdlc()
1145 nfc_llcp_send_rr(llcp_sock); in nfc_llcp_recv_hdlc()
1148 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_hdlc()
1154 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_disc() local
1167 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); in nfc_llcp_recv_disc()
1168 if (llcp_sock == NULL) { in nfc_llcp_recv_disc()
1173 sk = &llcp_sock->sk; in nfc_llcp_recv_disc()
1176 nfc_llcp_socket_purge(llcp_sock); in nfc_llcp_recv_disc()
1180 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_disc()
1192 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_disc()
1198 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_cc() local
1205 llcp_sock = nfc_llcp_connecting_sock_get(local, dsap); in nfc_llcp_recv_cc()
1206 if (llcp_sock == NULL) { in nfc_llcp_recv_cc()
1213 sk = &llcp_sock->sk; in nfc_llcp_recv_cc()
1218 llcp_sock->dsap = ssap; in nfc_llcp_recv_cc()
1220 nfc_llcp_parse_connection_tlv(llcp_sock, &skb->data[LLCP_HEADER_SIZE], in nfc_llcp_recv_cc()
1226 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_cc()
1232 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_dm() local
1245 llcp_sock = nfc_llcp_connecting_sock_get(local, dsap); in nfc_llcp_recv_dm()
1249 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); in nfc_llcp_recv_dm()
1253 if (llcp_sock == NULL) { in nfc_llcp_recv_dm()
1258 sk = &llcp_sock->sk; in nfc_llcp_recv_dm()
1264 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_dm()
1270 struct nfc_llcp_sock *llcp_sock; in nfc_llcp_recv_snl() local
1315 llcp_sock = nfc_llcp_sock_from_sn(local, service_name, in nfc_llcp_recv_snl()
1318 if (!llcp_sock) { in nfc_llcp_recv_snl()
1328 if (llcp_sock->ssap == LLCP_SDP_UNBOUND) { in nfc_llcp_recv_snl()
1337 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_snl()
1347 llcp_sock->ssap = sap; in nfc_llcp_recv_snl()
1348 llcp_sock->reserved_ssap = sap; in nfc_llcp_recv_snl()
1350 sap = llcp_sock->ssap; in nfc_llcp_recv_snl()
1353 pr_debug("%p %d\n", llcp_sock, sap); in nfc_llcp_recv_snl()
1355 nfc_llcp_sock_put(llcp_sock); in nfc_llcp_recv_snl()