Driversbasemapc

struct kobj_map {

struct probe {

struct probe *next; dev_t dev;

unsigned long range; struct module *owner; kobj_probe_t *get;

The mutex lock serializes access to the hash table. The elements of struct probe are as follows:

□ next connects all hash elements in a singly linked list.

□ dev denotes the device number. Recall that both major and minor numbers are contained in this datum.

□ The consecutive range of minor numbers is stored in range. The minor numbers associated to the device are thus given by MINORS(DEV) + range - 1.

□ owner points to the module (if any) providing the device driver.

□ get points to a function that returns the kobject instance associated with the device. Usually, this task is rather straightforward, but it may become more involved if device mappers are in use.

□ The distinction between block and character devices is made by data. For character devices, it points to an instance of struct cdev, while struct genhd is the pointer destination for block devices.

Continue reading here: Character Device Range Database

Was this article helpful?

0 0