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

📄 atadrv.html

📁 vxworks相关论文
💻 HTML
字号:
<html><head><!-- /vobs/wpwr/docs/vxworks/ref/ataDrv.html - generated by refgen from ataDrv.c --> <title> ataDrv </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>ataDrv</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong>ataDrv</strong> - ATA/IDE (LOCAL and PCMCIA) disk device driver </p></blockquote><h4>ROUTINES</h4><blockquote><p><p><b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b>  -  initialize the ATA driver<br><b><i><a href="./ataDrv.html#ataDevCreate">ataDevCreate</a></i>(&nbsp;)</b>  -  create a device for a ATA/IDE disk<br><b><i><a href="./ataDrv.html#ataRawio">ataRawio</a></i>(&nbsp;)</b>  -  do raw I/O access<br><p></blockquote><h4>DESCRIPTION</h4><blockquote><p><p>This is a driver for ATA/IDE devices on PCMCIA, ISA, and other buses. Thedriver can be customized via various macros to run on a variety of boards andboth big-endian, and little endian CPUs.<p></blockquote><h4>USER-CALLABLE ROUTINES</h4><blockquote><p><p>Most of the routines in this driver are accessible only through the I/Osystem.  However, two routines must be called directly:  <b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b> toinitialize the driver and <b><i><a href="./ataDrv.html#ataDevCreate">ataDevCreate</a></i>(&nbsp;)</b> to create devices.<p>Before the driver can be used, it must be initialized by calling <b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b>.This routine must be called exactly once, before any reads, writes, orcalls to <b><i><a href="./ataDrv.html#ataDevCreate">ataDevCreate</a></i>(&nbsp;)</b>.  Normally, it is called from <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>(&nbsp;)</b> in<b>usrConfig.c</b>.<p>The routine <b><i><a href="./ataDrv.html#ataRawio">ataRawio</a></i>(&nbsp;)</b> supports physical I/O access. The firstargument is a drive number, 0 or 1; the second argument is a pointerto an <b>ATA_RAW</b> structure.<p></blockquote><h4>NOTE</h4><blockquote><p>Format is not supported, because ATA/IDE disks are already formatted, and badsectors are mapped.<p></blockquote><h4>PARAMETERS</h4><blockquote><p><table><tr valign=top><td align=left></tr></tr></table><p>The <b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b> function requires a configuration flag as a parameter.The configuration flag is one of the following:<p><table><tr valign=top><td align=left>Transfer mode </tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>ATA_PIO_DEF_0</b>    </td><td align=left> PIO default mode</tr><tr valign=top><td align=left><b>ATA_PIO_DEF_1</b>    </td><td align=left> PIO default mode, no IORDY</tr><tr valign=top><td align=left><b>ATA_PIO_0</b>        </td><td align=left> PIO mode 0</tr><tr valign=top><td align=left><b>ATA_PIO_1</b>        </td><td align=left> PIO mode 1</tr><tr valign=top><td align=left><b>ATA_PIO_2</b>        </td><td align=left> PIO mode 2</tr><tr valign=top><td align=left><b>ATA_PIO_3</b>        </td><td align=left> PIO mode 3</tr><tr valign=top><td align=left><b>ATA_PIO_4</b>        </td><td align=left> PIO mode 4</tr><tr valign=top><td align=left><b>ATA_PIO_AUTO</b>     </td><td align=left> PIO max supported mode</tr><tr valign=top><td align=left><b>ATA_DMA_0</b>        </td><td align=left> DMA mode 0</tr><tr valign=top><td align=left><b>ATA_DMA_1</b>        </td><td align=left> DMA mode 1</tr><tr valign=top><td align=left><b>ATA_DMA_2</b>        </td><td align=left> DMA mode 2</tr><tr valign=top><td align=left><b>ATA_DMA_AUTO</b>     </td><td align=left> DMA max supported mode</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>Transfer bits</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>ATA_BITS_16</b>      </td><td align=left> RW bits size, 16 bits</tr><tr valign=top><td align=left><b>ATA_BITS_32</b>      </td><td align=left> RW bits size, 32 bits</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>Transfer unit</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>ATA_PIO_SINGLE</b>   </td><td align=left> RW PIO single sector</tr><tr valign=top><td align=left><b>ATA_PIO_MULTI</b>    </td><td align=left> RW PIO multi sector</tr><tr valign=top><td align=left><b>ATA_DMA_SINGLE</b>   </td><td align=left> RW DMA single word</tr><tr valign=top><td align=left><b>ATA_DMA_MULTI</b>    </td><td align=left> RW DMA multi word</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left>Geometry parameters</tr><tr valign=top><td align=left></tr><tr valign=top><td align=left><b>ATA_GEO_FORCE</b>    </td><td align=left> set geometry in the table</tr><tr valign=top><td align=left><b>ATA_GEO_PHYSICAL</b> </td><td align=left> set physical geometry</tr><tr valign=top><td align=left><b>ATA_GEO_CURRENT</b>  </td><td align=left> set current geometry</tr><tr valign=top><td align=left></tr></tr></table>DMA transfer is not supported in this release.  If <b>ATA_PIO_AUTO</b> or <b>ATA_DMA_AUTO</b>is specified, the driver automatically chooses the maximum mode supported by thedevice.  If <b>ATA_PIO_MULTI</b> or <b>ATA_DMA_MULTI</b> is specified, and the device doesnot support it, the driver automatically chooses single sector or word mode.If <b>ATA_BITS_32</b> is specified, the driver uses 32-bit transfer mode regardless ofthe capability of the drive.  <p>If <b>ATA_GEO_PHYSICAL</b> is specified, the driver uses the physical geometry parameters stored in the drive.  If <b>ATA_GEO_CURRENT</b> is specified,the driver uses current geometry parameters initialized by BIOS.  If <b>ATA_GEO_FORCE</b> is specified, the driver uses geometry parameters stored in <b>sysLib.c</b>.<p>The geometry parameters are stored in the structure table<b>ataTypes[]</b> in <b>sysLib.c</b>. That table has two entries, the first fordrive 0, the second for drive 1. The members of the structureare:<pre>    int cylinders;              /* number of cylinders */    int heads;                  /* number of heads */    int sectors;                /* number of sectors per track */    int bytes;                  /* number of bytes per sector */    int precomp;                /* precompensation cylinder */</pre>This driver does not access the PCI-chip-set IDE interface, but rather takesadvantage of BIOS or VxWorks initialization.  Thus, the BIOS setting should match the modes specified by the configuration flag.<p>The BSP may provide a <b><i><a href="../bsp/mbx860/sysLib.html#sysAtaInit" >sysAtaInit</a></i>(&nbsp;)</b> routine for situations where an ATAcontroller RESET (0x1f6 or 0x3f6, bit 2 is set) clears ATA specificfunctionality in a chipset that is not re-enabled per the ATA-2 spec.<p>This BSP routine should be declared in <b>sysLib.c</b> or <b>sysAta.c</b> as follows:<p><pre>void sysAtaInit (BOOL ctrl)    {    /* BSP SPECIFIC CODE HERE */    }</pre>Then the BSP should perform the following operationbefore <b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b> is called, in sysHwInit for example:<p><pre>    IMPORT VOIDFUNCPTR _func_sysAtaInit;    /* setup during initialization */    _func_sysAtaInit = (VOIDFUNCPTR) sysAtaInit;</pre><p> It should contain chipset specific reset code, such as code which re-enablesPCI write posting for an integrated PCI-IDE device, for example.  This willbe executed during every <b><i><a href="./ataDrv.html#ataDrv">ataDrv</a></i>(&nbsp;)</b>, <b><i>ataInit</i>(&nbsp;)</b>, and <b><i>ataReset</i>(&nbsp;)</b> or equivalent  block device routine.  If the sysAtaInit routine is not provided by theBSP it is ignored by the driver, therefore it is not a required BSP routine.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ataDrv.html#top">ataDrv</a></b>, <i>VxWorks Programmer's Guide: I/O System</i><hr><a name="ataDrv"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ataDrv</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ataDrv</i>(&nbsp;)</strong> - initialize the ATA driver</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ataDrv    (    int  ctrl,       /* controller no. */    int  drives,     /* number of drives */    int  vector,     /* interrupt vector */    int  level,      /* interrupt level */    BOOL configType, /* configuration type */    int  semTimeout, /* timeout seconds for sync semaphore */    int  wdgTimeout  /* timeout seconds for watch dog */    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine initializes the ATA/IDE driver, sets up interrupt vectors,and performs hardware initialization of the ATA/IDE chip.<p>This routine must be called exactly once, before any reads, writes,or calls to <b><i><a href="./ataDrv.html#ataDevCreate">ataDevCreate</a></i>(&nbsp;)</b>.  Normally, it is called by <b><i><a href="./usrConfig.html#usrRoot">usrRoot</a></i>(&nbsp;)</b>in <b>usrConfig.c</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p>OK, or ERROR if initialization fails.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ataDrv.html#top">ataDrv</a></b>, <b><i><a href="./ataDrv.html#ataDevCreate">ataDevCreate</a></i>(&nbsp;)</b><hr><a name="ataDevCreate"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ataDevCreate</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ataDevCreate</i>(&nbsp;)</strong> - create a device for a ATA/IDE disk</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>BLK_DEV *ataDevCreate    (    int ctrl,    int drive,    int nBlocks,    int blkOffset    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine creates a device for a specified ATA/IDE disk.<p><i>drive</i> is a drive number for the hard drive; it must be 0 or 1.<p>The <i>nBlocks</i> parameter specifies the size of the device in blocks.If <i>nBlocks</i> is zero, the whole disk is used.<p>The <i>blkOffset</i> parameter specifies an offset, in blocks, from the startof the device to be used when writing or reading the hard disk.  Thisoffset is added to the block numbers passed by the file system duringdisk accesses.  (VxWorks file systems always use block numbers beginningat zero for the start of a device.)<p></blockquote><h4>RETURNS</h4><blockquote><p><p>A pointer to a block device structure (<b>BLK_DEV</b>) or NULL if memory cannotbe allocated for the device structure.<p></blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ataDrv.html#top">ataDrv</a></b>, <b><i><a href="./dosFsLib.html#dosFsMkfs">dosFsMkfs</a></i>(&nbsp;)</b>, <b><i><a href="./dosFsLib.html#dosFsDevInit">dosFsDevInit</a></i>(&nbsp;)</b>, <b><i><a href="./rt11FsLib.html#rt11FsDevInit">rt11FsDevInit</a></i>(&nbsp;)</b>, <b><i><a href="./rt11FsLib.html#rt11FsMkfs">rt11FsMkfs</a></i>(&nbsp;)</b>,  <b><i><a href="./rawFsLib.html#rawFsDevInit">rawFsDevInit</a></i>(&nbsp;)</b><hr><a name="ataRawio"></a><p align=right><a href="rtnIndex.html"><i>Libraries :  Routines</i></a></p></blockquote><h1><i>ataRawio</i>(&nbsp;)</h1> <blockquote></a></blockquote><h4>NAME</h4><blockquote>  <p><strong><i>ataRawio</i>(&nbsp;)</strong> - do raw I/O access</p></blockquote><h4>SYNOPSIS</h4><blockquote><p><pre>STATUS ataRawio    (    int       ctrl,    int       drive,    ATA_RAW * pAtaRaw    )</pre></blockquote><h4>DESCRIPTION</h4><blockquote><p>This routine is called to perform raw I/O access.<p><i>drive</i> is a drive number for the hard drive: it must be 0 or 1.<p>The <i>pAtaRaw</i> is a pointer to the structure <b>ATA_RAW</b> which is defined in <b>ataDrv.h</b>.<p></blockquote><h4>RETURNS</h4><blockquote><p><p>OK, or ERROR if the parameters are not valid.</blockquote><h4>SEE ALSO</h4><blockquote><p><b><a href="./ataDrv.html#top">ataDrv</a></b></body></html>

⌨️ 快捷键说明

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