Lines Matching refs:pn
122 struct pep_sock *pn = pep_sk(sk); in pep_indicate() local
133 ph->pipe_handle = pn->pipe_handle; in pep_indicate()
143 struct pep_sock *pn = pep_sk(sk); in pipe_handler_request() local
154 ph->pipe_handle = pn->pipe_handle; in pipe_handler_request()
161 struct pep_sock *pn = pep_sk(sk); in pipe_handler_send_created_ind() local
164 pn->tx_fc, pn->rx_fc, in pipe_handler_send_created_ind()
241 struct pep_sock *pn = pep_sk(sk); in pipe_grant_credits() local
245 switch (pn->rx_fc) { in pipe_grant_credits()
251 pn->rx_credits = 1; in pipe_grant_credits()
254 if ((pn->rx_credits + CREDITS_THR) > CREDITS_MAX) in pipe_grant_credits()
257 CREDITS_MAX - pn->rx_credits, in pipe_grant_credits()
259 pn->rx_credits = CREDITS_MAX; in pipe_grant_credits()
266 struct pep_sock *pn = pep_sk(sk); in pipe_rcv_status() local
282 switch (pn->tx_fc) { in pipe_rcv_status()
286 atomic_set(&pn->tx_credits, 0); in pipe_rcv_status()
289 atomic_set(&pn->tx_credits, wake = 1); in pipe_rcv_status()
295 atomic_set(&pn->tx_credits, wake = 1); in pipe_rcv_status()
301 if (pn->tx_fc != PN_MULTI_CREDIT_FLOW_CONTROL) in pipe_rcv_status()
303 atomic_add(wake = hdr->data[4], &pn->tx_credits); in pipe_rcv_status()
318 struct pep_sock *pn = pep_sk(sk); in pipe_rcv_created() local
322 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL; in pipe_rcv_created()
334 pn->tx_fc = data[0] & 3; in pipe_rcv_created()
335 pn->rx_fc = data[1] & 3; in pipe_rcv_created()
347 struct pep_sock *pn = pep_sk(sk); in pipe_do_rcv() local
374 pn->init_enable = 0; in pipe_do_rcv()
377 pn->init_enable = 1; in pipe_do_rcv()
385 atomic_set(&pn->tx_credits, 0); in pipe_do_rcv()
390 if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) { in pipe_do_rcv()
395 queue = &pn->ctrlreq_queue; in pipe_do_rcv()
403 if (!pn_flow_safe(pn->rx_fc)) { in pipe_do_rcv()
411 if (pn->rx_credits == 0) { in pipe_do_rcv()
416 pn->rx_credits--; in pipe_do_rcv()
434 if (!pn->init_enable) in pipe_do_rcv()
438 if (!pn_flow_safe(pn->tx_fc)) { in pipe_do_rcv()
439 atomic_set(&pn->tx_credits, 1); in pipe_do_rcv()
450 pn->rx_credits = 0; in pipe_do_rcv()
475 struct pep_sock *pn = pep_sk(sk); in pipe_destruct() local
478 skb_queue_purge(&pn->ctrlreq_queue); in pipe_destruct()
497 struct pep_sock *pn = pep_sk(sk); in pep_connresp_rcv() local
521 pn->tx_fc = pipe_negotiate_fc(data + 2, len - 2); in pep_connresp_rcv()
527 pn->rx_fc = pipe_negotiate_fc(data + 2, len - 2); in pep_connresp_rcv()
551 struct pep_sock *pn = pep_sk(sk); in pipe_start_flow_control() local
553 if (!pn_flow_safe(pn->tx_fc)) { in pipe_start_flow_control()
554 atomic_set(&pn->tx_credits, 1); in pipe_start_flow_control()
564 struct pep_sock *pn = pep_sk(sk); in pipe_handler_do_rcv() local
574 if (!pn_flow_safe(pn->rx_fc)) { in pipe_handler_do_rcv()
582 if (pn->rx_credits == 0) { in pipe_handler_do_rcv()
587 pn->rx_credits--; in pipe_handler_do_rcv()
605 if (pn->init_enable == PN_PIPE_DISABLE) in pipe_handler_do_rcv()
670 struct pep_sock *pn = pep_sk(sk); in pep_do_rcv() local
687 sknode = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_do_rcv()
731 struct pep_sock *pn = pep_sk(sk); in pipe_do_remove() local
742 ph->pipe_handle = pn->pipe_handle; in pipe_do_remove()
750 struct pep_sock *pn = pep_sk(sk); in pep_sock_close() local
767 ifindex = pn->ifindex; in pep_sock_close()
768 pn->ifindex = 0; in pep_sock_close()
778 struct pep_sock *pn = pep_sk(sk), *newpn; in pep_sock_accept() local
841 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_sock_accept()
887 sk_add_node(newsk, &pn->hlist); in pep_sock_accept()
897 struct pep_sock *pn = pep_sk(sk); in pep_sock_connect() local
901 if (pn->pipe_handle == PN_PIPE_INVALID_HANDLE) in pep_sock_connect()
902 pn->pipe_handle = 1; /* anything but INVALID_HANDLE */ in pep_sock_connect()
905 pn->init_enable, data, 4); in pep_sock_connect()
907 pn->pipe_handle = PN_PIPE_INVALID_HANDLE; in pep_sock_connect()
932 struct pep_sock *pn = pep_sk(sk); in pep_ioctl() local
945 !skb_queue_empty(&pn->ctrlreq_queue)) in pep_ioctl()
946 answ = skb_peek(&pn->ctrlreq_queue)->len; in pep_ioctl()
972 struct pep_sock *pn = pep_sk(sk); in pep_init() local
975 INIT_HLIST_HEAD(&pn->hlist); in pep_init()
976 pn->listener = NULL; in pep_init()
977 skb_queue_head_init(&pn->ctrlreq_queue); in pep_init()
978 atomic_set(&pn->tx_credits, 0); in pep_init()
979 pn->ifindex = 0; in pep_init()
980 pn->peer_type = 0; in pep_init()
981 pn->pipe_handle = PN_PIPE_INVALID_HANDLE; in pep_init()
982 pn->rx_credits = 0; in pep_init()
983 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL; in pep_init()
984 pn->init_enable = 1; in pep_init()
985 pn->aligned = 0; in pep_init()
992 struct pep_sock *pn = pep_sk(sk); in pep_setsockopt() local
1009 if (!pn->ifindex == !val) in pep_setsockopt()
1019 pn->ifindex = err; in pep_setsockopt()
1023 pn->ifindex = 0; in pep_setsockopt()
1033 pn->pipe_handle = val; in pep_setsockopt()
1039 pn->init_enable = !!val; in pep_setsockopt()
1054 struct pep_sock *pn = pep_sk(sk); in pep_getsockopt() local
1064 val = pn->ifindex ? PNPIPE_ENCAP_IP : PNPIPE_ENCAP_NONE; in pep_getsockopt()
1068 val = pn->ifindex; in pep_getsockopt()
1072 val = pn->pipe_handle; in pep_getsockopt()
1078 val = pn->init_enable; in pep_getsockopt()
1095 struct pep_sock *pn = pep_sk(sk); in pipe_skb_send() local
1099 if (pn_flow_safe(pn->tx_fc) && in pipe_skb_send()
1100 !atomic_add_unless(&pn->tx_credits, -1, 0)) { in pipe_skb_send()
1105 skb_push(skb, 3 + pn->aligned); in pipe_skb_send()
1109 if (pn->aligned) { in pipe_skb_send()
1114 ph->pipe_handle = pn->pipe_handle; in pipe_skb_send()
1117 if (err && pn_flow_safe(pn->tx_fc)) in pipe_skb_send()
1118 atomic_inc(&pn->tx_credits); in pipe_skb_send()
1126 struct pep_sock *pn = pep_sk(sk); in pep_sendmsg() local
1145 skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned); in pep_sendmsg()
1171 done = atomic_read(&pn->tx_credits); in pep_sendmsg()
1186 done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits)); in pep_sendmsg()
1206 struct pep_sock *pn = pep_sk(sk); in pep_writeable() local
1208 return atomic_read(&pn->tx_credits); in pep_writeable()
1267 struct pep_sock *pn = pep_sk(sk); in pep_recvmsg() local
1271 skb = skb_dequeue(&pn->ctrlreq_queue); in pep_recvmsg()
1311 struct pep_sock *pn = pep_sk(sk); in pep_sock_unhash() local
1316 if (pn->listener != NULL) { in pep_sock_unhash()
1317 skparent = pn->listener; in pep_sock_unhash()
1318 pn->listener = NULL; in pep_sock_unhash()
1321 pn = pep_sk(skparent); in pep_sock_unhash()
1329 if (hlist_empty(&pn->hlist)) in pep_sock_unhash()
1330 pn_sock_unhash(&pn->pn_sk.sk); in pep_sock_unhash()