I figured out why things were crashing in netif->output(), I missed
the fact that the order of the parameter list for etharp_output()
changed, my driver still had them in the "old" order... Now, my APP
comes up, responds to ICMP ping, but when I go into an accept
(SOCKET_API mode), my APP never returns, even when it looks like the
connection is established... I attached a debug file showing the
connection. Have I mis-configured my timers or something? Anyone have
any ideas?
This is my initialization code:
void* configure_ethernet()
{
struct ip_addr ipaddr, netmask, gw;
struct netif *default_netif;
char low_mac[3] =
{0x00,0x00,0x11};
char fullmac[6] = {XILINX_MAC_OUI0, XILINX_MAC_OUI1, XILINX_MAC_OUI2, low_mac[0], low_mac[2], low_mac[3]};
char ip[4] = {151,190,95,120};
char subnet[4] = {255,255,255,0};
char gateway[4] = {0,0,0,0};
int len;
struct sockaddr_in addr,rem;
XEmacIf_Config *xemacif_ptr = &XEmacIf_ConfigTable[0];
// Initial Header, do this before the netif_init() so we can
// change the MAC Address and IP addresses if needed
fullmac[0] = XILINX_MAC_OUI0;
fullmac[1] = XILINX_MAC_OUI1;
fullmac[2] = XILINX_MAC_OUI2;
fullmac[3] = low_mac[0];
fullmac[4] = low_mac[1];
fullmac[5] = low_mac[2];
// Set host addresses
xemacif_setmac(0, (u8_t *) fullmac); // Set MAC
IP4_ADDR(&gw, gateway[0],gateway[1],gateway[2],gateway[3]); // Set gateway
IP4_ADDR(&ipaddr, ip[0],ip[1],ip[2],ip[3]); // Set ip
IP4_ADDR(&netmask,subnet[0],subnet[1],subnet[2],subnet[3]); // Set subnet msk
// Set up the lwIP network interface... allocate netif structure
default_netif = mem_malloc(sizeof(struct netif));
if (default_netif == NULL)
{
ifdInterfacePrintf("netif_add(): out of memory for default_netif");
return NULL;
}
default_netif = netif_add(default_netif,
&ipaddr,
&netmask,
&gw,
&XEmacIf_ConfigTable[0],
xemacif_init,
tcpip_input);
netif_set_default(default_netif);
netif_set_up(default_netif);
// Register XEmacHandler with interrupt controller and enable interrupts with XMK
register_int_handler(XPAR_INTC_ETHERNET_IP2INTC_IRPT_INTR,
(XInterruptHandler)XEmac_IntrHandlerFifo,
xemacif_ptr->instance_ptr);
// Enable EMAC interrupts in XMK
enable_interrupt(XPAR_INTC_ETHERNET_IP2INTC_IRPT_INTR);
return;
}
int socket_listen(int portId)
{
int reuseOptVal, rs;
// create socket and start application
sock
= socket(AF_INET, SOCK_STREAM, 0);
addr.sin_family = AF_INET;
addr.sin_port = htons(portId);
addr.sin_addr.s_addr = INADDR_ANY;
addr.sin_addr.s_addr = inet_addr("151.190.95.120");
bind(sock, (struct sockaddr *)&addr, sizeof(addr));
listen(sock, 5);
return sock;
}
int socket_accept()
{
int len;
int status = 0;
int TCPNoDelay = 1;
char optval = 1;
len = sizeof(rem);
xil_printf ("I- SOCKET: Accepting a new connection...\n\r");
s = accept(sock,(struct sockaddr*)&rem,&len);
xil_printf("I- SOCKET: Accepted!\n\r");
return s;
}
I call them in order,
sock is global, and my code never returns from accept call...
Arden
----- Original Message ----
From: "address@hidden" <address@hidden>
To: address@hidden
Sent: Tuesday, June 19, 2007 12:35:47 PM
Subject: lwip-users Digest, Vol 46, Issue 28
Send lwip-users mailing list submissions to
address@hidden
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.nongnu.org/mailman/listinfo/lwip-usersor, via email, send a message with subject or body 'help' to
address@hidden
You can reach the person managing the list at
address@hidden
When replying, please edit
your Subject line so it is more specific
than "Re: Contents of lwip-users digest..."
Today's Topics:
1. RE: [Virtex II Pro] pbuf / DHCP / lwIP upgrade to EDK/upgrade
to EDK 9.1i (Louis Filasky) (Goldschmidt Simon) (Arden Llewellyn)
(Arden Llewellyn)
----------------------------------------------------------------------
Message: 1
Date: Tue, 19 Jun 2007 08:54:48 -0700 (PDT)
From: Arden Llewellyn <address@hidden>
Subject: [lwip-users] RE: [Virtex II Pro] pbuf / DHCP / lwIP upgrade
to EDK/upgrade to EDK 9.1i (Louis Filasky) (Goldschmidt Simon) (Arden
Llewellyn)
To: address@hidden
Message-ID: <address@hidden>
Content-Type: text/plain;
charset="us-ascii"
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: =?utf-8?q?tcpICMPbutNoConnect?=
Type: application/octet-stream
Size: 49990 bytes
Desc: not available
Url :
http://lists.gnu.org/pipermail/lwip-users/attachments/20070619/aa93ece0/utf-8qtcpICMPbutNoConnect.obj------------------------------
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-usersEnd of lwip-users Digest, Vol 46, Issue 28
******************************************