lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] lwip on w32 platform


From: Yigal Hochberg
Subject: Re: [lwip-users] lwip on w32 platform
Date: Thu, 25 Feb 2010 07:15:50 -0500

Thanks Simon:

The "solution" is in ethernetif.c code.
Please see below:

On Thu, Feb 25, 2010 at 1:42 AM, Simon Goldschmidt <address@hidden> wrote:

Yigal Hochberg wrote:
> I am trying to make the latest cvs lwip work on w32 platform using
> msvc60.

/contrib/ports/win32 already includes a netif driver using packet.lib, it seems you are using a different netif driver? Unless there's a specific need to do so, I'd suggest to use the existing driver, as it does work.

The contrib/win32 pcap related code cannot be compiled with the latest pcap.
The pcap code I use is not the problem.
 
> [..]
> 2. sys_timeouts_mbox_fetch() enters tight loop (goto again)
>    never gets to read the Ethernet port.

There's no goto code in '/contrib/ports/win32/sys_arch.c'!

sys_timeouts_mbox_fetch() is in  core/timres.c. I user cvs-1.8
It has a "goto again".

This is where timeouts are processed and mail-box is read.
 
> Please advise.

Please try the complete (and up-to-date!) win32 port instead of using only parts of it and being suprised it doesn't just work.

The contrib pcap code cannot be compiled with latest pcap.

The problem was the "crude"  ethernetif.c as in comes in cvs.
I had to add a low-level reader thread (as in older code):

...
  /* Do whatever else is needed to initialize interface. */ 
  /* EHTERNET_THREAD_PRIO is set to 0. */
  sys_thread_new("ether_input", ethernetif_input, netif, 0, 0);

} /* end low_level_init() */
....

Than add a loop in the reader ethernetif_input():

  /* move received packet into a new pbuf */
  while (1)
  {
      p = low_level_input(netif);
      /* no packet could be read, silently ignore this */
      if (p == NULL)
          /*return;*/
          continue;

      /* points to packet payload, which starts with an Ethernet header */
      ethhdr = p->payload;

      switch (htons(ethhdr->type)) {
          /* IP or ARP packet? */
        case ETHTYPE_IP:
        case ETHTYPE_ARP:
#if PPPOE_SUPPORT
  /* PPPoE packet? */
  case ETHTYPE_PPPOEDISC:
  case ETHTYPE_PPPOE:
#endif /* PPPOE_SUPPORT */
            /* full packet send to tcpip_thread to process */
            if (netif->input(p, netif)!=ERR_OK)
            { LWIP_DEBUGF(NETIF_DEBUG, ("ethernetif_input: IP input error\n"));
                pbuf_free(p);
                p = NULL;
            }
            break;
           
        default:
            pbuf_free(p);
            p = NULL;
            break;
      } /* switch ther type */

  } /* while true */






 
Simon
--
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users



--
Yigal


reply via email to

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