DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

scsi_ad(D4sdi)


scsi_ad -- SDI device address structure

Synopsis

   #include <sys/sdi.h>

Description

These structures store information about the device configuration for all SDI devices. All scb(D4sdi) and sfb(D4sdi) structures include a pointer to the scsi_ad structure. The address is populated by the target driver for the purpose of passing the target address to SDI, and then on to the HBA driver.

The scsi_ad structure points to the sdi_extended_adr structure, which is used for HBA s that use the extended addressing scheme that is supported for SCO SVR5 2.X and SVR5.

The sdi_extended_adr structure points to the scsi_adr structure, which contains information about the controller, target, bus, and logical unit numbers for devices that use the extended address scheme. This information is accessed only through a set of macros defined later on this page.

Structure definition

The scsi_ad structure is defined as follows:
   int            pdi_adr_version;
   struct         sdi_extended_adr
   unsigned char  sa_lun;  
   unsigned char  sa_bus:  3;  
   unsigned char  sa_exta: 5; 
   short          sa_ct;   

The sdi_extended_adr structure is defined as follows:

   int            version; 
   major_t        major;   
   minor_t        minor;   
   struct scsi_adr scsi_adr;

The scsi_adr structure is defined as follows:

   int            scsi_ctl;
   int            scsi_bus;
   int            scsi_target;
   int            scsi_lun;

Structure members

The members of the scsi_ad structure are:

pdi_adr_version

sdi_extended_adr
Extended address structure.

sa_lun
Logical Unit Number.

sa_bus
Bus number, expressed in 3 bits.

sa_exta
Extended target number, expressed in 5 bits.

sa_ct
Controller and target.

The members of the scsi_extended_adr structure are:


version
Internal use.

scsi_adr
Pointer to the scsi_adr structure.

The members of the scsi_adr structure are:


scsi_ctl
HBA index into the Equipped Device Table (EDT). Its values are limited to -1, 0 to MAX_EXHAS. A -1 is used as a wild card to match all controllers. Not all commands support wild cards.

scsi_bus
SCSI bus index into the EDT. Its values are limited to -1, 0 to MAX_BUS. A -1 is used as a wild card to match all controllers. Not all commands support wild cards.

scsi_target
SCSI target index into the EDT. Its values are limited to -1, 0 to MAX_TCS. A -1 is used as a wild card to match all controllers. Not all commands support wild cards.

scsi_lun
SCSI Logical Unit Number (LUN) index into the EDT. Its values are limited to -1, 0 to MAX_EXLUS. A -1 is used as a wild card to match all controllers. Not all commands support wild cards.

Usage

A set of macros defined in the sdi_comm.h header file take a scsi_ad pointer as an argument and extract the SCSI controller, target, LUN, and bus values.

In the current structure definition, there are no limitations regarding the maximum number of devices. The former address model supported 32 devices with 32 Logical Units per device. This is replaced by a simple integer (providing 2^32 unique addresses and can be translated by SDI into whatever address is appropriate for the given HBA). For compatibility, a default translation for the simple SCSI addresses is provided by using the sa_lun, sa_bus, sa_exta, and sa_ct members.

Drivers written for HBAs that use the extended addressing scheme must set the flag HBA_EXT_ADDRESS in the version_num member of the hba_idata_v5(D4sdi) structure and use these macros to retrieve the controller, target, bus, and logical unit numbers:

   #define SDI_HAN_32(x) ((x)->extended_address->scsi_adr.scsi_ctl)
   #define SDI_TCN_32(x) ((x)->extended_address->scsi_adr.scsi_target)
   #define SDI_LUN_32(x) ((x)->extended_address->scsi_adr.scsi_lun)
   #define SDI_BUS_32(x) ((x)->extended_address->scsi_adr.scsi_bus)

Applicable hardware

All.

Version applicability

sdi: 2, 3, 4

Differences between versions

In sdi 3, the scsi_ad structure took on a different form:
   long           sa_major;
   long           sa_minor;
   unsigned char  sa_lun;  
   unsigned char  sa_exlun;
   short          sa_fill; 

For DDI 7 and earlier versions, the SDI_* macros take the minor number returned by geteminor(D3) as an argument.

References

scb(D4sdi), scsi_adr(D4sdi), sfb(D4sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005