I have a problem in my lwip implementation (MPC8347 from freescale).
In my low level output, I receive a pbuf struct. As far as I
understand, this pbuf is an ethernet frame. So I only need to send this
frame to my interface. The problem is that sometimes in the middle of a
pbuf chain, I have a pbuf wich len field is 0. I'm not sure what to do
with it.
First I've tried to simply ignore the fact that it's length was 0. As
my Ethernet controller is Buffer Descriptor based, I can map each pbuf
of the chain to a Buffer Descriptor and simply set a last flag in my
Buffer Descriptors as soon as it's the last pbuf in the chain. I simply
have a Buffer Descriptor that has a length of zero. The problem is that
my interface doesn't like that and it generates FIFO underrun.
My second though was to simply skip it, but then I'm not sure it's a good solution.
My question is : why do I have some pbuf with len field being 0 ? Is it normal, what should I do with them ?
Here the code for my second try. Note that if we skip the first test in
the loop, then sometimes we program a DMA transfer with data length
being 0 wih in turn lead to a Fifo underrun condition.