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,
274 static void init_ppp_file(struct ppp_file *pf, int kind);
390 struct ppp_file *pf = file->private_data; in ppp_release() local
393 if (pf) { in ppp_release()
395 if (pf->kind == INTERFACE) { in ppp_release()
396 ppp = PF_TO_PPP(pf); in ppp_release()
402 if (atomic_dec_and_test(&pf->refcnt)) { in ppp_release()
403 switch (pf->kind) { in ppp_release()
405 ppp_destroy_interface(PF_TO_PPP(pf)); in ppp_release()
408 ppp_destroy_channel(PF_TO_CHANNEL(pf)); in ppp_release()
419 struct ppp_file *pf = file->private_data; in ppp_read() local
428 if (!pf) in ppp_read()
430 add_wait_queue(&pf->rwait, &wait); in ppp_read()
433 skb = skb_dequeue(&pf->rq); in ppp_read()
437 if (pf->dead) in ppp_read()
439 if (pf->kind == INTERFACE) { in ppp_read()
445 struct ppp *ppp = PF_TO_PPP(pf); in ppp_read()
459 remove_wait_queue(&pf->rwait, &wait); in ppp_read()
484 struct ppp_file *pf = file->private_data; in ppp_write() local
488 if (!pf) in ppp_write()
491 skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL); in ppp_write()
494 skb_reserve(skb, pf->hdrlen); in ppp_write()
501 skb_queue_tail(&pf->xq, skb); in ppp_write()
503 switch (pf->kind) { in ppp_write()
505 ppp_xmit_process(PF_TO_PPP(pf)); in ppp_write()
508 ppp_channel_push(PF_TO_CHANNEL(pf)); in ppp_write()
521 struct ppp_file *pf = file->private_data; in ppp_poll() local
524 if (!pf) in ppp_poll()
526 poll_wait(file, &pf->rwait, wait); in ppp_poll()
528 if (skb_peek(&pf->rq)) in ppp_poll()
530 if (pf->dead) in ppp_poll()
532 else if (pf->kind == INTERFACE) { in ppp_poll()
534 struct ppp *ppp = PF_TO_PPP(pf); in ppp_poll()
570 struct ppp_file *pf; in ppp_ioctl() local
582 pf = file->private_data; in ppp_ioctl()
583 if (!pf) { in ppp_ioctl()
585 pf, file, cmd, arg); in ppp_ioctl()
602 if (pf->kind == INTERFACE) { in ppp_ioctl()
603 ppp = PF_TO_PPP(pf); in ppp_ioctl()
618 if (pf->kind == CHANNEL) { in ppp_ioctl()
622 pch = PF_TO_CHANNEL(pf); in ppp_ioctl()
646 if (pf->kind != INTERFACE) { in ppp_ioctl()
653 ppp = PF_TO_PPP(pf); in ppp_ioctl()
834 static int ppp_unattached_ioctl(struct net *net, struct ppp_file *pf, in ppp_unattached_ioctl() argument
2822 init_ppp_file(struct ppp_file *pf, int kind) in init_ppp_file() argument
2824 pf->kind = kind; in init_ppp_file()
2825 skb_queue_head_init(&pf->xq); in init_ppp_file()
2826 skb_queue_head_init(&pf->rq); in init_ppp_file()
2827 atomic_set(&pf->refcnt, 1); in init_ppp_file()
2828 init_waitqueue_head(&pf->rwait); in init_ppp_file()