Lines Matching refs:pn

110 	struct pep_sock *pn = pep_sk(sk);
121 ph->pipe_handle = pn->pipe_handle;
131 struct pep_sock *pn = pep_sk(sk);
142 ph->pipe_handle = pn->pipe_handle;
149 struct pep_sock *pn = pep_sk(sk);
152 pn->tx_fc, pn->rx_fc,
229 struct pep_sock *pn = pep_sk(sk);
233 switch (pn->rx_fc) {
239 pn->rx_credits = 1;
242 if ((pn->rx_credits + CREDITS_THR) > CREDITS_MAX)
245 CREDITS_MAX - pn->rx_credits,
247 pn->rx_credits = CREDITS_MAX;
254 struct pep_sock *pn = pep_sk(sk);
270 switch (pn->tx_fc) {
274 atomic_set(&pn->tx_credits, 0);
277 atomic_set(&pn->tx_credits, wake = 1);
283 atomic_set(&pn->tx_credits, wake = 1);
289 if (pn->tx_fc != PN_MULTI_CREDIT_FLOW_CONTROL)
291 atomic_add(wake = hdr->data[3], &pn->tx_credits);
306 struct pep_sock *pn = pep_sk(sk);
310 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL;
322 pn->tx_fc = data[0] & 3;
323 pn->rx_fc = data[1] & 3;
335 struct pep_sock *pn = pep_sk(sk);
362 pn->init_enable = 0;
365 pn->init_enable = 1;
373 atomic_set(&pn->tx_credits, 0);
378 if (skb_queue_len(&pn->ctrlreq_queue) >= PNPIPE_CTRLREQ_MAX) {
383 queue = &pn->ctrlreq_queue;
391 if (!pn_flow_safe(pn->rx_fc)) {
399 if (pn->rx_credits == 0) {
404 pn->rx_credits--;
422 if (!pn->init_enable)
426 if (!pn_flow_safe(pn->tx_fc)) {
427 atomic_set(&pn->tx_credits, 1);
438 pn->rx_credits = 0;
462 struct pep_sock *pn = pep_sk(sk);
465 skb_queue_purge(&pn->ctrlreq_queue);
484 struct pep_sock *pn = pep_sk(sk);
508 pn->tx_fc = pipe_negotiate_fc(data + 2, len - 2);
514 pn->rx_fc = pipe_negotiate_fc(data + 2, len - 2);
538 struct pep_sock *pn = pep_sk(sk);
540 if (!pn_flow_safe(pn->tx_fc)) {
541 atomic_set(&pn->tx_credits, 1);
551 struct pep_sock *pn = pep_sk(sk);
561 if (!pn_flow_safe(pn->rx_fc)) {
569 if (pn->rx_credits == 0) {
574 pn->rx_credits--;
591 if (pn->init_enable == PN_PIPE_DISABLE)
656 struct pep_sock *pn = pep_sk(sk);
673 sknode = pep_find_pipe(&pn->hlist, &dst, pipe_handle);
717 struct pep_sock *pn = pep_sk(sk);
728 ph->pipe_handle = pn->pipe_handle;
736 struct pep_sock *pn = pep_sk(sk);
753 ifindex = pn->ifindex;
754 pn->ifindex = 0;
765 struct pep_sock *pn = pep_sk(sk), *newpn;
829 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle);
877 sk_add_node(newsk, &pn->hlist);
887 struct pep_sock *pn = pep_sk(sk);
891 if (pn->pipe_handle == PN_PIPE_INVALID_HANDLE)
892 pn->pipe_handle = 1; /* anything but INVALID_HANDLE */
895 pn->init_enable, data, 4);
897 pn->pipe_handle = PN_PIPE_INVALID_HANDLE;
922 struct pep_sock *pn = pep_sk(sk);
929 q = &pn->ctrlreq_queue;
953 struct pep_sock *pn = pep_sk(sk);
973 else if (!pn->pn_sk.sobject)
986 struct pep_sock *pn = pep_sk(sk);
989 INIT_HLIST_HEAD(&pn->hlist);
990 pn->listener = NULL;
991 skb_queue_head_init(&pn->ctrlreq_queue);
992 atomic_set(&pn->tx_credits, 0);
993 pn->ifindex = 0;
994 pn->peer_type = 0;
995 pn->pipe_handle = PN_PIPE_INVALID_HANDLE;
996 pn->rx_credits = 0;
997 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL;
998 pn->init_enable = 1;
999 pn->aligned = 0;
1006 struct pep_sock *pn = pep_sk(sk);
1023 if (!pn->ifindex == !val)
1033 pn->ifindex = err;
1037 pn->ifindex = 0;
1047 pn->pipe_handle = val;
1053 pn->init_enable = !!val;
1068 struct pep_sock *pn = pep_sk(sk);
1078 val = pn->ifindex ? PNPIPE_ENCAP_IP : PNPIPE_ENCAP_NONE;
1082 val = pn->ifindex;
1086 val = pn->pipe_handle;
1092 val = pn->init_enable;
1109 struct pep_sock *pn = pep_sk(sk);
1113 if (pn_flow_safe(pn->tx_fc) &&
1114 !atomic_add_unless(&pn->tx_credits, -1, 0)) {
1119 skb_push(skb, 3 + pn->aligned);
1123 if (pn->aligned) {
1128 ph->pipe_handle = pn->pipe_handle;
1131 if (err && pn_flow_safe(pn->tx_fc))
1132 atomic_inc(&pn->tx_credits);
1139 struct pep_sock *pn = pep_sk(sk);
1158 skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned);
1184 done = atomic_read(&pn->tx_credits);
1198 done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits), &wait);
1218 struct pep_sock *pn = pep_sk(sk);
1220 return atomic_read(&pn->tx_credits);
1278 struct pep_sock *pn = pep_sk(sk);
1282 skb = skb_dequeue(&pn->ctrlreq_queue);
1322 struct pep_sock *pn = pep_sk(sk);
1327 if (pn->listener != NULL) {
1328 skparent = pn->listener;
1329 pn->listener = NULL;
1332 pn = pep_sk(skparent);
1340 if (hlist_empty(&pn->hlist))
1341 pn_sock_unhash(&pn->pn_sk.sk);