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;
828 newsk = pep_find_pipe(&pn->hlist, &dst, pipe_handle);
876 sk_add_node(newsk, &pn->hlist);
886 struct pep_sock *pn = pep_sk(sk);
890 if (pn->pipe_handle == PN_PIPE_INVALID_HANDLE)
891 pn->pipe_handle = 1; /* anything but INVALID_HANDLE */
894 pn->init_enable, data, 4);
896 pn->pipe_handle = PN_PIPE_INVALID_HANDLE;
921 struct pep_sock *pn = pep_sk(sk);
934 !skb_queue_empty(&pn->ctrlreq_queue))
935 answ = skb_peek(&pn->ctrlreq_queue)->len;
950 else if (!pn->pn_sk.sobject)
963 struct pep_sock *pn = pep_sk(sk);
966 INIT_HLIST_HEAD(&pn->hlist);
967 pn->listener = NULL;
968 skb_queue_head_init(&pn->ctrlreq_queue);
969 atomic_set(&pn->tx_credits, 0);
970 pn->ifindex = 0;
971 pn->peer_type = 0;
972 pn->pipe_handle = PN_PIPE_INVALID_HANDLE;
973 pn->rx_credits = 0;
974 pn->rx_fc = pn->tx_fc = PN_LEGACY_FLOW_CONTROL;
975 pn->init_enable = 1;
976 pn->aligned = 0;
983 struct pep_sock *pn = pep_sk(sk);
1000 if (!pn->ifindex == !val)
1010 pn->ifindex = err;
1014 pn->ifindex = 0;
1024 pn->pipe_handle = val;
1030 pn->init_enable = !!val;
1045 struct pep_sock *pn = pep_sk(sk);
1055 val = pn->ifindex ? PNPIPE_ENCAP_IP : PNPIPE_ENCAP_NONE;
1059 val = pn->ifindex;
1063 val = pn->pipe_handle;
1069 val = pn->init_enable;
1086 struct pep_sock *pn = pep_sk(sk);
1090 if (pn_flow_safe(pn->tx_fc) &&
1091 !atomic_add_unless(&pn->tx_credits, -1, 0)) {
1096 skb_push(skb, 3 + pn->aligned);
1100 if (pn->aligned) {
1105 ph->pipe_handle = pn->pipe_handle;
1108 if (err && pn_flow_safe(pn->tx_fc))
1109 atomic_inc(&pn->tx_credits);
1116 struct pep_sock *pn = pep_sk(sk);
1135 skb_reserve(skb, MAX_PHONET_HEADER + 3 + pn->aligned);
1161 done = atomic_read(&pn->tx_credits);
1175 done = sk_wait_event(sk, &timeo, atomic_read(&pn->tx_credits), &wait);
1195 struct pep_sock *pn = pep_sk(sk);
1197 return atomic_read(&pn->tx_credits);
1255 struct pep_sock *pn = pep_sk(sk);
1259 skb = skb_dequeue(&pn->ctrlreq_queue);
1299 struct pep_sock *pn = pep_sk(sk);
1304 if (pn->listener != NULL) {
1305 skparent = pn->listener;
1306 pn->listener = NULL;
1309 pn = pep_sk(skparent);
1317 if (hlist_empty(&pn->hlist))
1318 pn_sock_unhash(&pn->pn_sk.sk);