First public contribution.
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Contains TDmaCapability and associated definitions.
15 * These are used by the DMA tests in test_cases.cpp to express dependancies
16 * on various DMA controller/channel capabilities
19 #ifndef __CAP_REQS_H__
20 #define __CAP_REQS_H__
25 The various types of requirement on a
26 value that can be specified by a TDmaCapability
30 EEqual, EGTE /* >= */, ELTE /* <= */, EBitsSet, EBitsClear
34 Enumerates all the various DMA channel capabilities
40 EChannelPauseAndResume,
41 EAddrAlignedToElementSize,
44 ESynchronizationTypes,
48 ELinkedListPausedInterrupt,
49 EEndiannessConversion,
56 EBalancedAsymSegments,
57 EAsymCompletionInterrupt,
58 EAsymDescriptorInterrupt,
63 enum TResult {ERun=0, ESkip=1, EFail=2}; //The ordering of these should not be changed
69 Represents a requirement for some DMA capability
70 to be either present or not present, less than, equal to, or
71 greater than some value, or to have certain bits in a mask
77 :iCapsReq(ENone), iCapsReqType(EEqual), iValue(ETrue), iFail(EFalse)
80 TDmaCapability(TCapsReq aReq, TCapsReqType aReqType, TUint aValue, TBool aFail)
81 :iCapsReq(aReq), iCapsReqType(aReqType), iValue(aValue), iFail(aFail)
84 static void SelfTest();
87 Compares the requirements held in the struct
88 against those described in aChannelCaps and makes a decision
89 as to whether this test case should be run, skipped, or failed.
91 TResult CompareToDmaCaps(const SDmacCaps& aChannelCaps) const;
92 TResult CompareToDmaCaps(const TDmacTestCaps& aChannelCaps) const;
95 TBool RequirementSatisfied(const SDmacCaps& aChannelCaps) const;
96 TBool RequirementSatisfied(const TDmacTestCaps& aChannelCaps) const;
98 TBool TestValue(TUint aValue) const;
102 TCapsReqType iCapsReqType;
104 // if HW capability is not available:-
105 // ETrue - Fail the test
106 // EFalse - Skip the test
110 //A set of DMA capability requirements
111 const TDmaCapability none(ENone, EEqual, 0, ETrue);
113 const TDmaCapability pauseRequired(EChannelPauseAndResume, EEqual, ETrue, ETrue);
114 const TDmaCapability pauseRequired_skip(EChannelPauseAndResume, EEqual, ETrue, EFalse);
115 const TDmaCapability pauseNotWanted(EChannelPauseAndResume, EEqual, EFalse, ETrue);
117 const TDmaCapability hwDesNotWanted(EHwDescriptors, EEqual, EFalse, ETrue);
118 const TDmaCapability hwDesNotWanted_skip(EHwDescriptors, EEqual, EFalse, EFalse);
119 const TDmaCapability hwDesWanted(EHwDescriptors, EEqual, ETrue, ETrue);
120 const TDmaCapability hwDesWanted_skip(EHwDescriptors, EEqual, ETrue, EFalse);
122 const TDmaCapability cap_2DRequired(E2DAddressing, EEqual, ETrue, EFalse);
124 const TDmaCapability capEqualV1(EPilVersion, EEqual, 1, EFalse);
125 const TDmaCapability capEqualV2(EPilVersion, EEqual, 2, EFalse);
126 const TDmaCapability capEqualV2Fatal(EPilVersion, EEqual, 2, ETrue);
128 const TDmaCapability capAboveV1(EPilVersion, EGTE, 2, EFalse);
129 const TDmaCapability capBelowV2(EPilVersion, ELTE, 1, EFalse);
130 #endif // #ifdef __CAP_REQS_H__