VxWorks Reference Manual : Libraries

wd33c93Lib2

NAME

wd33c93Lib2 - WD33C93 SCSI-Bus Interface Controller library (SCSI-2)

ROUTINES

wd33c93CtrlCreateScsi2( ) - create and partially initialize an SBIC structure

DESCRIPTION

This library contains part of the I/O driver for the Western Digital WD33C93 family of SCSI-2 Bus Interface Controllers (SBIC). It is designed to work with scsi2Lib. The driver routines in this library depend on the SCSI-2 ANSI specification; for general driver routines and for overall SBIC documentation, see wd33c93Lib.

USER-CALLABLE ROUTINES

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 wd33c93CtrlCreateScsi2( ), which creates a controller structure.

INCLUDE FILES

wd33c93.h, wd33c93_2.h

SEE ALSO

wd33c93Lib2, scsiLib, scsi2Lib, wd33c93Lib, VxWorks Programmer's Guide: I/O System


Libraries : Routines

wd33c93CtrlCreateScsi2( )

NAME

wd33c93CtrlCreateScsi2( ) - create and partially initialize an SBIC structure

SYNOPSIS

WD_33C93_SCSI_CTRL *wd33c93CtrlCreateScsi2
    (
    UINT8 * sbicBaseAdrs,       /* base address of the SBIC */
    int     regOffset,          /* address offset between SBIC registers */
    UINT    clkPeriod,          /* period of the SBIC clock (nsec) */
    FUNCPTR sysScsiBusReset,    /* function to reset SCSI bus */
    int     sysScsiResetArg,    /* argument to pass to above function */
    UINT    sysScsiDmaMaxBytes, /* maximum byte count using DMA */
    FUNCPTR sysScsiDmaStart,    /* function to start SCSI DMA transfer */
    FUNCPTR sysScsiDmaAbort,    /* function to abort SCSI DMA transfer */
    int     sysScsiDmaArg       /* argument to pass to above functions */
    )

DESCRIPTION

This routine creates an SBIC data structure and must be called before using an SBIC chip. It must be called exactly once for a specified SBIC. Since it allocates memory for a structure needed by all routines in wd33c93Lib2, it must be called before any other routines in the library. After calling this routine, at least one call to wd33c93CtrlInit( ) must be made before any SCSI transaction is initiated using the SBIC.

NOTE

Only the non-multiplexed processor interface is supported.

A detailed description of the input parameters follows:

sbicBaseAdrs
the address at which the CPU would access the lowest (AUX STATUS) register of the SBIC.

regOffset
the address offset (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 CLK input.

sysScsiBusReset and sysScsiResetArg
the board-specific routine to pulse the SCSI bus RST signal. The specified argument is passed to this routine when it is called. It may be used to identify the SCSI bus to be reset, if there is a choice. The interface to this routine is of the form:
    void xxBusReset 
        (
        int arg;                    /* call-back argument */ 
        )
sysScsiDmaMaxBytes, sysScsiDmaStart, sysScsiDmaAbort, and sysScsiDmaArg
board-specific routines to handle DMA transfers to and from the SBIC; if the maximum DMA byte count is zero, programmed I/O is used. Otherwise, non-NULL function pointers to DMA start and abort routines must be provided. The specified argument is passed to these routines when they are called; it may be used to identify the DMA channel to use, for example. Note that DMA is implemented only during SCSI data in/out phases. The interface to these DMA routines must be of the form:
    STATUS xxDmaStart 
        (
        int arg;                    /* call-back argument           */
        UINT8 *pBuffer;             /* ptr to the data buffer       */
        UINT bufLength;             /* number of bytes to xfer      */
        int direction;              /* 0 = SCSI->mem, 1 = mem->SCSI */
        )

    STATUS xxDmaAbort
        (
        int arg;                    /* call-back argument */
        )

RETURNS

 A pointer to the SBIC structure, or NULL if memory is  insufficient or the parameters are invalid.

SEE ALSO

wd33c93Lib2