Writing Device Drivers

Diagnosing Faults

The fault management daemon, fmd(1M), provides a programming interface for the development of diagnosis engine (DE) plug-in modules. A DE can be written to consume and diagnose any error telemetry or specific error telemetries. The eft DE was designed to diagnose any number of ereport classes based on diagnosis rules specified in the Eversholt language.

Standard Leaf Device Diagnosis

Most I/O subsystems use the eft DE and rules sets to diagnose device and device driver related problems. A standard set of ereports, listed in Reporting Standard I/O Controller Errors, has been specified for PCI leaf devices. Accompanying these ereports are eft diagnosis rules that take the telemetry and identify the associated device fault. Drivers that generate these ereports do not need to deliver any additional diagnosis software or eft rules.

The detection and generation of these ereports produces the following fault events:

fault.io.pci.bus-linkerr

A hardware fault on the PCI bus

fault.io.pci.device-interr

A hardware fault within the device

fault.io.pci.device-invreq

A hardware fault in the device or a defect in the driver that causes the device to send an invalid request

fault.io.pci.device-noresp

A hardware fault in the device that causes the driver not to respond to a valid request

fault.io.pciex.bus-linkerr

A hardware fault on the link

fault.io.pciex.bus-noresp

The link going down so that a device cannot respond to a valid request

fault.io.pciex.device-interr

A hardware fault within the device

fault.io.pciex.device-invreq

A hardware fault in the device or a defect in the driver that causes the device to send an invalid request

fault.io.pciex.device-noresp

A hardware fault in the device causing it not to respond to a valid request

Specialized Device Diagnosis

Driver developers who want to generate additional ereports or provide more specialized diagnosis software or eft rules can do so by writing a C-based DE or an eft diagnosis rules set. See the Fault Management community on the OpenSolaris project for information.