www.pudn.com > DMBDRV.rar > SianoDMA.h


#ifndef _SIANO_DMA_PLUGIN_H 
#define _SIANO_DMA_PLUGIN_H 
 
 
#include  
#include "SianoDma_API.h" 
#include "DmaCedebug.h" 
#include "CEDDK.h" 
 
#define ALIGNMENT_MASK (PAGE_SIZE-1) 
 
#define PAGE_MASK (PAGE_SIZE-1) 
 
 
/** 
 * Used in DMA handler definition 
 **/ 
#define DMA_STATUS_OK	0 
#define DMA_STATUS_ERR	-1	 
 
 
 
 
#define MAX_NUM_OF_WAITING_TRANSACTIONS 10 
 
 
typedef struct  DMA_DESCRIPTOR_S 
{ 
	unsigned int srcPhyAddr;		// address of the source  data (physical address) 
	unsigned int dstPhyAddr;		// address of the destination 
	unsigned int len;				// transaction length 
	unsigned int flags; 
}DMA_DESCRIPTOR_ST; 
 
typedef struct  DMA_DB_NODE_S 
{ 
	DMA_DESCRIPTOR_ST*  desc; 
	DWORD				numOfDesc; 
	DMA_CallBackF		callBack; 
	DWORD				transactionId; 
}DMA_DB_NODE_ST; 
 
 
 
 
typedef struct  DMA_DATABASE_S 
{ 
	DWORD				firstMsg; 
	DWORD				lastMsg; 
	DMA_DB_NODE_ST		transactions[MAX_NUM_OF_WAITING_TRANSACTIONS]; 
}DMA_DATABASE_ST; 
 
 
 
typedef struct DMA_DRV_PARAMS_S 
{ 
	PVOID				pDmacAddr; 
	DWORD				channel; 
	DWORD				dmaInt; 
	HANDLE				dmaIntEvent; 
    DWORD				dmaReq; 
	DWORD				burstSize; 
	DWORD				busWidth; 
	BOOL				useHWFlowCtrl; 
	DMA_DATABASE_ST*	dataBase; 
	HANDLE				ist; 
	HANDLE				databaseSemaphore; 
	BOOL				activeChannel; 
	PHYSICAL_ADDRESS	descPhyAddr; 
	PVOID				desc; 
}DMA_DRV_PARAMS_ST; 
 
 
/////////////////////////////// 
//Physical DMA services. 
 
BOOL PhyDmaSetUp(DMA_DRV_PARAMS_ST* dev); 
VOID PhyDmaRemoveChannel(DMA_DRV_PARAMS_ST* dev); 
BOOL PhyDmaSendDescriptor(DMA_DRV_PARAMS_ST* dev,DMA_DB_NODE_ST* transaction); 
DWORD PhyDmaIntHandler(DMA_DRV_PARAMS_ST* dev, DMA_DB_NODE_ST* transaction); 
 
#endif /*_SIANO_DMA_PLUGIN_H*/