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