Lines Matching refs:file

43  * @file: pointer to file structure
47 static int mei_open(struct inode *inode, struct file *file)
71 cl->fp = file;
72 file->private_data = cl;
76 return nonseekable_open(inode, file);
87 * @fp: pointer to file structure
91 const struct file *fp)
108 * @file: pointer to file structure
112 static int mei_release(struct inode *inode, struct file *file)
114 struct mei_cl *cl = file->private_data;
125 mei_cl_vtag_remove_by_fp(cl, file);
129 mei_cl_flush_queues(cl, file);
141 mei_cl_flush_queues(cl, file);
152 file->private_data = NULL;
162 * @file: pointer to file structure
169 static ssize_t mei_read(struct file *file, char __user *ubuf,
172 struct mei_cl *cl = file->private_data;
175 bool nonblock = !!(file->f_flags & O_NONBLOCK);
200 cb = mei_cl_read_cb(cl, file);
207 rets = mei_cl_read_start(cl, length, file);
220 mei_cl_read_cb(cl, file) ||
233 cb = mei_cl_read_cb(cl, file);
281 * mei_cl_vtag_by_fp - obtain the vtag by file pointer
284 * @fp: pointer to file structure
288 static u8 mei_cl_vtag_by_fp(const struct mei_cl *cl, const struct file *fp)
304 * @file: pointer to file structure
311 static ssize_t mei_write(struct file *file, const char __user *ubuf,
314 struct mei_cl *cl = file->private_data;
353 if (file->f_flags & O_NONBLOCK) {
373 cb = mei_cl_alloc_cb(cl, length, MEI_FOP_WRITE, file);
378 cb->vtag = mei_cl_vtag_by_fp(cl, file);
397 * @file: private data of the file object
405 static int mei_ioctl_connect_client(struct file *file,
414 cl = file->private_data;
453 rets = mei_cl_connect(cl, me_cl, file);
496 * @file: private data of the file object
505 static int mei_ioctl_connect_vtag(struct file *file,
515 cl = file->private_data;
522 if (mei_cl_vtag_by_fp(cl, file) != vtag) {
552 file->private_data = pos;
557 cl_vtag = mei_cl_vtag_alloc(file, vtag);
581 return mei_ioctl_connect_client(file, in_client_uuid, client);
593 * @file: pointer to file structure
598 static int mei_ioctl_client_notify_request(const struct file *file, u32 request)
600 struct mei_cl *cl = file->private_data;
606 return mei_cl_notify_request(cl, file, (u8)request);
612 * @file: pointer to file structure
617 static int mei_ioctl_client_notify_get(const struct file *file, u32 *notify_get)
619 struct mei_cl *cl = file->private_data;
621 bool block = (file->f_flags & O_NONBLOCK) == 0;
635 * @file: pointer to file structure
641 static long mei_ioctl(struct file *file, unsigned int cmd, unsigned long data)
644 struct mei_cl *cl = file->private_data;
683 rets = mei_ioctl_connect_vtag(file, cl_uuid, props,
686 rets = mei_ioctl_connect_client(file, cl_uuid, props);
725 rets = mei_ioctl_connect_vtag(file, cl_uuid, props, vtag);
747 rets = mei_ioctl_client_notify_request(file, notify_req);
752 rets = mei_ioctl_client_notify_get(file, &notify_get);
778 * @file: pointer to file structure
783 static __poll_t mei_poll(struct file *file, poll_table *wait)
786 struct mei_cl *cl = file->private_data;
807 poll_wait(file, &cl->ev_wait, wait);
813 poll_wait(file, &cl->rx_wait, wait);
815 if (mei_cl_read_cb(cl, file))
818 mei_cl_read_start(cl, mei_cl_mtu(cl), file);
822 poll_wait(file, &cl->tx_wait, wait);
856 * @fp: pointer to file structure
863 static int mei_fsync(struct file *fp, loff_t start, loff_t end, int datasync)
906 * @fd: file descriptor
907 * @file: pointer to file structure
914 static int mei_fasync(int fd, struct file *file, int band)
917 struct mei_cl *cl = file->private_data;
922 return fasync_helper(fd, file, band, &cl->ev_async);
1107 * mei_set_devstate: set to new device state and notify sysfs file.
1166 * file operations structure will be used for mei char device.