VxWorks Reference Manual : Libraries

ncr5390Lib2

NAME

ncr5390Lib2 - NCR 53C90 Advanced SCSI Controller (ASC) library (SCSI-2)

ROUTINES

ncr5390CtrlCreateScsi2( ) - create a control structure for an NCR 53C90 ASC

DESCRIPTION

This is the I/O driver for the NCR 53C90 Advanced SCSI Controller (ASC). It is designed to work in conjunction with scsiLib.

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

INCLUDE FILES

ncr5390.h

SEE ALSO

ncr5390Lib2, scsiLib, NCR 53C90A, 53C90B Advanced SCSI Controller, VxWorks Programmer's Guide: I/O System


Libraries : Routines

ncr5390CtrlCreateScsi2( )

NAME

ncr5390CtrlCreateScsi2( ) - create a control structure for an NCR 53C90 ASC

SYNOPSIS

NCR_5390_SCSI_CTRL *ncr5390CtrlCreateScsi2
    (
    UINT8*  baseAdrs,           /* base address of ASC */
    int     regOffset,          /* offset between consecutive regs. */
    UINT    clkPeriod,          /* period of controller clock (nsec) */
    UINT    sysScsiDmaMaxBytes, /* maximum byte count using DMA */
    FUNCPTR sysScsiDmaStart,    /* function to start SCSI DMA xfer */
    FUNCPTR sysScsiDmaAbort,    /* function to abort SCSI DMA xfer */
    int     sysScsiDmaArg       /* argument to pass to above funcs. */
    )

DESCRIPTION

This routine creates a data structure that must exist before the ASC chip can be used. This routine must be called exactly once for a specified ASC, and must be the first routine called, since it calloc's a structure needed by all other routines in the library.

The input parameters are as follows:

baseAdrs
the address at which the CPU would access the lowest register of the ASC.

regOffset
the address offset (bytes) to access consecutive registers.

clkPeriod
the period, in nanoseconds, of the signal to the ASC clock input.

sysScsiDmaMaxBytes, sysScsiDmaStart, sysScsiDmaAbort, and sysScsiDmaArg
board-specific routines to handle DMA transfers to and from the ASC; 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. The interface to these DMA routines must be of the form:
    STATUS xxDmaStart (arg, pBuffer, bufLength, direction)

        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 (arg)

        int arg;                    /* call-back argument */
Implementation details for the DMA routines can be found in the specific DMA driver for that board.

NOTE

If there is no DMA interface, synchronous transfers are not supported. This is a limitation of the NCR5390 hardware.

RETURNS

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

SEE ALSO

ncr5390Lib2