📄 readme.txt
字号:
platformData, pointer to platform specified data structure
DESCRIPTION:
This function is called so the platform layer can clean up
any resources that may have been acquired in Platform_Initialize.
If Platform_Initialize returned 0, then this function will
not be called.
***********************************************************/
void Platform_CleanUp(
PPLATFORM_DATA platformData);
/************************************************************
FUNCTION: Platform_SetRegDW
PARAMETERS:
DWORD dwLanBase, the virtual base address returned by
Platform_Initialize
DWORD dwOffset, the byte offset into the Lan address space
where the register of interest is located.
dwOffset should be DWORD aligned.
DWORD dwVal, the value to write to the register of interest
DESCRIPTION:
This function is used to provide a platform independent
method of register access. It allows platform code
for big endian systems to do byte swapping, if necessary.
Because this function is very simple, it is recommended that
it should be implemented as inline or as a macro.
RETURN VALUE: void
************************************************************/
inline void Platform_SetRegDW(
DWORD dwLanBase,
DWORD dwOffset,
DWORD dwVal);
/************************************************************
FUNCTION: Platform_GetRegDW
PARAMETERS:
DWORD dwLanBase, the virtual base address returned by
Platform_Initialize
DWORD dwOffset, the byte offset into the Lan address space
where the register of interest is located.
dwOffset should be DWORD aligned.
DESCRIPTION:
This function is used to provide a platform independent
method of register access. It allows platform code
for big endian systems to do byte swapping if necessary.
Because this function is very simple, it is recommended that
it should be implemented as inline or as a macro.
RETURN VALUE:
The DWORD value read from the register of interest;
************************************************************/
inline DWORD Platform_GetRegDW(
DWORD dwLanBase,
DWORD dwOffset);
/***********************************************************
FUNCTION: Platform_Is16BitMode
PARAMETER:
platformData, pointer to platform specific data structure
RETURN VALUE:
TRUE if the platform is configured for 16 bit mode
FALSE if the platform is configured for 32 bit mode
NOTE: this function is not currently used.
***********************************************************/
BOOLEAN Platform_Is16BitMode(
PPLATFORM_DATA platformData);
/************************************************************
FUNCTION: Platform_RequestIRQ
DESCRIPTION:
Used to request and set up the ISR
PARAMETERS:
platformData, pointer to platform specific data structure
dwIrq,
= 0xFFFFFFFF, let this function decide what IRQ to use
= any other value is the IRQ requested by the user
pIsr, pointer to the ISR, to be registered.
dev_id, pointer to the driver specific structure
used when registering the ISR with Linux
RETURN VALUE:
TRUE if successful
FALSE is unsuccessful
************************************************************/
BOOLEAN Platform_RequestIRQ(
PPLATFORM_DATA platformData,
DWORD dwIrq,
void (*pIsr)(int irq,void *dev_id,struct pt_regs *regs),
void *dev_id);
/***********************************************************
FUNCTION: Platform_CurrentIRQ
PARAMETERS:
platformData, pointer to platform specific data structure
RETURN VALUE:
The IRQ number actually used by Platform_RequestIRQ
This may be different than the requested IRQ
***********************************************************/
DWORD Platform_CurrentIRQ(
PPLATFORM_DATA platformData);
/**********************************************************
FUNCTION: Platform_FreeIRQ
PARAMETERS:
platformData, pointer to platform specific data structure
DESCRIPTION:
uninstalls the ISR installed from Platform_RequestIRQ
**********************************************************/
void Platform_FreeIRQ(
PPLATFORM_DATA platformData);
/*********************************************************
FUNCTION: Platform_IsValidDmaChannel
PARAMETERS:
dwDmaCh, the dma channel number to test for validity
DESCRIPTION:
This function is used to test the validity of the
channels request with parameters rx_dma, and tx_dma
RETURN VALUE:
TRUE if the dma channel may be used
FALSE if the dma channel may not be used
NOTE: this function does not use PLATFORM_DATA because
it is called before the driver allocates memory for
PLATFORM_DATA
*********************************************************/
BOOLEAN Platform_IsValidDmaChannel(DWORD dwDmaCh);
/********************************************************
FUNCTION: Platform_DmaInitialize
PARAMETERS:
platformData, pointer to the platform specific data structure
dwDmaCh, the Dma channel to initialize
RETURN VALUE:
TRUE, on Success
FALSE, on Failure
********************************************************/
BOOLEAN Platform_DmaInitialize(
PPLATFORM_DATA platformData,
DWORD dwDmaCh);
/********************************************************
FUNCTION: Platform_DmaDisable
PARAMETERS:
platformData, pointer to the platform specific data structure
dwDmaCh, the Dma channel to disable
RETURN VALUE:
TRUE on success
FALSE on failure
********************************************************/
BOOLEAN Platform_DmaDisable(
PPLATFORM_DATA platformData,
const DWORD dwDmaCh);
/*******************************************************
FUNCTION: Platform_CacheInvalidate
PARAMETERS:
platformData, pointer to the platform specific data structure
pStartAddress, the starting virtual address of the region
dwLengthInBytes, the length in bytes of the region to invalidate
DESCRIPTION:
Invalidates a specified memory region if it exists in cache.
Does not necessarily write the data back to memory.
*******************************************************/
void Platform_CacheInvalidate(
PPLATFORM_DATA platformData,
const void * const pStartAddress,
const DWORD dwLengthInBytes);
/*******************************************************
FUNCTION: Platform_CachePurge
PARAMETERS:
platformData, pointer to the platform specific data structure
pStartAddress, the starting virtual address of the region
dwLengthInBytes, the length in bytes of the region to purge
DESCRIPTION:
Writes back data to a specified memory region if it
exists in cache.
*******************************************************/
void Platform_CachePurge(
PPLATFORM_DATA platformData,
const void * const pStartAddress,
const DWORD dwLengthInBytes);
/******************************************************
FUNCTION: Platform_RequestDmaChannel
PARAMETERS:
platformData, pointer to the platform specific data structure
DESCRIPTION:
If the OS supports Dma Channel allocation then this function
will use that support to reserve a dma channel.
If the OS does not support Dma Channel allocation, or a
channel can not be reserved then this function
will return TRANSFER_PIO
RETURN VALUE:
returns the DMA channel number that has been reserved
if a channel can not be reserved then return TRANSFER_PIO
******************************************************/
DWORD Platform_RequestDmaChannel(
PPLATFORM_DATA platformData);
/*****************************************************
FUNCTION: Platform_ReleaseDmaChannel
PARAMETERS:
platformData, pointer to the platform specific data structure
dwDmaChannel, the Dma channel number to be released
DESCRIPTION:
Releases the DMA channel specified by dwDmaChannel,
which was previously returned by Platform_RequestDmaChannel
If the OS supports it this function will notify the OS
that the dma channel is free to be used by other devices
******************************************************/
void Platform_ReleaseDmaChannel(
PPLATFORM_DATA platformData,
DWORD dwDmaChannel);
/*****************************************************
FUNCTION: Platform_DmaStartXfer
PARAMETERS:
platformData, pointer to the platform specific data structure
pDmaXfer, pointer to DMA_XFER structure
which describes the requested transfer
DESCRIPTION:
Begins a new dma transfer,
Should not be called if another transfer is in progress
RETURN VALUE:
TRUE if dma has begun the transfer
FALSE for any error
******************************************************/
BOOLEAN Platform_DmaStartXfer(
PPLATFORM_DATA platformData,
const DMA_XFER * const pDmaXfer);
/*******************************************************
FUNCTION: Platform_DmaGetDwCnt
PARAMETERS:
platformData, pointer to the platform specific data structure
dwDmaCh, Dma channel number
RETURN VALUE:
0, if the DMA channel is ready to handle another
request from Platform_DmaStartXfer
non zero, is the number of DWORDS left for the
dma channel to transfer
*******************************************************/
DWORD Platform_DmaGetDwCnt(
PPLATFORM_DATA platformData,
const DWORD dwDmaCh);
/******************************************************
FUNCTION: Platform_DmaComplete
PARAMETERS:
platformData, pointer to platform specific data structure
dwDmaCh, dma channel number
DESCRIPTION:
Waits for the specified dma channel to finish
transfering data. Upon return the dma channel should
be ready to handle another request from
Platform_DmaStartXfer
This function should be the same as waiting for
Platform_DmaGetDwCnt to return 0
******************************************************/
void Platform_DmaComplete(
PPLATFORM_DATA platformData,
const DWORD dwDmaCh);
/*****************************************************
FUNCTION: Platform_GetFlowControlParameters
PARAMETERS:
platformData, pointer to platform specific data structure
flowControlParameters, pointer to structure which receives
the flow control parameters.
useDma, flag which specifies whether to get flow control
parameters for PIO(FALSE) or DMA(TRUE).
DESCRIPTION:
fills the structure pointed to by flowControlParameters,
with the appropriate flow control parameters for the
current combination of ((118/117/112) or (116/115)),
(16 or 32 bit mode), and (PIO or DMA).
******************************************************/
void Platform_GetFlowControlParameters(
PPLATFORM_DATA platformData,
PFLOW_CONTROL_PARAMETERS flowControlParameters,
BOOLEAN useDma);
/******************************************************
FUNCTION: Platform_WriteFifo
PARAMETERS:
DWORD dwLanBase, the lan base address
DWORD * pdwBuf, a pointer to and array of DWORDs to
be written to the TX_DATA_FIFO
DWORD dwDwordCount, the number of DWORDs in the dword
array pointed to by pdwBuf
DESCRIPTION:
This function is during PIO transfers to write packet
data to the TX_DATA_FIFO. This function was made
platform dependent to allow platforms to perform
byte swapping on big endian systems, if necessary.
******************************************************/
void Platform_WriteFifo(
DWORD dwLanBase,
DWORD * pdwBuf,
DWORD dwDwordCount);
/******************************************************
FUNCTION: Platform_ReadFifo
PARAMETERS:
DWORD dwLanBase, the lan base address
DWORD * pdwBuf, a pointer to and array of DWORDs which
will be read from the RX_DATA_FIFO
DWORD dwDwordCount, the number of DWORDs in the dword
array pointed to by pdwBuf
DESCRIPTION:
This function is during PIO transfers to read packet
data from the RX_DATA_FIFO. This function was made
platform dependent to allow platforms to perform
byte swapping on big endian systems, if necessary.
******************************************************/
void Platform_ReadFifo(
DWORD dwLanBase,
DWORD * pdwBuf,
DWORD dwDwordCount);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -