Messages in this thread | | | Subject | How can LKM store persistent data? | Date | Mon, 3 Oct 2011 11:41:44 +0200 | From | "Doron Cohen" <> |
| |
Hi, I am handling Digital TV receiver drivers for Siano Mobile Silicon chips. We would like the driver to have some persistent data which can be saved from one load to another (explanation why is a bit long so it is written below and you may skip it. I know that accessing files from modules is strictly forbidden, but I couldn't find what the right way to do that is. One way I could think of is to make a mechanism like request_firmware is using which is making a device node and have a deamon in userspace fill it in (or write it to a file) when required. But I am not sure that would be wise for every module that needs such operation to implement such mechanism on it's own. Is there any other way for a module to save some configuration data for use on the next time the module is loaded?
Now as promised the why: Our device has some configuration data like DVB standard and operation mode which is not changes frequently. Currently it can be changed using module parameters and by ioctl calls. But when the driver is down and up again (meaning - every restart, sleep, reboot etc.) the module is back to the default settings unless the config file is changed which is not done for most users. Our users asked us to keep this data persistent, if someone is using ISDBT he would probably use it forever unless traveling to another region. So the request is once a mode was set, do not change it on the next reload just work at that mode until instructed otherwise. Therefore the driver needs to save this data somehow, and read it when it loads and work according to it.
Thanks, Doron
| |