xcb | 1 Sep 05:36 2004

ppp and gprs problem?

lwip-users:	
	I use lwip and ppp(newest version) to connect gprs,first my link is up,show down:
"pppLinkStatusCB  PPPERR_NONE 
local  IP address 10.95.25.125
remote IP address 192.168.254.254
primary   DNS address 211.138.151.161
secondary DNS address 211.136.18.171"

i do nothing about 10 secs,the link is auto down ,see down debug info.

my ppp debug info :

lcp_init: xmit_accm=0 0 0 0

pppOpen Ok
pppMain: unit 0: Connecting
pppStartCB: unit 0
ppp_set_xaccm[0]: outACCM=0 0 0 0
ppp_send_config[0]: outACCM=FF FF FF FF
ppp_recv_config[0]: inACCM=0 0 0 0
lcp_lowerup: asyncmap=0 0 0 0
LCP: lowerup state 0 -> 2
auth_reset: 0
lcp_addci: L opt=2 0
lcp_addci: L opt=5 7812A0B0
lcp_addci: opt=7
lcp_addci: opt=8
pppWrite[0]: len=46
fsm_sdata(LCP): Sent code 1,1,20.
LCP: sending Configure-Request, id 1
(Continue reading)

jean | 1 Sep 09:16 2004

RE: Remote tcp connection with TAPIF interface

Hello all,

I'm still trying to solve the problem of the remote tcp connection
("connect(...)" more precisely) which doesn't work with the (same)
configuration described below.

Leon Woestenberg advises me to disable ETHARP_QUEUEING, unfortunately it
doesn't solved the problem.
So, i try to change the tapif configuration by setting the hardware address
of tapif with the system address of tap0 (obtained by "ioctl"), here is the
example of code in low_level_init(..) in tapif.c:

*************************************************************	
    .....
	if (ioctl(tapif->fd, TUNSETIFF, (void *) &ifr) < 0) {
      perror("tapif_init: "DEVTAP" ioctl TUNSETIFF");
      exit(1);
    }
      /***********************
	s = socket(PF_INET, SOCK_DGRAM, 0);
	ioctl(s, SIOCGIFHWADDR, &buffer);
	for(int i =0;i<6;i++)
	 tapif->ethaddr->addr[i]= buffer.ifr_hwaddr.sa_data[i]
      *********/	 
}
#endif /*linux*/
....

***************************************************

(Continue reading)

Andreas Becker | 1 Sep 11:44 2004
Picon

Re: Remote tcp connection with TAPIF interface

Hello Gilbert,

I did not read your message in detail, but did your read my message 
"Re: [lwip-users] simhost linux-bridge" from 05.Aug.2004 ?
I had an Problem with ethernet broadcasts and the TAPIF with an Ethernet 
bridge.

Hope this helps.

--

-- 
Dipl.-Ing.(FH) Andreas Becker
Entwicklung

dSys e.K.
Soeflinger Str. 100
D-89077 Ulm
Tel:  +49.731.151579-1
Fax: +49.731.151579-9
web: www.dsys.de
Craig Graham | 2 Sep 12:00 2004
Picon

Re: SMSC LAN 91C111 vs Davicom DM9000

On Wednesday 25 August 2004 10:48, Nishen Naidu wrote:
> Hi All,
>
> We are currently looking to purchase either the
> SMSC LAN 91C111 or the Davicom DM9000 for use with the lwip stack.
> Any idea which ethernet controller would be better?
> Also, does anyone have the lwip ports that uses these ethernet controllers?
>
> Thanks
> Nishen

Just got back off my holidays (hence the delayed reply to this one....).

I'm using the SMSC91C111 part with LWIP (on a PPC405 based IBM Vulcan) with no 
problems......I'd post our driver, but as it's just based on code poached 
from the one in IBM's OpenBIOS code, there's no real benefit to it......

It's not as straightforward to program for as the Davicom part (but I didn't 
make the decision on which chip to use - apparently we got a good deal on 
volume pricing that made the SMSC part more attractive).

Laters,
Craig.
Chris WIlliams | 2 Sep 12:33 2004
Picon
Picon

Checksum problem with lwip_chksum()

I have had problems with checksums, and traced a problem in
lwip_chksum().

The problem is to do with alignment:

I am using Hitachi H8 which is 2 byte aligned and I have set

#define MEM_ALIGNMENT           2

The problem is that a definition of the kind:

char *text = "This is text";

is BYTE aligned.

If you try to send this with the following call:

tcp_write(port,text,strlen(text),0);

that is without copy, you can fail to get the correct checksum from
lwip_chksum(). This assumes that ALL the data it receives will be 2 byte
aligned. 

This caused one of my applications to always fail. If you change the
call to:

tcp_write(port,terminal,length,1);

then it works OK because it copies the data into a pbuf first which IS
correctly aligned.
(Continue reading)

John Taylor | 2 Sep 13:29 2004

RE: Checksum problem with lwip_chksum()

>Has anybody else seen this problem? 
Yes. I also had to modify lwip_chksum() to be byte oriented.

