Lines Matching refs:pn

110 	struct pep_sock *pn = pep_sk(sk);  in pep_indicate()  local
121 ph->pipe_handle = pn->pipe_handle; in pep_indicate()
131 struct pep_sock *pn = pep_sk(sk); in pipe_handler_request() local
142 ph->pipe_handle = pn->pipe_handle; in pipe_handler_request()
149 struct pep_sock *pn = pep_sk(sk); in pipe_handler_send_created_ind() local
152 pn->tx_fc, pn->rx_fc, in pipe_handler_send_created_ind()
229 struct pep_sock *pn = pep_sk(sk); in pipe_grant_credits() local
233 switch (pn->rx_fc) { in pipe_grant_credits()
239 pn->rx_credits = 1; in pipe_grant_credits()
242 if ((pn->rx_credits + CREDITS_THR) > CREDITS_MAX) in pipe_grant_credits()
245 CREDITS_MAX - pn->rx_credits, in pipe_grant_credits()
247 pn->rx_credits = CREDITS_MAX; in pipe_grant_credits()
254 struct pep_sock *pn = pep_sk(sk); in pipe_rcv_status() local
270 switch (pn->tx_fc) { in pipe_rcv_status()
274 atomic_set(&pn->tx_credits, 0); in pipe_rcv_status()
277 atomic_set(&pn->tx_credits, wake = 1); in pipe_rcv_status()
283 atomic_set(&pn->tx_credits, wake = 1); in pipe_rcv_status()
289 if (pn->tx_fc != PN_MULTI_CREDIT_FLOW_CONTROL) in pipe_rcv_status()
291 atomic_add(wake = hdr->data[3], &pn->tx_credits); in pipe_rcv_status()
306 struct pep_sock *pn = pep_sk(sk); in pipe_rcv_created() local
310 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL; in pipe_rcv_created()
322 pn->tx_fc = data[0] & 3; in pipe_rcv_created()
323 pn->rx_fc = data[1] & 3; in pipe_rcv_created()
335 struct pep_sock *pn = pep_sk(sk); in pipe_do_rcv() local
362 pn->init_enable = 0; in pipe_do_rcv()
365 pn->init_enable = 1; in pipe_do_rcv()
373 atomic_set(&pn->tx_credits, 0); in pipe_do_rcv()
378 if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) { in pipe_do_rcv()
383 queue = &pn->ctrlreq_queue; in pipe_do_rcv()
391 if (!pn_flow_safe(pn->rx_fc)) { in pipe_do_rcv()
399 if (pn->rx_credits == 0) { in pipe_do_rcv()
404 pn->rx_credits--; in pipe_do_rcv()
422 if (!pn->init_enable) in pipe_do_rcv()
426 if (!pn_flow_safe(pn->tx_fc)) { in pipe_do_rcv()
427 atomic_set(&pn->tx_credits, 1); in pipe_do_rcv()
438 pn->rx_credits = 0; in pipe_do_rcv()
462 struct pep_sock *pn = pep_sk(sk); in pipe_destruct() local
465 skb_queue_purge(&pn->ctrlreq_queue); in pipe_destruct()
484 struct pep_sock *pn = pep_sk(sk); in pep_connresp_rcv() local
508 pn->tx_fc = pipe_negotiate_fc(data + 2, len - 2); in pep_connresp_rcv()
514 pn->rx_fc = pipe_negotiate_fc(data + 2, len - 2); in pep_connresp_rcv()
538 struct pep_sock *pn = pep_sk(sk); in pipe_start_flow_control() local
540 if (!pn_flow_safe(pn->tx_fc)) { in pipe_start_flow_control()
541 atomic_set(&pn->tx_credits, 1); in pipe_start_flow_control()
551 struct pep_sock *pn = pep_sk(sk); in pipe_handler_do_rcv() local
561 if (!pn_flow_safe(pn->rx_fc)) { in pipe_handler_do_rcv()
569 if (pn->rx_credits == 0) { in pipe_handler_do_rcv()
574 pn->rx_credits--; in pipe_handler_do_rcv()
591 if (pn->init_enable == PN_PIPE_DISABLE) in pipe_handler_do_rcv()
656 struct pep_sock *pn = pep_sk(sk); in pep_do_rcv() local
673 sknode = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_do_rcv()
717 struct pep_sock *pn = pep_sk(sk); in pipe_do_remove() local
728 ph->pipe_handle = pn->pipe_handle; in pipe_do_remove()
736 struct pep_sock *pn = pep_sk(sk); in pep_sock_close() local
753 ifindex = pn->ifindex; in pep_sock_close()
754 pn->ifindex = 0; in pep_sock_close()
765 struct pep_sock *pn = pep_sk(sk), *newpn; in pep_sock_accept() local
829 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle); in pep_sock_accept()
877 sk_add_node(newsk, &pn->hlist); in pep_sock_accept()
887 struct pep_sock *pn = pep_sk(sk); in pep_sock_connect() local
891 if (pn->pipe_handle == PN_PIPE_INVALID_HANDLE) in pep_sock_connect()
892 pn->pipe_handle = 1; /* anything but INVALID_HANDLE */ in pep_sock_connect()
895 pn->init_enable, data, 4); in pep_sock_connect()
897 pn->pipe_handle = PN_PIPE_INVALID_HANDLE; in pep_sock_connect()
922 struct pep_sock *pn = pep_sk(sk); in pep_ioctl() local
935 !skb_queue_empty(&pn->ctrlreq_queue)) in pep_ioctl()
936 answ = skb_peek(&pn->ctrlreq_queue)->len; in pep_ioctl()
951 else if (!pn->pn_sk.sobject) in pep_ioctl()
964 struct pep_sock *pn = pep_sk(sk); in pep_init() local
967 INIT_HLIST_HEAD(&pn->hlist); in pep_init()
968 pn->listener = NULL; in pep_init()
969 skb_queue_head_init(&pn->ctrlreq_queue); in pep_init()
970 atomic_set(&pn->tx_credits, 0); in pep_init()
971 pn->ifindex = 0; in pep_init()
972 pn->peer_type = 0; in pep_init()
973 pn->pipe_handle = PN_PIPE_INVALID_HANDLE; in pep_init()
974 pn->rx_credits = 0; in pep_init()
975 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL; in pep_init()
976 pn->init_enable = 1; in pep_init()
977 pn->aligned = 0; in pep_init()
984 struct pep_sock *pn = pep_sk(sk); in pep_setsockopt() local
1001 if (!pn->ifindex == !val) in pep_setsockopt()
1011 pn->ifindex = err; in pep_setsockopt()
1015 pn->ifindex = 0; in pep_setsockopt()
1025 pn->pipe_handle = val; in pep_setsockopt()
1031 pn->init_enable = !!val; in pep_setsockopt()
1046 struct pep_sock *pn = pep_sk(sk); in pep_getsockopt() local
1056 val = pn->ifindex ? PNPIPE_ENCAP_IP : PNPIPE_ENCAP_NONE; in pep_getsockopt()
1060 val = pn->ifindex; in pep_getsockopt()
1064 val = pn->pipe_handle; in pep_getsockopt()
1070 val = pn->init_enable; in pep_getsockopt()
1087 struct pep_sock *pn = pep_sk(sk); in pipe_skb_send() local
1091 if (pn_flow_safe(pn->tx_fc) && in pipe_skb_send()
1092 !atomic_add_unless(&pn->tx_credits, -1, 0)) { in pipe_skb_send()
1097 skb_push(skb, 3 + pn->aligned); in pipe_skb_send()
1101 if (pn->aligned) { in pipe_skb_send()
1106 ph->pipe_handle = pn->pipe_handle; in pipe_skb_send()
1109 if (err && pn_flow_safe(pn->tx_fc)) in pipe_skb_send()
1110 atomic_inc(&pn->tx_credits); in pipe_skb_send()
1117 struct pep_sock *pn = pep_sk(sk); in pep_sendmsg() local
1136 skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned); in pep_sendmsg()
1162 done = atomic_read(&pn->tx_credits); in pep_sendmsg()
1176 done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits), &wait); in pep_sendmsg()
1196 struct pep_sock *pn = pep_sk(sk); in pep_writeable() local
1198 return atomic_read(&pn->tx_credits); in pep_writeable()
1256 struct pep_sock *pn = pep_sk(sk); in pep_recvmsg() local
1260 skb = skb_dequeue(&pn->ctrlreq_queue); in pep_recvmsg()
1300 struct pep_sock *pn = pep_sk(sk); in pep_sock_unhash() local
1305 if (pn->listener != NULL) { in pep_sock_unhash()
1306 skparent = pn->listener; in pep_sock_unhash()
1307 pn->listener = NULL; in pep_sock_unhash()
1310 pn = pep_sk(skparent); in pep_sock_unhash()
1318 if (hlist_empty(&pn->hlist)) in pep_sock_unhash()
1319 pn_sock_unhash(&pn->pn_sk.sk); in pep_sock_unhash()