码迷,mamicode.com
首页 > 其他好文 > 详细

IOCTL命令字的解析

时间:2020-02-22 11:42:27      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:命令   ==   bsp   led   def   nbsp   current   int   define   

 

#define CMD_ERR_PRINT(devname, cmd, arg) do { \
char *p[4] = {"", "W", "R", "WR"}; \
if (0 == _IOC_DIR(cmd)) { \
printk(KERN_ERR "ERROR: /dev/%s not find cmd(%#x): _IO(‘%c‘, %d), called by pname=%s, pid=%d\n", \
devname, cmd, _IOC_TYPE(cmd), _IOC_NR(cmd), current->comm, current->pid); \
} else { \
printk(KERN_ERR "ERROR: /dev/%s not find cmd(%#x): _IO%s(‘%c‘, %d, 0x%p), called by pname=%s, pid=%d\n", \
devname, cmd, p[_IOC_DIR(cmd)], _IOC_TYPE(cmd), _IOC_NR(cmd), (void *)arg, current->comm, current->pid); \
} \
} while (0)

 

 

__user

 

IOCTL命令字的解析

标签:命令   ==   bsp   led   def   nbsp   current   int   define   

原文地址:https://www.cnblogs.com/chuck11/p/12344510.html

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