Lines Matching refs:pf

84 #define PF_TO_X(pf, X)		((X *)((char *)(pf) - offsetof(X, file)))  argument
86 #define PF_TO_PPP(pf) PF_TO_X(pf, struct ppp) argument
87 #define PF_TO_CHANNEL(pf) PF_TO_X(pf, struct channel) argument
238 static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file,
263 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 != 0) { 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
384 if (pf == 0) in ppp_read()
386 add_wait_queue(&pf->rwait, &wait); in ppp_read()
389 skb = skb_dequeue(&pf->rq); in ppp_read()
393 if (pf->dead) in ppp_read()
404 remove_wait_queue(&pf->rwait, &wait); in ppp_read()
426 struct ppp_file *pf = file->private_data; in ppp_write() local
430 if (pf == 0) in ppp_write()
433 skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL); in ppp_write()
436 skb_reserve(skb, pf->hdrlen); in ppp_write()
443 skb_queue_tail(&pf->xq, skb); in ppp_write()
445 switch (pf->kind) { in ppp_write()
447 ppp_xmit_process(PF_TO_PPP(pf)); in ppp_write()
450 ppp_channel_push(PF_TO_CHANNEL(pf)); in ppp_write()
463 struct ppp_file *pf = file->private_data; in ppp_poll() local
466 if (pf == 0) in ppp_poll()
468 poll_wait(file, &pf->rwait, wait); in ppp_poll()
470 if (skb_peek(&pf->rq) != 0) in ppp_poll()
472 if (pf->dead) in ppp_poll()
480 struct ppp_file *pf = file->private_data; in ppp_ioctl() local
488 if (pf == 0) in ppp_ioctl()
489 return ppp_unattached_ioctl(pf, file, cmd, arg); in ppp_ioctl()
504 if (pf->kind == INTERFACE) { in ppp_ioctl()
505 ppp = PF_TO_PPP(pf); in ppp_ioctl()
518 if (pf->kind == CHANNEL) { in ppp_ioctl()
519 struct channel *pch = PF_TO_CHANNEL(pf); in ppp_ioctl()
544 if (pf->kind != INTERFACE) { in ppp_ioctl()
550 ppp = PF_TO_PPP(pf); in ppp_ioctl()
709 static int ppp_unattached_ioctl(struct ppp_file *pf, struct file *file, in ppp_unattached_ioctl() argument
2304 init_ppp_file(struct ppp_file *pf, int kind) in init_ppp_file() argument
2306 pf->kind = kind; in init_ppp_file()
2307 skb_queue_head_init(&pf->xq); in init_ppp_file()
2308 skb_queue_head_init(&pf->rq); in init_ppp_file()
2309 atomic_set(&pf->refcnt, 1); in init_ppp_file()
2310 init_waitqueue_head(&pf->rwait); in init_ppp_file()