VxWorks Reference Manual : Libraries
scsiMgrLib - SCSI manager library (SCSI-2)
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
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:
- It processes requests from client tasks.
- It activates a SCSI transaction thread by appending it to the target device's wait queue and allocating a specified time period to execute a transaction.
- It handles timeout events which cause threads to be aborted.
- It receives event notifications from the SCSI driver interrupt service routine (ISR) and processes the event.
- It responds to events generated by the controller hardware, such as disconnection and information transfer requests.
- It replies to clients when their requests have completed or aborted.
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.
scsiLib.h, scsi2Lib.h
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
scsiMgrEventNotify( ) - notify the SCSI manager of a SCSI (controller) event
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 */ )
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.
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( ).
OK, or ERROR if the SCSI manager's event queue is full.
scsiMgrLib, scsiBusResetNotify( )
scsiMgrBusReset( ) - handle a controller-bus reset event
void scsiMgrBusReset ( SCSI_CTRL * pScsiCtrl /* SCSI ctrlr on which bus reset */ )
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.
This routine does not physically reset the SCSI bus; see scsiBusReset( ). This routine should not be called by application programs.
N/A
scsiMgrCtrlEvent( ) - send an event to the SCSI controller state machine
void scsiMgrCtrlEvent ( SCSI_CTRL * pScsiCtrl, SCSI_EVENT_TYPE eventType )
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.
This function should not be called by application programs.
N/A
scsiMgrThreadEvent( ) - send an event to the thread state machine
void scsiMgrThreadEvent ( SCSI_THREAD * pThread, SCSI_THREAD_EVENT_TYPE eventType )
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.
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.
N/A
scsiMgrShow( ) - show status information for the SCSI manager
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 */ )
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.
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.
N/A