VxWorks Reference Manual : Libraries
ncr5390Lib - NCR5390 SCSI-Bus Interface Controller library (SBIC)
ncr5390CtrlInit( ) - initialize the user-specified fields in an ASC structure
ncr5390Show( ) - display the values of all readable NCR5390 chip registers
This library contains the main interface routines to the SCSI-Bus Interface Controllers (SBIC). These routines simply switch the calls to the SCSI-1 or SCSI-2 drivers, implemented in ncr5390Lib1.c or ncr5390Lib2.c as configured by the Board Support Package (BSP).
In order to configure the SCSI-1 driver, which depends upon scsi1Lib, the ncr5390CtrlCreate( ) routine, defined in ncr5390Lib1, must be invoked. Similarly ncr5390CtrlCreateScsi2( ), defined in ncr5390Lib2 and dependent on scsi2Lib, must be called to configure and initialize the SCSI-2 driver.
ncr5390.h, ncr5390_1.h, ncr5390_2.h
ncr5390CtrlInit( ) - initialize the user-specified fields in an ASC structure
STATUS ncr5390CtrlInit ( int * pAsc, /* ptr to ASC info */ int scsiCtrlBusId, /* SCSI bus ID of this ASC */ UINT defaultSelTimeOut, /* default dev. select timeout (microsec) */ int scsiPriority /* priority of task when doing SCSI I/O */ )
This routine initializes an ASC structure, after the structure is created with ncr5390CtrlCreate( ). This structure must be initialized before the ASC 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:
- pAsc
- a pointer to the NCR5390_SCSI_CTRL structure created with ncr5390CtrlCreate( ).
- scsiCtrlBusId
- the SCSI bus ID of the ASC, 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.
- 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.
OK, or ERROR if a parameter is out of range.
ncr5390Lib, scsiPhysDevCreate( ),
ncr5390Show( ) - display the values of all readable NCR5390 chip registers
int ncr5390Show ( int * pScsiCtrl /* ptr to SCSI controller info */ )
This routine displays the state of the ASC 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.
-> ncr5390Show 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
OK, or ERROR if pScsiCtrl and pSysScsiCtrl are both NULL.