[vortex] How to interpret raw packet data from NIC

amita_bi at ece.concordia.ca amita_bi at ece.concordia.ca
Thu Dec 23 18:47:34 PST 2004


Hi,

I am tinkering with the 3com905TXB (359x.c) driver and NIC card.
I am trying to extract the data which has been just uploaded (by DMA bus master)
by the NIC, I am picking up the data from the interrupt service routine, instead
of passing it up using netif_rx() call.

I am able to pick up the data all right, but but not able to make head or tail
out of it.

I want to understand this packets contents, but till now I have not been able to
match anything with the standard IP header.

my final objective is to write a minimal UDP/IP stack from scratch. si I wanted
this data for testing purpose.

Can any one give pointer what am I missing ? Is it a big and little endian
conversion problem ?

I am using PII intel, Redhat Linux, and following is the code segment that I
used within the boomerang_rx(). I am using flat memory area, instead of sk_buff
to receive the data from NIC. rx_skbuff[entry] is just a char pointer to that
memory area.
i tried to read the memory using a striding int pointer, then de-referenced that
int pointer and printed the content in hex in the log with printk, i used both
original version and cpu native version. both appear same.
***

memcpy(skb_put(skb, pkt_len),  vp->rx_skbuff[entry],
					   pkt_len);


int_ptr= (int *)vp->rx_skbuff[entry];
printk("<1>mapdevice:ISR:At %d : %d:", entry, pkt_len);

for (j=0;j<80/sizeof(int);j++) {printk("<1>%04x ",
le32_to_cpu(*int_ptr));int_ptr++;}
		printk("<1>\n");

int_ptr= (int *)vp->rx_skbuff[entry];
		printk("<1>mapdevice:ISR:");
for (j=0;j<80/sizeof(int);j++) {printk("<1>%04x ", *int_ptr);int_ptr++;}
		printk("<1>\n");


thanks for looking into my problem.

regards
amitava




More information about the vortex mailing list