>Is it a particular problem of the H8
It's not H8 specific.  It is problem with all processors that require
16bit words to be aligned on an even boundary.   However, as you
mentioned the problem only show ups when a pbuf is referencing
"externally managed packet contents" AND that content is not aligned -
as your literal string example.

<sidebar>The H8 is particular annoying in that it does *not* throw a
hardware exception when attempting to read words from odd addresses.
You just get garbage for the odd byte and the CPU goes on its merry way.
Makes debugging alignment issues a joy ;-).</sidebar>

-----Original Message-----
From:
lwip-users-bounces+jtaylor=shift-right.com@...
[mailto:lwip-users-bounces+jtaylor=shift-right.com@...]
On Behalf
Of Chris WIlliams
Sent: Thursday, September 02, 2004 6:33 AM
To: lwip-users@...
Subject: [lwip-users] Checksum problem with lwip_chksum()

I have had problems with checksums, and traced a problem in
lwip_chksum().

The problem is to do with alignment:

(Continue reading)

Paul C | 2 Sep 13:33 2004
Picon

Re: Checksum problem with lwip_chksum()

I have always used tcp_write( ...,1);
Now I look back at lwip_chksum() I remember finding 
the same issue. As the copy function aligns the 
data I decided that was easiest to copy all data.

Can you post your code?

Paul

On Thu, 2 Sep 2004 11:33:12 +0100, "Chris WIlliams"
<chris@...> said:
> 
> Has anybody else seen this problem? Is it a particular problem of the H8
> (Paul C, did you have any problem here?). Would anybody like me to post
> my new code?
> 
> Chris.
John Taylor | 2 Sep 13:48 2004

RE: Checksum problem with lwip_chksum()

> Can you post your code?
Here is may hack.  I do not how efficient it is with respect to a true
byte oriented checksum - but it was a quick fix.

In lwip_chksum(), in the for loop - replace: 

	acc = acc + *((u16_t *)dataptr)++;

with
	/* !srt: read buffer byte-wise to resolve alignment issues! */
     *((u8_t*)(&temp)+0) = *((u8_t*)dataptr);
     *((u8_t*)(&temp)+1) = *((u8_t*)dataptr+1);
      acc += temp;

where 'temp' is a local variable declared as:

  	volatile u16_t temp; /* !srt: work var for intermediate value */

-----Original Message-----
From:
lwip-users-bounces+jtaylor=shift-right.com@...
[mailto:lwip-users-bounces+jtaylor=shift-right.com@...]
On Behalf
Of Paul C
Sent: Thursday, September 02, 2004 7:34 AM
To: Mailing list for lwIP users; Mailing list for lwIP users
Subject: Re: [lwip-users] Checksum problem with lwip_chksum()

I have always used tcp_write( ...,1);
Now I look back at lwip_chksum() I remember finding 
(Continue reading)

jean | 2 Sep 15:09 2004

RE: Remote tcp connection with TAPIF interface

Hello Andreas,

Thanks for answering my mail. In, fact, i try your solution (a good one)
explained in your mail "Re: [lwip-users] simhost linux-bridge" from
05.Aug.2004" , it does work with ARP request and reply because ethernet
broadcast is used...thanks..
However, for a unicast tcp connection, I notice that IP packets manage to
exit the client side ("connect" fucntion), they reach the remote Bridge
(br1) on the "server" side, but once they are on this machine, the packets
are not "forwarded" to TAP0 interface.... (tcpdump).

Maybe a bad configuration... or the pakets send by "do_connect" are not IP
compliant ????

Thanks for your help...

Jean-louis

-----Message d'origine-----
De: Andreas Becker [mailto:andreas.becker@...]
Date: mercredi 1 septembre 2004 11:45
À: Mailing list for lwIP users
Objet: Re: [lwip-users] Remote tcp connection with TAPIF interface

Hello Gilbert,

I did not read your message in detail, but did your read my message 
"Re: [lwip-users] simhost linux-bridge" from 05.Aug.2004 ?
I had an Problem with ethernet broadcasts and the TAPIF with an Ethernet 
bridge.
(Continue reading)

Chris WIlliams | 2 Sep 21:14 2004
Picon
Picon

RE:Re: Checksum problem with lwip_chksum()

We all have our own way of coding. This is my routine at the moment.

I can't tell if this is faster of slower than John Taylors. If people
find this of use, could it be included properly?

Good luck.

static u16_t
lwip_chksum(void *dataptr, int len)
{
  u32_t acc = 0;
        unsigned char *dp = (unsigned char *)dataptr;
        int half_len;

        for(half_len = len / 2;half_len;half_len--){
                acc += ((u16_t)*dp++) << 8;
                acc += *dp++;
        }
        if(len & 1){
                acc += ((u16_t)*dp++) << 8;
        }

  acc = (acc >> 16) + (acc & 0xffffUL);

  if ((acc & 0xffff0000L) != 0) {
         acc = (acc >> 16) + (acc & 0xffffUL);
  }
  return (u16_t)acc;
}

(Continue reading)


Gmane