linux驱动编程--几个重要函数及概念
2014-02-11 21:29
429 查看
@cdev is a structure, it is used to record some information about char-device. for add a @cdev, the following steps is necessary:
1.create a @cdev
cdev_init() --init a structure about cdev
cdev_alloc() --alloc and init a structure
ps:it is actually helpfull that read a example and the source of the functions.
2.get a @(device-num)
register_chrdev_region() -- 向系统请求一个用户指定的设备号,可能已经被占用
unregister_chrdev_region()
alloc_chrdev_region() -- 请求系统分配一个设备号,不会出现被占用的问题
3.register this cdev
cdev_add()
cdev_del()
关于设备类和设备文件
class_create() -- 产生设备类,在参数中指定设备类名称
device_create() -- 产生设备文件,在参数中指定设备文件名称
class_destroy() --
device_destroy() --
其他未解决问题:
主次设备号:主设备号--区分驱动程序。次设备号--区分调用程序?不同调用程序间会通过驱动互相影响?
1.create a @cdev
cdev_init() --init a structure about cdev
cdev_alloc() --alloc and init a structure
ps:it is actually helpfull that read a example and the source of the functions.
2.get a @(device-num)
register_chrdev_region() -- 向系统请求一个用户指定的设备号,可能已经被占用
unregister_chrdev_region()
alloc_chrdev_region() -- 请求系统分配一个设备号,不会出现被占用的问题
3.register this cdev
cdev_add()
cdev_del()
关于设备类和设备文件
class_create() -- 产生设备类,在参数中指定设备类名称
device_create() -- 产生设备文件,在参数中指定设备文件名称
class_destroy() --
device_destroy() --
其他未解决问题:
主次设备号:主设备号--区分驱动程序。次设备号--区分调用程序?不同调用程序间会通过驱动互相影响?
相关文章推荐
- OMAP3630 Linux I2C总线驱动分析
- Linux设备驱动开发环境的搭建
- udev 入门:管理设备事件的 Linux 子系统
- 设备控制接口(ioctl 函数) 主要是在驱动中
- 转 字符设备驱动与块设备驱动的区别
- NAPI
- udev安全补丁
- struct file结构体
- Linux设备驱动之简单字符设备驱动开开发
- pwm驱动程序及其注释
- pwm驱动程序及其注释
- 块设备和字符设备区别
- linux驱动入门手记
- Poll机制分析
- linux驱动程序安装
- Linux设备驱动剖析之SPI(二)
- Linux设备驱动剖析之SPI(三)
- Linux设备驱动剖析之SPI(四)
- linux驱动相关文章
- Linux驱动学习之:按键中断驱动