Line 11... |
Line 11... |
|
|
#ifndef _DMA_CHAN_H_
|
#ifndef _DMA_CHAN_H_
|
#define _DMA_CHAN_H_
|
#define _DMA_CHAN_H_
|
|
|
#include "pexioctl.h"
|
#include "pexioctl.h"
|
|
#include "memory.h"
|
|
|
#define PE_EXT_FIFO_ID 0x0018
|
#define PE_EXT_FIFO_ID 0x0018
|
|
|
typedef void (*TASKLET_ROUTINE)(unsigned long);
|
typedef void (*TASKLET_ROUTINE)(unsigned long);
|
|
|
Line 61... |
Line 62... |
|
|
u32 m_BlockCount; //Количество блоков для DMA
|
u32 m_BlockCount; //Количество блоков для DMA
|
u32 m_BlockSize; //Размер одного блока DMA
|
u32 m_BlockSize; //Размер одного блока DMA
|
|
|
SHARED_MEMORY_DESCRIPTION m_pBufDscr; //Описатель для адресов блоков DMA каждый элемент содержит
|
SHARED_MEMORY_DESCRIPTION m_pBufDscr; //Описатель для адресов блоков DMA каждый элемент содержит
|
|
SHARED_MEMORY_DESCRIPTION m_BufDscrVA;
|
|
dma_addr_t m_BufDscrPA;
|
|
/*
|
|
DMA_CHAINING_DESCRIPTOR *m_pScatterGatherTableVA;
|
|
dma_addr_t m_pScatterGatherTablePA;
|
|
|
|
DMA_CHAINING_DESCRIPTOR *m_SGTableDscrVA;
|
|
dma_addr_t m_SGTableDscrPA;
|
|
*/
|
|
|
DMA_CHAINING_DESCR_EXT *m_pScatterGatherTableExt; //Содержит массив для организации цепочек DMA (v2)
|
DMA_CHAINING_DESCR_EXT *m_pScatterGatherTableExt; //Содержит массив для организации цепочек DMA (v2)
|
u32 m_ScatterGatherBlockCnt; //Количество элементов-дескрипторов цепочек DMA
|
u32 m_ScatterGatherBlockCnt; //Количество элементов-дескрипторов цепочек DMA
|
SHARED_MEMORY_DESCRIPTION m_SGTableDscr; //Описатель массива цепочек DMA
|
SHARED_MEMORY_DESCRIPTION m_SGTableDscr; //Описатель массива цепочек DMA
|
u32 m_ScatterGatherTableEntryCnt; //Количество блоков для DMA
|
u32 m_ScatterGatherTableEntryCnt; //Количество блоков для DMA
|
|
|
TASKLET_ROUTINE m_DpcForIsr;
|
TASKLET_ROUTINE m_DpcForIsr;
|
};
|
};
|
|
|
struct CDmaChannel* CDmaChannelCreate( u32 NumberOfChannel,
|
struct CDmaChannel* CDmaChannelCreate( u32 NumberOfChannel,
|
|
TASKLET_ROUTINE dpc,
|
void *m_Board,
|
void *m_Board,
|
struct device *dev,
|
struct device *dev,
|
u32 cbMaxTransferLength,
|
u32 cbMaxTransferLength,
|
u16 idBlockFifo,
|
u16 idBlockFifo,
|
int bScatterGather );
|
int bScatterGather );
|
void CDmaChannelDelete(struct CDmaChannel *dma);
|
void CDmaChannelDelete(struct CDmaChannel *dma);
|
int RequestMemory(struct CDmaChannel *dma, void **ppMemPhysAddr, u32 size, u32 *pCount, void **pStubPhysAddr, u32 bMemType);
|
int RequestMemory(struct CDmaChannel *dma, void **ppMemPhysAddr, u32 size, u32 *pCount, void **pStubPhysAddr, u32 bMemType);
|
void ReleaseMemory(struct CDmaChannel *dma);
|
int ReleaseMemory(struct CDmaChannel *dma);
|
int RequestSysBuf(struct CDmaChannel *dma, void **pMemPhysAddr);
|
int RequestSysBuf(struct CDmaChannel *dma, void **pMemPhysAddr);
|
void ReleaseSysBuf(struct CDmaChannel *dma);
|
int ReleaseSysBuf(struct CDmaChannel *dma);
|
int RequestSGList(struct CDmaChannel *dma);
|
int RequestSGList(struct CDmaChannel *dma);
|
void ReleaseSGList(struct CDmaChannel *dma);
|
int ReleaseSGList(struct CDmaChannel *dma);
|
int RequestStub(struct CDmaChannel *dma, void **pStubPhysAddr);
|
int RequestStub(struct CDmaChannel *dma, void **pStubPhysAddr);
|
void ReleaseStub(struct CDmaChannel *dma);
|
void ReleaseStub(struct CDmaChannel *dma);
|
int SetScatterGatherListExt(struct CDmaChannel *dma);
|
int SetScatterGatherListExt(struct CDmaChannel *dma);
|
|
int SetScatterGatherListExtUser(struct CDmaChannel *dma);
|
void FreeUserAddress(struct CDmaChannel *dma);
|
void FreeUserAddress(struct CDmaChannel *dma);
|
u32 NextDmaTransfer(struct CDmaChannel *dma);
|
u32 NextDmaTransfer(struct CDmaChannel *dma);
|
int SetScatterGatherList(struct CDmaChannel *dma);
|
int SetScatterGatherList(struct CDmaChannel *dma);
|
int SetDmaDirection(struct CDmaChannel *dma, u32 DmaDirection);
|
int SetDmaDirection(struct CDmaChannel *dma, u32 DmaDirection);
|
void SetDmaLocalAddress(struct CDmaChannel *dma, u32 Address);
|
void SetDmaLocalAddress(struct CDmaChannel *dma, u32 Address);
|
Line 105... |
Line 117... |
u32 GetAdmNum(struct CDmaChannel *dma);
|
u32 GetAdmNum(struct CDmaChannel *dma);
|
u32 GetTetrNum(struct CDmaChannel *dma);
|
u32 GetTetrNum(struct CDmaChannel *dma);
|
void GetSGStartParams(struct CDmaChannel *dma, u64* SGTableAddress, u32* LocalAddress, u32* DmaDirection);
|
void GetSGStartParams(struct CDmaChannel *dma, u64* SGTableAddress, u32* LocalAddress, u32* DmaDirection);
|
int StartDmaTransfer(struct CDmaChannel *dma, u32 IsCycling);
|
int StartDmaTransfer(struct CDmaChannel *dma, u32 IsCycling);
|
u32 SetDoneBlock(struct CDmaChannel *dma, long numBlk);
|
u32 SetDoneBlock(struct CDmaChannel *dma, long numBlk);
|
void DmaDpcForIsr( unsigned long Context );
|
//void DmaDpcForIsr( unsigned long Context );
|
|
|
#endif //_DMA_CHANNEL_H_
|
#endif //_DMA_CHANNEL_H_
|
|
|
//
|
//
|
// End of File
|
// End of File
|