Lines Matching refs:po

177 static int __set_item(struct pppoe_net *pn, struct pppox_sock *po)  in __set_item()  argument
179 int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote); in __set_item()
184 if (cmp_2_addr(&ret->pppoe_pa, &po->pppoe_pa) && in __set_item()
185 ret->pppoe_ifindex == po->pppoe_ifindex) in __set_item()
191 po->next = pn->hash_table[hash]; in __set_item()
192 pn->hash_table[hash] = po; in __set_item()
226 struct pppox_sock *po; in get_item() local
229 po = __get_item(pn, sid, addr, ifindex); in get_item()
230 if (po) in get_item()
231 sock_hold(sk_pppox(po)); in get_item()
234 return po; in get_item()
281 struct pppox_sock *po = pn->hash_table[i]; in pppoe_flush_dev() local
284 while (po) { in pppoe_flush_dev()
285 while (po && po->pppoe_dev != dev) { in pppoe_flush_dev()
286 po = po->next; in pppoe_flush_dev()
289 if (!po) in pppoe_flush_dev()
292 sk = sk_pppox(po); in pppoe_flush_dev()
306 if (po->pppoe_dev == dev && in pppoe_flush_dev()
310 po->pppoe_dev = NULL; in pppoe_flush_dev()
324 po = pn->hash_table[i]; in pppoe_flush_dev()
367 struct pppox_sock *po = pppox_sk(sk); in pppoe_rcv_core() local
379 ppp_input(&po->chan, skb); in pppoe_rcv_core()
382 &po->pppoe_relay); in pppoe_rcv_core()
417 struct pppox_sock *po; in pppoe_rcv() local
447 po = get_item(pn, ph->sid, eth_hdr(skb)->h_source, dev->ifindex); in pppoe_rcv()
448 if (!po) in pppoe_rcv()
451 return sk_receive_skb(sk_pppox(po), skb, 0); in pppoe_rcv()
461 struct pppox_sock *po = container_of(work, struct pppox_sock, in pppoe_unbind_sock_work() local
463 struct sock *sk = sk_pppox(po); in pppoe_unbind_sock_work()
466 if (po->pppoe_dev) { in pppoe_unbind_sock_work()
467 dev_put(po->pppoe_dev); in pppoe_unbind_sock_work()
468 po->pppoe_dev = NULL; in pppoe_unbind_sock_work()
486 struct pppox_sock *po; in pppoe_disc_rcv() local
504 po = get_item(pn, ph->sid, eth_hdr(skb)->h_source, dev->ifindex); in pppoe_disc_rcv()
505 if (po) in pppoe_disc_rcv()
506 if (!schedule_work(&po->proto.pppoe.padt_work)) in pppoe_disc_rcv()
507 sock_put(sk_pppox(po)); in pppoe_disc_rcv()
564 struct pppox_sock *po; in pppoe_release() local
577 po = pppox_sk(sk); in pppoe_release()
579 if (po->pppoe_dev) { in pppoe_release()
580 dev_put(po->pppoe_dev); in pppoe_release()
581 po->pppoe_dev = NULL; in pppoe_release()
596 delete_item(pn, po->pppoe_pa.sid, po->pppoe_pa.remote, in pppoe_release()
597 po->pppoe_ifindex); in pppoe_release()
614 struct pppox_sock *po = pppox_sk(sk); in pppoe_connect() local
645 if (stage_session(po->pppoe_pa.sid)) { in pppoe_connect()
648 delete_item(pn, po->pppoe_pa.sid, in pppoe_connect()
649 po->pppoe_pa.remote, po->pppoe_ifindex); in pppoe_connect()
650 if (po->pppoe_dev) { in pppoe_connect()
651 dev_put(po->pppoe_dev); in pppoe_connect()
652 po->pppoe_dev = NULL; in pppoe_connect()
655 po->pppoe_ifindex = 0; in pppoe_connect()
656 memset(&po->pppoe_pa, 0, sizeof(po->pppoe_pa)); in pppoe_connect()
657 memset(&po->pppoe_relay, 0, sizeof(po->pppoe_relay)); in pppoe_connect()
658 memset(&po->chan, 0, sizeof(po->chan)); in pppoe_connect()
659 po->next = NULL; in pppoe_connect()
660 po->num = 0; in pppoe_connect()
673 po->pppoe_dev = dev; in pppoe_connect()
674 po->pppoe_ifindex = dev->ifindex; in pppoe_connect()
680 memcpy(&po->pppoe_pa, in pppoe_connect()
685 error = __set_item(pn, po); in pppoe_connect()
690 po->chan.hdrlen = (sizeof(struct pppoe_hdr) + in pppoe_connect()
693 po->chan.mtu = dev->mtu - sizeof(struct pppoe_hdr) - 2; in pppoe_connect()
694 po->chan.private = sk; in pppoe_connect()
695 po->chan.ops = &pppoe_chan_ops; in pppoe_connect()
697 error = ppp_register_net_channel(dev_net(dev), &po->chan); in pppoe_connect()
699 delete_item(pn, po->pppoe_pa.sid, in pppoe_connect()
700 po->pppoe_pa.remote, po->pppoe_ifindex); in pppoe_connect()
707 po->num = sp->sa_addr.pppoe.sid; in pppoe_connect()
713 if (po->pppoe_dev) { in pppoe_connect()
714 dev_put(po->pppoe_dev); in pppoe_connect()
715 po->pppoe_dev = NULL; in pppoe_connect()
740 struct pppox_sock *po = pppox_sk(sk); in pppoe_ioctl() local
751 if (put_user(po->pppoe_dev->mtu - in pppoe_ioctl()
768 if (val < (po->pppoe_dev->mtu in pppoe_ioctl()
798 if (copy_from_user(&po->pppoe_relay, in pppoe_ioctl()
804 if (po->pppoe_relay.sa_family != AF_PPPOX || in pppoe_ioctl()
805 po->pppoe_relay.sa_protocol != PX_PROTO_OE) in pppoe_ioctl()
810 relay_po = get_item_by_addr(sock_net(sk), &po->pppoe_relay); in pppoe_ioctl()
841 struct pppox_sock *po = pppox_sk(sk); in pppoe_sendmsg() local
858 hdr.sid = po->num; in pppoe_sendmsg()
860 dev = po->pppoe_dev; in pppoe_sendmsg()
894 po->pppoe_pa.remote, NULL, total_len); in pppoe_sendmsg()
914 struct pppox_sock *po = pppox_sk(sk); in __pppoe_xmit() local
915 struct net_device *dev = po->pppoe_dev; in __pppoe_xmit()
946 ph->sid = po->num; in __pppoe_xmit()
953 po->pppoe_pa.remote, NULL, data_len); in __pppoe_xmit()
980 struct pppox_sock *po = pppox_sk(sk); in pppoe_fill_forward_path() local
981 struct net_device *dev = po->pppoe_dev; in pppoe_fill_forward_path()
989 path->encap.id = be16_to_cpu(po->num); in pppoe_fill_forward_path()
990 memcpy(path->encap.h_dest, po->pppoe_pa.remote, ETH_ALEN); in pppoe_fill_forward_path()
991 memcpy(ctx->daddr, po->pppoe_pa.remote, ETH_ALEN); in pppoe_fill_forward_path()
1036 struct pppox_sock *po; in pppoe_seq_show() local
1044 po = v; in pppoe_seq_show()
1045 dev_name = po->pppoe_pa.dev; in pppoe_seq_show()
1048 po->pppoe_pa.sid, po->pppoe_pa.remote, dev_name); in pppoe_seq_show()
1055 struct pppox_sock *po; in pppoe_get_idx() local
1059 po = pn->hash_table[i]; in pppoe_get_idx()
1060 while (po) { in pppoe_get_idx()
1063 po = po->next; in pppoe_get_idx()
1068 return po; in pppoe_get_idx()
1084 struct pppox_sock *po; in pppoe_seq_next() local
1088 po = pppoe_get_idx(pn, 0); in pppoe_seq_next()
1091 po = v; in pppoe_seq_next()
1092 if (po->next) in pppoe_seq_next()
1093 po = po->next; in pppoe_seq_next()
1095 int hash = hash_item(po->pppoe_pa.sid, po->pppoe_pa.remote); in pppoe_seq_next()
1097 po = NULL; in pppoe_seq_next()
1099 po = pn->hash_table[hash]; in pppoe_seq_next()
1100 if (po) in pppoe_seq_next()
1106 return po; in pppoe_seq_next()