author | Mike Kinghan <mikek@symbian.org> |
Thu, 25 Nov 2010 14:35:45 +0000 | |
branch | GCC_SURGE |
changeset 305 | 1ba12ef4ef89 |
parent 200 | 73ea206103e6 |
permissions | -rw-r--r-- |
0 | 1 |
// Copyright (c) 1995-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 |
// e32\include\d32locd.h |
|
15 |
// |
|
16 |
// WARNING: This file contains some APIs which are internal and are subject |
|
17 |
// to change without notice. Such APIs should therefore not be used |
|
18 |
// outside the Kernel and Hardware Services package. |
|
19 |
// |
|
20 |
||
21 |
#ifndef __D32LOCD_H__ |
|
22 |
#define __D32LOCD_H__ |
|
23 |
#include <e32cmn.h> |
|
24 |
#include <partitions.h> |
|
25 |
||
26 |
||
27 |
/** |
|
28 |
@publishedPartner |
|
29 |
@released |
|
30 |
||
31 |
Local media IDs. |
|
32 |
||
33 |
A media ID is passed to LocDrv::RegisterMediaDevice() when registering |
|
34 |
a media driver with the local media subsystem. |
|
35 |
*/ |
|
36 |
enum TMediaDevice { EFixedMedia0, EFixedMedia1, EFixedMedia2, EFixedMedia3, |
|
37 |
EFixedMedia4, EFixedMedia5, EFixedMedia6, EFixedMedia7, |
|
38 |
ERemovableMedia0, ERemovableMedia1, ERemovableMedia2, ERemovableMedia3, |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
39 |
EInvalidMedia, |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
40 |
EMediaExtension0, EMediaExtension1, EMediaExtension2, EMediaExtension3, |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
41 |
EMediaExtension4, EMediaExtension5, EMediaExtension6, EMediaExtension7, |
0 | 42 |
}; |
43 |
||
44 |
#define __IS_REMOVABLE(aDevice) (aDevice>=ERemovableMedia0 && aDevice<=ERemovableMedia3) |
|
45 |
#define __IS_FIXED(aDevice) ((TUint)aDevice<=EFixedMedia7) |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
46 |
#define __IS_EXTENSION(aDevice) (aDevice>=EMediaExtension0 && aDevice<=EMediaExtension7) |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
47 |
|
0 | 48 |
#define MEDIA_DEVICE_IRAM EFixedMedia0 |
49 |
#define MEDIA_DEVICE_LFFS EFixedMedia1 |
|
50 |
#define MEDIA_DEVICE_NAND EFixedMedia2 |
|
51 |
#define MEDIA_DEVICE_MMC ERemovableMedia0 |
|
52 |
#define MEDIA_DEVICE_PCCARD ERemovableMedia1 |
|
53 |
#define MEDIA_DEVICE_CSA ERemovableMedia2 |
|
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
54 |
#define MEDIA_DEVICE_NFE EMediaExtension0 |
0 | 55 |
|
56 |
typedef signed int TSocket; |
|
57 |
||
58 |
class TLDriveAssignInfo |
|
59 |
/** |
|
60 |
No longer used |
|
61 |
@internalComponent |
|
62 |
@removed |
|
63 |
*/ |
|
64 |
{ |
|
65 |
public: |
|
66 |
TMediaDevice iDevice; |
|
67 |
TInt iPriority; |
|
68 |
}; |
|
69 |
||
70 |
class TMediaDeviceAssignInfo |
|
71 |
/** |
|
72 |
No longer used |
|
73 |
@internalComponent |
|
74 |
@removed |
|
75 |
*/ |
|
76 |
{ |
|
77 |
public: |
|
78 |
TInt iFirstMedia; |
|
79 |
TInt iLastMedia; |
|
80 |
}; |
|
81 |
||
82 |
class TLocalDriveCaps |
|
83 |
/** |
|
84 |
Drives media capabilities fields |
|
85 |
||
86 |
@publishedPartner |
|
87 |
@released |
|
88 |
*/ |
|
89 |
{ |
|
90 |
public: |
|
91 |
IMPORT_C TLocalDriveCaps(); |
|
92 |
public: |
|
93 |
/** |
|
94 |
Size of drive |
|
95 |
||
96 |
Note : This is the size of the partition, not the entire media. |
|
97 |
The entire media size can be obtained from TLocalDriveCapsV4::MediaSizeInBytes() |
|
98 |
*/ |
|
99 |
TInt64 iSize; |
|
100 |
/** |
|
101 |
Media Type of drive |
|
102 |
*/ |
|
103 |
TMediaType iType; |
|
104 |
/** |
|
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
105 |
Connection type used to interface to the media |
0 | 106 |
*/ |
33
0173bcd7697c
Revision: 201001
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
107 |
TConnectionBusType iConnectionBusType; |
0 | 108 |
/** |
109 |
Attributes of the drive |
|
110 |
*/ |
|
111 |
TUint iDriveAtt; |
|
112 |
/** |
|
113 |
Attributes of underlying media |
|
114 |
*/ |
|
115 |
TUint iMediaAtt; |
|
116 |
/** |
|
117 |
Base address of media |
|
118 |
*/ |
|
119 |
TUint8* iBaseAddress; |
|
120 |
/** |
|
121 |
Identity of the file system used for this media |
|
122 |
*/ |
|
123 |
TUint16 iFileSystemId; |
|
124 |
/** |
|
125 |
Partition type of media |
|
126 |
*/ |
|
127 |
TUint16 iPartitionType; |
|
128 |
}; |
|
129 |
typedef TPckgBuf<TLocalDriveCaps> TLocalDriveCapsBuf; |
|
130 |
// |
|
131 |
class TLocalDriveCapsV2 : public TLocalDriveCaps |
|
132 |
/** |
|
133 |
Extension to Capabilities fields mainly to support Nor flash |
|
134 |
||
135 |
@publishedPartner |
|
136 |
@released |
|
137 |
*/ |
|
138 |
{ |
|
139 |
public: |
|
140 |
/** |
|
141 |
Number of hidden sectors on drive |
|
142 |
*/ |
|
143 |
TUint iHiddenSectors; |
|
144 |
/** |
|
145 |
Size of erase unit on media |
|
146 |
*/ |
|
147 |
TUint iEraseBlockSize; |
|
148 |
}; |
|
149 |
typedef TPckgBuf<TLocalDriveCapsV2> TLocalDriveCapsV2Buf; |
|
150 |
// |
|
151 |
||
152 |
||
153 |
||
154 |
/** |
|
155 |
This class is used to provide file system-specific parameters for media formatting. |
|
156 |
@see TInt RFormat::Open(RFs &aFs, const TDesC &aName, TUint aFormatMode, TInt &aCount, const TDesC8 &anInfo);" |
|
157 |
||
158 |
For example, for FAT file system it is possible to specify FAT type(12/16/32), |
|
159 |
cluster size, number of FATs and number of reserved sectors. Note that not all |
|
160 |
combinations of custom parameters can be compatible; some media types, like SD |
|
161 |
can reject formatting with user-defined parameters. |
|
162 |
||
163 |
@publishedPartner |
|
164 |
@released |
|
165 |
||
166 |
*/ |
|
167 |
class TLDFormatInfo |
|
168 |
{ |
|
169 |
public: |
|
170 |
inline TLDFormatInfo(); |
|
171 |
public: |
|
172 |
||
173 |
TInt64 iCapacity; ///< Format Capacity |
|
174 |
TUint16 iSectorsPerCluster; ///< Specified sectors per cluster |
|
175 |
TUint16 iSectorsPerTrack; ///< Specified sectors per track |
|
176 |
TUint16 iNumberOfSides; ///< Specified number of sides |
|
177 |
||
178 |
enum TFATBits {EFBDontCare, EFB12 = 12, EFB16 = 16, EFB32 = 32}; |
|
179 |
TFATBits iFATBits; ///< Specified bits per fat table entry |
|
180 |
||
181 |
TUint16 iReservedSectors; ///< Reserved sector count, required for SD card compliance |
|
182 |
||
183 |
// Flags field. Allows the number of FAT tables to be specified: set both bits to zero to use the default. |
|
184 |
enum TFlags {EOneFatTable = 0x01, ETwoFatTables = 0x02}; |
|
185 |
TUint8 iFlags; |
|
186 |
||
187 |
TUint8 iPad; ///< Padding for offset alignment between kernel and user code |
|
188 |
||
189 |
}; |
|
190 |
typedef TPckgBuf<TLDFormatInfo> TSpecialFormatInfoBuf; |
|
191 |
||
192 |
||
193 |
// |
|
194 |
class TLocalDriveCapsV3 : public TLocalDriveCapsV2 |
|
195 |
/** |
|
196 |
Extension to Capabilities fields mainly to support removable media format specifications |
|
197 |
||
198 |
@publishedPartner |
|
199 |
@released |
|
200 |
*/ |
|
201 |
{ |
|
202 |
public: |
|
203 |
/** |
|
204 |
Format specification |
|
205 |
*/ |
|
206 |
TLDFormatInfo iFormatInfo; |
|
207 |
/** |
|
208 |
Set if iFormatInfo is valid |
|
209 |
*/ |
|
210 |
TBool iExtraInfo; |
|
211 |
/** |
|
212 |
*/ |
|
213 |
TInt iMaxBytesPerFormat; |
|
214 |
}; |
|
215 |
//The following ASSERTs checks for offset of any TInt64 member be a multiple of 8 as per DEF045510 |
|
216 |
__ASSERT_COMPILE(_FOFF(TLocalDriveCaps,iSize)%8 == 0); |
|
217 |
__ASSERT_COMPILE(_FOFF(TLocalDriveCapsV3,iFormatInfo.iCapacity) % 8 == 0); |
|
218 |
||
219 |
||
220 |
typedef TPckgBuf<TLocalDriveCapsV3> TLocalDriveCapsV3Buf; |
|
221 |
// |
|
222 |
class TLocalDriveCapsV4 : public TLocalDriveCapsV3 |
|
223 |
/** |
|
224 |
Extension to Capabilities fields mainly to support Nand flash |
|
225 |
||
226 |
@publishedPartner |
|
227 |
@released |
|
228 |
*/ |
|
229 |
{ |
|
230 |
public: |
|
231 |
union |
|
232 |
{ |
|
233 |
/** |
|
234 |
Number of blocks (for NAND flash) |
|
235 |
- The entire capacity of NAND media can be calculated using: |
|
236 |
capacity = iNumOfBlocks * iNumPagesPerBlock * iNumBytesMain |
|
237 |
*/ |
|
238 |
TInt iNumOfBlocks; |
|
239 |
/** |
|
240 |
Number of sectors (for other types of media) |
|
241 |
- The entire capacity of sector based media can be calculated using: |
|
242 |
capacity = iNumberOfSectors * iSectorSizeInBytes |
|
243 |
*/ |
|
244 |
TUint32 iNumberOfSectors; |
|
245 |
}; |
|
246 |
||
247 |
/** |
|
248 |
Number of pages per block |
|
249 |
*/ |
|
250 |
TInt iNumPagesPerBlock; |
|
251 |
||
252 |
union |
|
253 |
{ |
|
254 |
/** |
|
255 |
Number of Bytes in the main array (for NAND flash) |
|
256 |
- The entire capacity of NAND media can be calculated using: |
|
257 |
capacity = iNumOfBlocks * iNumPagesPerBlock * iNumBytesMain |
|
258 |
*/ |
|
259 |
TInt iNumBytesMain; |
|
260 |
/** |
|
261 |
Number of Bytes in a sector (for other types of media) |
|
262 |
- The entire capacity of sector based media can be calculated using: |
|
263 |
capacity = iNumberOfSectors * iSectorSizeInBytes |
|
264 |
*/ |
|
265 |
TUint32 iSectorSizeInBytes; |
|
266 |
}; |
|
267 |
||
268 |
/** |
|
269 |
Number of Bytes in the spare array |
|
270 |
*/ |
|
271 |
TInt iNumBytesSpare; |
|
272 |
/** |
|
273 |
Effective usable blocks |
|
274 |
*/ |
|
275 |
TInt iEffectiveBlks; |
|
276 |
/** |
|
277 |
Start page of drive |
|
278 |
*/ |
|
279 |
TInt iStartPage; |
|
280 |
public: |
|
281 |
inline TInt64 MediaSizeInBytes(); |
|
282 |
}; |
|
283 |
typedef TPckgBuf<TLocalDriveCapsV4> TLocalDriveCapsV4Buf; |
|
284 |
// |
|
285 |
class TLocalDriveCapsV5 : public TLocalDriveCapsV4 |
|
286 |
/** |
|
287 |
Add serial number support for certain media. |
|
288 |
||
289 |
@publishedPartner |
|
290 |
@released |
|
291 |
*/ |
|
292 |
{ |
|
293 |
public: |
|
294 |
/** |
|
295 |
Serial number buffer length, 0 if not supported |
|
296 |
*/ |
|
297 |
TUint iSerialNumLength; |
|
298 |
/** |
|
299 |
Serial number buffer |
|
300 |
*/ |
|
301 |
TUint8 iSerialNum[KMaxSerialNumLength]; |
|
302 |
}; |
|
303 |
typedef TPckgBuf<TLocalDriveCapsV5> TLocalDriveCapsV5Buf; |
|
304 |
||
305 |
// |
|
306 |
/** |
|
307 |
Extension to Capabilities fields mainly to support reporting block size |
|
308 |
information of underlying media. |
|
309 |
||
310 |
@publishedPartner |
|
311 |
@released |
|
312 |
*/ |
|
313 |
class TLocalDriveCapsV6 : public TLocalDriveCapsV5 |
|
314 |
{ |
|
315 |
public: |
|
316 |
/** |
|
317 |
Block size information of underlying media is required to assist in chosing |
|
318 |
efficient size of buffers for reading and writing. |
|
319 |
This information can also be accessed through the function |
|
320 |
- RFs::VolumeIOParam |
|
321 |
||
322 |
These functions retrieve this blocksize information by calling the media |
|
323 |
driver's Caps() function. |
|
324 |
*/ |
|
325 |
TUint iBlockSize; |
|
326 |
||
327 |
private: |
|
328 |
/** |
|
329 |
Reserved space for future use. |
|
330 |
*/ |
|
331 |
TUint32 iSpare[4]; |
|
332 |
}; |
|
333 |
typedef TPckgBuf<TLocalDriveCapsV6> TLocalDriveCapsV6Buf; |
|
334 |
||
335 |
||
336 |
class TLocalDriveCapsV7 : public TLocalDriveCapsV6 |
|
337 |
/** |
|
338 |
Add control mode, object mode, partition size for M18 NOR Flash. |
|
339 |
*/ |
|
340 |
{ |
|
341 |
public: |
|
342 |
TUint32 iWriteBufferSize; |
|
343 |
TUint32 iPartitionSize; |
|
344 |
TUint32 iControlModeSize; |
|
345 |
TUint32 iObjectModeSize; |
|
346 |
}; |
|
347 |
||
348 |
typedef TPckgBuf<TLocalDriveCapsV7> TLocalDriveCapsV7Buf; |
|
349 |
||
350 |
// |
|
351 |
class TFormatInfo |
|
352 |
/** |
|
353 |
Format information class |
|
354 |
||
355 |
@publishedPartner |
|
356 |
@released |
|
357 |
*/ |
|
358 |
{ |
|
359 |
public: |
|
360 |
IMPORT_C TFormatInfo(); |
|
361 |
public: |
|
362 |
TBool iFormatIsCurrent; |
|
363 |
TInt i512ByteSectorsFormatted; |
|
364 |
TInt iMaxBytesPerFormat; |
|
365 |
}; |
|
366 |
// |
|
367 |
class TErrorInfo |
|
368 |
/** |
|
369 |
@internalTechnology |
|
370 |
*/ |
|
371 |
{ |
|
372 |
public: |
|
373 |
enum TReasonCode |
|
374 |
{ |
|
375 |
ENoError=0, //No error |
|
376 |
EBadSector=1, //Error due to corrupt sector |
|
377 |
}; |
|
378 |
public: |
|
379 |
TReasonCode iReasonCode; |
|
380 |
union |
|
381 |
{ |
|
382 |
// holds position error occurred for KErrCorrupt |
|
383 |
// It numerically equals number of bytes succesfully read/written during |
|
384 |
// last disk operation. |
|
385 |
TInt64 iErrorPos; |
|
386 |
TInt iOtherInfo; |
|
387 |
}; |
|
388 |
}; |
|
389 |
typedef TPckgBuf<TErrorInfo> TErrorInfoBuf; |
|
390 |
// |
|
391 |
class TLocalDriveMessageData |
|
392 |
/** |
|
393 |
@internalTechnology |
|
394 |
*/ |
|
395 |
{ |
|
396 |
public: |
|
397 |
inline TLocalDriveMessageData() |
|
398 |
{} |
|
399 |
inline TLocalDriveMessageData(TInt64 aPos, TInt aLength, const TAny* aPtr, TInt aHandle, TInt anOffset, TInt aFlags) |
|
400 |
: iPos(aPos), iLength(aLength), iPtr(aPtr), iHandle(aHandle), iOffset(anOffset), iFlags(aFlags) |
|
401 |
{} |
|
402 |
public: |
|
403 |
TInt64 iPos; |
|
404 |
TInt iLength; |
|
405 |
const TAny* iPtr; |
|
406 |
TInt iHandle; |
|
407 |
TInt iOffset; |
|
408 |
TInt iFlags; |
|
409 |
}; |
|
410 |
||
411 |
class TLocalDriveControlIOData |
|
412 |
/** |
|
413 |
Control IO data class |
|
414 |
||
415 |
@internalTechnology |
|
416 |
*/ |
|
417 |
{ |
|
418 |
public: |
|
419 |
inline TLocalDriveControlIOData() |
|
420 |
{} |
|
421 |
inline TLocalDriveControlIOData(TInt aCommand, TAny* aParam1, TAny* aParam2, TInt aHandle) |
|
422 |
: iCommand(aCommand), iParam1(aParam1), iParam2(aParam2), iHandle(aHandle) |
|
423 |
{} |
|
424 |
inline TLocalDriveControlIOData(TInt aCommand, TUint8* aBuf, TInt aParam, TInt aLength) |
|
425 |
: iCommand(aCommand), iParam1(aBuf), iParam2((TAny*) aParam), iHandle(aLength) |
|
426 |
{} |
|
427 |
public: |
|
428 |
TInt iCommand; |
|
429 |
TAny* iParam1; |
|
430 |
TAny* iParam2; |
|
431 |
TInt iHandle; |
|
432 |
}; |
|
433 |
||
434 |
class TLocalDrivePasswordData |
|
435 |
/** |
|
436 |
Password store for password protected media |
|
437 |
||
438 |
@internalTechnology |
|
439 |
*/ |
|
440 |
{ |
|
441 |
public: |
|
442 |
TLocalDrivePasswordData(const TDesC8& aOldPasswd, const TDesC8& aNewPasswd, TBool aStorePasswd) |
|
443 |
: iOldPasswd(&aOldPasswd), iNewPasswd(&aNewPasswd), iStorePasswd(aStorePasswd) |
|
444 |
{} |
|
445 |
TLocalDrivePasswordData() |
|
446 |
: iOldPasswd(&KNullDesC8), iNewPasswd(&KNullDesC8), iStorePasswd(EFalse) |
|
447 |
{} |
|
448 |
public: |
|
449 |
const TDesC8 *iOldPasswd; |
|
450 |
const TDesC8 *iNewPasswd; |
|
451 |
TBool iStorePasswd; |
|
452 |
}; |
|
453 |
typedef TPckgBuf<TLocalDrivePasswordData> TLocalDrivePasswordDataPckg; |
|
454 |
||
455 |
||
456 |
class TPasswordStore |
|
457 |
/** |
|
458 |
@internalTechnology |
|
459 |
*/ |
|
460 |
{ |
|
461 |
public: |
|
462 |
virtual TInt Init()=0; |
|
463 |
virtual TInt ReadPasswordData(TDes8 &aBuf)=0; |
|
464 |
virtual TInt WritePasswordData(TDesC8 &aBuf)=0; |
|
465 |
virtual TInt PasswordStoreLengthInBytes()=0; |
|
466 |
enum {EMaxPasswordLength=1024}; /**< Size of the password store write buffer, which may contain multiple password mappings */ |
|
467 |
}; |
|
468 |
||
469 |
class TMountInfoData |
|
470 |
/** |
|
471 |
@internalTechnology |
|
472 |
*/ |
|
473 |
{ |
|
474 |
public: |
|
475 |
TDesC8* iInfo; |
|
476 |
TAny* iThread; |
|
477 |
}; |
|
478 |
||
479 |
||
480 |
const TInt KLocalDriveMajorVersion=1; |
|
481 |
const TInt KLocalDriveMinorVersion=0; |
|
482 |
const TInt KLocalDriveBuildVersion=160; |
|
483 |
_LIT(KLitLocalDriveLddName,"LocDrv"); |
|
484 |
||
485 |
const TInt KLocalMessageHandle=-1; |
|
486 |
||
487 |
||
488 |
enum TMediaPagingStats |
|
489 |
{ |
|
490 |
EMediaPagingStatsAll, |
|
491 |
EMediaPagingStatsRomAndCode = EMediaPagingStatsAll, // @deprecated - use EMediaPagingStatsAll instead |
|
492 |
EMediaPagingStatsRom, |
|
493 |
EMediaPagingStatsCode, |
|
494 |
EMediaPagingStatsDataIn, |
|
495 |
EMediaPagingStatsDataOut, |
|
496 |
}; |
|
497 |
||
498 |
/** |
|
499 |
Paging media details - for testing purposes only |
|
500 |
This is a structure used to communicate paging-related information |
|
501 |
from the paging media driver to an application. |
|
502 |
||
503 |
@internalTechnology |
|
504 |
@prototype |
|
505 |
*/ |
|
506 |
class TPageDeviceInfo |
|
507 |
{ |
|
508 |
public: |
|
509 |
TInt iReservoirBlockCount; // number of blocks in replacement reservoir (used & unused) |
|
510 |
TInt iBadBlockCount; // numer of bad blocks |
|
511 |
}; |
|
512 |
typedef TPckgBuf<TPageDeviceInfo> TPageDeviceInfoBuf; |
|
513 |
||
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
514 |
class TLocalDriveFinaliseInfo |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
515 |
/** |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
516 |
@internalTechnology |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
517 |
*/ |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
518 |
{ |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
519 |
public: |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
520 |
TInt iMode; // @see RFs::TFinaliseDrvMode |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
521 |
}; |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
522 |
typedef TPckgBuf<TLocalDriveFinaliseInfo> TLocalDriveFinaliseInfoBuf; |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
523 |
|
0 | 524 |
class RLocalDrive : public RBusLogicalChannel |
525 |
/** |
|
526 |
Interface class to local media |
|
527 |
||
528 |
@internalTechnology |
|
529 |
*/ |
|
530 |
{ |
|
531 |
public: |
|
532 |
enum TControl |
|
533 |
{ |
|
534 |
EControlRead=0, /**< Read request */ |
|
535 |
EControlWrite=1, /**< Write request */ |
|
536 |
EControlCaps=2, /**< Caps request */ |
|
537 |
EControlFormat=3, /**< Format request */ |
|
538 |
EControlEnlarge=4, /**< Enlarge drive request */ |
|
539 |
EControlReduce=5, /**< Reduce Drive request */ |
|
540 |
EControlForceMediaChange=6, /**< Force media change request */ |
|
541 |
EControlMediaDevice=7, /**< Return the media device request */ |
|
542 |
EControlPasswordLock=8, /**< Password lock media request */ |
|
543 |
EControlPasswordUnlock=9, /**< Password unlock media request */ |
|
544 |
EControlPasswordClear=10, /**< Password clear request */ |
|
545 |
EControlNotifyChange=11, /**< Notify change request */ |
|
546 |
EControlNotifyChangeCancel=12, /**< Notify change cancel request */ |
|
547 |
EControlReadPasswordStore=13, /**< Read password request */ |
|
548 |
EControlWritePasswordStore=14, /**< Write password request */ |
|
549 |
EControlPasswordStoreLengthInBytes=15, /**< Password request */ |
|
550 |
EControlIsRemovable=16, /**< Query removable request */ |
|
551 |
EControlSetMountInfo=17, /**< Set mount info request */ |
|
552 |
EControlControlIO=18, /**< Control IO request */ |
|
553 |
EControlPasswordErase=19, /**< Password erase media request */ |
|
554 |
EControlDeleteNotify=20, /**< Delete notification */ |
|
555 |
EControlGetLastErrorInfo=21, /**< Get last error info request */ |
|
556 |
EControlQueryDevice=22, /**< Query device request*/ |
|
557 |
}; |
|
558 |
||
559 |
enum TRemountFlags |
|
560 |
{ |
|
561 |
ELocDrvRemountNotifyChange = 0, /**< Notify clients of media change but don't remount */ |
|
562 |
ELocDrvRemountForceMediaChange = 1, /**< Notify clients of media change and remount */ |
|
563 |
}; |
|
564 |
||
565 |
enum TReadWriteFlags |
|
566 |
{ |
|
567 |
ELocDrvMetaData = 0x80000000, /**< Set if read/write request is for metadata */ |
|
200
73ea206103e6
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
109
diff
changeset
|
568 |
ELocDrvWholeMedia = 0x40000000, /**< Set to access whole media, rather than partition */ |
73ea206103e6
Revision: 201025
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
109
diff
changeset
|
569 |
ELocDrvDirectIO = 0x20000000 |
0 | 570 |
}; |
571 |
||
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
572 |
// @see TBusLocalDrive::QueryDevice() |
0 | 573 |
enum TQueryDevice |
574 |
{ |
|
575 |
// Symbian publishedPartner range |
|
576 |
EQuerySymbianPublishedPartnerFirst = 0x0000, |
|
577 |
EQuerySymbianPublishedPartnerLast = 0x3FFF, |
|
578 |
||
579 |
// Symbian test range |
|
580 |
EQuerySymbianTestFirst = 0x4000, |
|
581 |
EQuerySymbianTestLast = 0x7FFF, |
|
582 |
||
583 |
// Licensee range |
|
584 |
EQueryLicenseeFirst = 0x8000, |
|
585 |
EQueryLicenseeLast = 0xBFFF, |
|
586 |
||
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
587 |
// Finalize Drive - called as a result of a call to RFs::FinaliseDrives() |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
588 |
EQueryFinaliseDrive = EQuerySymbianPublishedPartnerFirst + 0, // @internalTechnology |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
589 |
|
0 | 590 |
EQueryPageDeviceInfo = EQuerySymbianTestFirst, /**< @see TPageDeviceInfo */ |
109
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
591 |
|
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
592 |
// NFE test driver |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
593 |
EQuerySymbianNfeTestFirst = EQuerySymbianTestFirst+0x10, |
b3a1d9898418
Revision: 201019
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
33
diff
changeset
|
594 |
EQuerySymbianNfeTestEnd = EQuerySymbianTestFirst+0x1F, |
0 | 595 |
}; |
596 |
public: |
|
597 |
inline TVersion VersionRequired() const; |
|
598 |
inline TInt Connect(TInt aDriveNumber, TBool& aChangedFlag); |
|
599 |
inline TInt Enlarge(TInt aLength); |
|
600 |
inline TInt Reduce(TInt aPos, TInt aLength); |
|
601 |
inline TInt Read(TInt64 aPos, TInt aLength, const TAny* aTrg, TInt aMessageHandle, TInt aOffset, TInt aFlags); |
|
602 |
inline TInt Read(TInt64 aPos, TInt aLength, const TAny* aTrg, TInt aMessageHandle, TInt anOffset); |
|
603 |
inline TInt Read(TInt64 aPos, TInt aLength, TDes8& aTrg); |
|
604 |
inline TInt Write(TInt64 aPos, TInt aLength, const TAny* aSrc, TInt aMessageHandle, TInt aOffset, TInt aFlags); |
|
605 |
inline TInt Write(TInt64 aPos, TInt aLength, const TAny* aSrc, TInt aMessageHandle, TInt anOffset); |
|
606 |
inline TInt Write(TInt64 aPos, const TDesC8& aSrc); |
|
607 |
inline TInt Caps(TDes8& anInfo); |
|
608 |
inline TInt Format(TInt64 aPos, TInt aLength); |
|
609 |
inline TInt ForceMediaChange(TInt aMode=0); |
|
610 |
inline void NotifyChange(TRequestStatus* aStatus); |
|
611 |
inline void NotifyChangeCancel(); |
|
612 |
inline TInt SetMountInfo(const TDesC8* aInfo,TInt aMessageHandle); |
|
613 |
inline TMediaDevice MediaDevice(); |
|
614 |
inline TInt IsRemovable(TInt& aSocketNum); |
|
615 |
inline TInt ControlIO(TInt aCommand, TAny* aParam1, TAny* aParam2); |
|
616 |
inline TInt ControlIO(TInt aCommand, TDes8& aBuf, TInt aParam); |
|
617 |
inline TInt ControlIO(TInt aCommand, TDesC8& aBuf, TInt aParam); |
|
618 |
inline TInt ControlIO(TInt aCommand, TInt aParam1, TInt aParam2); |
|
619 |
inline TInt Unlock(const TDesC8& aPassword, TBool aStorePassword); |
|
620 |
inline TInt SetPassword(const TDesC8& aOldPassword, const TDesC8& aNewPassword, TBool aStorePassword); |
|
621 |
inline TInt Clear(const TDesC8& aPassword); |
|
622 |
inline TInt ErasePassword(); |
|
623 |
inline TInt ReadPasswordData(TDesC8& aStoreData); |
|
624 |
inline TInt WritePasswordData(const TDesC8& aStoreData); |
|
625 |
inline TInt PasswordStoreLengthInBytes(); |
|
626 |
inline TInt DeleteNotify(TInt64 aPos, TInt aLength); |
|
627 |
inline TInt GetLastErrorInfo(TDesC8& aErrorInfo); |
|
628 |
inline TInt QueryDevice(TQueryDevice aQueryDevice, TDes8 &aBuf); |
|
629 |
}; |
|
630 |
// |
|
631 |
#ifndef __KERNEL_MODE__ |
|
632 |
class TBusLocalDrive : public RLocalDrive |
|
633 |
/** |
|
634 |
@internalTechnology |
|
635 |
*/ |
|
636 |
{ |
|
637 |
public: |
|
638 |
IMPORT_C TBusLocalDrive(); |
|
639 |
IMPORT_C TInt Connect(TInt aDriveNumber, TBool& aChangedFlag); |
|
640 |
IMPORT_C void Disconnect(); |
|
641 |
IMPORT_C TInt Enlarge(TInt aLength); |
|
642 |
IMPORT_C TInt ReduceSize(TInt aPos, TInt aLength); |
|
643 |
IMPORT_C TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aMessageHandle,TInt aOffset,TInt aFlags); |
|
644 |
IMPORT_C TInt Read(TInt64 aPos,TInt aLength,const TAny* aTrg,TInt aMessageHandle,TInt anOffset); |
|
645 |
IMPORT_C TInt Read(TInt64 aPos,TInt aLength,TDes8& aTrg); |
|
646 |
IMPORT_C TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aMessageHandle,TInt aOffset,TInt aFlags); |
|
647 |
IMPORT_C TInt Write(TInt64 aPos,TInt aLength,const TAny* aSrc,TInt aMessageHandle,TInt anOffset); |
|
648 |
IMPORT_C TInt Write(TInt64 aPos,const TDesC8& aSrc); |
|
649 |
IMPORT_C TInt Caps(TDes8& anInfo); |
|
650 |
IMPORT_C TInt Format(TFormatInfo& anInfo); |
|
651 |
IMPORT_C TInt Format(TInt64 aPos,TInt aLength); |
|
652 |
IMPORT_C TInt SetMountInfo(const TDesC8* aMountInfo,TInt aMessageHandle); |
|
653 |
IMPORT_C TInt ForceRemount(TUint aFlags=0); |
|
654 |
IMPORT_C TInt ControlIO(TInt aCommand, TAny* aParam1, TAny* aParam2); |
|
655 |
IMPORT_C TInt ControlIO(TInt aCommand, TDes8& aBuf, TInt aParam); |
|
656 |
IMPORT_C TInt ControlIO(TInt aCommand, TDesC8& aBuf, TInt aParam); |
|
657 |
IMPORT_C TInt ControlIO(TInt aCommand, TInt aParam1, TInt aParam2); |
|
658 |
||
659 |
IMPORT_C TInt Unlock(const TDesC8& aPassword, TBool aStorePassword); |
|
660 |
IMPORT_C TInt SetPassword(const TDesC8& aOldPassword, const TDesC8& aNewPassword, TBool aStorePassword); |
|
661 |
IMPORT_C TInt Clear(const TDesC8& aPassword); |
|
662 |
IMPORT_C TInt ErasePassword(); |
|
663 |
IMPORT_C TInt ReadPasswordData(TDes8 &aBuf); |
|
664 |
IMPORT_C TInt WritePasswordData(const TDesC8 &aBuf); |
|
665 |
IMPORT_C TInt PasswordStoreLengthInBytes(); |
|
666 |
IMPORT_C TInt DeleteNotify(TInt64 aPos, TInt aLength); |
|
667 |
IMPORT_C TInt GetLastErrorInfo(TDes8& aErrorInfo); |
|
668 |
||
669 |
IMPORT_C TInt QueryDevice(TQueryDevice aQueryDevice, TDes8 &aBuf); |
|
670 |
||
671 |
public: |
|
672 |
inline TInt& Status() {return(iStatus);} |
|
673 |
private: |
|
674 |
TInt CheckMount(); |
|
675 |
private: |
|
676 |
TInt iStatus; |
|
677 |
}; |
|
678 |
#endif |
|
679 |
||
680 |
#define _LOCKABLE_MEDIA |
|
681 |
||
682 |
#include <d32locd.inl> |
|
683 |
#endif |
|
684 |