LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 591|回复: 0

新手求助编写驱动设备

[复制链接]
发表于 2008-8-7 11:24:58 | 显示全部楼层 |阅读模式
http://www.it.com.cn/f/edu/0411/30/53811.htm
按照上面连接的范例想要编写设备驱动程序
得到如下错误,请教高手该如何修改
test.c:13: warning: `struct file' declared inside parameter list
test.c:13: warning: its scope is only this definition or declaration, which is probably not what you want
test.c:13: warning: `struct inode' declared inside parameter list
test.c: In function `read_test':
test.c:18: `VERIFY_WRITE' undeclared (first use in this function)
test.c:18: (Each undeclared identifier is reported only once
test.c:18: for each function it appears in.)
test.c:21: parse error before "for"
test.c: At top level:
test.c:30: warning: `struct file' declared inside parameter list
test.c:30: warning: `struct inode' declared inside parameter list
test.c:35: warning: `struct file' declared inside parameter list
test.c:35: warning: `struct inode' declared inside parameter list
test.c: In function `open_tibet':
test.c:37: `MOD_ING_USE_COUNT' undeclared (first use in this function)
test.c: At top level:
test.c:41: warning: `struct file' declared inside parameter list
test.c:41: warning: `struct inode' declared inside parameter list
test.c: In function `release_tibet':
test.c:43: union has no member named `usecount'
test.c: At top level:
test.c:46: variable `test_fops' has initializer but incomplete type
test.c:47: warning: excess elements in struct initializer
test.c:47: warning: (near initialization for `test_fops')
test.c:48: warning: excess elements in struct initializer
test.c:48: warning: (near initialization for `test_fops')
test.c:49: `write_test' undeclared here (not in a function)
test.c:49: warning: excess elements in struct initializer
test.c:49: warning: (near initialization for `test_fops')
test.c:50: warning: excess elements in struct initializer
test.c:50: warning: (near initialization for `test_fops')
test.c:51: warning: excess elements in struct initializer
test.c:51: warning: (near initialization for `test_fops')
test.c:52: warning: excess elements in struct initializer
test.c:52: warning: (near initialization for `test_fops')
test.c:53: warning: excess elements in struct initializer
test.c:53: warning: (near initialization for `test_fops')
test.c:54: `open_test' undeclared here (not in a function)
test.c:54: warning: excess elements in struct initializer
test.c:54: warning: (near initialization for `test_fops')
test.c:55: `release_test' undeclared here (not in a function)
test.c:55: warning: excess elements in struct initializer
test.c:55: warning: (near initialization for `test_fops')
test.c:56: warning: excess elements in struct initializer
test.c:56: warning: (near initialization for `test_fops')
test.c:57: warning: excess elements in struct initializer
test.c:57: warning: (near initialization for `test_fops')
test.c: In function `init_module':
test.c:64: parse error before '=' token
test.c:67: `KERN_INFO' undeclared (first use in this function)
test.c:67: parse error before string constant
/usr/include/linux/timer.h: At top level:
test.c:46: storage size of `test_fops' isn't known

<LINUX设备驱动>那本书的第三章看完了,但由于没有具体例子,很多地方都搞不懂,麻烦高手帮忙,谢谢!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表