Using ioctl communication between Kernel mode and user mode
Asked Answered
E

2

17

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

Excrete answered 3/5, 2011 at 11:40 Comment(0)
B
23

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.

Benzoic answered 4/5, 2011 at 4:25 Comment(0)
M
4

In newer kernels, use .unlocked_ioctl in the place of .ioctl. It works fine.

Mccauley answered 16/10, 2012 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.