Results 1 to 2 of 2
Hi all,
How to open a file inside a driver. I heard that it is bad idea to open a file inside a kernel module but my driver wants to ...
- 08-08-2006 #1Just Joined!
- Join Date
- May 2006
- Posts
- 24
how to open a file inside a driver (kernel module)
Hi all,
How to open a file inside a driver. I heard that it is bad idea to open a file inside a kernel module but my driver wants to open a file for maintaining device states. Can anyone help me in this.If opening a file is bad idea in a kernel module how the network drivers are maintaining the mac addresses . So please help me how can i proceed .
- 08-08-2006 #2Yes, it is really a bad idea that has been extensively discussed time ago... in fact, in kernelnewbies, it has been included in the FAQ.
Originally Posted by raju82
http://kernelnewbies.org/FAQ/WhyWrit...romKernelIsBad
I don't know what you mean... if you are attempting to communicate with userland and tell something like: "Device is busy" "Device ready" and so on... you should use one of the pseudo-filesystems provided by the kernel (sysfs, debugfs or procfs, although this last should be used only if your module offers process related information. For general information use the first ones).
Originally Posted by raju82
The NIC data is stored in the net_device structure declared at linux/netdevice.h. See the field:
Originally Posted by raju82
RegardsCode:unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */


Reply With Quote
