📄 scsiseqlib.html
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/scsiSeqLib.html - generated by refgen from scsiSeqLib.c --> <title> scsiSeqLib </title></head><body bgcolor="#FFFFFF"> <hr><a name="top"></a><p align=right><a href="libIndex.htm"><i>VxWorks API Reference : OS Libraries</i></a></p></blockquote><h1>scsiSeqLib</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiSeqLib</strong> - SCSI sequential access device library (SCSI-2) </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><a href="./scsiSeqLib.html#scsiSeqDevCreate">scsiSeqDevCreate</a>( )</b> - create a SCSI sequential device<br><b><a href="./scsiSeqLib.html#scsiErase">scsiErase</a>( )</b> - issue an ERASE command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiTapeModeSelect">scsiTapeModeSelect</a>( )</b> - issue a <b>MODE_SELECT</b> command to a SCSI tape device<br><b><a href="./scsiSeqLib.html#scsiTapeModeSense">scsiTapeModeSense</a>( )</b> - issue a <b>MODE_SENSE</b> command to a SCSI tape device<br><b><a href="./scsiSeqLib.html#scsiSeqReadBlockLimits">scsiSeqReadBlockLimits</a>( )</b> - issue a <b>READ_BLOCK_LIMITS</b> command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiRdTape">scsiRdTape</a>( )</b> - read bytes or blocks from a SCSI tape device<br><b><a href="./scsiSeqLib.html#scsiWrtTape">scsiWrtTape</a>( )</b> - write data to a SCSI tape device<br><b><a href="./scsiSeqLib.html#scsiRewind">scsiRewind</a>( )</b> - issue a REWIND command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiReserveUnit">scsiReserveUnit</a>( )</b> - issue a RESERVE UNIT command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiReleaseUnit">scsiReleaseUnit</a>( )</b> - issue a RELEASE UNIT command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiLoadUnit">scsiLoadUnit</a>( )</b> - issue a LOAD/UNLOAD command to a SCSI device<br><b><a href="./scsiSeqLib.html#scsiWrtFileMarks">scsiWrtFileMarks</a>( )</b> - write file marks to a SCSI sequential device<br><b><a href="./scsiSeqLib.html#scsiSpace">scsiSpace</a>( )</b> - move the tape on a specified physical SCSI device<br><b><a href="./scsiSeqLib.html#scsiSeqStatusCheck">scsiSeqStatusCheck</a>( )</b> - detect a change in media<br><b><a href="./scsiSeqLib.html#scsiSeqIoctl">scsiSeqIoctl</a>( )</b> - perform an I/O control function for sequential access devices<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p>This library contains commands common to all sequential-access SCSI devices.Sequential-access SCSI devices are usually SCSI tape devices.These routines are separated from <b><a href="./scsi2Lib.html#top">scsi2Lib</a></b> in order to create an additionallayer for better support of all SCSI sequential devices.<p>SCSI commands in this library include:<p><table><tr valign=top><th align=left>Command </th><th align=left> </th><th align=left> </th><th align=left> </th><th align=left> Op Code</tr><tr><td colspan="5"><hr></tr><tr valign=top><td align=left>ERASE </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> (0x19)</tr><tr valign=top><td align=left>MODE SELECT (6) </td><td align=left> </td><td align=left> </td><td align=left> (0x15)</tr><tr valign=top><td align=left><b>MODE_SENSE</b> (6) </td><td align=left> </td><td align=left> </td><td align=left> (0x1a)</tr><tr valign=top><td align=left>READ (6) </td><td align=left> </td><td align=left> </td><td align=left> (0x08)</tr><tr valign=top><td align=left>READ BLOCK LIMITS </td><td align=left> </td><td align=left> (0x05)</tr><tr valign=top><td align=left>RELEASE UNIT </td><td align=left> </td><td align=left> </td><td align=left> (0x17)</tr><tr valign=top><td align=left>RESERVE UNIT </td><td align=left> </td><td align=left> </td><td align=left> (0x16)</tr><tr valign=top><td align=left>REWIND </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> (0x01)</tr><tr valign=top><td align=left>SPACE </td><td align=left> </td><td align=left> </td><td align=left> </td><td align=left> (0x11)</tr><tr valign=top><td align=left>WRITE (6) </td><td align=left> </td><td align=left> </td><td align=left> (0x0a)</tr><tr valign=top><td align=left>WRITE FILEMARKS </td><td align=left> </td><td align=left> </td><td align=left> (0x10)</tr><tr valign=top><td align=left>LOAD/UNLOAD </td><td align=left> </td><td align=left> </td><td align=left> (0x1b)</tr><tr valign=top><td align=left></tr></tr></table>The SCSI routines implemented here operate mostly on a <b>SCSI_SEQ_DEV</b>structure. This structure acts as an interface between this libraryand a higher-level layer. The <b>SEQ_DEV</b> structure is analogous to the<b>BLK_DEV</b> structure for block devices. <p>The <b><a href="./scsiSeqLib.html#scsiSeqDevCreate">scsiSeqDevCreate</a>( )</b> routine creates a <b>SCSI_SEQ_DEV</b> structure whose first element is a <b>SEQ_DEV</b>, operated upon by higher layers. This routine publishesall functions to be invoked byhigher layers and maintains some state information (for example, block size)for tracking SCSI-sequential-device information.<p></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="./tapeFsLib.html#top">tapeFsLib</a></b>, <b><a href="./scsi2Lib.html#top">scsi2Lib</a></b>,<i>VxWorks Programmer's Guide: I/O System, Local File Systems </i><hr><a name="scsiSeqDevCreate"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiSeqDevCreate( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiSeqDevCreate( )</strong> - create a SCSI sequential device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>SEQ_DEV *scsiSeqDevCreate ( SCSI_PHYS_DEV * pScsiPhysDev /* ptr to SCSI physical device info */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a SCSI sequential device and saves a pointer to this<b>SEQ_DEV</b> in the SCSI physical device. The following functions areinitialized in this structure:<p><table><tr valign=top><td align=left><b>sd_seqRd</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiRdTape">scsiRdTape</a>( )</b></tr><tr valign=top><td align=left><b>sd_seqWrt</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiWrtTape">scsiWrtTape</a>( )</b></tr><tr valign=top><td align=left><b>sd_ioctl</b> </td><td align=left> - <b><a href="./scsiLib.html#scsiIoctl">scsiIoctl</a>( )</b> (in <b><a href="./scsiLib.html#top">scsiLib</a></b>)</tr><tr valign=top><td align=left><b>sd_seqWrtFileMarks</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiWrtFileMarks">scsiWrtFileMarks</a>( )</b></tr><tr valign=top><td align=left><b>sd_statusChk</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiSeqStatusCheck">scsiSeqStatusCheck</a>( )</b></tr><tr valign=top><td align=left><b>sd_reset</b> </td><td align=left> - (not used)</tr><tr valign=top><td align=left><b>sd_rewind</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiRewind">scsiRewind</a>( )</b></tr><tr valign=top><td align=left><b>sd_reserve</b> </td><td align=left> - <b><a href="./scsiDirectLib.html#scsiReserve">scsiReserve</a>( )</b></tr><tr valign=top><td align=left><b>sd_release</b> </td><td align=left> - <b><a href="./scsiDirectLib.html#scsiRelease">scsiRelease</a>( )</b></tr><tr valign=top><td align=left><b>sd_readBlkLim</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiSeqReadBlockLimits">scsiSeqReadBlockLimits</a>( )</b></tr><tr valign=top><td align=left><b>sd_load</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiLoadUnit">scsiLoadUnit</a>( )</b></tr><tr valign=top><td align=left><b>sd_space</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiSpace">scsiSpace</a>( )</b></tr><tr valign=top><td align=left><b>sd_erase</b> </td><td align=left> - <b><a href="./scsiSeqLib.html#scsiErase">scsiErase</a>( )</b></tr><tr valign=top><td align=left></tr></tr></table>Only one <b>SEQ_DEV</b> per <b>SCSI_PHYS_DEV</b> is allowed, unlike <b>BLK_DEVs</b> where an entire list is maintained. Therefore, this routine can be called only once per creation of a sequential device.<p></blockquote><h4>RETURNS</h4><blockquote><p>A pointer to the <b>SEQ_DEV</b> structure, or NULL if the command fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b><hr><a name="scsiErase"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiErase( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiErase( )</strong> - issue an ERASE command to a SCSI device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiErase ( SCSI_PHYS_DEV * pScsiPhysDev, /* ptr to SCSI physical device */ BOOL longErase /* TRUE for entire tape erase */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine issues an ERASE command to a specified SCSI device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the command fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b><hr><a name="scsiTapeModeSelect"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiTapeModeSelect( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiTapeModeSelect( )</strong> - issue a <b>MODE_SELECT</b> command to a SCSI tape device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiTapeModeSelect ( SCSI_PHYS_DEV * pScsiPhysDev, /* ptr to SCSI physical device */ int pageFormat, /* value of the page format bit (0-1) */ int saveParams, /* value of the save parameters bit (0-1) */ char * buffer, /* ptr to output data buffer */ int bufLength /* length of buffer in bytes */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine issues a <b>MODE_SELECT</b> command to a specified SCSI device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the command fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b><hr><a name="scsiTapeModeSense"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiTapeModeSense( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiTapeModeSense( )</strong> - issue a <b>MODE_SENSE</b> command to a SCSI tape device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiTapeModeSense ( SCSI_PHYS_DEV * pScsiPhysDev, /* ptr to SCSI physical device */ int pageControl, /* value of the page control field (0-3) */ int pageCode, /* value of the page code field (0-0x3f) */ char * buffer, /* ptr to input data buffer */ int bufLength /* length of buffer in bytes */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine issues a <b>MODE_SENSE</b> command to a specified SCSI tape device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the command fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b><hr><a name="scsiSeqReadBlockLimits"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiSeqReadBlockLimits( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiSeqReadBlockLimits( )</strong> - issue a <b>READ_BLOCK_LIMITS</b> command to a SCSI device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS scsiSeqReadBlockLimits ( SCSI_SEQ_DEV * pScsiSeqDev, /* ptr to SCSI sequential device */ int * pMaxBlockLength, /* where to return maximum block length */ UINT16 * pMinBlockLength /* where to return minimum block length */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine issues a <b>READ_BLOCK_LIMITS</b> command to a specified SCSI device.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if the command fails.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./scsiSeqLib.html#top">scsiSeqLib</a></b><hr><a name="scsiRdTape"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>scsiRdTape( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>scsiRdTape( )</strong> - read bytes or blocks from a SCSI tape device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int scsiRdTape ( SCSI_SEQ_DEV * pScsiSeqDev, /* ptr to SCSI sequential device info */ UINT count, /* total bytes or blocks to be read */ char * buffer, /* ptr to input data buffer */ BOOL fixedSize /* if variable size blocks */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine reads the specified number of bytes or blocks from a specified
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -