📄 cbiolib.html
字号:
</blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioLibInit (void)</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This function initializes the CBIO library, and will be calledwhen the first CBIO device is created, hence it does not need tobe called during system initialization. It can be called mulitpletimes, but will do nothing after the first call.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK or ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioBlkRW"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioBlkRW( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioBlkRW( )</strong> - transfer blocks to or from memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioBlkRW ( CBIO_DEV_ID dev, /* CBIO handle */ block_t startBlock, /* starting block of transfer */ block_t numBlocks, /* number of blocks to transfer */ addr_t buffer, /* address of the memory buffer */ CBIO_RW rw, /* direction of transfer R/W */ cookie_t * pCookie /* pointer to cookie */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine verifies the CBIO device is valid and if so calls the devices block transfer routine. The CBIO device performs block transfers between the device and memory. <p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b><p>RETURNS OK if sucessful or ERROR if the handle is invalid, or if theCBIO device routine returns ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioBytesRW"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioBytesRW( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioBytesRW( )</strong> - transfer bytes to or from memory</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioBytesRW ( CBIO_DEV_ID dev, /* CBIO handle */ block_t startBlock, /* starting block of the transfer */ off_t offset, /* offset into block in bytes */ addr_t buffer, /* address of data buffer */ size_t nBytes, /* number of bytes to transfer */ CBIO_RW rw, /* direction of transfer R/W */ cookie_t * pCookie /* pointer to cookie */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine verifies the CBIO device is valid and if so calls the devicesbyte tranfer routine which transfers between a user buffer and the lower layer (hardware, subordinate CBIO, or <b>BLK_DEV</b>). It is optimized for byte transfers. <p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b><p>RETURNS OK if sucessful or ERROR if the handle is invalid, or if theCBIO device routine returns ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioBlkCopy"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioBlkCopy( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioBlkCopy( )</strong> - block to block (sector to sector) tranfer routine</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioBlkCopy ( CBIO_DEV_ID dev, /* CBIO handle */ block_t srcBlock, /* source start block */ block_t dstBlock, /* destination start block */ block_t numBlocks /* number of blocks to copy */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine verifies the CBIO device is valid and if so calls the devicesblock to block tranfer routine which makes copies of one or more blocks on the lower layer (hardware, subordinate CBIO, or <b>BLK_DEV</b>). It is optimized for block to block copies on the subordinate layer. <p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b><p>RETURNS OK if sucessful or ERROR if the handle is invalid, or if theCBIO device routine returns ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioIoctl"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioIoctl( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioIoctl( )</strong> - perform ioctl operation on device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioIoctl ( CBIO_DEV_ID dev, /* CBIO handle */ int command, /* ioctl command to be issued */ addr_t arg /* arg - specific to ioctl */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine verifies the CBIO device is valid and if so calls the devicesI/O control operation routine.<p>CBIO modules expect the following <b><a href="./ioLib.html#ioctl">ioctl</a>( )</b> codes:<p><ul><li><b>CBIO_RESET</b> - reset the CBIO device. When the third argument to the ioctl</li>call accompaning <b>CBIO_RESET</b> is NULL, the code verifies that the disk is inserted and is ready, after getting it to a known state. When the 3rd argument is a non-zero, it is assumed to be a <b>BLK_DEV</b> pointer and <b>CBIO_RESET</b> will install a new subordinate block device. This workis performed at the <b>BLK_DEV</b> to CBIO layer, and all layers shall accountfor it. A <b>CBIO_RESET</b> indicates a possible change in device geometry, and the <b>CBIO_PARAMS</b> members will be reinitialized after a <b>CBIO_RESET</b>.<li><b>CBIO_STATUS_CHK</b> - check device status of CBIO device and lower layer</li><li><b>CBIO_DEVICE_LOCK</b> - Prevent disk removal </li><li><b>CBIO_DEVICE_UNLOCK</b> - Allow disk removal</li><li><b>CBIO_DEVICE_EJECT</b> - Unmount and eject device</li><li><b>CBIO_CACHE_FLUSH</b> - Flush any dirty cached data</li><li><b>CBIO_CACHE_INVAL</b> - Flush & Invalidate all cached data</li><li><b>CBIO_CACHE_NEWBLK</b> - Allocate scratch block</li></ul><p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b><p>RETURNS OK if sucessful or ERROR if the handle is invalid, or if theCBIO device routine returns ERROR.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioModeGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioModeGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioModeGet( )</strong> - return the mode setting for CBIO device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int cbioModeGet ( CBIO_DEV_ID dev /* CBIO handle */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b>This routine is not protected by a semaphore.<p>This routine confirms if the current layer is a CBIO to BLKDEV wrapper or a CBIO to CBIO layer. Depending on the current layer it either returns the mode from <b>BLK_DEV</b> or calls <b><a href="./cbioLib.html#cbioModeGet">cbioModeGet</a>( )</b> recursively.<p>RETURNS <b>O_RDONLY</b>, <b>O_WRONLY</b>, or <b>O_RDWR</b> or ERROR</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioModeSet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioModeSet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioModeSet( )</strong> - set mode for CBIO device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS cbioModeSet ( CBIO_DEV_ID dev, /* CBIO handle */ int mode /* O_RDONLY, O_WRONLY, or O_RDWR */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>Valid modes are <b>O_RDONLY</b>, <b>O_WRONLY</b>, or <b>O_RDWR</b>.<p>If the <b>CBIO_DEV_ID</b> passed to this routine is not a valid CBIO handle,ERROR will be returned with errno set to <b>S_cbioLib_INVALID_CBIO_DEV_ID</b>This routine is not protected by a semaphore.<p>This routine confirms if the current layer is a CBIO to BLKDEV wrapper or a CBIO to CBIO layer. Depending on the current layer it either sets the mode of the <b>BLK_DEV</b> or calls <b><a href="./cbioLib.html#cbioModeSet">cbioModeSet</a>( )</b> recursively.<p>RETURNS OK or ERROR if mode is not set.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./cbioLib.html#top">cbioLib</a></b><hr><a name="cbioRdyChgdGet"></a><p align=right><a href="rtnIndex.htm"><i>OS Libraries : Routines</i></a></p></blockquote><h1>cbioRdyChgdGet( )</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote> <p><strong>cbioRdyChgdGet( )</strong> - determine ready status of CBIO device</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>int cbioRdyChgdGet ( CBIO_DEV_ID dev /* CBIO handle */ )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>For example <pre> switch (cbioRdyChgdGet (cbioDeviceId)) { case TRUE: printf ("Disk changed.\n"); break; case FALSE: printf ("Disk has not changed.\n"); break; case ERROR: printf ("Not a valid CBIO device.\n"); break; default: break; }</pre>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -