Lines Matching refs:tun
21 struct qrtr_tun *tun = container_of(ep, struct qrtr_tun, ep); in qrtr_tun_send() local
23 skb_queue_tail(&tun->queue, skb); in qrtr_tun_send()
26 wake_up_interruptible(&tun->readq); in qrtr_tun_send()
33 struct qrtr_tun *tun; in qrtr_tun_open() local
36 tun = kzalloc(sizeof(*tun), GFP_KERNEL); in qrtr_tun_open()
37 if (!tun) in qrtr_tun_open()
40 skb_queue_head_init(&tun->queue); in qrtr_tun_open()
41 init_waitqueue_head(&tun->readq); in qrtr_tun_open()
43 tun->ep.xmit = qrtr_tun_send; in qrtr_tun_open()
45 filp->private_data = tun; in qrtr_tun_open()
47 ret = qrtr_endpoint_register(&tun->ep, QRTR_EP_NID_AUTO); in qrtr_tun_open()
55 kfree(tun); in qrtr_tun_open()
62 struct qrtr_tun *tun = filp->private_data; in qrtr_tun_read_iter() local
66 while (!(skb = skb_dequeue(&tun->queue))) { in qrtr_tun_read_iter()
71 if (wait_event_interruptible(tun->readq, in qrtr_tun_read_iter()
72 !skb_queue_empty(&tun->queue))) in qrtr_tun_read_iter()
88 struct qrtr_tun *tun = filp->private_data; in qrtr_tun_write_iter() local
108 ret = qrtr_endpoint_post(&tun->ep, kbuf, len); in qrtr_tun_write_iter()
116 struct qrtr_tun *tun = filp->private_data; in qrtr_tun_poll() local
119 poll_wait(filp, &tun->readq, wait); in qrtr_tun_poll()
121 if (!skb_queue_empty(&tun->queue)) in qrtr_tun_poll()
129 struct qrtr_tun *tun = filp->private_data; in qrtr_tun_release() local
131 qrtr_endpoint_unregister(&tun->ep); in qrtr_tun_release()
134 skb_queue_purge(&tun->queue); in qrtr_tun_release()
136 kfree(tun); in qrtr_tun_release()