mb87030lib.html

来自「vxworks相关论文」· HTML 代码 · 共 240 行

HTML
240
字号
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/mb87030Lib.html - generated by refgen from mb87030Lib.c --> <title> mb87030Lib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.html"><i>VxWorks Reference Manual :  Libraries</i></a></p></blockquote><h1>mb87030Lib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>mb87030Lib</strong> - Fujitsu MB87030 SCSI Protocol Controller (SPC) library </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./mb87030Lib.html#mb87030CtrlCreate">mb87030CtrlCreate</a></i>(&nbsp;)</b>  -  create a control structure for an MB87030 SPC<br><b><i><a href="./mb87030Lib.html#mb87030CtrlInit">mb87030CtrlInit</a></i>(&nbsp;)</b>  -  initialize a control structure for an MB87030 SPC<br><b><i><a href="./mb87030Lib.html#mb87030Show">mb87030Show</a></i>(&nbsp;)</b>  -  display the values of all readable MB87030 SPC registers<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This is the I/O driver for the Fujitsu MB87030 SCSI Protocol Controller(SPC) chip.  It is designed to work in conjunction with scsiLib.<p></blockquote><h4>USER-CALLABLE ROUTINES</h4><blockquote><p>Most of the routines in this driver are accessible only through the I/Osystem.  Two routines, however, must be called directly:  <b><i><a href="./mb87030Lib.html#mb87030CtrlCreate">mb87030CtrlCreate</a></i>(&nbsp;)</b>to create a controller structure, and <b><i><a href="./mb87030Lib.html#mb87030CtrlInit">mb87030CtrlInit</a></i>(&nbsp;)</b> to initializethe controller structure.<p></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>mb87030.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mb87030Lib.html#top">mb87030Lib</a></b>, <b><a href="./scsiLib.html#top">scsiLib</a></b>,  <i>Fujitsu Small Computer Systems Interface MB87030 Synchronous/Asynchronous Protocol Controller Users Manual, </i><i>VxWorks Programmer's Guide: I/O System</i><hr><a name="mb87030CtrlCreate"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>mb87030CtrlCreate</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>mb87030CtrlCreate</i>(&nbsp;)</strong> - create a control structure for an MB87030 SPC</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>MB_87030_SCSI_CTRL *mb87030CtrlCreate    (    UINT8 * spcBaseAdrs,   /* base address of SPC */    int     regOffset,     /* addr offset between consecutive regs. */    UINT    clkPeriod,     /* period of controller clock (nsec) */    int     spcDataParity, /* type of input to SPC DP (data parity) */    FUNCPTR spcDMABytesIn, /* SCSI DMA input function */    FUNCPTR spcDMABytesOut /* SCSI DMA output function */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a data structure that must exist before the SPC chip canbe used.  This routine should be called once and only once for a specified SPC.  It should be the first routine called, since it allocates memory fora structure needed by all other routines in the library.<p>After calling this routine, at least one call to <b><i><a href="./mb87030Lib.html#mb87030CtrlInit">mb87030CtrlInit</a></i>(&nbsp;)</b> shouldbe made before any SCSI transaction is initiated using the SPC chip.<p>A detailed description of the input parameters follows:<dl><dt><i>spcBaseAdrs</i><dd>the address at which the CPU would access the lowest register of the SPC.<p><dt><i>regOffset</i><dd>the address offset (bytes) to access consecutive registers.(This must be a power of 2, for example, 1, 2, 4, etc.)<p><dt><i>clkPeriod</i><dd>the period in nanoseconds of the signal to the SPC clock input (onlyused for select command timeouts).<p><dt><i>spcDataParity</i><dd>the parity bit must be defined by one of the following constants,according to whether the input to SPC DP is GND, +5V, or a validparity signal, respectively:<br>&nbsp;&nbsp;&nbsp;&nbsp;<b>SPC_DATA_PARITY_LOW</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>SPC_DATA_PARITY_HIGH</b><br>&nbsp;&nbsp;&nbsp;&nbsp;<b>SPC_DATA_PARITY_VALID</b><p><dt><i>spcDmaBytesIn</i> and <i>spcDmaBytesOut</i><dd> pointers to board-specific routines to handle DMA input and output.  If these are NULL (0), SPC program transfer mode is used.DMA is possible only during SCSI data in/out phases.The interface to these DMA routines must be of the form:<pre>    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 */        )</pre></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;A&nbsp;pointer&nbsp;to&nbsp;the&nbsp;SPC&nbsp;control&nbsp;structure,&nbsp;or&nbsp;NULL&nbsp;if&nbsp;memory&nbsp;is insufficient or parameters are invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mb87030Lib.html#top">mb87030Lib</a></b><hr><a name="mb87030CtrlInit"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>mb87030CtrlInit</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>mb87030CtrlInit</i>(&nbsp;)</strong> - initialize a control structure for an MB87030 SPC</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mb87030CtrlInit    (    MB_87030_SCSI_CTRL * pSpc,              /* ptr to SPC struct */    int                  scsiCtrlBusId,     /* SCSI bus ID of this SPC */    UINT                 defaultSelTimeOut, /* default dev sel timeout */    int                  scsiPriority       /* priority of task doing SCSI */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes an SPC control structure created by<b><i><a href="./mb87030Lib.html#mb87030CtrlCreate">mb87030CtrlCreate</a></i>(&nbsp;)</b>.  It must be called before the SPC is used.  Thisroutine can be called more than once; however, it should becalled only while there is no activity on the SCSI interface.<p>Before returning, this routine pulses RST (reset) on the SCSI bus, thusresetting all attached devices.<p>The input parameters are as follows:<dl><dt><i>pSpc</i><dd>a pointer to the <b>MB_87030_SCSI_CTRL</b> structure created with<b><i><a href="./mb87030Lib.html#mb87030CtrlCreate">mb87030CtrlCreate</a></i>(&nbsp;)</b>.<p><dt><i>scsiCtrlBusId</i><dd>the SCSI bus ID of the SIOP, in the range 0 - 7.  The ID is somewhat arbitrary; the value 7, or highest priority, is conventional.<p><dt><i>defaultSelTimeOut</i><dd>the timeout, in microseconds, for selecting a SCSI deviceattached to this controller.  The recommended value 0specifies <b>SCSI_DEF_SELECT_TIMEOUT</b> (250 milliseconds).The maximum timeout possible is approximately 3 seconds.Values exceeding this revert to the maximum.<p><dt><i>scsiPriority</i><dd> the priority to which a task is set when performing a SCSItransaction.  Valid priorities range from 0 to 255.  Alternatively, the value -1 specifies that the priority should not bealtered during SCSI transactions.<p></dl></blockquote><h4>RETURNS</h4><blockquote><p><p>&nbsp;OK,&nbsp;or&nbsp;ERROR&nbsp;if&nbsp;parameters&nbsp;are&nbsp;out&nbsp;of&nbsp;range.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mb87030Lib.html#top">mb87030Lib</a></b><hr><a name="mb87030Show"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>mb87030Show</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>mb87030Show</i>(&nbsp;)</strong> - display the values of all readable MB87030 SPC registers</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS mb87030Show    (    SCSI_CTRL * pScsiCtrl /* ptr to SCSI controller info */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the state of the SPC registers in a user-friendly manner.  It is useful primarily for debugging.<p></blockquote><h4>EXAMPLE</h4><blockquote><p><p><pre>    -&gt; mb87030Show    SCSI Bus ID: 7        SCTL (0x01): intsEnbl      SCMD (0x00): busRlease     TMOD (0x00): asyncMode     INTS (0x00):                PSNS (0x00): req0 ack0 atn0 sel0 bsy0 msg0 c_d0 i_o0     SSTS (0x05): noConIdle xferCnt=0 dregEmpty     SERR (0x00): noParErr      PCTL (0x00): bfIntDsbl phDataOut     MBC  (0x00): 0             XFER COUNT : 0x000000 =         0</pre></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if <i>pScsiCtrl</i> and <i>pSysScsiCtrl</i> are both NULL.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./mb87030Lib.html#top">mb87030Lib</a></b></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?