lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-users] Odd byte packets in LWIP


From: Nishen Naidu
Subject: RE: [lwip-users] Odd byte packets in LWIP
Date: Wed, 12 Nov 2003 14:48:43 +0200

Hi

Thanks guys,
I've solved the problem with my odd length packets.
I am using the cs8900 card in IO Mode so the code is a little different.
Instead of copying the data to a buffer, I just saved the byte from
the odd packet and used the logic below. It works quite well.


  /****** Step 5: copy Tx data into CS8900's buffer*/
     /* This actually starts the Txmit*/
       for(q = p; q != NULL; q = q->next)
      {

      /* if previous packet is odd then we take the 1st byte of the current
      packet together with the last byte of the previous packet and send it
      to the ethernet card */

    if (oddflag==1)
    {
       ptr8 = (u8_t *)q->payload + 1;
       ptr = (u16_t *)ptr8;
       pktlen = q->len - 1;
          ptrodd = (u16_t *)q->payload;
          tempword = ((tempword ) | (*ptrodd<<8));
       outword(CS8900_RTDATA, tempword);
       oddflag = 0;

    }
    else
    {
       ptr = (u16_t *)q->payload;
       pktlen = q->len;
    }


        // Send the data from the pbuf to the interface, one pbuf at a
        // time. The size of the data in each pbuf is kept in the ->len
        // variable.
         for(i = 0; i < pktlen/2; i ++)
         {

       outword(CS8900_RTDATA, *(ptr++));


         }


       /* if the length is odd */
     if (pktlen%2 == 1)
     {
      tempword = *((u8_t *)ptr);
      oddflag = 1;

     }


       }


    /* Finally write last word if packet is odd */
  if (oddflag==1)
  {

       outword(CS8900_RTDATA, tempword);
       oddflag = 0;

    }



-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of Jan
Wester
Sent: 11 November 2003 16:13
To: Mailing list for lwIP users
Subject: SV: [lwip-users] Odd byte packets in LWIP


Hi
We have also tested CS8900, we solved the problem by adding a 2k buffer to
read out all payloads to and sened that to the controller.
You can't add space to you payloads, it corrupt your data
//Jan
-----Ursprungligt meddelande-----
Från: address@hidden
[mailto:address@hidden Nishen Naidu
Skickat: den 11 november 2003 13:00
Till: Mailing list for lwIP users
Ämne: Re: [lwip-users] Odd byte packets in LWIP


Hi,

I'm using a c8900 ethernet chip and I do know it
has a problem wit odd length packets.
Any idea what a solution to this problem might be?
Do you automatically make all the packets you send out even length?
I could not do this since the client on the other side requires the packet
length to be correct i.e. odd in this case.
The packets get sent out correctly if I make the packet even just before I
call
the netconn_write, but I don't want to do it this way due to the above
reason.
If I make the 'frame length' in the ethernet driver fot lwip even then the
packets
still do not get send correctly.
Any ideas?

Thanks
Nishen


----- Original Message -----
From: Jan Wester
To: Mailing list for lwIP users
Sent: Tuesday, November 11, 2003 11:31 AM
Subject: SV: [lwip-users] Odd byte packets in LWIP


Hi
I had problem with odd length in the driver for Ethernet Controller,
depending on the hardware how the Ethernet Controller is connected
to the processor.
We use ARM with Davicom Ethernet Controller.
We also got problem with odd startaddress for buffer, but I think what is
ARM specific.
file://Jan
-----Ursprungligt meddelande-----
Från: address@hidden
[mailto:address@hidden Nishen Naidu
Skickat: den 11 november 2003 07:29
Till: Mailing list for lwIP users
Ämne: [lwip-users] Odd byte packets in LWIP


Hi

I'm having a problem sending out packets of odd length on certain occasions.
Does lwip work well with odd length packets?
I read the following comment in some lwip sample code:
/*

Important!!! LwIP data alignment issue:
   As of now LwIP code does not handle odd byte length packets properly. So
round packets to even byte
   length by adding space characters (' '). This is true only for processors
that cannot handle
   mis-aligned memory access.

*/

is this correct??

Thanks
Nishen



_______________________________________________
lwip-users mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/lwip-users






reply via email to

[Prev in Thread] Current Thread [Next in Thread]