0
|
1 |
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
// f32\sfat32\fat_config.h
|
|
15 |
// FAT fsy configurator
|
|
16 |
//
|
|
17 |
//
|
|
18 |
|
|
19 |
/**
|
|
20 |
@file
|
|
21 |
@internalTechnology
|
|
22 |
*/
|
|
23 |
|
|
24 |
#ifndef FAT_CONFIGURATOR_H
|
|
25 |
#define FAT_CONFIGURATOR_H
|
|
26 |
|
|
27 |
#include <f32dbg.h>
|
|
28 |
//-----------------------------------------------------------------------------
|
|
29 |
|
|
30 |
/**
|
|
31 |
This class provides access to the FAT settings in estart.txt file and the interface to
|
|
32 |
get these setting to the client (CFatMountCB).
|
|
33 |
*/
|
|
34 |
class TFatConfig
|
|
35 |
{
|
|
36 |
public:
|
|
37 |
|
|
38 |
TFatConfig();
|
|
39 |
void ReadConfig(TInt aDrvNumber, TBool aForceRead = EFalse);
|
|
40 |
|
|
41 |
//-- parameters getters
|
|
42 |
inline TBool ScanDrvSkipFinalisedVolume() const;
|
|
43 |
inline TBool FAT32_AsynchMount() const;
|
|
44 |
inline TBool FAT32_UseFSInfoOnMount() const;
|
|
45 |
inline TBool FAT32_UseBitSupercache() const;
|
|
46 |
|
|
47 |
|
|
48 |
inline TUint32 DirCacheSize() const;
|
|
49 |
inline TUint32 DirCacheMaxPageSizeLog2() const;
|
|
50 |
|
|
51 |
inline void Fat16FixedCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2) const;
|
|
52 |
inline void Fat32LruCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2, TUint32& aCacheSize) const;
|
|
53 |
inline TBool FAT16_UseCleanShutDownBit() const;
|
|
54 |
|
|
55 |
inline TUint32 LeafDirCacheSize() const;
|
|
56 |
inline TUint32 DynamicDirCacheSizeMin() const;
|
|
57 |
inline TUint32 DynamicDirCacheSizeMax() const;
|
|
58 |
inline TUint32 DynamicDirCacheMaxPageSizeLog2() const;
|
|
59 |
|
|
60 |
protected:
|
|
61 |
|
|
62 |
TFatConfig(const TFatConfig&);
|
|
63 |
TFatConfig& operator=(const TFatConfig&);
|
|
64 |
|
|
65 |
TUint32 ReadUint(const TDesC8& aSection, const TDesC8& aKeyName, TUint32 aDefaultValue) const;
|
|
66 |
|
|
67 |
private:
|
|
68 |
|
|
69 |
void DumpParameters() const;
|
|
70 |
void DoDumpUintParam(const TDesC8& aKeyName, TUint32 aParam) const;
|
|
71 |
|
|
72 |
void ProcessDirCacheParams(const TDesC8& aSection);
|
|
73 |
void ProcessFatCacheParams(const TDesC8& aSection);
|
|
74 |
void ProcessDynamicDirCacheParams(const TDesC8& aSection);
|
|
75 |
|
|
76 |
private:
|
|
77 |
|
|
78 |
TUint32 iInitialised : 1; //-- ETrue if the object is initialised, i.e. ReadConfig() called
|
|
79 |
|
|
80 |
//-- cached FAT parameters, see appropriate methods description
|
|
81 |
|
|
82 |
//-- boolean values
|
|
83 |
TUint32 iScanDrvSkipFinalisedVolume :1; ///< if 1 ScanDrive will skip properly finalised volumes
|
|
84 |
TUint32 iFAT32_AsynchMount :1; ///< if 1 FAT3 Asynchronous mounting is enabled
|
|
85 |
TUint32 iFAT32_UseFSInfoOnMount :1; ///< 1 enables using FSInfo sector on FAT32 volumes
|
|
86 |
TUint32 iFAT32_UseBitSupercache :1; ///< 1 enables using FAT32 bit supercache for fast free cluster lookup
|
|
87 |
TUint32 iFAT16_UseCleanShutDownBit :1; ///< if 1 "clean shutdown mask" bit in FAT16[1] will be used during volume finalisations.
|
|
88 |
|
|
89 |
//---
|
|
90 |
|
|
91 |
TUint16 iDirCacheSizeKB; ///< directory cache size, Kbytes
|
|
92 |
TUint16 iDirCacheMaxPageSizeLog2; ///< Log2(Max. dir. cache page size)
|
|
93 |
|
|
94 |
TUint16 iFat16FixedCacheReadGrLog2; ///< Log2(FAT16 fixed cache read granularity)
|
|
95 |
TUint16 iFat16FixedCacheWriteGrLog2; ///< Log2(FAT16 fixed cache write granularity)
|
|
96 |
|
|
97 |
TUint16 iFat32LRUCacheSizeKB; ///< FAT32 LRU cache size, Kbytes
|
|
98 |
TUint16 iFat32LRUCacheReadGrLog2; ///< Log2(FAT32 LRU cache read granularity)
|
|
99 |
TUint16 iFat32LRUCacheWriteGrLog2; ///< Log2(FAT32 LRU cache write granularity)
|
|
100 |
|
|
101 |
TUint32 iLeafDirCacheSize; ///< leaf directory cache size, maximum number of most recently visited leaf dirs to be cached
|
|
102 |
TUint32 iDynamicDirCacheSizeMinKB; ///< minimum directory cache size, Kbytes
|
|
103 |
TUint32 iDynamicDirCacheSizeMaxKB; ///< maximum directory cache size, Kbytes
|
|
104 |
TUint32 iDynamicDirCacheMaxPageSizeLog2;///< Log2(maximum dynamic dir cache page size)
|
|
105 |
|
|
106 |
};
|
|
107 |
|
|
108 |
#include"fat_config.inl"
|
|
109 |
|
|
110 |
#endif //FAT_CONFIGURATOR_H
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|