VxWorks Reference Manual : Libraries

scsiMgrLib

NAME

scsiMgrLib - SCSI manager library (SCSI-2)

ROUTINES

scsiMgrEventNotify( ) - notify the SCSI manager of a SCSI (controller) event
scsiMgrBusReset( ) - handle a controller-bus reset event
scsiMgrCtrlEvent( ) - send an event to the SCSI controller state machine
scsiMgrThreadEvent( ) - send an event to the thread state machine
scsiMgrShow( ) - show status information for the SCSI manager

DESCRIPTION

This SCSI-2 library implements the SCSI manager. The purpose of the SCSI manager is to manage SCSI threads between requesting VxWorks tasks and the SCSI controller. The SCSI manager handles SCSI events and SCSI threads but allocation and de-allocation of SCSI threads is not the manager's responsiblity. SCSI thread management includes despatching threads and scheduling multiple threads (which are performed by the SCSI manager, plus allocation and de-allocation of threads (which are performed by routines in scsi2Lib).

The SCSI manager is spawned as a VxWorks task upon initialization of the SCSI interface within VxWorks. The entry point of the SCSI manager task is scsiMgr( ). The SCSI manager task is usually spawned during initialization of the SCSI controller driver. The driver's xxxCtrlCreateScsi2( ) routine is typically responsible for such SCSI interface initializations.

Once the SCSI manager has been initialized, it is ready to handle SCSI requests from VxWorks tasks. The SCSI manager has the following resposibilities:

One SCSI manager task must be spawned per SCSI controller. Thus, if a particular hardware platform contains more than one SCSI controller then that number of SCSI manager tasks must be spawned by the controller-driver intialization routine.

INCLUDE FILES

scsiLib.h, scsi2Lib.h

SEE ALSO

scsiMgrLib, scsiLib, scsi2Lib, scsiCommonLib, scsiDirectLib, scsiSeqLib, scsiCtrlLib, < >American National Standard for Information Systems - Small Computer" < >System Interface (SCSI-2), ANSI X3T9, " VxWorks Programmer's Guide: I/O System, Local File Systems


Libraries : Routines

scsiMgrEventNotify( )

NAME

scsiMgrEventNotify( ) - notify the SCSI manager of a SCSI (controller) event

SYNOPSIS

STATUS scsiMgrEventNotify
    (
    SCSI_CTRL *  pScsiCtrl, /* pointer to SCSI controller structure */
    SCSI_EVENT * pEvent,    /* pointer to the SCSI event */
    int          eventSize  /* size of the event information */
    )

DESCRIPTION

This routine posts an event message on the appropriate SCSI manager queue, then notifies the SCSI manager that there is a message to be accepted.

NOTE

This routine should not be called by application programs.

No access serialization is required, because event messages are only posted by the SCSI controller ISR. See the reference entry for scsiBusResetNotify( ).

RETURNS

OK, or ERROR if the SCSI manager's event queue is full.

SEE ALSO

scsiMgrLib, scsiBusResetNotify( )


Libraries : Routines

scsiMgrBusReset( )

NAME

scsiMgrBusReset( ) - handle a controller-bus reset event

SYNOPSIS

void scsiMgrBusReset
    (
    SCSI_CTRL * pScsiCtrl /* SCSI ctrlr on which bus reset */
    )

DESCRIPTION

This routine resets in turn: each attached physical device, each target, and the controller-finite-state machine. In practice, this routine implements the SCSI hard reset option.

NOTE

This routine does not physically reset the SCSI bus; see scsiBusReset( ). This routine should not be called by application programs.

RETURNS

N/A

SEE ALSO

scsiMgrLib


Libraries : Routines

scsiMgrCtrlEvent( )

NAME

scsiMgrCtrlEvent( ) - send an event to the SCSI controller state machine

SYNOPSIS

void scsiMgrCtrlEvent
    (
    SCSI_CTRL *     pScsiCtrl,
    SCSI_EVENT_TYPE eventType
    )

DESCRIPTION

This routine is called by the thread driver whenever selection, reselection, or disconnection occurs or when a thread is activated. It manages a simple finite-state machine for the SCSI controller.

NOTE

This function should not be called by application programs.

RETURNS

N/A

SEE ALSO

scsiMgrLib


Libraries : Routines

scsiMgrThreadEvent( )

NAME

scsiMgrThreadEvent( ) - send an event to the thread state machine

SYNOPSIS

void scsiMgrThreadEvent
    (
    SCSI_THREAD *          pThread,
    SCSI_THREAD_EVENT_TYPE eventType
    )

DESCRIPTION

This routine forwards an event to the thread's physical device. If the event is completion or deferral, it frees up the tag which was allocated when the thread was activated and either completes or defers the thread.

NOTE

This function should not be called by application programs.

The thread passed into this function does not have to be an active client thread (it may be an identification thread).

If the thread has no corresponding physical device, this routine does nothing. (This occassionally occurs if an unexpected disconnection or bus reset happens when an identification thread has not yet identified which physical device it corresponds to.

RETURNS

N/A

SEE ALSO

scsiMgrLib


Libraries : Routines

scsiMgrShow( )

NAME

scsiMgrShow( ) - show status information for the SCSI manager

SYNOPSIS

void scsiMgrShow
    (
    SCSI_CTRL * pScsiCtrl,      /* SCSI controller to use */
    BOOL        showPhysDevs,   /* TRUE => show phys dev details */
    BOOL        showThreads,    /* TRUE => show thread details */
    BOOL        showFreeThreads /* TRUE => show free thread IDs */
    )

DESCRIPTION

This routine shows the current state of the SCSI manager for the specified controller, including the total number of threads created and the number of threads currently free.

Optionally, this routine also shows details for all created physical devices on this controller and all threads for which SCSI requests are outstanding. It also shows the IDs of all free threads.

NOTE

The information displayed is volatile; this routine is best used when there is no activity on the SCSI bus. Threads allocated by a client but for which there are no outstanding SCSI requests are not shown.

RETURNS

N/A

SEE ALSO

scsiMgrLib