Specifications
10-1
10
Chapter 10Developing a Device Driver
10
10
10
This chapter describes the procedures for developing a device driver. It identifies aspects
of the device that you need to understand prior to writing the driver and explains the pro-
cedures for installing the device in a Series 6000 system. It explains how to develop the
driver header file, data structures, and source file. Detailed descriptions of the different
types of driver routines are provided.
Understanding the Device 10
Before attempting to write a device driver for a hardware device, spend some time study-
ing the device itself. Gather as much technical information on the device hardware as pos-
sible. This includes a description of what the device modes are, how they are configured,
and what the associated functions are. It also includes a description of how the device
hardware interfaces with the rest of the system, whether the device uses programmed I/O,
generates interrupts, or uses DMA (Direct Memory Access).
Most of this information can be found by reviewing the documentation supplied by the
vendor from which the board has been obtained. This documentation might be in the form
of a technical reference manual or an installation manual. If necessary, consider contacting
the vendor for technical assistance.
Device Modes 10
A device can have as many device modes as it provides operating features and options.
Such modes might include a normal operating mode and a diagnostic mode. The normal
operating mode might include different options. The HSA adapter, for example, supports
two pass-through modes of operation to support data transfers between attached SCSI
devices and system memory. These modes are called pass-through mode out and
pass-through mode in. The former is from attached SCSI devices to system memory. The
latter is from system memory to the attached SCSI devices.
Consult the technical reference manual for your board to learn the device modes used.
These device modes are important to the functionality of the device and affect the device
driver. Examine each mode carefully, paying particular attention to the way in which each
mode is entered and exited and what its functionality is.
Configuration Modes 10
Some devices have a hardware configuration mode through which the device performs
configuration functions only. The HPS, for example, enters a configuration mode after it is