Searched refs:llcp_sock (Results 1 - 3 of 3) sorted by relevance

/linux-4.1.27/net/nfc/
H A Dllcp_sock.c73 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_bind() local
111 llcp_sock->dev = dev; llcp_sock_bind()
112 llcp_sock->local = nfc_llcp_local_get(local); llcp_sock_bind()
113 llcp_sock->nfc_protocol = llcp_addr.nfc_protocol; llcp_sock_bind()
114 llcp_sock->service_name_len = min_t(unsigned int, llcp_sock_bind()
117 llcp_sock->service_name = kmemdup(llcp_addr.service_name, llcp_sock_bind()
118 llcp_sock->service_name_len, llcp_sock_bind()
121 llcp_sock->ssap = nfc_llcp_get_sdp_ssap(local, llcp_sock); llcp_sock_bind()
122 if (llcp_sock->ssap == LLCP_SAP_MAX) { llcp_sock_bind()
127 llcp_sock->reserved_ssap = llcp_sock->ssap; llcp_sock_bind()
131 pr_debug("Socket bound to SAP %d\n", llcp_sock->ssap); llcp_sock_bind()
147 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_raw_sock_bind() local
181 llcp_sock->dev = dev; llcp_raw_sock_bind()
182 llcp_sock->local = nfc_llcp_local_get(local); llcp_raw_sock_bind()
183 llcp_sock->nfc_protocol = llcp_addr.nfc_protocol; llcp_raw_sock_bind()
228 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); nfc_llcp_setsockopt() local
258 llcp_sock->rw = (u8) opt; nfc_llcp_setsockopt()
280 llcp_sock->miux = cpu_to_be16((u16) opt); nfc_llcp_setsockopt()
291 pr_debug("%p rw %d miux %d\n", llcp_sock, nfc_llcp_setsockopt()
292 llcp_sock->rw, llcp_sock->miux); nfc_llcp_setsockopt()
302 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); nfc_llcp_getsockopt() local
315 local = llcp_sock->local; nfc_llcp_getsockopt()
325 rw = llcp_sock->rw > LLCP_MAX_RW ? local->rw : llcp_sock->rw; nfc_llcp_getsockopt()
332 miux = be16_to_cpu(llcp_sock->miux) > LLCP_MAX_MIUX ? nfc_llcp_getsockopt()
333 be16_to_cpu(local->miux) : be16_to_cpu(llcp_sock->miux); nfc_llcp_getsockopt()
341 remote_miu = llcp_sock->remote_miu > LLCP_MAX_MIU ? nfc_llcp_getsockopt()
342 local->remote_miu : llcp_sock->remote_miu; nfc_llcp_getsockopt()
356 if (put_user(llcp_sock->remote_rw, (u32 __user *) optval)) nfc_llcp_getsockopt()
376 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); nfc_llcp_accept_unlink() local
380 list_del_init(&llcp_sock->accept_queue); nfc_llcp_accept_unlink()
381 sk_acceptq_removed(llcp_sock->parent); nfc_llcp_accept_unlink()
382 llcp_sock->parent = NULL; nfc_llcp_accept_unlink()
389 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); nfc_llcp_accept_enqueue() local
395 list_add_tail(&llcp_sock->accept_queue, nfc_llcp_accept_enqueue()
397 llcp_sock->parent = parent; nfc_llcp_accept_enqueue()
500 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_getname() local
503 if (llcp_sock == NULL || llcp_sock->dev == NULL) llcp_sock_getname()
506 pr_debug("%p %d %d %d\n", sk, llcp_sock->target_idx, llcp_sock_getname()
507 llcp_sock->dsap, llcp_sock->ssap); llcp_sock_getname()
513 llcp_addr->dev_idx = llcp_sock->dev->idx; llcp_sock_getname()
514 llcp_addr->target_idx = llcp_sock->target_idx; llcp_sock_getname()
515 llcp_addr->nfc_protocol = llcp_sock->nfc_protocol; llcp_sock_getname()
516 llcp_addr->dsap = llcp_sock->dsap; llcp_sock_getname()
517 llcp_addr->ssap = llcp_sock->ssap; llcp_sock_getname()
518 llcp_addr->service_name_len = llcp_sock->service_name_len; llcp_sock_getname()
519 memcpy(llcp_addr->service_name, llcp_sock->service_name, llcp_sock_getname()
527 struct nfc_llcp_sock *llcp_sock, *parent_sock; llcp_accept_poll() local
532 list_for_each_entry(llcp_sock, &parent_sock->accept_queue, llcp_accept_poll()
534 sk = &llcp_sock->sk; llcp_accept_poll()
586 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_release() local
594 local = llcp_sock->local; llcp_sock_release()
604 nfc_llcp_send_disconnect(llcp_sock); llcp_sock_release()
610 list_for_each_entry_safe(lsk, n, &llcp_sock->accept_queue, llcp_sock_release()
622 if (llcp_sock->reserved_ssap < LLCP_SAP_MAX) llcp_sock_release()
623 nfc_llcp_put_ssap(llcp_sock->local, llcp_sock->ssap); llcp_sock_release()
650 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_connect() local
701 llcp_sock->dev = dev; llcp_sock_connect()
702 llcp_sock->local = nfc_llcp_local_get(local); llcp_sock_connect()
703 llcp_sock->ssap = nfc_llcp_get_local_ssap(local); llcp_sock_connect()
704 if (llcp_sock->ssap == LLCP_SAP_MAX) { llcp_sock_connect()
709 llcp_sock->reserved_ssap = llcp_sock->ssap; llcp_sock_connect()
712 llcp_sock->dsap = addr->dsap; llcp_sock_connect()
714 llcp_sock->dsap = LLCP_SAP_SDP; llcp_sock_connect()
715 llcp_sock->nfc_protocol = addr->nfc_protocol; llcp_sock_connect()
716 llcp_sock->service_name_len = min_t(unsigned int, llcp_sock_connect()
719 llcp_sock->service_name = kmemdup(addr->service_name, llcp_sock_connect()
720 llcp_sock->service_name_len, llcp_sock_connect()
725 ret = nfc_llcp_send_connect(llcp_sock); llcp_sock_connect()
741 nfc_llcp_put_ssap(local, llcp_sock->ssap); llcp_sock_connect()
757 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_sendmsg() local
782 return nfc_llcp_send_ui_frame(llcp_sock, addr->dsap, addr->ssap, llcp_sock_sendmsg()
793 return nfc_llcp_send_i_frame(llcp_sock, msg, len); llcp_sock_sendmsg()
928 struct nfc_llcp_sock *llcp_sock = nfc_llcp_sock(sk); llcp_sock_destruct() local
933 nfc_put_device(llcp_sock->dev); llcp_sock_destruct()
937 nfc_llcp_sock_free(llcp_sock); llcp_sock_destruct()
948 struct nfc_llcp_sock *llcp_sock; nfc_llcp_sock_alloc() local
954 llcp_sock = nfc_llcp_sock(sk); nfc_llcp_sock_alloc()
962 llcp_sock->ssap = 0; nfc_llcp_sock_alloc()
963 llcp_sock->dsap = LLCP_SAP_SDP; nfc_llcp_sock_alloc()
964 llcp_sock->rw = LLCP_MAX_RW + 1; nfc_llcp_sock_alloc()
965 llcp_sock->miux = cpu_to_be16(LLCP_MAX_MIUX + 1); nfc_llcp_sock_alloc()
966 llcp_sock->send_n = llcp_sock->send_ack_n = 0; nfc_llcp_sock_alloc()
967 llcp_sock->recv_n = llcp_sock->recv_ack_n = 0; nfc_llcp_sock_alloc()
968 llcp_sock->remote_ready = 1; nfc_llcp_sock_alloc()
969 llcp_sock->reserved_ssap = LLCP_SAP_MAX; nfc_llcp_sock_alloc()
970 nfc_llcp_socket_remote_param_init(llcp_sock); nfc_llcp_sock_alloc()
971 skb_queue_head_init(&llcp_sock->tx_queue); nfc_llcp_sock_alloc()
972 skb_queue_head_init(&llcp_sock->tx_pending_queue); nfc_llcp_sock_alloc()
973 INIT_LIST_HEAD(&llcp_sock->accept_queue); nfc_llcp_sock_alloc()
H A DMakefile11 llcp_sock.o
H A Dllcp_core.c83 struct nfc_llcp_sock *llcp_sock; nfc_llcp_socket_release() local
90 llcp_sock = nfc_llcp_sock(sk); nfc_llcp_socket_release()
94 nfc_llcp_socket_purge(llcp_sock); nfc_llcp_socket_release()
97 nfc_put_device(llcp_sock->dev); nfc_llcp_socket_release()
104 &llcp_sock->accept_queue, nfc_llcp_socket_release()
139 llcp_sock = nfc_llcp_sock(sk); nfc_llcp_socket_release()
143 nfc_llcp_socket_purge(llcp_sock); nfc_llcp_socket_release()
202 struct nfc_llcp_sock *llcp_sock, *tmp_sock; nfc_llcp_sock_get() local
211 llcp_sock = NULL; nfc_llcp_sock_get()
217 llcp_sock = tmp_sock; nfc_llcp_sock_get()
224 if (llcp_sock == NULL) nfc_llcp_sock_get()
227 sock_hold(&llcp_sock->sk); nfc_llcp_sock_get()
229 return llcp_sock; nfc_llcp_sock_get()
343 struct nfc_llcp_sock *llcp_sock, *tmp_sock; nfc_llcp_sock_from_sn() local
352 llcp_sock = NULL; nfc_llcp_sock_from_sn()
375 llcp_sock = tmp_sock; nfc_llcp_sock_from_sn()
382 pr_debug("Found llcp sock %p\n", llcp_sock); nfc_llcp_sock_from_sn()
384 return llcp_sock; nfc_llcp_sock_from_sn()
716 struct nfc_llcp_sock *llcp_sock; nfc_llcp_tx_work() local
721 llcp_sock = nfc_llcp_sock(sk); nfc_llcp_tx_work()
723 if (llcp_sock == NULL && nfc_llcp_ptype(skb) == LLCP_PDU_I) { nfc_llcp_tx_work()
726 } else if (llcp_sock && !llcp_sock->remote_ready) { nfc_llcp_tx_work()
763 skb_queue_tail(&llcp_sock->tx_pending_queue, nfc_llcp_tx_work()
779 struct nfc_llcp_sock *llcp_sock; nfc_llcp_connecting_sock_get() local
784 llcp_sock = nfc_llcp_sock(sk); nfc_llcp_connecting_sock_get()
786 if (llcp_sock->ssap == ssap) { nfc_llcp_connecting_sock_get()
787 sock_hold(&llcp_sock->sk); nfc_llcp_connecting_sock_get()
792 llcp_sock = NULL; nfc_llcp_connecting_sock_get()
797 return llcp_sock; nfc_llcp_connecting_sock_get()
803 struct nfc_llcp_sock *llcp_sock; nfc_llcp_sock_get_sn() local
805 llcp_sock = nfc_llcp_sock_from_sn(local, sn, sn_len); nfc_llcp_sock_get_sn()
807 if (llcp_sock == NULL) nfc_llcp_sock_get_sn()
810 sock_hold(&llcp_sock->sk); nfc_llcp_sock_get_sn()
812 return llcp_sock; nfc_llcp_sock_get_sn()
841 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_ui() local
855 llcp_sock = nfc_llcp_sock_get(local, dsap, LLCP_SAP_SDP); nfc_llcp_recv_ui()
856 if (llcp_sock == NULL || llcp_sock->sk.sk_type != SOCK_DGRAM) nfc_llcp_recv_ui()
861 if (!sock_queue_rcv_skb(&llcp_sock->sk, skb)) { nfc_llcp_recv_ui()
871 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_ui()
1027 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_hdlc() local
1039 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); nfc_llcp_recv_hdlc()
1040 if (llcp_sock == NULL) { nfc_llcp_recv_hdlc()
1045 sk = &llcp_sock->sk; nfc_llcp_recv_hdlc()
1049 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_hdlc()
1054 pr_debug("I frame, queueing on %p\n", &llcp_sock->sk); nfc_llcp_recv_hdlc()
1056 if (ns == llcp_sock->recv_n) nfc_llcp_recv_hdlc()
1057 llcp_sock->recv_n = (llcp_sock->recv_n + 1) % 16; nfc_llcp_recv_hdlc()
1062 if (!sock_queue_rcv_skb(&llcp_sock->sk, skb)) { nfc_llcp_recv_hdlc()
1074 if (llcp_sock->send_ack_n != nr) { nfc_llcp_recv_hdlc()
1078 llcp_sock->send_ack_n = nr; nfc_llcp_recv_hdlc()
1081 skb_queue_walk_safe(&llcp_sock->tx_pending_queue, s, tmp) { nfc_llcp_recv_hdlc()
1084 skb_unlink(s, &llcp_sock->tx_pending_queue); nfc_llcp_recv_hdlc()
1092 skb_queue_reverse_walk_safe(&llcp_sock->tx_pending_queue, nfc_llcp_recv_hdlc()
1094 skb_unlink(s, &llcp_sock->tx_pending_queue); nfc_llcp_recv_hdlc()
1100 llcp_sock->remote_ready = true; nfc_llcp_recv_hdlc()
1102 llcp_sock->remote_ready = false; nfc_llcp_recv_hdlc()
1104 if (nfc_llcp_queue_i_frames(llcp_sock) == 0 && ptype == LLCP_PDU_I) nfc_llcp_recv_hdlc()
1105 nfc_llcp_send_rr(llcp_sock); nfc_llcp_recv_hdlc()
1108 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_hdlc()
1114 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_disc() local
1127 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); nfc_llcp_recv_disc()
1128 if (llcp_sock == NULL) { nfc_llcp_recv_disc()
1133 sk = &llcp_sock->sk; nfc_llcp_recv_disc()
1136 nfc_llcp_socket_purge(llcp_sock); nfc_llcp_recv_disc()
1140 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_disc()
1152 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_disc()
1157 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_cc() local
1164 llcp_sock = nfc_llcp_connecting_sock_get(local, dsap); nfc_llcp_recv_cc()
1165 if (llcp_sock == NULL) { nfc_llcp_recv_cc()
1172 sk = &llcp_sock->sk; nfc_llcp_recv_cc()
1177 llcp_sock->dsap = ssap; nfc_llcp_recv_cc()
1179 nfc_llcp_parse_connection_tlv(llcp_sock, &skb->data[LLCP_HEADER_SIZE], nfc_llcp_recv_cc()
1185 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_cc()
1190 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_dm() local
1203 llcp_sock = nfc_llcp_connecting_sock_get(local, dsap); nfc_llcp_recv_dm()
1207 llcp_sock = nfc_llcp_sock_get(local, dsap, ssap); nfc_llcp_recv_dm()
1211 if (llcp_sock == NULL) { nfc_llcp_recv_dm()
1216 sk = &llcp_sock->sk; nfc_llcp_recv_dm()
1222 nfc_llcp_sock_put(llcp_sock); nfc_llcp_recv_dm()
1228 struct nfc_llcp_sock *llcp_sock; nfc_llcp_recv_snl() local
1272 llcp_sock = nfc_llcp_sock_from_sn(local, service_name, nfc_llcp_recv_snl()
1274 if (!llcp_sock) { nfc_llcp_recv_snl()
1284 if (llcp_sock->ssap == LLCP_SDP_UNBOUND) { nfc_llcp_recv_snl()
1302 llcp_sock->ssap = sap; nfc_llcp_recv_snl()
1303 llcp_sock->reserved_ssap = sap; nfc_llcp_recv_snl()
1305 sap = llcp_sock->ssap; nfc_llcp_recv_snl()
1308 pr_debug("%p %d\n", llcp_sock, sap); nfc_llcp_recv_snl()

Completed in 62 milliseconds