Lines Matching refs:pf
91 #define PF_TO_X(pf, X) container_of(pf, X, file) argument
93 #define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp) argument
94 #define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel) argument
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; in ppp_release() local
391 if (pf) { in ppp_release()
393 if (pf->kind == INTERFACE) { in ppp_release()
394 ppp = PF_TO_PPP(pf); in ppp_release()
398 if (atomic_dec_and_test(&pf->refcnt)) { in ppp_release()
399 switch (pf->kind) { in ppp_release()
401 ppp_destroy_interface(PF_TO_PPP(pf)); in ppp_release()
404 ppp_destroy_channel(PF_TO_CHANNEL(pf)); in ppp_release()
415 struct ppp_file *pf = file->private_data; in ppp_read() local
424 if (!pf) in ppp_read()
426 add_wait_queue(&pf->rwait, &wait); in ppp_read()
429 skb = skb_dequeue(&pf->rq); in ppp_read()
433 if (pf->dead) in ppp_read()
435 if (pf->kind == INTERFACE) { in ppp_read()
441 struct ppp *ppp = PF_TO_PPP(pf); in ppp_read()
455 remove_wait_queue(&pf->rwait, &wait); in ppp_read()
480 struct ppp_file *pf = file->private_data; in ppp_write() local
484 if (!pf) in ppp_write()
487 skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL); in ppp_write()
490 skb_reserve(skb, pf->hdrlen); in ppp_write()
497 skb_queue_tail(&pf->xq, skb); in ppp_write()
499 switch (pf->kind) { in ppp_write()
501 ppp_xmit_process(PF_TO_PPP(pf)); in ppp_write()
504 ppp_channel_push(PF_TO_CHANNEL(pf)); in ppp_write()
517 struct ppp_file *pf = file->private_data; in ppp_poll() local
520 if (!pf) in ppp_poll()
522 poll_wait(file, &pf->rwait, wait); in ppp_poll()
524 if (skb_peek(&pf->rq)) in ppp_poll()
526 if (pf->dead) in ppp_poll()
528 else if (pf->kind == INTERFACE) { in ppp_poll()
530 struct ppp *ppp = PF_TO_PPP(pf); in ppp_poll()
566 struct ppp_file *pf = file->private_data; in ppp_ioctl() local
576 if (!pf) in ppp_ioctl()
578 pf, file, cmd, arg); in ppp_ioctl()
594 if (pf->kind == INTERFACE) { in ppp_ioctl()
595 ppp = PF_TO_PPP(pf); in ppp_ioctl()
609 if (pf->kind == CHANNEL) { in ppp_ioctl()
614 pch = PF_TO_CHANNEL(pf); in ppp_ioctl()
639 if (pf->kind != INTERFACE) { in ppp_ioctl()
646 ppp = PF_TO_PPP(pf); in ppp_ioctl()
824 static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, in ppp_unattached_ioctl() argument
2767 init_ppp_file(struct ppp_file *pf, int kind) in init_ppp_file() argument
2769 pf->kind = kind; in init_ppp_file()
2770 skb_queue_head_init(&pf->xq); in init_ppp_file()
2771 skb_queue_head_init(&pf->rq); in init_ppp_file()
2772 atomic_set(&pf->refcnt, 1); in init_ppp_file()
2773 init_waitqueue_head(&pf->rwait); in init_ppp_file()