I write the character device driver myself in LKM, which has simply:
dev_open(struct inode *inode, struct file *filp);
dev_read (struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
dev_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
dev_release(struct inode *inode, struct file *filp)
Then in my kernel module, I also want to write to the character device, and the write must actually call my function:
dev_write(struct file *filp, const char __user *buf, size_t count, loff_t *f_pos)
I've found a similar link here at SE, but in this way it won't call my dev_write()
function to write but some deeper like vfs_write()
,right?