Chinaunix首页 | 论坛 | 博客
  • 博客访问: 358723
  • 博文数量: 92
  • 博客积分: 1037
  • 博客等级: 准尉
  • 技术积分: 854
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-27 11:13
文章分类

全部博文(92)

文章存档

2013年(2)

2012年(90)

分类: 嵌入式

2012-08-25 17:15:06

可以参考:http://blog.csdn.net/djinglan/article/details/7372564

http://www.cnblogs.com/xiaoya901109/archive/2012/07/13/2589623.html

在linux-2.6.36内核上加载编译驱动时,出现

 error:unknown field 'ioctl' specified in initializer

原因是:在2.6.36内核上file_operations发生了重大的改变:

原先的

  int (*ioctl)(struct inode*, struct file*, unsigned int, unsigned long);

被改为了       

   long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
        long (*compat_ioctl) (struct file *, unsigned int, unsigned long);

因而在实际驱动中,我们需要将原先的写的ioctl函数头给改成下面的unlocked_ioctl,在file_operations结构体的填充中也是一样。

阅读(2117) | 评论(0) | 转发(0) |
0

上一篇:typedef再补充

下一篇:内核调试

给主人留下些什么吧!~~