博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
常见的设备注册函数
阅读量:2455 次
发布时间:2019-05-10

本文共 3029 字,大约阅读时间需要 10 分钟。

常见的设备注册函数
来源: ChinaUnix博客  日期: 2008.07.06 10:49 (共有0 条评论)
 
1、register_chrdev
位置 :fs/char_dev.c
原型 :int register_chrdev(unsigned int major, const char *name,
      const struct file_operations *fops)
说明
/**
* register_chrdev() - Register a major number for character devices.
* @major: major device number or 0 for dynamic allocation
* @name: name of this range of devices
* @fops: file operations associated with this devices
*
* If @major == 0 this functions will dynamically allocate a major and return
* its number.
*
* If @major > 0 this function will attempt to reserve a device with the given
* major number and will return zero on success.
*
* Returns a -ve errno on failure.
*
* The name of this device has nothing to do with the name of the device in
* /dev. It only helps to keep track of the different owners of devices. If
* your module name has only one type of devices it's ok to use e.g. the name
* of the module here.
*
* This function registers a range of 256 minor numbers. The first minor number
* is 0.
*/
2、register_netdev
位置 :net/core/dev.c
原型 :int register_netdev(struct net_device *dev)
说明
/**
* register_netdev - register a network device
* @dev: device to register
*
* Take a completed network device structure and add it to the kernel
* interfaces. A %NETDEV_REGISTER message is sent to the netdev notifier
* chain. 0 is returned on success. A negative errno code is returned
* on a failure to set up the device, or if the name is a duplicate.
*
* This is a wrapper around register_netdevice that takes the rtnl semaphore
* and expands the device name if you passed a format string to
* alloc_netdev.
*/
3、register_framebuffer
位置 :driver/video/fbmem.c
原型 :int
register_framebuffer(struct fb_info *fb_info)
说明
/**
* register_framebuffer - registers a frame buffer device
* @fb_info: frame buffer info structure
*
* Registers a frame buffer device @fb_info.
*
* Returns negative errno on error, or zero for success.
*
*/
4、register_sound_dsp
位置 :sound/sound_core.c
原型 :int register_sound_dsp(const struct file_operations *fops, int dev)
说明
/**
* register_sound_dsp - register a DSP device
* @fops: File operations for the driver
* @dev: Unit number to allocate
*
* Allocate a DSP device. Unit is the number of the DSP requested.
* Pass -1 to request the next free DSP unit. On success the allocated
* number is returned, on failure a negative error code is returned.
*
* This function allocates both the audio and dsp device entries together
* and will always allocate them as a matching pair - eg dsp3/audio3
*/
5、register_sound_mixer
位置 :sound/sound_core.c
原型 :int register_sound_mixer(const struct file_operations *fops, int dev)
说明
/**
* register_sound_mixer - register a mixer device
* @fops: File operations for the driver
* @dev: Unit number to allocate
*
* Allocate a mixer device. Unit is the number of the mixer requested.
* Pass -1 to request the next free mixer unit. On success the allocated
* number is returned, on failure a negative error code is returned.
*/
本文来自ChinaUnix博客,如果查看原文请点:

转载地址:http://gnjhb.baihongyu.com/

你可能感兴趣的文章
nginx mozilla_我发现Mozilla的私人浏览模式存在重大缺陷。
查看>>
databricks_如何开始使用Databricks
查看>>
盖茨比乔布斯_如何使用盖茨比创建您的博客并通过手机进行处理
查看>>
react发送和接收请求_React行为编程简介:请求,等待和阻止
查看>>
orcale可视化建立用户_建立动态可视化的新方法
查看>>
代码编写工具_我希望在开始编写代码时就已经知道的工具:已复习
查看>>
把转变为json_如何使用7行JSON将您的网站转变为移动应用程序
查看>>
如何使用TensorFlow对象检测API播放Quidditch
查看>>
交付方式 saas_我在全职工作时如何交付我的第一个SaaS副项目
查看>>
instagram技术_Instagram9位科技女孩进行技术采访的主要技巧
查看>>
angular面试题及答案_关于最流行的Angular问题的StackOverflow上的48个答案
查看>>
zeppelin连接数据源_使用开放源代码合同(open-zeppelin)创建以太坊令牌
查看>>
ai人工智能程序_简单解释:一个AI程序如何掌握Go的古老游戏
查看>>
以下是ECMAScript 2016、2017和2018中所有新增功能的示例
查看>>
印地语freeCodeCamp YouTube频道+不和谐聊天现已上线
查看>>
css content属性_CSS之前和之后CSS –如何使用content属性
查看>>
如何将ApexCharts与Vue.js集成-详细指南
查看>>
nsfw_如何使用机器学习设置NSFW内容检测
查看>>
react中使用构建缓存_如何使用React构建客户支持实时聊天小部件
查看>>
reactjs生命周期_如何在ReactJS中了解组件的生命周期方法
查看>>