Lines Matching refs:file

45 static int mei_open(struct inode *inode, struct file *file)  in mei_open()  argument
71 cl->fp = file; in mei_open()
72 file->private_data = cl; in mei_open()
76 return nonseekable_open(inode, file); in mei_open()
91 const struct file *fp) in mei_cl_vtag_remove_by_fp()
112 static int mei_release(struct inode *inode, struct file *file) in mei_release() argument
114 struct mei_cl *cl = file->private_data; in mei_release()
125 mei_cl_vtag_remove_by_fp(cl, file); in mei_release()
129 mei_cl_flush_queues(cl, file); in mei_release()
141 mei_cl_flush_queues(cl, file); in mei_release()
152 file->private_data = NULL; in mei_release()
169 static ssize_t mei_read(struct file *file, char __user *ubuf, in mei_read() argument
172 struct mei_cl *cl = file->private_data; in mei_read()
175 bool nonblock = !!(file->f_flags & O_NONBLOCK); in mei_read()
200 cb = mei_cl_read_cb(cl, file); in mei_read()
207 rets = mei_cl_read_start(cl, length, file); in mei_read()
220 mei_cl_read_cb(cl, file) || in mei_read()
233 cb = mei_cl_read_cb(cl, file); in mei_read()
288 static u8 mei_cl_vtag_by_fp(const struct mei_cl *cl, const struct file *fp) in mei_cl_vtag_by_fp()
311 static ssize_t mei_write(struct file *file, const char __user *ubuf, in mei_write() argument
314 struct mei_cl *cl = file->private_data; in mei_write()
353 if (file->f_flags & O_NONBLOCK) { in mei_write()
373 cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file); in mei_write()
378 cb->vtag = mei_cl_vtag_by_fp(cl, file); in mei_write()
405 static int mei_ioctl_connect_client(struct file *file, in mei_ioctl_connect_client() argument
414 cl = file->private_data; in mei_ioctl_connect_client()
453 rets = mei_cl_connect(cl, me_cl, file); in mei_ioctl_connect_client()
505 static int mei_ioctl_connect_vtag(struct file *file, in mei_ioctl_connect_vtag() argument
515 cl = file->private_data; in mei_ioctl_connect_vtag()
522 if (mei_cl_vtag_by_fp(cl, file) != vtag) { in mei_ioctl_connect_vtag()
552 file->private_data = pos; in mei_ioctl_connect_vtag()
557 cl_vtag = mei_cl_vtag_alloc(file, vtag); in mei_ioctl_connect_vtag()
581 return mei_ioctl_connect_client(file, in_client_uuid, client); in mei_ioctl_connect_vtag()
598 static int mei_ioctl_client_notify_request(const struct file *file, u32 request) in mei_ioctl_client_notify_request() argument
600 struct mei_cl *cl = file->private_data; in mei_ioctl_client_notify_request()
606 return mei_cl_notify_request(cl, file, (u8)request); in mei_ioctl_client_notify_request()
617 static int mei_ioctl_client_notify_get(const struct file *file, u32 *notify_get) in mei_ioctl_client_notify_get() argument
619 struct mei_cl *cl = file->private_data; in mei_ioctl_client_notify_get()
621 bool block = (file->f_flags & O_NONBLOCK) == 0; in mei_ioctl_client_notify_get()
641 static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data) in mei_ioctl() argument
644 struct mei_cl *cl = file->private_data; in mei_ioctl()
683 rets = mei_ioctl_connect_vtag(file, cl_uuid, props, in mei_ioctl()
686 rets = mei_ioctl_connect_client(file, cl_uuid, props); in mei_ioctl()
725 rets = mei_ioctl_connect_vtag(file, cl_uuid, props, vtag); in mei_ioctl()
747 rets = mei_ioctl_client_notify_request(file, notify_req); in mei_ioctl()
752 rets = mei_ioctl_client_notify_get(file, &notify_get); in mei_ioctl()
783 static __poll_t mei_poll(struct file *file, poll_table *wait) in mei_poll() argument
786 struct mei_cl *cl = file->private_data; in mei_poll()
807 poll_wait(file, &cl->ev_wait, wait); in mei_poll()
813 poll_wait(file, &cl->rx_wait, wait); in mei_poll()
815 if (mei_cl_read_cb(cl, file)) in mei_poll()
818 mei_cl_read_start(cl, mei_cl_mtu(cl), file); in mei_poll()
822 poll_wait(file, &cl->tx_wait, wait); in mei_poll()
863 static int mei_fsync(struct file *fp, loff_t start, loff_t end, int datasync) in mei_fsync()
914 static int mei_fasync(int fd, struct file *file, int band) in mei_fasync() argument
917 struct mei_cl *cl = file->private_data; in mei_fasync()
922 return fasync_helper(fd, file, band, &cl->ev_async); in mei_fasync()