Hi Thomas,

Thomas Körper wrote:
> Hello,
> 
> I recently worked with the esd PCI/331 driver (esd_pci331.c) and found
> some problems there when loopback is disabled. (e.g. just with "cangen -x")
> 
> In the esd331_start_xmit() function I was told to call can_put_echo_skb()
> before sending the frame But it seems the skb is freed there when loopback
> is disabled (cause it's not needed anymore?)

Yes, that's right and I realize the problem now. can_put_echo_skb()
should be called when the skb is *not* needed any more. But it should be
called before the message is sent out to avoid that the TX done event
comes to early. That could be ensured differently. esd331_start_xmit()
needs fixing anyhow, as it returns improperly in case of error
conditions. I/we need to check the other drivers for that issue as well.

> So when that frame is sent afterwards it contains just junk...
> 
> Should I just copy the frame before calling can_put_echo_skb()? Or is
> something else wrong here?

You copy the frame anyhow in esd331_send(). Just call can_put_echo_skb()
before "esd331_write(&msg, board);".

Wolfgang.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to