I want to communicate with my kernel module using ioctl. I have written two c program one for kernel module and other for user mode. I am getting this error while compiling kernel module:
error: unknown field ‘ioctl’ specified in initializer
at this line :
struct file_operations Fops = {
.read = device_read,
.write = device_write,
.ioctl = device_ioctl, ------> at this point error is occuring.
.open = device_open,
.release = device_release,
};
any idea why this is happening.
thanks
In newer kernels, the preferred way is to use .unlocked_ioctl
or .compat_ioctl
fields. The plain .ioctl
was removed from struct file_operations
. This discussion may clarify what happened and how to deal with that.