Muhamad Ikhwan Ismail wrote: > > Hi guys, > > I am porting lwip1.2.0(not using CVS for updates) to MPC852t with a > commercial RTOS from MQX I am a beginner in lwip. Got 2 qs on a problem > I am having. > > 1. MPC852T has a dual port ram with buffer descriptors, which have > pointers to the buffer/frame to be sent and the Ethernet controller > automatically fetch the pointed data for transmission as soon as I set a > flag up. The problem lies on the fact that the first-in-chain pbuf > payload pointer points to the actual data and skipped the headers, or at > least that is the way I understood it from the manual.
No, the netif output function should be being called with the payload pointing to the headers, as you would hope and expect. But perhaps the problem is that you have set the netif->output function to be your driver, rather than etharp_output. You should find the src/netif/ethernetif.c template driver gives you an idea of what's involved, including in its init function: netif->output = etharp_output; netif->linkoutput = low_level_output; Where low_level_output is that driver's call to transmit a packet. > 2. Can someone show me how do I initialise the lwip stack to be used > with the sockets API (maybe the flow)? This has been tidied up and changed quite a bit in CVS, but even for 1.2.0 you should find an example of the functions to call to initialise the stack in the ports directory hierarchy. > And is the usage of the sockets > api allows the lwip to be multithreading able ? The code in CVS is a bit safer for multithreading. But in whichever code base, it's important to remember that with lwIP you cannot use the same socket (or netconn) from multiple threads. You can have different sockets used by different threads though. Jifl -- eCosCentric Limited http://www.eCosCentric.com/ The eCos experts Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571 Registered in England and Wales: Reg No 4422071. ------["Si fractum non sit, noli id reficere"]------ Opinions==mine _______________________________________________ lwip-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/lwip-users
