Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

124 lines
4.9 KiB

  1. /*
  2. * $Log: V:/Flite/archives/TrueFFS5/Src/FLTL.H_V $
  3. *
  4. * Rev 1.7 Apr 15 2002 07:39:04 oris
  5. * Added support for VERIFY_ERASED_SECTOR compilation flag.
  6. *
  7. * Rev 1.6 Feb 19 2002 21:00:10 oris
  8. * Replaced blockev.h include directive with fltl.h and flreq.h
  9. * Added FL_LEAVE_BINARY_AREA definition.
  10. *
  11. * Rev 1.5 Jan 17 2002 23:02:54 oris
  12. * Added flash record as a parameter to flMount / flFormat / flPremount prototypes
  13. * Added checkVolume routine pointer in the TL record.
  14. * Placed readBBT under NO_READ_BBT_CODE compilation flag.
  15. * Removed SINGLE_BUFFER compilation flag.
  16. * Added flash record as a parameter to flMount / flFormat / flPremount prototype.
  17. *
  18. * Rev 1.4 May 16 2001 21:19:56 oris
  19. * Made noOfDriver public.
  20. *
  21. * Rev 1.3 Apr 24 2001 17:09:02 oris
  22. * change readBBT routine interface.
  23. *
  24. * Rev 1.2 Apr 01 2001 07:57:48 oris
  25. * copywrite notice.
  26. * Changed readSectors prototype.
  27. * Aliggned left all # directives.
  28. *
  29. * Rev 1.1 Feb 14 2001 01:56:46 oris
  30. * Changed readBBT prototype.
  31. *
  32. * Rev 1.0 Feb 04 2001 12:13:32 oris
  33. * Initial revision.
  34. *
  35. */
  36. /***********************************************************************************/
  37. /* M-Systems Confidential */
  38. /* Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001 */
  39. /* All Rights Reserved */
  40. /***********************************************************************************/
  41. /* NOTICE OF M-SYSTEMS OEM */
  42. /* SOFTWARE LICENSE AGREEMENT */
  43. /* */
  44. /* THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE */
  45. /* AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT */
  46. /* FOR THE SPECIFIC TERMS AND CONDITIONS OF USE, */
  47. /* OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE: */
  48. /* E-MAIL = [email protected] */
  49. /***********************************************************************************/
  50. #ifndef FLTL_H
  51. #define FLTL_H
  52. #include "flflash.h"
  53. #include "flfuncno.h"
  54. #include "flreq.h"
  55. typedef struct {
  56. SectorNo sectorsInVolume;
  57. unsigned long bootAreaSize;
  58. unsigned long eraseCycles;
  59. unsigned long tlUnitBits;
  60. } TLInfo;
  61. /* See interface documentation of functions in ftllite.c */
  62. typedef struct tTL TL; /* Forward definition */
  63. typedef struct tTLrec TLrec; /* Defined by translation layer */
  64. struct tTL {
  65. TLrec *rec;
  66. byte partitionNo;
  67. byte socketNo;
  68. const void FAR0 *(*mapSector)(TLrec *, SectorNo sectorNo, CardAddress *physAddr);
  69. FLStatus (*writeSector)(TLrec *, SectorNo sectorNo, void FAR1 *fromAddress);
  70. FLStatus (*writeMultiSector)(TLrec *, SectorNo sectorNo, void FAR1 *fromAddress,SectorNo sectorCount);
  71. FLStatus (*readSectors)(TLrec *, SectorNo sectorNo, void FAR1 *dest,SectorNo sectorCount);
  72. FLStatus (*deleteSector)(TLrec *, SectorNo sectorNo, SectorNo noOfSectors);
  73. FLStatus (*tlSetBusy)(TLrec *, FLBoolean);
  74. void (*dismount)(TLrec *);
  75. #ifdef DEFRAGMENT_VOLUME
  76. FLStatus (*defragment)(TLrec *, long FAR2 *bytesNeeded);
  77. #endif
  78. #if (defined(VERIFY_VOLUME) || defined(VERIFY_WRITE) || defined(VERIFY_ERASED_SECTOR))
  79. FLStatus (*checkVolume)(TLrec *);
  80. #endif /* VERIFY_VOLUME || VERIFY_WRITE || VERIFY_ERASED_SECTOR */
  81. SectorNo (*sectorsInVolume)(TLrec *);
  82. FLStatus (*getTLInfo)(TLrec *, TLInfo *tlInfo);
  83. void (*recommendedClusterInfo)(TLrec *, int *sectorsPerCluster, SectorNo *clusterAlignment);
  84. #ifndef NO_READ_BBT_CODE
  85. FLStatus (*readBBT)(TLrec *, CardAddress FAR1 * buf, long FAR2 * mediaSize, unsigned FAR2 * noOfBB);
  86. #endif
  87. };
  88. #include "dosformt.h"
  89. /* Translation layer registration information */
  90. extern int noOfTLs; /* No. of translation layers actually registered */
  91. typedef struct {
  92. FLStatus (*mountRoutine) (unsigned volNo, TL *tl, FLFlash *flash, FLFlash **volForCallback);
  93. FLStatus (*formatRoutine) (unsigned volNo, TLFormatParams *deviceFormatParams, FLFlash *flash);
  94. FLStatus (*preMountRoutine)(FLFunctionNo callType, IOreq FAR2* ioreq ,FLFlash* flash,FLStatus* status);
  95. } TLentry;
  96. extern TLentry tlTable[TLS];
  97. extern FLStatus noFormat (unsigned volNo, TLFormatParams *formatParams, FLFlash *flash);
  98. extern FLStatus flMount(unsigned volNo, unsigned socketNo,TL *, FLBoolean useFilters , FLFlash *flash);
  99. extern FLStatus flPreMount(FLFunctionNo callType, IOreq FAR2* ioreq , FLFlash *flash);
  100. extern unsigned noOfDrives;
  101. #ifdef FORMAT_VOLUME
  102. extern FLStatus flFormat(unsigned volNo, TLFormatParams *formatParams, FLFlash * flash);
  103. #define FL_LEAVE_BINARY_AREA 8
  104. #endif
  105. #endif