码迷,mamicode.com
首页 > 系统相关 > 详细

003_linux驱动之_file_operations函数

时间:2018-09-22 16:55:14      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:blank   href   图片   ima   name   nbsp   注册   驱动程序   ati   

(一)解析file_operations函数

(二)
1. file_operations结构原型
技术分享图片

2. 使用举例
技术分享图片

 
(三)从上面的原型可以看出file_operations函数有很多类型,下面将解析一部分
1. 以.open为例:
当应用程序使用open函数打开这个设备驱动时候,.open中的first_drv_open函数就会被调用,其它的也是一样
 
2. 安装驱动程序时候001中说明,将主设备号和file_operations结构一起注册到内核中去,也就是我们002中的问题

 

003_linux驱动之_file_operations函数

标签:blank   href   图片   ima   name   nbsp   注册   驱动程序   ati   

原文地址:https://www.cnblogs.com/luxiaoguogege/p/9690208.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!