lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] PPP with NO_SYS=1 in an interrupt context


From: Mehmet Ali Ekici
Subject: [lwip-users] PPP with NO_SYS=1 in an interrupt context
Date: Tue, 14 Jun 2011 12:29:52 +0300

Hi,

We are using ti’s stellaris family for a project. TI have ported lwip but without PPP. TI’s port of  tcpip runs in ethernet interrupt context. As timers and all network related jobs executed in the interrupt context.

 

I am now porting PPP to the same context. I am preparing modem as follows

 

#if PPP_SUPPORT

  const char *username = NULL, *password = NULL;

#ifdef PPP_USERNAME

  username = PPP_USERNAME;

#endif

#ifdef PPP_PASSWORD

  password = PPP_PASSWORD;

#endif

  UARTprintf("pppInit\n");

  pppInit();

  // ppp auth none

  pppSetAuth(PPPAUTHTYPE_ANY, username, password);

 

After this  I am calling  the ppp functions in the ethernet interrupt’s context as follows

 

    if((g_ulLocalTimer - g_pppCheckTimer) >= 150)

    {

        g_pppCheckTimer = g_ulLocalTimer;

 

      sys_check_timeouts();

 

      count = sio_read(ppp_sio, (u8_t*)rxbuf, 1024);

      if(count > 0) {

          pppos_input(ppp_desc, rxbuf, count); 

      }        

    } 

 

 

 

 

I am wondering if you can comment if there is an issue as I am not able to set up the PPP session.

Because we are running PPP in an interrupt context we cannot use blocking sio functions.  Must sio implementations be blocking for PPP to work ?

 

Finally here is the logs I hope you can help

 

 

Executing command  : ATDt*99#

 

CONNECT

<CR><LF>CONNECT<CR><LF> len = 11 : 0

Received expected result : CONNECT

pppInit

lcp_init: xmit_accm=0 0 0 0

pppOpen: COM1

pppOverSerialOpen: unit 0: Connecting

pppStart: 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 (LS_INITIAL) -> 2 (LS_CLOSED)

auth_reset: 0

lcp_addci: L opt=2 0

lcp_addci: L opt=5 24f8b455

lcp_addci: opt=7

lcp_addci: opt=8

pppWrite[0]: len=44

ff 7d 23 c0 21 7d 21 7d 21 7d 20 7d 34 7d 22 7d 26 7d 20 7d 20 7d 20 7d 20 7d 25 7d 26 24 f8 b4 55 7d 27 7d 22 7d 28 7d 22 54 79 7e fsm_sdata(LCP): Sent code 1,1,20.

LCP: sending Configure-Request, id 1

LCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT)

pppStart: finished

System initialised

> 7e ff 7d 23 c0 21 7d 21 7d 21 7d 20 7d 2e 7d 22 7d 26 7d 20 7d 2a 7d 20 7d 20 7d 23 7d 24 c0 23 f3 4d 7e 7e ff 7d 23 c0 21 7d 24 7d 21 7d 20 7d 2e 7d 25 7d 26 24 f8 b4 55 7d 27 7d 22 7d 28 7d 22 ad 7d 35 7e

pppInProc[0]: got 69 bytes

pppInput[0]: LCP len=14

fsm_input(LCP):1,1,14

fsm_rconfreq(LCP): Rcvd id 1 state=6 (LS_REQSENT)

lcp_reqci:  ASYNCMAP=X PAP (C023)

lcp_reqci: returning CONFACK.

pppWrite[0]: len=35

7e ff 7d 23 c0 21 7d 22 7d 21 7d 20 7d 2e 7d 22 7d 26 7d 20 7d 2a 7d 20 7d 20 7d 23 7d 24 c0 23 cd ce 7e fsm_sdata(LCP): Sent code 2,1,14.

pppInput[0]: packet processed

pppInput[0]: LCP len=14

fsm_input(LCP):4,1,14

fsm_rconfnakrej(LCP): Rcvd id 1 state=8 (LS_ACKSENT)

lcp_rejci: long opt 5 rejected

lcp_rejci: void opt 7 rejected

lcp_rejci: void opt 8 rejected

lcp_addci: L opt=2 0

pppWrite[0]: len=28

ff 7d 23 c0 21 7d 21 7d 22 7d 20 7d 2a 7d 22 7d 26 7d 20 7d 20 7d 20 7d 20 5f ad 7e fsm_sdata(LCP): Sent code 1,2,10.

LCP: sending Configure-Request, id 2

pppInput[0]: packet processed

7e ff 7d 23 c0 21 7d 22 7d 22 7d 20 7d 2a 7d 22 7d 26 7d 20 7d 20 7d 20 7d 20 36 d9 7e

pppInProc[0]: got 29 bytes

pppInput[0]: LCP len=10

fsm_input(LCP):2,2,10

fsm_rconfack(LCP): Rcvd id 2 state=8 (LS_ACKSENT)

lcp_acki: Ack

ppp_send_config[0]: outACCM=0 0 a 0

ppp_recv_config[0]: inACCM=0 0 0 0

pppWrite[0]: len=16

7e ff 03 c0 21 09 00 00 08 00 00 00 00 bb 6e 7e fsm_sdata(LCP): Sent code 9,0,8.

link_established: unit 0; Lowering up all protocols...

IPCP: lowerup state 0 (LS_INITIAL) -> 2 (LS_CLOSED)

pppWrite[0]: len=36

ff 03 80 21 01 01 00 1c 03 06 00 00 00 00 02 06 00 2d 0f 00 81 06 00 00 00 00 83 06 00 00 00 00 7d 5e 84 7e fsm_sdata(IPCP): Sent code 1,1,28.

IPCP: sending Configure-Request, id 1

IPCP: open state 2 (LS_CLOSED) -> 6 (LS_REQSENT)

pppInput[0]: packet processed

7e ff 03 c0 21 0a 08 6b e4 7e

pppInProc[0]: got 10 bytes

pppInProc[0]: Dropping bad fcs 0x70d6 proto=0xc021

 

We are getting this error. What might be the reason to have it. Normally LCP is using it. How can we negotiate fcs 16 or 32 ?

 

pppDrop: pbuf len=12, addr 2000509c

7e ff 7d 23 c0 21 7d 25 7d 22 7d 20 7d 3b 41 75 74 68 65 6e 74 69 63 61 74 69 6f 6e 20 66 61 69 6c 65 64 2c 20 fe 9c 7e

pppInProc[0]: got 40 bytes

pppInput[0]: LCP len=27

fsm_input(LCP):5,2,27

fsm_rtermreq(LCP): Rcvd id 2 state=9 (LS_OPENED)

LCP terminated by peer (20004e98)

link_down: 0

IPCP: lowerdown state 6 (LS_REQSENT) -> 1 (LS_STARTING)

IPCP: close reason=LCP down state 1 (LS_STARTING) -> 0 (LS_INITIAL)

pppLinkDown: unit 0

pppRecvWakeup: unit 0

Read abort

ppp_send_config[0]: outACCM=ff ff ff ff

ppp_recv_config[0]: inACCM=0 0 0 0

pppWrite[0]: len=18

7e ff 7d 23 c0 21 7d 26 7d 22 7d 20 7d 24 94 7d 2d 7e fsm_sdata(LCP): Sent code 6,2,4.

pppInput[0]: packet processed

0d 0a 4e 4f 20 43 41 52 52 49 45 52 0d 0a

pppInProc[0]: got 14 bytes

 

 

 

 


reply via email to

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