Changes to use lwip 1.2.0 with Xilinx EDK 9.1 or earlier

Dec 19, 2007 0 Replies

Below and at

formatting link
are the changes to use lwip 1.2.0 with Xilinx EDK 9.1 or earlier It seems the lwip api has changed slightly. I don't have EDK 9.2 so I don't know what version of lwip is included, but EDK 9.1 uses lwip 0.7.2.



Alan Nishioka snipped-for-privacy@nishioka.com


$ diff -Naur xemacif.c-orig xemacif.c



--- xemacif.c-orig 2007-12-18 22:59:57.893585600 -0800



+++ xemacif.c 2007-12-18 12:01:08.242739200 -0800 @@ -305,9 +305,12 @@ struct pbuf *p, struct ip_addr *ipaddr) {
  • err_t status;
  • XEmacIf_Config *xemacif_ptr = xemacif_ptr = netif_ptr->state;


- p = etharp_output(netif_ptr, ipaddr, p);



  • status = etharp_output(netif_ptr, ipaddr, p);
  • if( status != ERR_OK ) return status;

if (p != NULL) { /* send the frame */ @@ -329,7 +332,7 @@ struct netif * netif_ptr = (struct netif *) CallBackRef; XEmacIf_Config * xemacif_ptr; struct eth_hdr * ethernet_header;



- struct pbuf *p, *q;



  • struct pbuf *p;

xemacif_ptr = netif_ptr->state;



@@ -338,25 +341,19 @@ if (p != NULL) { ethernet_header = p->payload;


- q = NULL; switch (htons(ethernet_header->type)) { case ETHTYPE_IP:



- q = etharp_ip_input(netif_ptr, p);



  • etharp_ip_input(netif_ptr, p); pbuf_header(p, -14); netif_ptr->input(p, netif_ptr); break; case ETHTYPE_ARP:

- q = etharp_arp_input(netif_ptr, &(xemacif_ptr->ethaddr), p);



  • etharp_arp_input(netif_ptr, &(xemacif_ptr->ethaddr), p); break; default: pbuf_free(p); break; }

-

- if (q != NULL) {



- low_level_output(netif_ptr, q);



- pbuf_free(q);



- } }



return ERR_OK;


Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required