VxWorks Reference Manual : Libraries
wd33c93Lib1 - WD33C93 SCSI-Bus Interface Controller library (SCSI-1)
wd33c93CtrlCreate( ) - create and partially initialize a WD33C93 SBIC structure
This library contains part of the I/O driver for the Western Digital WD33C93 and WD33C93A SCSI-Bus Interface Controllers (SBIC). The driver routines in this library depend on the SCSI-1 version of the SCSI standard; for driver routines that do not depend on SCSI-1 or SCSI-2, and for overall SBIC driver documentation, see wd33c93Lib.
Most of the routines in this driver are accessible only through the I/O system. The only exception in this portion of the driver is wd33c93CtrlCreate( ), which creates a controller structure.
wd33c93.h, wd33c93_1.h
wd33c93Lib1, scsiLib, scsi1Lib, wd33c93Lib
wd33c93CtrlCreate( ) - create and partially initialize a WD33C93 SBIC structure
WD_33C93_SCSI_CTRL *wd33c93CtrlCreate ( UINT8 * sbicBaseAdrs, /* base address of SBIC */ int regOffset, /* addr offset between consecutive regs. */ UINT clkPeriod, /* period of controller clock (nsec) */ int devType, /* SBIC device type */ FUNCPTR sbicScsiReset, /* SCSI bus reset function */ FUNCPTR sbicDmaBytesIn, /* SCSI DMA input function */ FUNCPTR sbicDmaBytesOut /* SCSI DMA output function */ )
This routine creates an SBIC data structure and must be called before using an SBIC chip. It should be called once and only once for a specified SBIC. Since it allocates memory for a structure needed by all routines in wd33c93Lib, it must be called before any other routines in the library. After calling this routine, at least one call to wd33c93CtrlInit( ) should be made before any SCSI transaction is initiated using the SBIC.
Note that only the non-multiplexed processor interface is supported.
The input parameters are as follows:
- sbicBaseAdrs
- the address where the CPU accesses the lowest register of the SBIC.
- regOffset
- the address offset (in bytes) to access consecutive registers. (This must be a power of 2; for example, 1, 2, 4, etc.)
- clkPeriod
- the period, in nanoseconds, of the signal-to-SBIC clock input used only for select command timeouts.
- devType
- a constant corresponding to the type (part number) of this controller; possible options are enumerated in wd33c93.h under the heading "SBIC device type."
- sbicScsiReset
- a board-specific routine to assert the RST line on the SCSI bus, which causes all connected devices to return to a known quiescent state.
- spcDmaBytesIn and spcDmaBytesOut
- board-specific routines to handle DMA input and output. If these are NULL (0), SBIC program transfer mode is used. DMA is implemented only during SCSI data in/out phases. The interface to these DMA routines must be of the form:
STATUS xxDmaBytes{In, Out} ( SCSI_PHYS_DEV *pScsiPhysDev, /* ptr to phys dev info */ UINT8 *pBuffer, /* ptr to the data buffer */ int bufLength /* number of bytes to xfer */ )
A pointer to the SBIC control structure, or NULL if memory is insufficient or parameters are invalid.
wd33c93Lib1, wd33c93.h