WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2007-May-22 19:53:43

terrysu
Member
Registered: 2007-Apr-26
Posts: 7

Question about using DMA with EMAC(interrupt enabled)

Hi, we are working using interrupt with EMAC to simply transmit packet received from hostPC via the WARP board back to the hostPC.
The FIFO mode works out okay, but we not sure how to use simple DMA mode of the EMAC. The updated Warp_MAC files has the Macframe structure. Is there any significance of

volatile Xuint32 *data __attribute__ ((aligned (8)) );

isn't each data packet segmented into 8 bits, why the 32bits?

Also, shoiuld we make use of these 2 function if we simply want to trasmit the received packet on WARP board back to the sending hostPC?

warpmac_setRxBuffer(Macframe* packet) and warpmac_setRxBuffer(Macframe* packet)

Thanks in advance.

Offline

 

#2 2007-May-23 21:25:03

chunter
Administrator
From: Mango Communications
Registered: 2006-Aug-24
Posts: 1212

Re: Question about using DMA with EMAC(interrupt enabled)

Hi,

In the "xemac_intr_simple_dma_example.c" file within the EDK folder, there is this piece of code:

Code:

/*
 * The buffer memory needs to be 64-bit aligned if using the PLB 10/100 EMAC,
 * or 32-bit aligned if using the OPB 10/100 EMAC. We chose to use a gnu
 * compiler attribute to get the 64-bit alignment in this example, but you
 * may need to implement another mechanism based on your needs.
 */
static Xuint32 TxFrame[XEM_MAX_FRAME_SIZE_WORDS] __attribute__ ((aligned (8)));
static Xuint32 RxBuffer[XEM_MAX_FRAME_SIZE_WORDS] __attribute__ ((aligned (8)));

For the second part of your question, I'm slightly confused about what you are referring to. Are you trying to receive a packet from ethernet via the fiforecv function and loop it back to the ethernet interface? If so, the pieces of example code in the emac driver directory do this and are very well documented. I hope that helps.

Offline

 

Board footer