In raw mode, the application has to manually call xemacif_input function to receive packets. In socket mode, the application has to launch a thread, xemacif_input_thread. The documentation for each of these two functions follows:
Raw Mode Onlyvoid xemacif_input(struct netif *netif)
The Xilinx lwIP adapters work in interrupt mode. The receive interrupt handlers move the packet data from the MAC and store them in a queue. The xemacif_input function takes those received packets from the queue, and passes them to lwIP; consequently, this function is required for lwIP operation in raw mode. An lwIP application in raw mode should have a structure like the following:
while (1) {
/* receive packets */
xemacif_input(netif);
/* do application specific processing */
}
The program is notified of the received data through callbacks.
Socket Mode Onlyvoid xemacif_input_thread(struct netif *netif)
In the socket mode, the application thread must launch a separate thread to receive the input packets. This performs the same work as the raw mode function, xemacif_input, except that it resides in its own separate thread; consequently, any lwIP socket mode application is required to have code similar to the following in its main thread:
sys_thread_new(xemacif_input_thread, netif, DEFAULT_THREAD_PRIO);
The application can then continue launching separate threads for performing application-specific tasks. The xemacif_input_thread receives data processed by the interrupt handlers, and passes them to the lwIP tcpip_thread.
For other lwIP issues, please refer to
(Xilinx Answer 29757),
(Xilinx Answer 29791), and
(Xilinx Answer 30195).
The above information is now included in the OS and Libraries Guide in 10.1 Service Pack 2 available at:
http://www.xilinx.com/support/download/index.htm The first service pack containing the fix is 10.1 Service Pack 2.