kerneltest/e32test/hcr/d_hcrsim.h
changeset 47 46fffbe7b5a7
parent 43 96e5fb8b040d
equal deleted inserted replaced
46:0bf4040442f9 47:46fffbe7b5a7
    19 #define D_HCRSIM_H
    19 #define D_HCRSIM_H
    20 
    20 
    21 #include <e32cmn.h>
    21 #include <e32cmn.h>
    22 #include <e32ver.h>
    22 #include <e32ver.h>
    23 #include <drivers/hcr.h>
    23 #include <drivers/hcr.h>
    24 #ifndef HCRTEST_USERSIDE_INTERFACE
       
    25 #include "hcr_hai.h"
    24 #include "hcr_hai.h"
    26 #include "hcr_pil.h"
    25 #include "hcr_pil.h"
    27 #endif // HCRTEST_USERSIDE_INTERFACE
    26 
    28 
       
    29 #ifndef __KERNEL_MODE__
       
    30 using namespace HCR;
    27 using namespace HCR;
    31 #endif // __KERNEL_MODE__
    28 
       
    29 //Local helper macros
       
    30 #define _ABS(x)     (x > 0 ? x : -x)
    32 
    31 
    33 // Device driver names
    32 // Device driver names
    34 _LIT(KTestHcrRealOwn, "d_hcrext_own");
    33 _LIT(KTestHcrRealOwn, "d_hcrext_own");
    35 _LIT(KTestHcrSimOwn, "d_hcrsim_own");
    34 _LIT(KTestHcrSimOwn, "d_hcrsim_own");
    36 _LIT(KTestHcrRealClient, "d_hcrext_client");
    35 _LIT(KTestHcrRealClient, "d_hcrext_client");
   109 		EHcrSwitchRepository,
   108 		EHcrSwitchRepository,
   110 		EHcrClearRepository,
   109 		EHcrClearRepository,
   111 		EHcrCheckIntegrity,
   110 		EHcrCheckIntegrity,
   112 		// Others
   111 		// Others
   113 		EHcrGetInitExtensionTestResults,
   112 		EHcrGetInitExtensionTestResults,
       
   113 		EHcrHasRepositoryInSmr,
   114 		EHcrBenchmarkGetSettingInt,
   114 		EHcrBenchmarkGetSettingInt,
   115 		EHcrBenchmarkGetSettingArray,
   115 		EHcrBenchmarkGetSettingArray,
   116 		EHcrBenchmarkGetSettingDes,
   116 		EHcrBenchmarkGetSettingDes,
   117 		EHcrBenchmarkFindNumSettingsInCategory,
   117 		EHcrBenchmarkFindNumSettingsInCategory,
   118 		EHcrBenchmarkFindSettings,
   118 		EHcrBenchmarkFindSettings,
   123 #ifndef __KERNEL_MODE__
   123 #ifndef __KERNEL_MODE__
   124 	inline TInt Open(const TDesC& aLdd);
   124 	inline TInt Open(const TDesC& aLdd);
   125 	inline TInt GetLinAddr(const TSettingId& aId, TLinAddr& aValue);
   125 	inline TInt GetLinAddr(const TSettingId& aId, TLinAddr& aValue);
   126 	inline TInt FindNumSettingsInCategory(TCategoryUid aCatUid);
   126 	inline TInt FindNumSettingsInCategory(TCategoryUid aCatUid);
   127 	inline TInt FindSettings(TCategoryUid aCatUid,
   127 	inline TInt FindSettings(TCategoryUid aCatUid,
   128 							TInt aMaxNum, TUint32& aNumFound,
   128 							TInt aMaxNum, TElementId* aElIds, TSettingType* aTypes,
   129 							TElementId* aElIds, TSettingType* aTypes, TUint16* aLens);
   129 							TUint16* aLens);
   130 	inline TInt FindSettings(TCategoryUid aCat,	TInt aMaxNum,
   130 	inline TInt FindSettings(TCategoryUid aCat,	TInt aMaxNum,
   131 							TUint32 aMask, TUint32 aPattern, TUint32& aNumFound,
   131 							TUint32 aMask, TUint32 aPattern, TElementId* aElIds,
   132 							TElementId* aElIds, TSettingType* aTypes, TUint16* aLens);
   132 							TSettingType* aTypes, TUint16* aLens);
   133 	inline TInt GetTypeAndSize(const TSettingId& aId,
   133 	inline TInt GetTypeAndSize(const TSettingId& aId,
   134 							TSettingType& aType, TUint16& aLen);
   134 							TSettingType& aType, TUint16& aLen);
   135 	inline TInt GetWordSettings(TInt aNum, const SSettingId aIds[],
   135 	inline TInt GetWordSettings(TInt aNum, const SSettingId aIds[],
   136 							TInt32 aValues[], TSettingType aTypes[],
   136 							TInt32 aValues[], TSettingType aTypes[],
   137 							TInt aErrors[]);
   137 							TInt aErrors[]);
   156 							TText8* aValue, TUint16& aLen);
   156 							TText8* aValue, TUint16& aLen);
   157 	inline TInt InitExtension(const TUint32 aFlags = 0);
   157 	inline TInt InitExtension(const TUint32 aFlags = 0);
   158 	inline TInt SwitchRepository(const TDesC8& aFileName, HCRInternal::TReposId aId);
   158 	inline TInt SwitchRepository(const TDesC8& aFileName, HCRInternal::TReposId aId);
   159 	inline TInt CheckIntegrity();
   159 	inline TInt CheckIntegrity();
   160 	inline TInt GetInitExtensionTestResults(TInt& aLine, TInt& aError);
   160 	inline TInt GetInitExtensionTestResults(TInt& aLine, TInt& aError);
       
   161 	inline TInt HasRepositoryInSmr(TBool& aHasSmr, TBool& aHasSmrRep);
   161 	inline TInt BenchmarkGetSettingInt(const TSettingId& aId, TUint32& aTimeMs);
   162 	inline TInt BenchmarkGetSettingInt(const TSettingId& aId, TUint32& aTimeMs);
   162 	inline TInt BenchmarkGetSettingArray(const TSettingId& aId, TUint32& aTimeMs);
   163 	inline TInt BenchmarkGetSettingArray(const TSettingId& aId, TUint32& aTimeMs);
   163 	inline TInt BenchmarkGetSettingDes(const TSettingId& aId, TUint32& aTimeMs);
   164 	inline TInt BenchmarkGetSettingDes(const TSettingId& aId, TUint32& aTimeMs);
   164 	inline TInt BenchmarkFindNumSettingsInCategory(const TCategoryUid aCatUid, TUint32& aTimeMs);
   165 	inline TInt BenchmarkFindNumSettingsInCategory(const TCategoryUid aCatUid, TUint32& aTimeMs);
   165 	inline TInt BenchmarkFindSettings(const TCategoryUid aCatUid, TUint32& aTimeMs);
   166 	inline TInt BenchmarkFindSettings(const TCategoryUid aCatUid, TUint32& aTimeMs);
   174 inline TInt RHcrSimTestChannel::GetLinAddr(const TSettingId& aId, TLinAddr& aValue)
   175 inline TInt RHcrSimTestChannel::GetLinAddr(const TSettingId& aId, TLinAddr& aValue)
   175 	{return DoControl(EHcrGetLinAddr, (TAny*) &aId, (TAny*) &aValue);}
   176 	{return DoControl(EHcrGetLinAddr, (TAny*) &aId, (TAny*) &aValue);}
   176 inline TInt RHcrSimTestChannel::FindNumSettingsInCategory(TCategoryUid aCatUid)
   177 inline TInt RHcrSimTestChannel::FindNumSettingsInCategory(TCategoryUid aCatUid)
   177 	{return DoControl(EHcrFindNumSettingsInCategory, (TAny*) aCatUid);}
   178 	{return DoControl(EHcrFindNumSettingsInCategory, (TAny*) aCatUid);}
   178 inline TInt RHcrSimTestChannel::FindSettings(TCategoryUid aCatUid,
   179 inline TInt RHcrSimTestChannel::FindSettings(TCategoryUid aCatUid,
   179 					TInt aMaxNum, TUint32& aNumFound,
   180 					TInt aMaxNum, TElementId* aElIds, TSettingType* aTypes, TUint16* aLens)
   180 					TElementId* aElIds, TSettingType* aTypes, TUint16* aLens)
       
   181 	{
   181 	{
   182 	TAny* args[6];
   182 	TAny* args[6];
   183 	args[0] = (TAny*) aCatUid;
   183 	args[0] = (TAny*) aCatUid;
   184 	args[1] = (TAny*) aMaxNum;
   184 	args[1] = (TAny*) aMaxNum;
   185 	args[2] = (TAny*) &aNumFound;
   185 	args[2] =  0; //It's not used
   186 	args[3] = (TAny*) aElIds;
   186 	args[3] = (TAny*) aElIds;
   187 	args[4] = (TAny*) aTypes;
   187 	args[4] = (TAny*) aTypes;
   188 	args[5] = (TAny*) aLens;
   188 	args[5] = (TAny*) aLens;
   189 	return DoControl(EHcrFindSettingsCategory, (TAny*) args);
   189 	return DoControl(EHcrFindSettingsCategory, (TAny*) args);
   190 	}
   190 	}
   191 inline TInt RHcrSimTestChannel::FindSettings(TCategoryUid aCat,	TInt aMaxNum, 
   191 inline TInt RHcrSimTestChannel::FindSettings(TCategoryUid aCat,	TInt aMaxNum, 
   192 					TUint32 aMask, TUint32 aPattern, TUint32& aNumFound,
   192 					TUint32 aMask, TUint32 aPattern, TElementId* aElIds, 
   193 					TElementId* aElIds, TSettingType* aTypes, TUint16* aLens)
   193 					TSettingType* aTypes, TUint16* aLens)
   194 	{
   194 	{
   195 	TAny* args[8];
   195 	TAny* args[8];
   196 	args[0] = (TAny*) aCat;
   196 	args[0] = (TAny*) aCat;
   197 	args[1] = (TAny*) aMaxNum;
   197 	args[1] = (TAny*) aMaxNum;
   198 	args[2] = (TAny*) aMask;
   198 	args[2] = (TAny*) aMask;
   199 	args[3] = (TAny*) aPattern;
   199 	args[3] = (TAny*) aPattern;
   200 	args[4] = (TAny*) &aNumFound;
   200 	args[4] =  0; //It's not used
   201 	args[5] = (TAny*) aElIds;
   201 	args[5] = (TAny*) aElIds;
   202 	args[6] = (TAny*) aTypes;
   202 	args[6] = (TAny*) aTypes;
   203 	args[7] = (TAny*) aLens;
   203 	args[7] = (TAny*) aLens;
   204 	return DoControl(EHcrFindSettingsPattern, (TAny*) args);
   204 	return DoControl(EHcrFindSettingsPattern, (TAny*) args);
   205 	}
   205 	}
   292 	{return DoControl(EHcrSwitchRepository, (TAny*) &aFileName, (TAny*) aId);}
   292 	{return DoControl(EHcrSwitchRepository, (TAny*) &aFileName, (TAny*) aId);}
   293 inline TInt RHcrSimTestChannel::CheckIntegrity()
   293 inline TInt RHcrSimTestChannel::CheckIntegrity()
   294 	{return DoControl(EHcrCheckIntegrity);}
   294 	{return DoControl(EHcrCheckIntegrity);}
   295 inline TInt RHcrSimTestChannel::GetInitExtensionTestResults(TInt& aLine, TInt& aError)
   295 inline TInt RHcrSimTestChannel::GetInitExtensionTestResults(TInt& aLine, TInt& aError)
   296 	{return DoControl(EHcrGetInitExtensionTestResults, (TAny*) &aLine, (TAny*) &aError);}
   296 	{return DoControl(EHcrGetInitExtensionTestResults, (TAny*) &aLine, (TAny*) &aError);}
       
   297 inline TInt RHcrSimTestChannel::HasRepositoryInSmr(TBool& aHasSmr, TBool& aHasSmrRep)
       
   298 	{return DoControl(EHcrHasRepositoryInSmr, (TAny*) &aHasSmr, (TAny*) &aHasSmrRep);}
   297 inline TInt RHcrSimTestChannel::BenchmarkGetSettingInt(const TSettingId& aId, TUint32& aTimeMs)
   299 inline TInt RHcrSimTestChannel::BenchmarkGetSettingInt(const TSettingId& aId, TUint32& aTimeMs)
   298 	{return DoControl(EHcrBenchmarkGetSettingInt, (TAny*) &aId, (TAny*) &aTimeMs);}
   300 	{return DoControl(EHcrBenchmarkGetSettingInt, (TAny*) &aId, (TAny*) &aTimeMs);}
   299 inline TInt RHcrSimTestChannel::BenchmarkGetSettingArray(const TSettingId& aId, TUint32& aTimeMs)
   301 inline TInt RHcrSimTestChannel::BenchmarkGetSettingArray(const TSettingId& aId, TUint32& aTimeMs)
   300 	{return DoControl(EHcrBenchmarkGetSettingArray, (TAny*) &aId, (TAny*) &aTimeMs);}
   302 	{return DoControl(EHcrBenchmarkGetSettingArray, (TAny*) &aId, (TAny*) &aTimeMs);}
   301 inline TInt RHcrSimTestChannel::BenchmarkGetSettingDes(const TSettingId& aId, TUint32& aTimeMs)
   303 inline TInt RHcrSimTestChannel::BenchmarkGetSettingDes(const TSettingId& aId, TUint32& aTimeMs)