标签:io ar sp on bs ad amp linux c
#include <linux/miscdevice.h>
混杂设备:主设备号为10的字符设备
struct miscdevice
{
int minor; //次设备号
const char *name;
const struct file_operations *fops;
struct list_head list;
struct device *parent;
struct device *this_device;
}
混杂设备注册
int misc_register (struct miscdevice * misc);
int misc_deregister (struct miscdevice * misc);
例:
struct miscdevice misc = {
.minor = 12, //若需动态分配填255,不为0为静态分配
.name = DEVICE_NAME,
.fops = &dev_fops,
}
标签:io ar sp on bs ad amp linux c
原文地址:http://www.cnblogs.com/tolimit/p/4109387.html