We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
DWORD EMACReceive( DWORD *EMACBuf ) { DWORD RxProduceIndex, RxConsumeIndex; DWORD RxLength = 0; DWORD Counter = 0; /* the input parameter, EMCBuf, needs to be word aligned */ RxProduceIndex = MAC_RXPRODUCEINDEX; RxConsumeIndex = MAC_RXCONSUMEINDEX; if ( RxProduceIndex == EMAC_RX_DESCRIPTOR_COUNT ) { /* reach the limit, that probably should never happen */ MAC_RXPRODUCEINDEX = 0; CurrentRxPtr = EMAC_RX_BUFFER_ADDR; } /* a packet has arrived. */ if ( RxProduceIndex != RxConsumeIndex ) { if ( RxProduceIndex < RxConsumeIndex ) /* Wrapped around already */ { /* take care of unwrapped, RxConsumeIndex to EMAC_RX_DESCERIPTOR_COUNT */ RxLength += EMACReceiveFractions( RxConsumeIndex, EMAC_RX_DESCRIPTOR_COUNT ); Counter++; PacketReceived = TRUE; /* then take care of wrapped, 0 to RxProduceIndex */ if ( RxProduceIndex > 0 ) { RxLength += EMACReceiveFractions( 0, RxProduceIndex ); Counter++; } } else /* Normal process */ { RxLength += EMACReceiveFractions( RxConsumeIndex, RxProduceIndex ); Counter++; } } return( RxLength ); }
This is my EMACReceive function and
#define MAC_RXPRODUCEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x114)) /* Rx produce index reg (RO) */ #define MAC_RXCONSUMEINDEX (*(volatile unsigned long *)(MAC_BASE_ADDR + 0x118)) /* Rx consume index reg */
Execution skip the receiving portion bescause RxProduceIndex = RxConsumeIndex = 0
What wil be the problem
Thank you
check wether your interrupt part is working... when a packet is recieved, interrupt has to be generated. unless interrupt is generated u wont recieve the packet
Regards, Gayathri.K