Linux Hybrid device driver

Source: Internet
Author: User

1. Linux Hybrid device driver model

① in Linux systems, there are a class of character devices, which have the same main device number (10), but the second device number is different, we call this device a hybrid device (Miscdevice). All promiscuous devices form a linked list, and the kernel looks for the corresponding promiscuous device based on the secondary device number when accessing the device.

Using struct Miscdevice in ②linux to describe hybrid devices

struct Miscdevice  {    int  minor;     Const Char *name;     Const struct file_operations *fops;     struct list_head list;     struct device *parent;     struct device *this_device;};


③linux using the Misc_register function to register a hybrid device driver

int misc_register (struct miscdevice * misc)

④linux using the Misc_deregister function to unregister a hybrid device driver

int misc_deregister (struct miscdevice *misc)

Linux Hybrid device driver

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.