WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2008-Aug-10 07:47:51

ragha
Member
Registered: 2008-Aug-07
Posts: 35

Opening up the Ethernet packet in WarP

Hi all,
        Has any body tried opening up the Ethernet packet that was received by the WarP and checked out the mac address or the IP address information at the WarP level. I tried to print the
Macframe *packet
for(.....
packet->data[i]
....

but the data that was printed and the data that was received are entirely different, is it because i am accesing a different memory location?
how do i then get to open ethernet packet in the WarP platform level ?

-Ragha

Offline

 

#2 2008-Aug-10 10:17:47

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

Re: Opening up the Ethernet packet in WarP

The Macframe associated with the received wireless packet does not have the Ethernet payload in it; it is only the wireless header plus a "isNew" flag that is used by some of our other MAC layers.

If you want to user code to have access to the underlying payload, you can use the "warpphy_getBuffAddr" function like it is used here

Offline

 

#3 2008-Aug-10 10:59:38

ragha
Member
Registered: 2008-Aug-07
Posts: 35

Re: Opening up the Ethernet packet in WarP

Hi Chris,
            Sorry for not giving details about the hardware/software version we are using, we are currently using
OFDM Reference Design v04 (60MB .zip file) - For kits without a 40MHz converter reference clock.
this version
and in the warpmac.h the structure is as below
typedef struct {
    volatile unsigned char pktRev;
    volatile unsigned char pktType;
    volatile unsigned char destAddr[6];
    volatile unsigned char srcAddr[6];
    volatile unsigned char currReSend;
    volatile unsigned int length;
    //volatile unsigned char *data;
   volatile Xuint32 *data __attribute__ ((aligned (8)));
    volatile unsigned int chkSum;
    volatile unsigned char isNew;
} Macframe;

In this case what should we do to access the ethernet payload with 0.4 version. It will take some time for us to have the 1.0 compatible warp boards.


-Ragha

Offline

 

#4 2008-Aug-11 09:39:33

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Opening up the Ethernet packet in WarP

The data field is definitely a pointer to the packet payload; on line 133 of warpmac.c, you can see the call:

Code:

RxStatus = XEmac_FifoRecv(EmacPtr, txPacket->data, &length);

That call initiates the DMA transfer of an Ethernet packet from the EMAC to the buffer pointed to by txPacket->data. The analogous call for received wireless packets is on line 1054:

Code:

mimo_ofdmRx_copyPayload(packet->data, (size_t)(16 + packet->length));

This one executes a memcpy from the PHY's packet buffer to the intermediate buffer pointed to by packet->data.

Are you sure you're using the right calls for handling the pointers? I always get tripped up with struct pointers which contain fields which are pointers themselves.

Offline

 

#5 2008-Aug-11 13:46:10

ragha
Member
Registered: 2008-Aug-07
Posts: 35

Re: Opening up the Ethernet packet in WarP

Hi Murphpo,
                 You are right, i actually did not make a call to this function
mimo_ofdmRx_copyPayload(packet->data, (size_t)(16 + packet->length));
and was blindly accessing the memory which was why i got wrong results.

thanks for the correction. (Now am getting the hang of WARP thanks to this forum)

-Ragha

Offline

 

Board footer