VxWorks Reference Manual : Libraries

wd33c93Lib

NAME

wd33c93Lib - WD33C93 SCSI-Bus Interface Controller (SBIC) library

ROUTINES

wd33c93CtrlInit( ) - initialize the user-specified fields in an SBIC structure
wd33c93Show( ) - display the values of all readable WD33C93 chip registers

DESCRIPTION

This library contains the main interface routines to the Western Digital WD33C93 and WD33C93A SCSI-Bus Interface Controllers (SBIC). However, these routines simply switch the calls to either the SCSI-1 or SCSI-2 drivers, implemented in wd33c93Lib1 and wd33c93Lib2 respectively, as configued by the Board Support Package (BSP).

In order to configure the SCSI-1 driver, which depends upon scsi1Lib, the wd33c93CtrlCreate( ) routine, defined in wd33c93Lib1, must be invoked. Similarly, wd33c93CtrlCreateScsi2( ), defined in wd33c93Lib2 and dependent on scsi2Lib, must be called to configure and initialize the SCSI-2 driver.

INCLUDE FILES

wd33c93.h, wd33c93_1.h, wd33c93_2.h

SEE ALSO

scsiLib, scsi1Lib, scsi2Lib, wd33c93Lib1, wd33c93Lib2, Western Digital WD33C92/93 SCSI-Bus Interface Controller, Western Digital WD33C92A/93A SCSI-Bus Interface Controller, VxWorks Programmer's Guide: I/O System


Libraries : Routines

wd33c93CtrlInit( )

NAME

wd33c93CtrlInit( ) - initialize the user-specified fields in an SBIC structure

SYNOPSIS

STATUS wd33c93CtrlInit
    (
    int * pSbic,             /* ptr to SBIC info */
    int   scsiCtrlBusId,     /* SCSI bus ID of this SBIC */
    UINT  defaultSelTimeOut, /* default dev. select timeout (microsec) */
    int   scsiPriority       /* priority of task when doing SCSI I/O */
    )

DESCRIPTION

This routine initializes an SBIC structure, after the structure is created with either wd33c93CtrlCreate( ) or wd33c93CtrlCreateScsi2( ). This structure must be initialized before the SBIC can be used. It may be called more than once; however, it should be called only while there is no activity on the SCSI interface.

Before returning, this routine pulses RST (reset) on the SCSI bus, thus resetting all attached devices.

The input parameters are as follows:

pSbic
a pointer to the WD_33C93_SCSI_CTRL structure created with wd33c93CtrlCreate( ) or wd33c93CtrlCreateScsi2( ).

scsiCtrlBusId
the SCSI bus ID of the SBIC, in the range 0 - 7. The ID is somewhat arbitrary; the value 7, or highest priority, is conventional.

defaultSelTimeOut
the timeout, in microseconds, for selecting a SCSI device attached to this controller. This value is used as a default if no timeout is specified in scsiPhysDevCreate( ). The recommended value zero (0) specifies SCSI_DEF_SELECT_TIMEOUT (250 millisec). The maximum timeout possible is approximately 2 seconds. Values exceeding this revert to the maximum. For more information about chip timeouts, see the manuals Western Digital WD33C92/93 SCSI-Bus Interface Controller, Western Digital WD33C92A/93A SCSI-Bus Interface Controller.

scsiPriority
the priority to which a task is set when performing a SCSI transaction. Valid priorities are 0 to 255. Alternatively, the value -1 specifies that the priority should not be altered during SCSI transactions.

RETURNS

 OK, or ERROR if a parameter is out of range.

SEE ALSO

wd33c93Lib, scsiPhysDevCreate( ), Western Digital WD33C92/93 SCSI-Bus Interface Controller, Western Digital WD33C92A/93A SCSI-Bus Interface Controller


Libraries : Routines

wd33c93Show( )

NAME

wd33c93Show( ) - display the values of all readable WD33C93 chip registers

SYNOPSIS

int wd33c93Show
    (
    int * pScsiCtrl /* ptr to SCSI controller info */
    )

DESCRIPTION

This routine displays the state of the SBIC registers in a user-friendly manner. It is useful primarily for debugging. It should not be invoked while another running process is accessing the SCSI controller.

EXAMPLE

    -> wd33c93Show
    REG #00 (Own ID         ) = 0x07
    REG #01 (Control        ) = 0x00
    REG #02 (Timeout Period ) = 0x20
    REG #03 (Sectors        ) = 0x00
    REG #04 (Heads          ) = 0x00
    REG #05 (Cylinders MSB  ) = 0x00 
    REG #06 (Cylinders LSB  ) = 0x00
    REG #07 (Log. Addr. MSB ) = 0x00
    REG #08 (Log. Addr. 2SB ) = 0x00
    REG #09 (Log. Addr. 3SB ) = 0x00
    REG #0a (Log. Addr. LSB ) = 0x00
    REG #0b (Sector Number  ) = 0x00
    REG #0c (Head Number    ) = 0x00 
    REG #0d (Cyl. Number MSB) = 0x00
    REG #0e (Cyl. Number LSB) = 0x00
    REG #0f (Target LUN     ) = 0x00
    REG #10 (Command Phase  ) = 0x00
    REG #11 (Synch. Transfer) = 0x00
    REG #12 (Xfer Count MSB ) = 0x00
    REG #13 (Xfer Count 2SB ) = 0x00
    REG #14 (Xfer Count LSB ) = 0x00
    REG #15 (Destination ID ) = 0x03
    REG #16 (Source ID      ) = 0x00
    REG #17 (SCSI Status    ) = 0x42
    REG #18 (Command        ) = 0x07

RETURNS

OK, or ERROR if pScsiCtrl and pSysScsiCtrl are both NULL.

SEE ALSO

wd33c93Lib