Lines Matching refs:pf

91 #define PF_TO_X(pf, X)		container_of(pf, X, file)
93 #define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp)
94 #define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel)
248 static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
273 static void init_ppp_file(struct ppp_file *pf, int kind);
388 struct ppp_file *pf = file->private_data;
391 if (pf) {
393 if (pf->kind == INTERFACE) {
394 ppp = PF_TO_PPP(pf);
398 if (atomic_dec_and_test(&pf->refcnt)) {
399 switch (pf->kind) {
401 ppp_destroy_interface(PF_TO_PPP(pf));
404 ppp_destroy_channel(PF_TO_CHANNEL(pf));
415 struct ppp_file *pf = file->private_data;
423 if (!pf)
425 add_wait_queue(&pf->rwait, &wait);
428 skb = skb_dequeue(&pf->rq);
432 if (pf->dead)
434 if (pf->kind == INTERFACE) {
440 struct ppp *ppp = PF_TO_PPP(pf);
454 remove_wait_queue(&pf->rwait, &wait);
478 struct ppp_file *pf = file->private_data;
482 if (!pf)
485 skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL);
488 skb_reserve(skb, pf->hdrlen);
495 skb_queue_tail(&pf->xq, skb);
497 switch (pf->kind) {
499 ppp_xmit_process(PF_TO_PPP(pf));
502 ppp_channel_push(PF_TO_CHANNEL(pf));
515 struct ppp_file *pf = file->private_data;
518 if (!pf)
520 poll_wait(file, &pf->rwait, wait);
522 if (skb_peek(&pf->rq))
524 if (pf->dead)
526 else if (pf->kind == INTERFACE) {
528 struct ppp *ppp = PF_TO_PPP(pf);
564 struct ppp_file *pf = file->private_data;
574 if (!pf)
576 pf, file, cmd, arg);
592 if (pf->kind == INTERFACE) {
593 ppp = PF_TO_PPP(pf);
607 if (pf->kind == CHANNEL) {
612 pch = PF_TO_CHANNEL(pf);
637 if (pf->kind != INTERFACE) {
644 ppp = PF_TO_PPP(pf);
824 static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf,
2766 init_ppp_file(struct ppp_file *pf, int kind)
2768 pf->kind = kind;
2769 skb_queue_head_init(&pf->xq);
2770 skb_queue_head_init(&pf->rq);
2771 atomic_set(&pf->refcnt, 1);
2772 init_waitqueue_head(&pf->rwait);