From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23994 invoked by alias); 10 Jun 2014 08:27:46 -0000 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org Received: (qmail 23975 invoked by uid 89); 10 Jun 2014 08:27:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail.ecoscentric.com Received: from albus.ecoscentric.com (HELO mail.ecoscentric.com) (212.13.207.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 10 Jun 2014 08:27:43 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 512) id C117CA82FFC; Tue, 10 Jun 2014 09:27:40 +0100 (BST) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001873] Patches to upgrade lwip to 1.4.1 Date: Tue, 10 Jun 2014 08:27:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: lwIP X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: o.uzenkov@unicore.co.ua X-Bugzilla-Status: NEEDINFO X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014/txt/msg00203.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001873 --- Comment #48 from Oleg Uzenkov --- Ilija, (In reply to comment #47) > Oleg > > (In reply to comment #46) > > Thank you for your report. I have some additional questions. > > > Hi Ilija, > > > > [SNIP] > > > > > (This is just a snipet from the log.) > > Apparently, it meant that I did not receive anything from GPRS modem through > > the serial port. That happened quite often, however, successful connection > > did happen also. > > What was your serial line setting: baud rate, (hardware) handshaking ? Serial settings: 9600, 8N1 (no hw/sw control) > > > > > But when I started using GPRS VPN service from my cellular network provider > > this problem has not shown up yet. I have tested it several times and there > > was always a successfull connection. So I believe now, the problem was > > related to the quality of service and not to the PPP (1.4.1) implementation. > > Can you try different locations? I tired two providers. > > Ilija Another problem came up: Sometimes when ppp connection gets terminated (it can happen all of a sudden, not sure why) and the stack is then trying to reconnect (i have a state machine logic, see below), it cannot open serial port (pppOpen, pd is negative, see below) again after it has been closed with pppClose. Please note, sometimes it can reopen serial port, but not always. The lwip stack is in simple mode (i.e. NO_SYS=1). With 1.3.2 version of ppp I do not have these problems. Here is the code snippet with the logic: void ppp_service::_thread_func (cyg_addrword_t p) { int err; cyg_uint32 len; cyg_uint32 cfg_data; int pd = -1; sio_fd_t sd; chat_t chat; int count; static const cyg_uint32 buf_length = 128; u8_t rxbuf[buf_length]; ppp_service * srv = reinterpret_cast (p); /*configure serial port */ err = cyg_io_lookup (SERIAL_PORT, &sd); LOG_ASSERT (err == ENOERR); LOG_ASSERT (sd != NULL); /* read port configuration */ cyg_serial_info_t port_info; cyg_uint32 port_info_len = sizeof (port_info); err = cyg_io_get_config (sd, CYG_IO_GET_CONFIG_SERIAL_INFO, &port_info, &port_info_len); LOG_ASSERT (err == ENOERR); /* update port configuration */ port_info_len = sizeof (port_info); port_info.baud = CYGNUM_SERIAL_BAUD_9600; port_info.stop = CYGNUM_SERIAL_STOP_1; port_info.parity = CYGNUM_SERIAL_PARITY_NONE; port_info.word_length = CYGNUM_SERIAL_WORD_LENGTH_8; err = cyg_io_set_config (sd, CYG_IO_SET_CONFIG_SERIAL_INFO, &port_info, &port_info_len); LOG_ASSERT (err == ENOERR); /** * configure cyg_io_read to be non-blocking * since blocking cannot be used in interrupts */ cfg_data = 0; len = sizeof(cfg_data); err = cyg_io_set_config (sd, CYG_IO_SET_CONFIG_READ_BLOCKING, &cfg_data, &len); LOG_ASSERT (err == ENOERR); while (1) { switch (srv->_init_state) { case CHAT_INIT: chat = chat_new(sd, chat_items, CHAT_TIMEOUT, srv->_chat_cb, srv->_chat_send_cb, static_cast(srv)); srv->_init_state = CHAT_RUN; break; case CHAT_RUN: chat_poll(chat); break; case CHAT_FINISH: chat_free(chat); chat = NULL; if (srv->_chat_ok) { srv->_init_state = PPP_INIT; } else { srv->_init_state = CHAT_INIT; } break; case PPP_INIT: pppInit(); pd = pppOpen(sd, srv->_ppp_status_cb, static_cast(srv)); if (pd < 0) { syslog (LOG_CRIT, "Cannot open PPP over serial\n"); } pppSetAuth(PPPAUTHTYPE_ANY, PPP_USER, PPP_PASSWORD); srv->_init_state = PPP_INIT_WAIT; break; case PPP_INIT_WAIT: sys_check_timeouts(); count = sio_read(sd, (u8_t*)rxbuf, buf_length); if(count > 0) { pppos_input(pd, rxbuf, count); } else { sys_msleep(1); //cyg_thread_delay(10); } srv->_init_state = PPP_UP; break; case PPP_UP: sys_check_timeouts(); count = sio_read(sd, (u8_t*)rxbuf, buf_length); if(count > 0) { pppos_input(pd, rxbuf, count); } else { sys_msleep(1); //cyg_thread_delay(10); } break; case FINISH: pppClose(pd); /* free chat if reconnect happend whilst chat init */ if (chat != NULL) { chat_free(chat); } srv->_init_state = FINISH_WAIT; break; case FINISH_WAIT: srv->_init_state = CHAT_INIT; cyg_thread_delay(20); //wait for x clks break; } cyg_thread_yield(); } } We do need to port ppp-new branch to ecos as judging from the author's comments it is more stable than the ppp implementation in vanilla 1.4.1 ppp stack (link: http://lists.gnu.org/archive/html/lwip-users/2014-03/msg00061.html) Oleg -- You are receiving this mail because: You are the assignee for the bug.