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

📄 fldrvvxw.h

📁 电子硬盘驱动
💻 H
字号:
/***********************************************************************************/
/*                        M-Systems Confidential                                   */
/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-99              */
/*                         All Rights Reserved                                     */
/***********************************************************************************/
/*                            NOTICE OF M-SYSTEMS OEM                              */
/*                           SOFTWARE LICENSE AGREEMENT                            */
/*                                                                                 */
/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
/*      E-MAIL = info@m-sys.com                                                    */
/***********************************************************************************/

/* $Header:   V:/Flite/archives/oldFLite/FLDRVVXW.H_V   1.3   May 28 2000 11:09:04   vadimk  $ */
/* 
 * $Log:   V:/Flite/archives/oldFLite/FLDRVVXW.H_V  $  
   
      Rev 1.3   May 28 2000 11:09:04   vadimk
   OSAK-4.1 with IOCTL support
   
      Rev 1.2   May 11 2000 19:34:02   vadimk
   "99 -> 98% media use"
   
      Rev 1.1   08 Mar 2000 14:03:32   dimitrys
   OSAK-4.1/VxWorks
 *  
 *    Rev 1.0   Jul 21 1999 16:28:52   Administrator
 * Initial Revision 
 */

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

#ifndef FLDRVVXW_H
#define FLDRVVXW_H

#ifdef __cplusplus
extern "C" {
#endif

#include "blkIo.h"


/*
 *  TFFS block device
 */ 

typedef struct
{
   BLK_DEV  tffsBlkdev;         /* VxWorks block device descriptor        */
   int      tffsDriveNo;        /* 0..DRIVES-1, internal FLite numbering  */
   long     tffsOffset;         /* first sector of the 1st FAT partition  */ 
   int      tffsFlags;          /* tffsDevCreate() flags saved here */
} TFFS_DEV;

extern TFFS_DEV* flBlkDevs[];


/*
 * function declarations
 */

extern void      tffsSetup (int diskonchips, long *addressRange);
extern STATUS	 tffsDrv (void);
extern BLK_DEV*  tffsDevCreate (int volNo, int flags);
extern STATUS    tffsRecycle (int volNo, int mode);
extern STATUS	 tffsDevFormat (int volNo, int arg);
extern void      tffsAnnonceDiskChange (int volNo);
extern char*     tffsViewDebugLog (void);


/*
 * tffsDevCreate() flags
 */

#define FL_DOSFS_LONGNAMES   0x10  /* support for dosFs's long filenames */
#define FL_TRUE_BLKDEV       0x20  /* dosFs-2 compatibility */
#define FL_VERIFY_WRITE      0x40  /* read back and verify every sector */


/*
 * 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;


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, 98, 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 + -