⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 scsi2lib.html

📁 Vxworks API操作系统和驱动程序设计API。压缩的HTML文件
💻 HTML
📖 第 1 页 / 共 3 页
字号:
    myScsiCmdBlock [N-1] = MY_CONTROL_BYTE;     /* typically == 0 */    /* fill in fields of SCSI_TRANSACTION structure */    myScsiXaction.cmdAddress    = myScsiCmdBlock;    myScsiXaction.cmdLength     = &lt;# of valid bytes in myScsiCmdBlock&gt;;    myScsiXaction.dataAddress   = (UINT8 *) buffer;    myScsiXaction.dataDirection = &lt;O_RDONLY (0) or O_WRONLY (1)&gt;;    myScsiXaction.dataLength    = bufLength;    myScsiXaction.addLengthByte = 0;            /* no longer used */    myScsiXaction.cmdTimeout    = &lt;timeout in usec&gt;;    myScsiXaction.tagType       = SCSI_TAG_{DEFAULT,UNTAGGED,                                            SIMPLE,ORDERED,HEAD_OF_Q};    myScsiXaction.priority      = [ 0 (highest) to 255 (lowest) ];    if (scsiIoctl (pScsiPhysDev, FIOSCSICOMMAND, &amp;myScsiXaction) == OK)        return (OK);    else        /* optionally perform retry or other action based on value of         *  myScsiXaction.statusByte         */        return (ERROR);    }</pre></blockquote><h4>INCLUDE FILES</h4><blockquote><p><b>scsiLib.h</b>, <b>scsi2Lib.h</b><p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./dosFsLib.html#top">dosFsLib</a></b>, <b><a href="./rt11FsLib.html#top">rt11FsLib</a></b>, <b><a href="./rawFsLib.html#top">rawFsLib</a></b>, <b><a href="./tapeFsLib.html#top">tapeFsLib</a></b>, <b><a href="./scsiLib.html#top">scsiLib</a></b>, <b><a href="./scsiCommonLib.html#top">scsiCommonLib</a></b>,<b><a href="./scsiDirectLib.html#top">scsiDirectLib</a></b>, <b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b>, <b><a href="./scsiMgrLib.html#top">scsiMgrLib</a></b>, <b><a href="./scsiCtrlLib.html#top">scsiCtrlLib</a></b>,<i>  American National Standard for Information Systems - Small Computer" </i><i>  System Interface (SCSI-2), ANSI X3T9,"</i><i>VxWorks Programmer's Guide: I/O System, Local File Systems </i><hr><a name="scsi2IfInit"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsi2IfInit(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsi2IfInit(&nbsp;)</strong> - initialize the SCSI-2 interface to <b><a href="./scsiLib.html#top">scsiLib</a></b></p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void scsi2IfInit ()</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the SCSI-2 function interface by adding all the routines in <b><a href="./scsi2Lib.html#top">scsi2Lib</a></b> plus those in <b><a href="./scsiDirectLib.html#top">scsiDirectLib</a></b> and <b><a href="./scsiCommonLib.html#top">scsiCommonLib</a></b>. It isinvoked by <b>usrConfig.c</b> if the macro <b>INCLUDE_SCSI2</b> is defined in<b>config.h</b>.  The calling interface remains the same between SCSI-1 and SCSI-2;this routine simply sets the calling interface function pointers to the SCSI-2 functions.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiTargetOptionsSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiTargetOptionsSet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiTargetOptionsSet(&nbsp;)</strong> - set options for one or all SCSI targets</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiTargetOptionsSet    (    SCSI_CTRL *    pScsiCtrl, /* ptr to SCSI controller info */    int            devBusId,  /* target to affect, or all */    SCSI_OPTIONS * pOptions,  /* buffer containing new options */    UINT           which      /* which options to change */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine sets the options defined by the bitmask <b>which</b> for thespecified target (or all targets if <b>devBusId</b> is <b>SCSI_SET_OPT_ALL_TARGETS</b>).<p>The bitmask <b>which</b> can be any combination of the following, bitwiseOR'd together (corresponding fields in the <b>SCSI_OPTIONS</b> structure areshown in parentheses):<p><table><tr valign=top><td align=left><b>SCSI_SET_OPT_TIMEOUT</b>    </td><td align=left> <b>selTimeOut</b> </td><td align=left> select timeout period, microseconds</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>SCSI_SET_OPT_MESSAGES</b>   </td><td align=left> <b>messages</b>   </td><td align=left> FALSE to disable SCSI messages</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>SCSI_SET_OPT_DISCONNECT</b> </td><td align=left> <b>disconnect</b> </td><td align=left> FALSE to disable discon/recon</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>SCSI_SET_OPT_XFER_PARAMS</b></td><td align=left> <b>maxOffset,</b> </td><td align=left> max sync xfer offset, 0=>async</tr><tr valign=top><td align=left>                        </td><td align=left>  <b>minPeriod</b> </td><td align=left> min sync xfer period, x 4 nsec.</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>SCSI_SET_OPT_TAG_PARAMS</b> </td><td align=left> <b>tagType,</b>   </td><td align=left> default tag type (<b>SCSI_TAG_</b>*)</tr><tr valign=top><td align=left>                        </td><td align=left>  <b>maxTags</b>   </td><td align=left> max cmd tags available</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>SCSI_SET_OPT_WIDE_PARAMS</b></td><td align=left> <b>xferWidth</b>  </td><td align=left> data transfer width setting.</tr><tr valign=top><td align=left></td><td align=left>  </td><td align=left>  </td><td align=left>  </td><td align=left>  </td><td align=left>    xferWidth = 0 ;  8 bits wide </tr><tr valign=top><td align=left></td><td align=left>  </td><td align=left>  </td><td align=left>  </td><td align=left>  </td><td align=left>    xferWidth = 1 ; 16 bits wide</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left></tr></tr></table></blockquote><h4>NOTE</h4><blockquote><p>This routine can be used after the target device has already been used; in this case, however, it is not possible to change the tag parameters. This routine must not be used while there is any SCSI activity on the specified target(s).<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the bus ID or options are invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiTargetOptionsGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiTargetOptionsGet(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiTargetOptionsGet(&nbsp;)</strong> - get options for one or all SCSI targets</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiTargetOptionsGet    (    SCSI_CTRL *    pScsiCtrl, /* ptr to SCSI controller info */    int            devBusId,  /* target to interrogate */    SCSI_OPTIONS * pOptions   /* buffer to return options */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine copies the current options for the specified target into thecaller's buffer.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the bus ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiTargetOptionsShow"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiTargetOptionsShow(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiTargetOptionsShow(&nbsp;)</strong> - display options for specified SCSI target</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiTargetOptionsShow    (    SCSI_CTRL * pScsiCtrl,    /* ptr to SCSI controller info */    int         devBusId      /* target to interrogate */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine displays the current target options for the specified target inthe following format:<p>Target Options (id <i>scsi bus ID</i>): <br>&nbsp;&nbsp;&nbsp;&nbsp;selection&nbsp;TimeOut:&nbsp;<i>timeout</i>&nbsp;nano&nbsp;secs<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;messages&nbsp;allowed:&nbsp;TRUE&nbsp;or&nbsp;FALSE<br>&nbsp;&nbsp;&nbsp;disconnect&nbsp;allowed:&nbsp;TRUE&nbsp;or&nbsp;FALSE<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REQ/ACK&nbsp;offset:&nbsp;<i>negotiated&nbsp;offset</i>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transfer&nbsp;period:&nbsp;<i>negotiated&nbsp;period</i>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;transfer&nbsp;width:&nbsp;8&nbsp;or&nbsp;16&nbsp;bitsmaximum transfer rate: <i>peak transfer rate</i> MB/sec<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tag&nbsp;type:&nbsp;<i>tag&nbsp;type</i><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maximum&nbsp;tags:&nbsp;<i>max&nbsp;tags</i><p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the bus ID is invalid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiPhysDevShow"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiPhysDevShow(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiPhysDevShow(&nbsp;)</strong> - show status information for a physical device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void scsiPhysDevShow    (    SCSI_PHYS_DEV * pScsiPhysDev, /* physical device to be displayed */    BOOL            showThreads,  /* show IDs of associated threads */    BOOL            noHeader      /* do not print title line */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine shows the state, the current nexus type, the current tagnumber, the number of tagged commands in progress, and the number ofwaiting and active threads for a SCSI physical device.  Optionally, it showsthe IDs of waiting and active threads, if any.  This routine may be calledat any time, but note that all of the information displayed is volatile.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiCacheSynchronize"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiCacheSynchronize(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiCacheSynchronize(&nbsp;)</strong> - synchronize the caches for data coherency</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>void scsiCacheSynchronize    (    SCSI_THREAD *     pThread, /* ptr to thread info */    SCSI_CACHE_ACTION action   /* cache action required */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine performs whatever cache action is necessary to ensure cachecoherency with respect to the various buffers involved in a SCSI command.<p>The process is as follows:<p><table></tr><tr valign=top><td>1.<td>The buffers for command, identification, and write data,which are simply written to SCSI, are flushed before the command.</tr><tr valign=top><td>2.<td>The status buffer, which is written and then read, is cleared(flushed and invalidated) before the command.</tr><tr valign=top><td>3.<td>The data buffer for a read command, which is only read, iscleared before the command.</table><p>The data buffer for a read command is cleared before the command ratherthan invalidated after it because it may share dirty cache lines with dataoutside the read buffer.  DMA drivers for older versions of the SCSIlibrary have flushed the first and last bytes of thedata buffer before the command.  However, this approach is not sufficientwith the enhanced SCSI library because the amount of data transferred intothe buffer may not fill it, which would cause dirty cache lines whichcontain correct data for the un-filled part of the buffer to be lostwhen the buffer is invalidated after the command.<p>To optimize the performance of the driver in supporting different cachingpolicies, the routine uses the <b>CACHE_USER_FLUSH</b> macro when flushing thecache.  In the absence of a <b>CACHE_USER_CLEAR</b> macro, the following steps are taken:<table></tr><tr valign=top><td>1.<td>If there is a non-NULL flush routine in the <b>cacheUserFuncs</b> structure, the cache is cleared.</tr><tr valign=top><td>2.<td>If there is a non-NULL invalidate routine, the cache is invalidated. </tr><tr valign=top><td>3.<td>Otherwise nothing is done; the cache is assumed to be coherentwithout any software intervention.</table><p>Finally, since flushing (clearing) cache line entries for a large databuffer can be time-consuming, if the data buffer is largerthan a preset (run-time configurable) size, the entire cache is flushed.<p></blockquote><h4>RETURNS</h4><blockquote><p>N/A</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsi2Lib.html#top">scsi2Lib</a></b><hr><a name="scsiIdentMsgBuild"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries :  Routines</i></a></p></blockquote><h1>scsiIdentMsgBuild(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>scsiIdentMsgBuild(&nbsp;)</strong> - build an identification message</p></blockquote><h4>SYNOPSIS</h4><blockquote><p>

⌨️ 快捷键说明

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