I ve seen some sample code that does this:
proc_entry->read_proc = module_read;
proc_entry->write_proc = module_write;
However, in my module, I ve used ioctls instead of the read and write. Here is my ioctl function prototype:
int mytimer_ioctl(struct inode *inode, struct file *file, unsigned int fcn, unsigned long args)
For read, my "fcn" is IOCTL_GET_TIMER, and for write, my "fcn" is IOCTL_SET_TIMER.
Anyway to do something like this:
proc_entry->read_proc = module_ioctl(IOCTL_GET_TIMER);
proc_entry->write_proc = module_ioctl(IOCTL_SET_TIMER);
But not pass in the "args" argument?
Or maybe the easier way is to just write the module_read and module_write function, and have those call the ioctl?
Thanks for the help guys!