Download RCC-1.2.18 drivers Manual

Transcript
GR-RTEMS-DRIVER
23
The driver information above does not contain a bus specific device information needed to detect
suitable devices. Bus drivers provide extended driver structures containing this additional bus
specific information, for example the PCI bus has a pointer to an array of PCI device
identifications:
struct pci_dev_id_match {
uint16_t
vendor;
uint16_t
device;
uint16_t
subvendor;
uint16_t
subdevice;
uint32_t
class; /* 24 lower bits */
uint32_t
class_mask; /* 24 lower bits */
};
struct pci_drv_info {
struct drvmgr_drv
general;
/* General bus info */
/* PCI specific bus information */
struct pci_dev_id_match
*ids; /* Supported hardware */
};
3.2.4
Device
Represents a hardware device found by the bus driver, in this document called device. A device is
found, created and registered by the bus driver, once registered the driver manager will insert it
into the bus device tree, assign a bus minor number (depending on the registration order) and
tries to find driver that supports the hardware. If a suitable driver is found it will unite the device
with the driver. In the process of uniting the manager will assign insert the device into the
driver's device list, give a driver minor number to the device (lowest free number), optionally
allocate zeroed memory for driver private, queue the device for initialization.
The bus driver must have given the device a bus specific description in dev.businfo if before
registering it. The driver can use the information to get register addresses, interrupt number etc.
During the first level of initialization the device driver may register a child bus, in that case the
bus will be queued for initialization.