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

📄 fldrvvxw.h

📁 DOC2000在vxworks下的驱动!
💻 H
字号:
/* $Header:   V:/fldrvvxw.h_v   1.0   25 Aug 1997 12:00:12   ANDRY  $ */

/************************************************************************/
/*                                                                      */
/*		FLite/VxWorks include file.          			*/
/*									*/
/************************************************************************/

#ifndef FLDRVVXW_H
#define FLDRVVXW_H

#ifdef __cplusplus
extern "C" {
#endif

#include "blkIo.h"


/*--------------------------------------------------------------------------*/
/*      Basic configuration variables.                                      */
/*--------------------------------------------------------------------------*/

extern int fl_use8bit;    /* set to non-zero value for strictly 8-bit       */
                          /* access to the DiskOnChip(s)                    */ 
extern int fl_useUCache;  /* set to zero to disable internal U-cache        */
extern int fl_useSCache;  /* set to zero to disable internal S-cache        */
extern int fl_useDebug;   /* set to non-zero to enable built-in Diagnostics.*/
                          /* See also routine tffsViewDebugLog() below.     */
extern int fl_useSleep;   /* set to non-zero to sleep during flash erase    */ 



/*--------------------------------------------------------------------------*/
/*      TFFS block devices                                                  */
/*--------------------------------------------------------------------------*/

typedef struct
{
   BLK_DEV  tffsBlkdev;         /* VxWorks block device descriptor        */
   int      tffsDriveNo;        /* 0..DRIVES-1, internal FLite numbering  */
} TFFS_DEV;

extern TFFS_DEV* flBlkDevs[];


/*--------------------------------------------------------------------------*/
/*      function declarations                                               */
/*--------------------------------------------------------------------------*/

extern STATUS	 tffsDrv (void);
extern BLK_DEV*  tffsDevCreate (int tffsDriveNo, int removableMediaFlag);

extern void      tffsSetup (int diskonchips, long *addressRange);
extern STATUS    tffsRecycle (int volNo, int kBytes);
extern STATUS	 tffsDevFormat (int tffsDriveNo, int arg);
extern void      tffsAnnonceDiskChange (int volNo);
extern STATUS    tffsPhysInfo (int volNo, int* rwUnitSize, int* eraseUnitSize);
extern STATUS    tffsPhysRead (int volNo, long addr, char *to, int length);
extern STATUS    tffsPhysWrite (int volNo, long addr, char *from, int length);
extern STATUS    tffsPhysErase (int volNo, long addr, int length);
extern char*     tffsViewDebugLog (void);



/*---------------------------------------------------------------------------*/
/*                Formatting parameter structure definition                  */
/*---------------------------------------------------------------------------*/

typedef struct {
  /* FTL formatting section */
  long int	bootImageLen;
		/* Space to reserve for a boot-image at the start of the
		   medium. The FLite volume will begin at the next higher
		   erase unit boundary */

  unsigned	percentUse;
		/* FTL performance depends on how full the Flash media is,
		   getting slower when the media is close to 100%. It is
		   possible to avoid the worst consequences of this effect by
		   formatting the media to less than 100% capacity, so
		   guaranteeing some free space at all times. This of course
		   sacrifices some capcity.
		   The standard value to use is 99 */

  unsigned	noOfSpareUnits;
		/* FTL needs at least one spare erase unit to function as a
		   read/write media (it is possible to specify 0 to achieve
		   WORM functionality). It is possible to specify more than
		   one spare unit, which costs more media space.
		   The advantage to doing this is in case one of the Flash
		   erase units becomes bad and unerasable in the future, one
		   of the spare units will need to replace it. A second spare
		   unit will then enable to continue read/write functionality
		   (in its absence, the media will go into read-only mode).
		   The standard value to use is 1 */

  unsigned long vmAddressingLimit;
		/* A part of the FTL Virtual Map always resides in RAM. The
		   RAM part is the one that is used to address the part of
		   the media below the VM addressing limit. Reading and
		   writing to this part is usually faster to some degree.
		   The downside is that the bigger the limit, the more RAM
		   size is required.
		   The minimum VM limit is 0.
		   The standard value to use is 0x10000 (first 64 KBytes) */

  int		(*progressCallback)(int totalUnitsToFormat,
				    int totalUnitsFormattedSoFar);
		/* Progress callback routine, will be called if not NULL.
		   The callback routine is called after erasing each unit,
		   and its parameters are the total number of erase units
		   to format and the number erased so far.
		   The callback routine returns a Status value. A value of
		   OK (0) allows formatting to continue. Any other value
		   will abort the formatting with the returned status code. */

  /* DOS formatting section */
  char		volumeId[4];
		/* Volume identification number */

  char *	volumeLabel;
		/* Volume label string. If NULL, no label */

  unsigned	noOfFATcopies;
		/* It is customary to format DOS media with 2 FAT copies.
		   The first copy is always used, but more copies make it
		   possible to recover if the FAT becomes corrupted (a
		   rare occurrence). On the other hand, this slows down
		   performance and uses media space.
		   The standard value to use is 2 */

  unsigned	embeddedCISlength;
		/* Length in bytes of CIS to embed after the unit header */

  char *	embeddedCIS;
		/* The unit header is structured as a beginning of a PCMCIA
		   'tuple' chain (a CIS). The unit header contains a
		   data-organization tuple, which points past the end of the
		   unit header to a location which usually just contains
		   hex FF's which mark an 'end-of-tuple-chain'. Optionally,
		   it is possible to embed an entire CIS chain at this
		   location. If so, 'embeddedCISlength' marks the length in
		   bytes */

} tffsFormatParams;


/*---------------------------------------------------------------------------*/
/*            IOCTL FIODISKFORMAT structure definition                       */
/*---------------------------------------------------------------------------*/

typedef struct {
  tffsFormatParams  formatParams;
  unsigned          formatFlags;
} tffsDevFormatParams;

/* values for tffsDevFormatParams.formatFlags */

#ifndef FTL_FORMAT
#define FTL_FORMAT	     1  /* FAT & FTL formatting                     */
#endif

#ifndef FTL_FORMAT_IF_NEEDED
#define FTL_FORMAT_IF_NEEDED 2	/* FAT formatting, FTL formatting if needed */
#endif

#ifndef NO_FTL_FORMAT
#define NO_FTL_FORMAT	     0	/* FAT formatting only                      */
#endif

/* Standard initializer for IOCTLParams structure */

#define TFFS_STD_FORMAT_PARAMS        {0, 99, 1, 0x10000l, NULL, {0,0,0,0}, NULL, 2, 0, NULL, FTL_FORMAT_IF_NEEDED}

#ifdef __cplusplus
}
#endif

#endif /* FLDRVVXW_H */

⌨️ 快捷键说明

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