My guess is that the raw initialization (tcp_new, etc) should go into the tcpip_init callback, correct? Yep.
(Another possibility would be ethernetif_init (which is run, I assume, in the context of tcpip_thread That pretty much depends on your initialization: ethernetif_init is called from the call stack where netif_add is called, so you have to ensure that netif_add is called in the tcpip_thread.
), but it seems wrong to put raw
api calls in that function.) Yes, it does seem wrong :-)
I’m pretty sure that’s right, but I can’t find any documentation stating that, nor any samples taking that approach. The only raw api sample code I can find doesn’t have a separate EMAC task at all. That doesn't really depend on whether the EMAC driver has its own thread. The EMAC driver just has to make sure it does not violate lwIP threading requirements (I.e. Call netif->input, which has to be set to ethernetif_input for ethernet MACs).
|