sl@0
|
1 |
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// f32\sfat\fat_config.inl
|
sl@0
|
15 |
// FAT fsy configurator
|
sl@0
|
16 |
//
|
sl@0
|
17 |
//
|
sl@0
|
18 |
|
sl@0
|
19 |
/**
|
sl@0
|
20 |
@file
|
sl@0
|
21 |
@internalTechnology
|
sl@0
|
22 |
*/
|
sl@0
|
23 |
|
sl@0
|
24 |
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
sl@0
|
25 |
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
sl@0
|
26 |
//!!
|
sl@0
|
27 |
//!! WARNING!! DO NOT edit this file !! '\sfat' component is obsolete and is not being used. '\sfat32'replaces it
|
sl@0
|
28 |
//!!
|
sl@0
|
29 |
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
sl@0
|
30 |
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
sl@0
|
31 |
|
sl@0
|
32 |
|
sl@0
|
33 |
#ifndef FAT_CONFIGURATOR_INL
|
sl@0
|
34 |
#define FAT_CONFIGURATOR_INL
|
sl@0
|
35 |
|
sl@0
|
36 |
//-----------------------------------------------------------------------------
|
sl@0
|
37 |
/**
|
sl@0
|
38 |
Meaning of this parameter:
|
sl@0
|
39 |
if not 0, ScanDrive will not run on finalised FAT volume, i.e. that has "CleanShutdown" flag set in FAT[1] by
|
sl@0
|
40 |
proper finalisation.
|
sl@0
|
41 |
See CFatMountCB::ScanDrive().
|
sl@0
|
42 |
*/
|
sl@0
|
43 |
TBool TFatConfig::ScanDrvSkipFinalisedVolume() const
|
sl@0
|
44 |
{
|
sl@0
|
45 |
ASSERT(iInitialised);
|
sl@0
|
46 |
return iScanDrvSkipFinalisedVolume;
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
//-----------------------------------------------------------------------------
|
sl@0
|
50 |
/**
|
sl@0
|
51 |
Meaning of this parameter:
|
sl@0
|
52 |
if not 0, enables asynchronous mounting of the FAT32 volumes.
|
sl@0
|
53 |
In particular background FAT32 scan for free clusters. See CAtaFatTable::CountFreeClustersL().
|
sl@0
|
54 |
*/
|
sl@0
|
55 |
TBool TFatConfig::FAT32_AsynchMount() const
|
sl@0
|
56 |
{
|
sl@0
|
57 |
ASSERT(iInitialised);
|
sl@0
|
58 |
return iFAT32_AsynchMount;
|
sl@0
|
59 |
}
|
sl@0
|
60 |
|
sl@0
|
61 |
//-----------------------------------------------------------------------------
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
Meaning of this parameter:
|
sl@0
|
64 |
if not 0, enables using FSInfo sector data during FAT32 volumes mounting to determine number of free clusters etc.
|
sl@0
|
65 |
*/
|
sl@0
|
66 |
TBool TFatConfig::FAT32_UseFSInfoOnMount() const
|
sl@0
|
67 |
{
|
sl@0
|
68 |
ASSERT(iInitialised);
|
sl@0
|
69 |
return iFAT32_UseFSInfoOnMount;
|
sl@0
|
70 |
}
|
sl@0
|
71 |
|
sl@0
|
72 |
//-----------------------------------------------------------------------------
|
sl@0
|
73 |
/**
|
sl@0
|
74 |
Meaning of this parameter:
|
sl@0
|
75 |
if not 0, enables using FAT32 bit supercache that makes free FAT entries lookup faster
|
sl@0
|
76 |
*/
|
sl@0
|
77 |
TBool TFatConfig::FAT32_UseBitSupercache() const
|
sl@0
|
78 |
{
|
sl@0
|
79 |
ASSERT(iInitialised);
|
sl@0
|
80 |
return iFAT32_UseBitSupercache;
|
sl@0
|
81 |
}
|
sl@0
|
82 |
|
sl@0
|
83 |
//-----------------------------------------------------------------------------
|
sl@0
|
84 |
/**
|
sl@0
|
85 |
Meaning of this parameter:
|
sl@0
|
86 |
Overall FAT directory cache size in bytes
|
sl@0
|
87 |
*/
|
sl@0
|
88 |
TUint32 TFatConfig::DirCacheSize() const
|
sl@0
|
89 |
{
|
sl@0
|
90 |
ASSERT(iInitialised);
|
sl@0
|
91 |
return iDirCacheSizeKB * K1KiloByte;
|
sl@0
|
92 |
}
|
sl@0
|
93 |
|
sl@0
|
94 |
//-----------------------------------------------------------------------------
|
sl@0
|
95 |
|
sl@0
|
96 |
/**
|
sl@0
|
97 |
Meaning of this parameter:
|
sl@0
|
98 |
Log2 of the maximal size of the dir. cache page in bytes. (Minimal size will be current cluster size)
|
sl@0
|
99 |
*/
|
sl@0
|
100 |
TUint32 TFatConfig::DirCacheMaxPageSizeLog2() const
|
sl@0
|
101 |
{
|
sl@0
|
102 |
ASSERT(iInitialised);
|
sl@0
|
103 |
return iDirCacheMaxPageSizeLog2;
|
sl@0
|
104 |
}
|
sl@0
|
105 |
|
sl@0
|
106 |
/**
|
sl@0
|
107 |
Get FAT16 fixed cache parameters
|
sl@0
|
108 |
@param aRdGrLog2 Log2(read granularity)
|
sl@0
|
109 |
@param aWrGrLog2 Log2(write granularity)
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
void TFatConfig::Fat16FixedCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2) const
|
sl@0
|
112 |
{
|
sl@0
|
113 |
ASSERT(iInitialised);
|
sl@0
|
114 |
aRdGrLog2 = iFat16FixedCacheReadGrLog2;
|
sl@0
|
115 |
aWrGrLog2 = iFat16FixedCacheWriteGrLog2;
|
sl@0
|
116 |
}
|
sl@0
|
117 |
/**
|
sl@0
|
118 |
Get FAT32 LRU cache parameters
|
sl@0
|
119 |
@param aRdGrLog2 Log2(read granularity)
|
sl@0
|
120 |
@param aWrGrLog2 Log2(write granularity)
|
sl@0
|
121 |
@param aCacheSize maximal cache size, bytes
|
sl@0
|
122 |
*/
|
sl@0
|
123 |
void TFatConfig::Fat32LruCacheParams(TUint32& aRdGrLog2, TUint32& aWrGrLog2, TUint32& aCacheSize) const
|
sl@0
|
124 |
{
|
sl@0
|
125 |
ASSERT(iInitialised);
|
sl@0
|
126 |
aRdGrLog2 = iFat32LRUCacheReadGrLog2;
|
sl@0
|
127 |
aWrGrLog2 = iFat32LRUCacheWriteGrLog2;
|
sl@0
|
128 |
aCacheSize = iFat32LRUCacheSizeKB * K1KiloByte;
|
sl@0
|
129 |
}
|
sl@0
|
130 |
|
sl@0
|
131 |
|
sl@0
|
132 |
/**
|
sl@0
|
133 |
Meaning of this parameter:
|
sl@0
|
134 |
if not 0, "clean shutdown mask" bit in FAT16[1] will be used during volume finalisation.
|
sl@0
|
135 |
Otherwise, FAT16[1] will not be affected during finalisation
|
sl@0
|
136 |
*/
|
sl@0
|
137 |
TBool TFatConfig::FAT16_UseCleanShutDownBit() const
|
sl@0
|
138 |
{
|
sl@0
|
139 |
ASSERT(iInitialised);
|
sl@0
|
140 |
return iFAT16_UseCleanShutDownBit;
|
sl@0
|
141 |
}
|
sl@0
|
142 |
|
sl@0
|
143 |
|
sl@0
|
144 |
|
sl@0
|
145 |
//-----------------------------------------------------------------------------
|
sl@0
|
146 |
/**
|
sl@0
|
147 |
Get leaf dir cache size
|
sl@0
|
148 |
@return leaf dir cache size
|
sl@0
|
149 |
*/
|
sl@0
|
150 |
TUint32 TFatConfig::LeafDirCacheSize() const
|
sl@0
|
151 |
{
|
sl@0
|
152 |
ASSERT(iInitialised);
|
sl@0
|
153 |
return iLeafDirCacheSize;
|
sl@0
|
154 |
}
|
sl@0
|
155 |
|
sl@0
|
156 |
/**
|
sl@0
|
157 |
get the minimum cache size setting for dynamic dir cache
|
sl@0
|
158 |
@return minimum cache size in bytes
|
sl@0
|
159 |
*/
|
sl@0
|
160 |
TUint32 TFatConfig::DynamicDirCacheSizeMin() const
|
sl@0
|
161 |
{
|
sl@0
|
162 |
ASSERT(iInitialised);
|
sl@0
|
163 |
ASSERT(iDynamicDirCacheSizeMinKB < (KMaxTUint32 >> K1KiloByteLog2)); //check data overflow
|
sl@0
|
164 |
return iDynamicDirCacheSizeMinKB << K1KiloByteLog2;
|
sl@0
|
165 |
}
|
sl@0
|
166 |
|
sl@0
|
167 |
/**
|
sl@0
|
168 |
get the maximum cache size setting for dynamic dir cache
|
sl@0
|
169 |
@return maximum cache size in bytes
|
sl@0
|
170 |
*/
|
sl@0
|
171 |
TUint32 TFatConfig::DynamicDirCacheSizeMax() const
|
sl@0
|
172 |
{
|
sl@0
|
173 |
ASSERT(iInitialised);
|
sl@0
|
174 |
ASSERT(iDynamicDirCacheSizeMaxKB < (KMaxTUint32 >> K1KiloByteLog2)); //check data overflow
|
sl@0
|
175 |
return iDynamicDirCacheSizeMaxKB << K1KiloByteLog2;
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
/**
|
sl@0
|
179 |
retrieve the size of the maximal size of the dynamic dir cache page in log2.
|
sl@0
|
180 |
(Minimal size will be current cluster size)
|
sl@0
|
181 |
@return maximum page size in bytes in log2
|
sl@0
|
182 |
*/
|
sl@0
|
183 |
TUint32 TFatConfig::DynamicDirCacheMaxPageSizeLog2() const
|
sl@0
|
184 |
{
|
sl@0
|
185 |
ASSERT(iInitialised);
|
sl@0
|
186 |
return iDynamicDirCacheMaxPageSizeLog2;
|
sl@0
|
187 |
}
|
sl@0
|
188 |
|
sl@0
|
189 |
|
sl@0
|
190 |
#endif //FAT_CONFIGURATOR_INL
|
sl@0
|
191 |
|
sl@0
|
192 |
|
sl@0
|
193 |
|
sl@0
|
194 |
|
sl@0
|
195 |
|
sl@0
|
196 |
|