Issue
In the book of Linux Device Driver 3rd ed, /proc
file system is used as a output method to export the running state of a certain device driver.
However, in some circumstances, /proc
file system is used as one interface to change the internal parameters of a driver module.
I googled a lot, and found some implementations on the Internet are too old that they used create_proc_entry()
rather than proc_create()
.
What's more, I'm prefer to implement this by seq_file
(actually, I'm not sure is it possible). I checked the seq_write()
function, and obtained nothing.
Can anyone show me an example to finish this mission? seq_file
implementation is more preferred.
Solution
After I tied a lot. I found there is actually no seq
version write function. However, you can treat /proc
file as a normal device file which can be operated by methods defined in file_operations
.
Answered By - Douglas Su Answer Checked By - Dawn Plyler (WPSolving Volunteer)