Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ hpdd(7) — Interactive 3.2r4.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

kconfig(1)

disk(7)

tape(7)

hpdd(7)  —  

NAME

hpdd − High Performance Device Driver

DESCRIPTION

The hpdd module contains initialization procedures and low-level primitives for driver modules that run as part of the High Performance Device Driver (HPDD) subsystem.  Such drivers provide for improved system throughput, increased ease of maintenance, and quick implementation by making use of structures and code provided by the HPDD. 

There are two types of modules associated with the HPDD: driver modules and low-level controller modules.  Driver modules provide traditional UNIX System block and character device entry points and generate request queues in terms of HPDD-specific data elements and a generic set of commands common to most low-level hardware controllers.  Currently, disk and tape drivers are supported by the HPDD subsystem (see disk(7) and tape(7)). It is anticipated that the list of supported drivers will grow fairly slowly. Low-level controller modules exist for each type of actual hardware interface supported by the HPDD.  These determine whether boards configured are in fact present, translate the generic command set to actual hardware commands, and process hardware interrupts.  A low-level module may be used by more than one driver (as is the case with a SCSI adapter used to communicate with both disk and tape drives) and may support more than one actual hardware controller.  For example, the athd module is used to communicate with all AT-compatible fixed disk adapters (ST-506, RLL, or ESDI) that exist within a system. 

Ioctls

There are two ioctls that relate directly to the HPDD.  They are used by applications that need to know how many adapters are connected to the HPDD and the characteristics of those adapters.  These ioctls are:

G_GET_HBA_COUNT The HPDD places the number of attached adapters in the int pointed to by the argument. 

G_GET_DCB This ioctl uses the following structure: struct hba_info

{
inthba;
charname[HBA_NAME_LEN];
struct  gdev_ctl_block   dcb;
};

The caller fills in the hba field with the number of the adapter of interest.  The address of the hba_info structure is passed to the ioctl and is filled in by the HPDD.  Note that the name of the adapter is not in the dcb as might be expected, but is in the separate name field.  Currently, only 80 characters of name information are returned. 

Configuration

It is suggested that you use the kernel configuration utility kconfig(1) to perform the following configuration functions.

System Files
The file /etc/conf/pack.d/gendev/space.c contains a table called gdev_init_routines, which contains the names of the driver initialization routines for each HPDD driver module.  The file /etc/conf/sdevice.d/gendev should indicate all interrupt levels to be handled by the HPDD low-level modules, as the control and scheduling of this activity is the responsibility of the HPDD module itself.  Note that all devices supported by the HPDD must be at the same interrupt priority level.  In addition, each driver will normally have a space.c file associated with it.  Tables in these files describe the actual hardware expected to be present in a given system configuration.  Note also that the names of the low-level controller modules configured must also be present in the modules list of the file /etc/conf/cf.d/mdevice. 

Pseudo Drivers
Pseudo devices provide a method of supporting multiple adapters and logical unit number (LUN) addressing on SCSI adapters.  They appear in configuration files and affect device names.  Their function is to map major device numbers to host bus adapters (HBAs) and determine how to decode the bits of the minor device numbers.  The pseudo devices for disks and tapes are slightly different.  Disk pseudo devices take on one of two forms, described below. 

The first, and most common form, is used when an adapter has some number of disk targets all addressed at LUN 0.  In this case, the pseudo driver will be called dsknt, where n is the HBA number.  Using this interface will cause the HPDD to decode the minor device numbers as follows:

bit 7 physical bit
bit 6
bit 5 target
bit 4
bit 3
bit 2 partition
bit 1
bit 0

In fact, the dsknt target interface will access the first disk LUN on any target.  It need not be LUN 0.  While the word target is used, the concept applies to SCSI and non-SCSI adapters, e.g., non-SCSI adapters having two disks can be thought of as having two disk targets, each at LUN 0. 

The second form is used when an adapter has some number of disk LUNs attached to the same target.  In this case, the disk pseudo driver will be called dskxy, where x is the HBA number and y is the target number.  Using this interface will cause the HPDD to decode the minor device numbers as follows:

bit 7 physical bit
bit 6
bit 5 LUN
bit 4
bit 3
bit 2 partition
bit 1
bit 0

Using this scheme, a SCSI adapter could be configured with 56 devices.  It should be noted that when a target is equipped with multiple LUNs, the first LUN can be accessed through two pseudo devices. 

Tape pseudo devices are similar in most respects to their disk counterparts, but there are some differences. 

The first difference is the name.  When an adapter has some number of tape targets all addressed at LUN 0, the tape pseudo driver will be called tpnt, where n is the HBA number.  Using this interface will cause the HPDD to decode the minor device numbers as follows:

bit 7 not used
bit 6
bit 5 target
bit 4
bit 3
bit 2 tape flag bits
bit 1
bit 0

Similarly, when an adapter has some number of LUNs attached to the same target, the pseudo driver will be called tpxy, where x is the HBA number and y is the target number.  Using this interface will cause the HPDD to decode the minor device numbers as follows:

bit 7 not used
bit 6
bit 5 LUN
bit 4
bit 3
bit 2 tape flag bits
bit 1
bit 0

Using this scheme, a SCSI adapter could be configured with 56 devices.  It should be noted that when a target is equipped with multiple LUNs, the first LUN can be accessed through two pseudo devices. 

Major Numbers
Each pseudo driver has a major number. By design, the target interface to the first adapter (dsk0t) is always major 0.  Major numbers for other pseudo drivers are assigned by kconfig. As noted above, when a target is equipped with multiple LUNs, the first LUN can be accessed through two pseudo devices.  In this case, the first LUN will have two major device numbers and two sets of device nodes. 

Controllers
If you have the kernel debugger configured, typing CTRL-ALT-D drops you to the kernel debugger. You can type gdev_ctl_blocks gdevcblk to see run-time HPDD information. This shows you the primary HPDD controller.  To see the second controller, type the hex address shown at the bottom of the screen followed by gdevcblk.  For example, 0xd00f5a40 gdevcblk gives you run-time HPDD information on the second controller. 

SEE ALSO

kconfig(1), disk(7), tape(7). 

ADDED VALUE

This entry, supplied by SunSoft, Inc., is an extension of UNIX System V. 

\*U  —  Version 1.0

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026