|
From: | address@hidden |
Subject: | Re: [lwip-users] Problem with do_writemore() + LWIP for AVR32 |
Date: | Fri, 11 Dec 2009 07:13:11 +0100 |
User-agent: | Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0 |
patelbaroda wrote:
This is the netif driver from lwip port to AVR32 [..] static void ethernetif_input(void * pvParameters) { struct netif *netif = (struct netif *)pvParameters; struct pbuf *p; for( ;; ) { do { /* move received packet into a new pbuf */ p = low_level_input( netif ); if( p == NULL ) { /* No packet could be read. Wait a for an interrupt to tell us there is more data available. */ vMACBWaitForInput(100); } }while( p == NULL ); if( ERR_OK != ethernet_input( p, netif ) )
The above line is where your problems come from. It should read: if(ERR_OK != netif->input(p, netif))With that, tcpip_input (which is what netif->input points to, since it was passed to netif_add()) is called instead of ethernet_input, which makes sure that packets are first passed into the correct thread before being processed.
Simon
{ pbuf_free(p); p = NULL; } } }
[Prev in Thread] | Current Thread | [Next in Thread] |