Miscellaneous device header files in "Include/linux/miscdevice.h", you need to use two functions and a struct
Miscellaneous device registration functions: int misc_register (struct misdevice *misc);
Miscellaneous device unload function: int mis_deregister (struct misdevice *misc);
struct misdevice{ int minor; const char *name; const struct file_operations *< Span style= "color: #000000;" >fops; struct List_head list; parent; this_device; const char *nodename; mode_t mode;}
Where the file_operations structure is in the header file "Include/linux/fs.h", the members of the file_operations structure belong to the main content of the driver design, and the function and Linux system correspond to the system interface one by one provided by the application.
You need to define these functions yourself (such as OPEN,RELEASE,IOCTL)
Drive Learning 5-Generating device nodes (Miscellaneous devices)