os/kernelhwsrv/kerneltest/e32test/dmav2/d_dma2.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/dmav2/d_dma2.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,572 @@
     1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// e32test\dmav2\d_dma2.h
    1.18 +// User-side API for LDD used to test DMAv2 framework.
    1.19 +// 
    1.20 +//
    1.21 +
    1.22 +#ifndef __D_DMA2_H__
    1.23 +#define __D_DMA2_H__
    1.24 +
    1.25 +#include <e32cmn.h>
    1.26 +#include <drivers/dmadefs.h>
    1.27 +
    1.28 +
    1.29 +#define ARRAY_LENGTH(ARRAY) sizeof(ARRAY)/sizeof(ARRAY[0])
    1.30 +
    1.31 +#ifdef __KERNEL_MODE__
    1.32 +	#include <nkern.h>
    1.33 +	#include <kernel.h>
    1.34 +	#define TEST_FAULT FAULT();
    1.35 +	#define PRINT(N) Kern::Printf("%s = 0x%08x (%d)", #N, (N), (N))
    1.36 +#else
    1.37 +	#include <e32std.h>
    1.38 +	#include <e32debug.h>
    1.39 +	#define TEST_FAULT RDebug::Printf("Assertion failure in %s, %d", __FILE__, __LINE__); User::Invariant()
    1.40 +	#define PRINT(N) RDebug::Printf("%s = 0x%08x (%d)", #N, (N), (N))
    1.41 +#endif
    1.42 +
    1.43 +#define TEST_ASSERT(C) if(!(C)) {TEST_FAULT;}
    1.44 +
    1.45 +const TUint KPhysAddrInvalidUser=0xFFFFFFFFu; // KPhysAddrInvalid is not defined on the user side
    1.46 +#ifdef __KERNEL_MODE__
    1.47 +//if this fails then KPhysAddrInvalidUser must be updated to match
    1.48 +//KPhysAddrInvalid
    1.49 +__ASSERT_COMPILE(KPhysAddrInvalidUser == KPhysAddrInvalid);
    1.50 +#endif
    1.51 +
    1.52 +
    1.53 +_LIT(KTestDmaLddName, "TestDmaV2");
    1.54 +
    1.55 +inline TVersion TestDmaLddVersion() { return TVersion(1, 0, 1); }
    1.56 +
    1.57 +TInt Log2(TInt aNum);
    1.58 +
    1.59 +/**
    1.60 +Indicates the number of each type of call back received
    1.61 +and their context
    1.62 +
    1.63 +TODO as yet, it does not indicate the context of each callback, only
    1.64 +the final one
    1.65 +*/
    1.66 +const TInt KNumberOfCallbacks = 12;
    1.67 +
    1.68 +class TCallbackRecord
    1.69 +	{
    1.70 +public:
    1.71 +	enum TCbContext
    1.72 +		{ EInvalid, EThread, EIsr };
    1.73 +
    1.74 +	TCallbackRecord(
    1.75 +			TCbContext aContext = EThread,
    1.76 +			TInt aReq = 0,
    1.77 +			TInt aReqSrc = 0,
    1.78 +			TInt aReqDst = 0,
    1.79 +
    1.80 +			TInt aDes = 0,
    1.81 +			TInt aDesSrc = 0,
    1.82 +			TInt aDesDst = 0,
    1.83 +
    1.84 +			TInt aFrame = 0,
    1.85 +			TInt aFrameSrc = 0,
    1.86 +			TInt aFrameDst = 0,
    1.87 +
    1.88 +			TInt aPause = 0,
    1.89 +			TInt aPauseSrc = 0,
    1.90 +			TInt aPauseDst = 0,
    1.91 +			TDmaResult aResult = EDmaResultOK
    1.92 +		);
    1.93 +
    1.94 +	static TCallbackRecord Empty();
    1.95 +
    1.96 +	void Reset();
    1.97 +
    1.98 +	/**
    1.99 +	Allows 2 callback records to be compared
   1.100 +	*/
   1.101 +	TBool operator == (const TCallbackRecord aOther) const;
   1.102 +	void Print() const;
   1.103 +
   1.104 +	/**
   1.105 +	Get the number of callbacks for callback aCbType
   1.106 +	*/
   1.107 +	TInt GetCount(TDmaCallbackType aCbType) const;
   1.108 +
   1.109 +	void SetCount(TDmaCallbackType aCbType, TInt aCount);
   1.110 +
   1.111 +	/**
   1.112 +	Set the result (expected or actual) from
   1.113 +	TDmaChannel::IsrRedoRequest
   1.114 +	 */
   1.115 +	inline TCallbackRecord& IsrRedoResult(TInt aResult) {iIsrRedoRequestResult = aResult; return *this;}
   1.116 +
   1.117 +	/**
   1.118 +	Reports the context in which the callback occurred.
   1.119 +	*/
   1.120 +	inline TCbContext GetContext()
   1.121 +		{return iContext;}
   1.122 +
   1.123 +	/**
   1.124 +	Updates data based on callback mask aCallbackMask
   1.125 +	@param aCallbackMask Bitmask of callback events @see TDmaCallbackType
   1.126 +	@oaram aResult The result reported by the current callback
   1.127 +	*/
   1.128 +	void ProcessCallback(TUint aCallbackMask, TDmaResult aResultaContext);
   1.129 +
   1.130 +	static void SelfTest();
   1.131 +
   1.132 +	// The below methods are setters, which may be chained together
   1.133 +	// ie. The Named Parameter Idiom
   1.134 +	// @see http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.18
   1.135 +	TCallbackRecord& Context(TCbContext aContext) {iContext = aContext; return *this;}
   1.136 +
   1.137 +private:
   1.138 +	TInt BitToIndex(TDmaCallbackType aCbType) const;
   1.139 +
   1.140 +	TCbContext CurrentContext() const;
   1.141 +
   1.142 +	TInt iCallbackLog[KNumberOfCallbacks];
   1.143 +
   1.144 +	TDmaResult iResult;
   1.145 +	TCbContext iContext;
   1.146 +	/** Result of the most recent redo request call */
   1.147 +	TInt iIsrRedoRequestResult;
   1.148 +	};
   1.149 +
   1.150 +/**
   1.151 +Extends SDmacCaps to contain the DMA PIL
   1.152 +version being used
   1.153 +*/
   1.154 +struct TDmacTestCaps : public SDmacCaps
   1.155 +	{
   1.156 +	TDmacTestCaps();
   1.157 +	TDmacTestCaps(const SDmacCaps& aDmacCaps, TInt aVersion = 2);
   1.158 +
   1.159 +	TInt iPILVersion;
   1.160 +	};
   1.161 +
   1.162 +
   1.163 +class TDmaChannel;
   1.164 +
   1.165 +struct TAddrRange
   1.166 +	{
   1.167 +	TAddrRange(TUint aStart, TUint aLength);
   1.168 +	inline TUint End() const {return (iStart + iLength -1);}
   1.169 +	inline TUint Start() const {return iStart;}
   1.170 +
   1.171 +	inline TBool Contains(TUint aValue) const {return Rng(iStart, aValue, End());}
   1.172 +	TBool Contains(TAddrRange aRange) const;
   1.173 +
   1.174 +	TBool Overlaps(const TAddrRange& aRange) const;
   1.175 +	static void SelfTest();
   1.176 +
   1.177 +private:
   1.178 +	TUint iStart;
   1.179 +	TUint iLength;
   1.180 +	};
   1.181 +
   1.182 +
   1.183 +struct TAddressParms
   1.184 +	{
   1.185 +	TAddressParms(TUint32 aSrcAddr=0, TUint32 aDstAddr=0, TUint aTransferCount=0)
   1.186 +		:iSrcAddr(aSrcAddr), iDstAddr(aDstAddr), iTransferCount(aTransferCount)
   1.187 +		{}
   1.188 +
   1.189 +	TAddressParms(const TDmaTransferArgs& aArgs)
   1.190 +		:iSrcAddr(aArgs.iSrcConfig.iAddr),
   1.191 +		iDstAddr(aArgs.iDstConfig.iAddr),
   1.192 +		iTransferCount(aArgs.iTransferCount)
   1.193 +		{}
   1.194 +
   1.195 +	/**
   1.196 +	If any src, dst, or transfer count are zero, substitute the values from
   1.197 +	aTransferArgs in their place
   1.198 +	*/
   1.199 +	void Substitute(const TDmaTransferArgs& aTransferArgs);
   1.200 +
   1.201 +	/**
   1.202 +	When recieved by the test driver, src and dst
   1.203 +	addresses will be offsets from the dma test session's
   1.204 +	chunk base. They must be converted to absolute, *physical* addresses
   1.205 +	*/
   1.206 +	void Fixup(TLinAddr aChunkBase);
   1.207 +
   1.208 +	/**
   1.209 +	Check that both the src and destination lie within the area
   1.210 +	defined by aStart and aSize
   1.211 +	*/
   1.212 +	TBool CheckRange(TLinAddr aStart, TUint aSize);
   1.213 +
   1.214 +	TAddrRange SourceRange() const;
   1.215 +	TAddrRange DestRange() const;
   1.216 +
   1.217 +	TBool Overlaps(const TAddrRange aRange) const;
   1.218 +	TBool Overlaps(const TAddressParms aParm) const;
   1.219 +
   1.220 +	TBool operator==(const TAddressParms& aOther) const;
   1.221 +
   1.222 +	static void SelfTest();
   1.223 +
   1.224 +	TUint32 iSrcAddr;
   1.225 +	TUint32 iDstAddr;
   1.226 +	TUint iTransferCount;
   1.227 +	};
   1.228 +
   1.229 +// These functions can be used for accessing TDmaTransferArgs in
   1.230 +// terms of TAddressParms. (TAddressParms would be a natural base
   1.231 +// class for TDmaTransferArgs but changing the production code
   1.232 +// is undesirable)
   1.233 +TAddressParms GetAddrParms(const TDmaTransferArgs&);
   1.234 +void SetAddrParms(TDmaTransferArgs&, const TAddressParms&);
   1.235 +
   1.236 +/**
   1.237 +This struct holds the arguments which can be used with TDmaChannel::IsrRedoRequest
   1.238 +*/
   1.239 +struct TIsrRequeArgs : public TAddressParms
   1.240 +	{
   1.241 +	TIsrRequeArgs(TUint32 aSrcAddr=KPhysAddrInvalidUser, TUint32 aDstAddr=KPhysAddrInvalidUser,
   1.242 +			TUint aTransferCount=0, TUint32 aPslRequestInfo=0,
   1.243 +			TBool aIsrCb=ETrue)
   1.244 +		: TAddressParms(aSrcAddr, aDstAddr, aTransferCount), iPslRequestInfo(aPslRequestInfo), iIsrCb(aIsrCb)
   1.245 +		{}
   1.246 +
   1.247 +
   1.248 +	TInt Call(TDmaChannel& aChannel);
   1.249 +
   1.250 +	TBool CheckRange(TLinAddr aStart, TUint aSize) const;
   1.251 +
   1.252 +	TUint32 iPslRequestInfo;
   1.253 +	TBool iIsrCb;
   1.254 +	};
   1.255 +class CISrRequeTest;
   1.256 +/**
   1.257 +A collection of TIsrRequeArgs
   1.258 +*/
   1.259 +struct TIsrRequeArgsSet
   1.260 +	{
   1.261 +
   1.262 +	friend class CIsrRequeTest; //TODO see line 394 t_dma2.cpp
   1.263 +	TIsrRequeArgsSet(TIsrRequeArgs* aRequeueArgs=NULL, TInt aCount =0)
   1.264 +		:iCount(aCount), iIndex(0)
   1.265 +		{
   1.266 +		TEST_ASSERT(iCount <= MaxCount);
   1.267 +		for(TInt i=0; i<iCount; i++)
   1.268 +			{
   1.269 +			iRequeArgs[i] = aRequeueArgs[i];
   1.270 +			}
   1.271 +
   1.272 +		}
   1.273 +
   1.274 +	TBool IsEmpty() const
   1.275 +		{return iCount == 0;}
   1.276 +
   1.277 +	TIsrRequeArgs GetArgs();
   1.278 +
   1.279 +	void Substitute(const TDmaTransferArgs& aTransferArgs);
   1.280 +	void Fixup(TLinAddr aChunkBase);
   1.281 +	TBool CheckRange(TLinAddr aAddr, TUint aSize) const;
   1.282 +
   1.283 +private:
   1.284 +	enum {MaxCount=6};
   1.285 +	TInt iCount;
   1.286 +	TInt iIndex;
   1.287 +	TIsrRequeArgs iRequeArgs[MaxCount];
   1.288 +	};
   1.289 +
   1.290 +class DDmaTestSession;
   1.291 +class RDmaSession : public RBusLogicalChannel
   1.292 +	{
   1.293 +	friend class DDmaTestSession;
   1.294 +public:
   1.295 +#ifndef __KERNEL_MODE__
   1.296 +	TInt ChannelIsQueueEmpty(TUint aDriverCookie,TBool& aQueueEmpty)
   1.297 +		{
   1.298 +		return DoControl(EIsQueueEmpty, reinterpret_cast<TAny*>(aDriverCookie),	&aQueueEmpty);		
   1.299 +		}
   1.300 +
   1.301 +	TInt ChannelIsOpened(TUint aDriverCookie,TBool &aChannelOpen)
   1.302 +		{
   1.303 +		return DoControl(EIsOpened, reinterpret_cast<TAny*>(aDriverCookie), &aChannelOpen);		
   1.304 +		}
   1.305 +
   1.306 +	TInt ChannelIsrRedoRequest(TUint aDriverCookie,TUint32 aSrcAddr,TUint32 aDstAddr,TInt aTransferCount,TUint32 aPslRequestInfo,TBool aIsrCb)
   1.307 +		{
   1.308 +		TIsrRedoReqArgs args(aDriverCookie,aSrcAddr,aDstAddr,aTransferCount,aPslRequestInfo,aIsrCb);
   1.309 +		TPckgC<TIsrRedoReqArgs> package(args);
   1.310 +		return DoControl(EIsrRedoRequest,&package);
   1.311 +		}
   1.312 +
   1.313 +	TInt ChannelCancelAll(TUint aDriverCookie)
   1.314 +		{	
   1.315 +		return DoControl(ECancelAllChannel, reinterpret_cast<TAny*>(aDriverCookie));
   1.316 +		}
   1.317 +
   1.318 +	TInt ChannelOpen(TUint aPslCookie,  TUint& aDriverCookie)
   1.319 +		{
   1.320 +		return DoControl(EOpenChannel, reinterpret_cast<TAny*>(aPslCookie), &aDriverCookie);
   1.321 +		}
   1.322 +
   1.323 +	TInt ChannelClose(TUint aDriverCookie)
   1.324 +		{	
   1.325 +		return DoControl(ECloseChannel, reinterpret_cast<TAny*>(aDriverCookie));
   1.326 +		}
   1.327 +
   1.328 +	TInt ChannelPause(TUint aDriverCookie)
   1.329 +		{	
   1.330 +		return DoControl(EPauseChannel, reinterpret_cast<TAny*>(aDriverCookie));
   1.331 +		}
   1.332 +	
   1.333 +	TInt ChannelResume(TUint aDriverCookie)
   1.334 +		{	
   1.335 +		return DoControl(EResumeChannel, reinterpret_cast<TAny*>(aDriverCookie));
   1.336 +		}
   1.337 +
   1.338 +	TInt ChannelCaps(TUint aDriverCookie, SDmacCaps& aChannelCaps)
   1.339 +		{
   1.340 +		TDmacTestCaps caps;
   1.341 +		TInt r = ChannelCaps(aDriverCookie, caps);
   1.342 +		aChannelCaps = caps;
   1.343 +		return r;
   1.344 +		}
   1.345 +
   1.346 +	TInt ChannelCaps(TUint aDriverCookie, TDmacTestCaps& aChannelCaps)
   1.347 +		{
   1.348 +		TPckg<TDmacTestCaps> package(aChannelCaps);
   1.349 +		return DoControl(EChannelCaps, reinterpret_cast<TAny*>(aDriverCookie), &package);
   1.350 +		}
   1.351 +	
   1.352 +	TInt Open()
   1.353 +		{// TO DO: Add Info , this  class is just to test the opening of channels
   1.354 +		//TPckgBuf<TOpenInfo> infoBuf;
   1.355 +		//infoBuf().iWhat = TOpenInfo::EOpen;
   1.356 +		//infoBuf().U.iOpen.iId = aId;
   1.357 +		//infoBuf().U.iOpen.iDesCount = aDesCount;
   1.358 +		//infoBuf().U.iOpen.iMaxTransferSize = aMaxTransferSize;
   1.359 +		return DoCreate(KTestDmaLddName,TestDmaLddVersion(), 0, NULL, NULL, EOwnerThread);
   1.360 +		}
   1.361 +
   1.362 +	//TODO rename this (append "old")
   1.363 +	TInt RequestCreate(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0)
   1.364 +		{	
   1.365 +		return DoRequestCreate(aChannelCookie, EFalse, aMaxTransferSize, aRequestCookie);
   1.366 +		}
   1.367 +
   1.368 +	//TODO rename this (get rid of "new"
   1.369 +	TInt RequestCreateNew(TUint aChannelCookie, TUint& aRequestCookie, TUint aMaxTransferSize=0)
   1.370 +		{
   1.371 +		return DoRequestCreate(aChannelCookie, ETrue, aMaxTransferSize, aRequestCookie);
   1.372 +		}
   1.373 +
   1.374 +	TInt RequestDestroy(TUint aRequestCookie)
   1.375 +		{	
   1.376 +		return DoControl(ERequestClose, reinterpret_cast<TAny*>(aRequestCookie));
   1.377 +		}
   1.378 +
   1.379 +	TInt RequestFragmentCount(TUint aRequestCookie)
   1.380 +		{	
   1.381 +		return DoControl(EFragmentCount, reinterpret_cast<TAny*>(aRequestCookie));
   1.382 +		}
   1.383 +
   1.384 +	/**
   1.385 +	Will fragment a DMA request using the legacy API
   1.386 +	*/
   1.387 +	TInt FragmentRequestOld(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs=NULL)
   1.388 +		{
   1.389 +		const TFragmentArgs args(aRequestCookie, aTransferArgs, aDurationMicroSecs);
   1.390 +		TPckgC<TFragmentArgs> package(args);
   1.391 +		return DoControl(EFragmentLegacy, &package);
   1.392 +		}
   1.393 +
   1.394 +	/**
   1.395 +	Will fragment a DMA request using the new API
   1.396 +	*/
   1.397 +	TInt FragmentRequest(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs=NULL)
   1.398 +		{
   1.399 +		const TFragmentArgs args(aRequestCookie, aTransferArgs, aDurationMicroSecs);
   1.400 +		TPckgC<TFragmentArgs> package(args);
   1.401 +		return DoControl(EFragment, &package);
   1.402 +		}
   1.403 +
   1.404 +	TInt QueueRequest(TUint aRequestCookie, TRequestStatus& aStatus, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
   1.405 +		{
   1.406 +		//These dummy values can accept the writeback from the driver
   1.407 +		//if the client does not want them.
   1.408 +		//(TClientDataRequest can not be programmed with a NULL to
   1.409 +		//indicate that an argument is unwanted)
   1.410 +		TCallbackRecord dummyRec;
   1.411 +		TUint64 dummyTime=0;
   1.412 +
   1.413 +		TQueueArgs args(aRequestCookie, &aStatus, aRecord ? aRecord : &dummyRec, aDurationMicroSecs ? aDurationMicroSecs : &dummyTime);
   1.414 +		TPckgC<TQueueArgs> package(args);
   1.415 +		return DoControl(EQueueRequest, &package);
   1.416 +		}
   1.417 +
   1.418 +	/**
   1.419 +	Synchronous version of QueueRequest
   1.420 +	*/
   1.421 +	TInt QueueRequest(TUint aRequestCookie, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
   1.422 +		{
   1.423 +		TRequestStatus status;
   1.424 +		TInt r = QueueRequest(aRequestCookie, status, aRecord, aDurationMicroSecs);
   1.425 +		User::WaitForRequest(status);
   1.426 +		return r;
   1.427 +		}
   1.428 +
   1.429 +	/**
   1.430 +	Queue a previously fragmented request.
   1.431 +	Additional request parameters are included in iRequeueArgs, these will be
   1.432 +	transferred from ISR context callback using the TDmaChannel::IsrRedoRequest function
   1.433 +
   1.434 +	@pre Isr callback for completion must have been requested at request fragmentation time
   1.435 +	*/
   1.436 +	TInt QueueRequestWithRequeue(TUint aRequestCookie, TIsrRequeArgs* aRequeueArgs, TInt aCount, TRequestStatus& aStatus, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
   1.437 +		{
   1.438 +		//These dummy values can accept the writeback from the driver
   1.439 +		//if the client does not want them.
   1.440 +		//(TClientDataRequest can not be programmed with a NULL to
   1.441 +		//indicate that an argument is unwanted)
   1.442 +		TCallbackRecord dummyRec;
   1.443 +		TUint64 dummyTime=0;
   1.444 +
   1.445 +		TQueueArgsWithReque args(aRequeueArgs, aCount, aRequestCookie, &aStatus, aRecord ? aRecord : &dummyRec, aDurationMicroSecs ? aDurationMicroSecs : &dummyTime);
   1.446 +		TPckgC<TQueueArgsWithReque> package(args);
   1.447 +		return DoControl(EQueueRequestWithReque, &package);
   1.448 +		}
   1.449 +
   1.450 +	/**
   1.451 +	Synchronous version of QueueRequestWithRequeue
   1.452 +	*/
   1.453 +	TInt QueueRequestWithRequeue(TUint aRequestCookie, TIsrRequeArgs* aRequeueArgs, TInt aCount, TCallbackRecord* aRecord = NULL, TUint64* aDurationMicroSecs=NULL)
   1.454 +		{
   1.455 +		TRequestStatus status;
   1.456 +		TInt r = QueueRequestWithRequeue(aRequestCookie, aRequeueArgs, aCount, status, aRecord, aDurationMicroSecs);
   1.457 +		User::WaitForRequest(status);
   1.458 +		return r;
   1.459 +		}
   1.460 +
   1.461 +	TInt OpenSharedChunk(RChunk& aChunk)
   1.462 +		{
   1.463 +		TUint chunkHandle = DoControl(EOpenSharedChunk);
   1.464 +		return aChunk.SetReturnedHandle(chunkHandle);
   1.465 +		}
   1.466 +	
   1.467 +	TInt GetTestInfo(TDmaV2TestInfo& aInfo)
   1.468 +		{
   1.469 +		TPckg<TDmaV2TestInfo> package(aInfo);
   1.470 +		return DoControl(EGetTestInfo, &package);
   1.471 +		}
   1.472 +
   1.473 +	static void SelfTest();
   1.474 +	
   1.475 +	static void ApiTest();
   1.476 +#endif // __KERNEL_MODE__
   1.477 +
   1.478 +private:
   1.479 +
   1.480 +	TInt DoRequestCreate(TUint aChannelCookie, TBool aNewStyle, TUint aMaxTransferSize, TUint& aRequestCookie)
   1.481 +		{
   1.482 +		TRequestCreateArgs args(aChannelCookie, aNewStyle, aMaxTransferSize);
   1.483 +		TPckgC<TRequestCreateArgs> package(args);
   1.484 +		return DoControl(ERequestOpen, &package, &aRequestCookie);
   1.485 +		}
   1.486 +
   1.487 +
   1.488 +	struct TRequestCreateArgs
   1.489 +		{
   1.490 +		TRequestCreateArgs(TUint aChannelCookie, TBool aNewStyle, TUint aMaxFragmentSize)
   1.491 +			:iChannelCookie(aChannelCookie), iNewStyle(aNewStyle), iMaxFragmentSize(aMaxFragmentSize)
   1.492 +			{}
   1.493 +
   1.494 +		TUint iChannelCookie;
   1.495 +		TBool iNewStyle;
   1.496 +		TUint iMaxFragmentSize;
   1.497 +		};
   1.498 +
   1.499 +	struct TFragmentArgs
   1.500 +		{
   1.501 +		TFragmentArgs()
   1.502 +			:iRequestCookie(0), iTransferArgs(), iDurationMicroSecs(NULL)
   1.503 +			{}
   1.504 +		TFragmentArgs(TUint aRequestCookie, const TDmaTransferArgs& aTransferArgs, TUint64* aDurationMicroSecs = NULL)
   1.505 +			:iRequestCookie(aRequestCookie), iTransferArgs(aTransferArgs), iDurationMicroSecs(aDurationMicroSecs)
   1.506 +			{}
   1.507 +
   1.508 +		const TUint iRequestCookie;
   1.509 +		const TDmaTransferArgs iTransferArgs;
   1.510 +		TUint64* const iDurationMicroSecs;
   1.511 +		};
   1.512 +
   1.513 +	struct TQueueArgs
   1.514 +		{
   1.515 +		TQueueArgs(TUint aRequestCookie=0, TRequestStatus* aStatus=NULL, TCallbackRecord* aCallbackRecord=NULL, TUint64* aDurationMicroSecs=NULL)
   1.516 +			:iRequestCookie(aRequestCookie), iStatus(aStatus), iCallbackRecord(aCallbackRecord), iDurationMicroSecs(aDurationMicroSecs)
   1.517 +			{}
   1.518 +		TUint iRequestCookie;
   1.519 +		TRequestStatus* iStatus;
   1.520 +		TCallbackRecord* iCallbackRecord;
   1.521 +		TUint64* iDurationMicroSecs;
   1.522 +		};
   1.523 +
   1.524 +	struct TIsrRedoReqArgs 	
   1.525 +		{
   1.526 +		TIsrRedoReqArgs(TUint aDriverCookie=0,TUint32 aSrcAddr=0, TUint32 aDstAddr=0, TInt aTransferCount=0, TUint32 aPslRequestInfo=0,TBool aIsrCb=ETrue)
   1.527 +			:iDriverCookie(aDriverCookie),iSrcAddr(aSrcAddr),iDstAddr(aDstAddr),iTransferCount(aTransferCount),iPslRequestInfo(aPslRequestInfo),iIsrCb(aIsrCb)
   1.528 +			{}
   1.529 +		TUint iDriverCookie;
   1.530 +		TUint32 iSrcAddr;
   1.531 +		TUint32 iDstAddr;
   1.532 +		TInt iTransferCount;
   1.533 +		TUint32 iPslRequestInfo;
   1.534 +		TBool iIsrCb;
   1.535 +		};
   1.536 +
   1.537 +	/**
   1.538 +	This struct is used for queing and including a set of transfers
   1.539 +	to be setup from ISR context callback
   1.540 +	*/
   1.541 +	struct TQueueArgsWithReque : public TQueueArgs
   1.542 +		{
   1.543 +		TQueueArgsWithReque(TIsrRequeArgs* aRequeueArgs=NULL, TInt aCount=0,
   1.544 +				TUint aRequestCookie=0, TRequestStatus* aStatus=NULL, TCallbackRecord* aCallbackRecord=NULL, TUint64* aDurationMicroSecs=NULL)
   1.545 +			:TQueueArgs(aRequestCookie, aStatus, aCallbackRecord, aDurationMicroSecs), iRequeSet(aRequeueArgs, aCount)
   1.546 +			{
   1.547 +			}
   1.548 +
   1.549 +		TIsrRequeArgsSet iRequeSet;
   1.550 +		};
   1.551 +
   1.552 +
   1.553 +	enum TControl
   1.554 +		{
   1.555 +		EOpenChannel,
   1.556 +		ECloseChannel,
   1.557 +		EPauseChannel,
   1.558 +		EResumeChannel,
   1.559 +		EChannelCaps,
   1.560 +		ERequestOpen,
   1.561 +		ERequestClose,
   1.562 +		EOpenSharedChunk,
   1.563 +		EFragmentLegacy,
   1.564 +		EFragment,
   1.565 +		EFragmentCount,
   1.566 +		EQueueRequest,
   1.567 +		EGetTestInfo,
   1.568 +		EIsQueueEmpty,
   1.569 +		EIsOpened,
   1.570 +		EIsrRedoRequest,
   1.571 +		ECancelAllChannel,
   1.572 +		EQueueRequestWithReque
   1.573 +		};
   1.574 +	};
   1.575 +#endif // __D_DMA2_H__