error: unknown field 'ioctl' specified in initializer问题是由于2.6.36内核之后 去掉了原来的ioctl,添加两个新的成员,所以会出错
long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
所以修改源文件中file_operations内.ioctl 改为 .compat_ioctl 即可
原因:
当ioctl被执行时,它使用big kernel lock (BKL),其他的事情将不能被执行,这种情况在多核系统上更糟糕,
所以内核开发人员努力移除BKL。首先unlocked_ioctl 被引入到内核,它可以让驱动开发人员选择其他的替换lock,
campat_ioctl 实际与上面问题无关,引入它的目的是允许32位的用户程序可以在64位内核调用ioctl