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