DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SCO OpenServer

shareg_ex(D4osdi)


shareg_ex -- SCSI host adapter registration structure

Synopsis

   #include <sys/devreg.h>

Description

Usage

Structure definition

<NEED C STRUCT>

Structure members

The shareg_ex structure members are defined as follows:

forw/back
used internally by the SCSI support functions and should be initialized to 0 by the adapter driver

entry
address of the adapter driver's entry routine (xx_entry)

intr
address of the adapter driver's interrupt routine (xxintr)

version
identifies the version number of the structure. If the adapter driver is controlling a non-PCI device, then this field should be set to SHAREG_VERSION. If the adapter driver is controlling a PCI device, then this field should be set to SHAREG_VERSION2.

bus
set to the PCI bus number if the adapter driver is controlling a PCI device on which the device resides. It is not used if the adapter driver is controlling a non-PCI device.

int_vec
specifies the interrupt vector (IRQ) used by the adapter driver when controlling a non-PCI device. Sharegister(D3osdi) puts the adapter driver's interrupt routine in the interrupt vector table at int_vec. This vector may be different from the one configured when the kernel was linked, so the driver can determine the interrupt vector set on the hardware if allowed by the adapter.

If the adapter driver is controlling a PCI device, then this member is set to the PCI device and function number. In the latter case, the following macro should be used:

   sha.int_vec = SHAREG_PCI_INTVEC(device, function);
where device is the PCI device number (0-31), and function is the PCI function number (0-7). Note that for PCI devices, the interrupt line (IRQ) is read by the kernel from the Interrupt Line register (offset 3C hex) in the PCI Configuration Space of the device.

root_id
SCSI ID of the device that the adapter's BIOS will use as the boot device.

in_use
If set to 1, the driver is statically configured, meaning it has an entry in the mscsi(F)" file that will link the driver into the kernel. If set to 0, indicates that the driver is not configured statically in the Link Kit through the mscsi(F)" file. Adapter drivers should always include the following declaration:
   struct scsi_ha_cfg xxcfg[1];
If the driver is not present in mscsi, this declaration will define xxcfg to be a single element, zero-filled array.

route
Must be set to IROUTE_GLOBAL.

weight
Used to give an indication to the kernel of the kind of interrupt load to expect from the device. This field should be set to the interrupt priority level of the adapter driver.

mode
specifies whether the device driver is capable of sharing interrupts or not. It is the same as the ``Type'' field in the sdevice(F)" file, and can take on the following values:

IMODE_NONE
The device does not require an interrupt vector.

IMODE_EXCLUSIVE
The device requires an interrupt vector. If the driver supports more than one hardware controller, each controller requires a separate vector.

IMODE_SHARED_DRIVER
The device requires an interrupt vector. If the driver supports more than one hardware controller, each controller will share the same vector.

IMODE_SHARED_DRIVERIPL
The device requires an interrupt vector. If the driver supports more than one hardware controller, each controller will share the same vector. Multiple device drivers with the same IPL can share this interrupt.

IMODE_SHARED_CDRIVERIPL
The device requires an interrupt vector. If the driver supports more than one hardware controller, each controller may either share a vector with one of the other controllers or use a separate vector. Multiple device drivers having the same IPL can share this interrupt.

IMODE_SHARED_INTER
The device requires an interrupt vector. If the driver supports more than one hardware controller, each controller will share the same vector. This interrupt type is only used by hard disk drivers to prevent other devices from sharing the same vector.

processor_mask
This field indicates whether the adapter driver is second level multithreaded or not. See ``Multithreaded drivers'' in HDK Technical Reference. If the adapter driver is not second level multithreaded (in other words, the driver is either non-multithreaded or is first level multithreaded) then this field should be set to 1. If the device driver is second level multithreaded, then this field should be set as shown on the remap_driver_cpu(D3oddi) manual page.

iosaddr
Reserved - set to zero.

ioeaddr
Reserved - set to zero.

Version applicability

osdi: 1, 2, 3, 4, 5

Differences between versions

OSDI versions 1, 2, and 3 use the shareg structure as an argument to the Sharegister(D3osdi) function instead of the shareg_ex structure. This structure contains the following members with the same meaning as they have in shareg_ex: forw, back, entry, intr, int_vec, root_id, in_use. This form is retained in ODDI version 3 for SCO OpenServer 5 Release 5.0.0 and later for backward compatibility, but may not work with some PCI bus architectures and may be removed in future releases. New SCSI host adapter drivers should be written to use the shareg_ex structure.

References

Sharegister(D3osdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 5 HDK - June 2005