Communication Example Code
Copyright © 2002 Marvell
CONFIDENTIAL
Doc. No. MV-S300165-00, Rev. A
May 21, 2002, Preliminary
Document Classification: Proprietary Information
Page 159
0x3000);
/* alocates buffers to all the tx descriptors */
allocBuffersForNicTxDescriptors(ETHERNET_DOWNLOADING_TX_PORT);
/* override the rx priority to receive every thing in the lowest priority */
etherGetDefaultPortConfig(&portConfig,ETHERNET_DOWNLOADING_PORT);
portConfig.portext |= OVERRIDE_RX_PRIORITY;
etherInitPort(&portConfig,ETHERNET_DOWNLOADING_PORT);
E.2 Ethernet API
ethernetLow.c: Ethernet register manipulation and MIB counter API + MII register manipulation
(PHY).
ethernetLow.h: Ethernet function and structure declaration.
ethernet.c : Ethernet port initialization code.
sdmaLow.c: SDMA register manipulation and initializations.
sdmaLow.h: SDMA functions and structures declaration.
sdma.c: SDMA memory allocation and transmit packet routines.
sdma.h: SDMA structs and function declaration.
STATUS wanTxPacket (STRUCT_TX* Transmit)
{
int i;
TX_DESC* pCurrTxDesc;
TX_DESC* pLastTxDesc;
TX_DESC* pFirstTxDesc;
/* get the current tx descriptor from a table (in the cache) */
pCurrTxDesc = (TX_DESC*)getCurrentTxDescriptor(ETHERNET_DOWNLOADING_TX_PORT);
/* if the owner is the GT return ERROR to prevant destroy data */
if(pCurrTxDesc->cmd_sts & OWNER_BY_GT)
{
return ERROR;
}
pFirstTxDesc = pCurrTxDesc;
pLastTxDesc = pCurrTxDesc;
*(UINT32*)(&(pFirstTxDesc->cmd_sts)) = FIRST | ENABLE_INTERRUPT | PADDING;