This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FW: LWIP-PPP and GPRS



-----Original Message-----
From: Кондратенко Антон Александров 
Sent: Monday, December 20, 2004 1:41 PM
To: 'Sebastian Block'
Subject: RE: [ECOS] LWIP-PPP and GPRS


I have GPRS via LWIP working OK, but after really many changes in
original lwip code. 
For example how do you think ppp_sio_read, determines the end of incoming packet ? ( if there's no hw flow control )

I have to do this:

int ppp_sio_read(void *fd, char *buf, int len)
{
	int recvd=0;
	u8_t state=0;
	while(1){
		signed int res;
		res = (signed int)sio_recv(fd);
		if(res==(-1)) return -1;
		buf[recvd]=res;
		recvd++;
		if(res==0x7E && state==0) state=1;
		if(res==0x7E && state==1) return recvd;
		if(recvd>=len) return recvd;
	}
	return -1;
}



Try it.



> -----Original Message-----
> From: ecos-discuss-owner@ecos.sourceware.org
> [mailto:ecos-discuss-owner@ecos.sourceware.org]On Behalf Of Sebastian
> Block
> Sent: Friday, December 17, 2004 3:08 PM
> To: ecos-discuss@sources.redhat.com
> Subject: [ECOS] LWIP-PPP and GPRS
> 
> 
> Hi,
> 
> I have a problem connected throught GRPS to my ISP using PPP
> I can auth at the ISP but than
> the problem begins with turn to the IPCP, where you should 
> normally get an IP 
> and so on.
> 
> I've added the output from LWIP-Stack in hope you can read 
> out more of it.
> I marked a line with <---- this line, in cause of that there 
> should be memory 
> allocation problems, but I can use the same Kernel (only 
> switching the 
> SerialLine which use to connect) to connect to my 
> linux-machine with ppp and 
> with local serial line (no GPRS) it works fine.
> 
> I hope you can help me 
> 
>  Sebastian
> 
> PS: Output of LWIP :
> 
> pppInput[0]: PAP len=5
> pap_rauthack: Rcvd id 1 s=3
> Remote message: 
> auth_withpeer_success: 0 proto=C023  <- Auth with pap = ok
> pbuf_alloc(length=0)
> pbuf_alloc: allocated pbuf 0x0203871c
> pbuf_alloc(length=0) == 0x0203871c
> pppWrite[0]: len=29
> pbuf_free(0x0203871c)
> pbuf_free: deallocating 0x0203871c
> fsm_sdata(IPCP): Sent code 1,1,22.
> IPCP: sending Configure-Request, id 1
> IPCP: open state 2 -> 6
> pbuf_free(0x0203830c)
> pbuf_free: deallocating 0x0203830c
> pppMainWakeup: unit 0 sio_read len=1504 returned 0
> memp_malloc: out of memory in pool 10  <-------- #### this line 
> upap_timeout: 0 timeout 6 expired s=4
> IPCP: timeout resending Config-Request state=6
> pbuf_alloc(length=0)
> pbuf_alloc: allocated pbuf 0x0203830c
> pbuf_alloc(length=0) == 0x0203830c
> pppWrite[0]: len=30
> pbuf_free(0x0203830c)
> pbuf_free: deallocating 0x0203830c
> fsm_sdata(IPCP): Sent code 1,1,22.
> IPCP: sending Configure-Request, id 1
> IPCP: timeout resending Config-Request state=6
> pbuf_alloc(length=0)
> pbuf_alloc: allocated pbuf 0x0203830c
> pbuf_alloc(length=0) == 0x0203830c
> pppWrite[0]: len=30
> pbuf_free(0x0203830c)
> pbuf_free: deallocating 0x0203830c
> fsm_sdata(IPCP): Sent code 1,1,22.
> IPCP: sending Configure-Request, id 1
> IPCP: timeout resending Config-Request state=6
> 
> .......
> ......
> 
> fsm_sdata(IPCP): Sent code 1,1,22.
> IPCP: sending Configure-Request, id 1
> IPCP: timeout sending Config-Requests state=6
> np_finished: 0 proto=21
> link_down: 0
> upap_lowerdown: 0 s=4
> IPCP: lowerdown state 3 -> 1
> IPCP: close reason=LCP down state 1 -> 0
> pppMainWakeup: unit 0
> Abort called
> ppp_send_config[0]: outACCM=FF FF FF FF
> ppp_recv_config[0]: inACCM=0 0 A 0
> pbuf_alloc(length=0)
> pbuf_alloc: allocated pbuf 0x0203830c
> pbuf_alloc(length=0) == 0x0203830c
> pppWrite[0]: len=44
> pbuf_free(0x0203830c)
> pbuf_free: deallocating 0x0203830c
> fsm_sdata(LCP): Sent code 5,3,32.
> LCP: close reason=No network protocols running state 9 -> 4
> LCP: timeout resending Terminate-Requests state=4
> pbuf_alloc(length=0)
> pbuf_alloc: allocated pbuf 0x0203830c
> pbuf_alloc(length=0) == 0x0203830c
> pppWrite[0]: len=44
> pbuf_free(0x0203830c)
> pbuf_free: deallocating 0x0203830c
> fsm_sdata(LCP): Sent code 5,4,32.
> LCP: timeout sending Terminate-Request state=4
> link_terminated: 0
> Connection terminated.
> pppMainWakeup: unit 0
> Abort called
> 
> -- 
> Before posting, please read the FAQ: 
> http://ecos.sourceware.org/fom/ecos
> and search the list archive: 
> http://ecos.sourceware.org/ml/ecos-discuss
> 
> 

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]