1、input子系统架构

下面对每层进行分析:
2、核心层input.c
input_init-> register_chrdev(INPUT_MAJOR, "input", &input_fops); static struct file_operations input_fops = { .owner = THIS_MODULE, .open = input_open_file, }; static int input_open_file(struct inode *inode, struct file *file) { ... struct input_handler *handler = input_table[iminor(inode) >> 5]; struct file_operations *old_fops, *new_fops = NULL; if (!handler || !(new_fops = fops_get(handler->fops))) return -ENODEV; int err; old_fops = file->f_op; file->f_op = new_fops; err = new_fops->open(inode, file); … } input_init-> r