Lines Matching refs:pf
87 #define PF_TO_X(pf, X) container_of(pf, X, file) argument
89 #define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp) argument
90 #define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel) argument
219 static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
244 static void init_ppp_file(struct ppp_file *pf, int kind);
352 struct ppp_file *pf = file->private_data; in ppp_release() local
355 if (pf) { in ppp_release()
357 if (pf->kind == INTERFACE) { in ppp_release()
358 ppp = PF_TO_PPP(pf); in ppp_release()
362 if (atomic_dec_and_test(&pf->refcnt)) { in ppp_release()
363 switch (pf->kind) { in ppp_release()
365 ppp_destroy_interface(PF_TO_PPP(pf)); in ppp_release()
368 ppp_destroy_channel(PF_TO_CHANNEL(pf)); in ppp_release()
379 struct ppp_file *pf = file->private_data; in ppp_read() local
386 if (!pf) in ppp_read()
388 add_wait_queue(&pf->rwait, &wait); in ppp_read()
391 skb = skb_dequeue(&pf->rq); in ppp_read()
395 if (pf->dead) in ppp_read()
397 if (pf->kind == INTERFACE) { in ppp_read()
403 struct ppp *ppp = PF_TO_PPP(pf); in ppp_read()
417 remove_wait_queue(&pf->rwait, &wait); in ppp_read()
439 struct ppp_file *pf = file->private_data; in ppp_write() local
443 if (!pf) in ppp_write()
446 skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL); in ppp_write()
449 skb_reserve(skb, pf->hdrlen); in ppp_write()
456 skb_queue_tail(&pf->xq, skb); in ppp_write()
458 switch (pf->kind) { in ppp_write()
460 ppp_xmit_process(PF_TO_PPP(pf)); in ppp_write()
463 ppp_channel_push(PF_TO_CHANNEL(pf)); in ppp_write()
476 struct ppp_file *pf = file->private_data; in ppp_poll() local
479 if (!pf) in ppp_poll()
481 poll_wait(file, &pf->rwait, wait); in ppp_poll()
483 if (skb_peek(&pf->rq)) in ppp_poll()
485 if (pf->dead) in ppp_poll()
487 else if (pf->kind == INTERFACE) { in ppp_poll()
489 struct ppp *ppp = PF_TO_PPP(pf); in ppp_poll()
536 struct ppp_file *pf = file->private_data; in ppp_ioctl() local
546 if (!pf) in ppp_ioctl()
547 return ppp_unattached_ioctl(pf, file, cmd, arg); in ppp_ioctl()
563 if (pf->kind == INTERFACE) { in ppp_ioctl()
564 ppp = PF_TO_PPP(pf); in ppp_ioctl()
578 if (pf->kind == CHANNEL) { in ppp_ioctl()
583 pch = PF_TO_CHANNEL(pf); in ppp_ioctl()
608 if (pf->kind != INTERFACE) { in ppp_ioctl()
615 ppp = PF_TO_PPP(pf); in ppp_ioctl()
766 static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file, in ppp_unattached_ioctl() argument
2480 init_ppp_file(struct ppp_file *pf, int kind) in init_ppp_file() argument
2482 pf->kind = kind; in init_ppp_file()
2483 skb_queue_head_init(&pf->xq); in init_ppp_file()
2484 skb_queue_head_init(&pf->rq); in init_ppp_file()
2485 atomic_set(&pf->refcnt, 1); in init_ppp_file()
2486 init_waitqueue_head(&pf->rwait); in init_ppp_file()