Thomas Körper wrote: > Hi, > >>> 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. > > What is meant by "returns improperly in case of error"? Sounds like another > issue...
Yes, valid return codes are listed here: http://lxr.linux.no/#linux+v2.6.32/include/linux/netdevice.h#L83 Also, check the other drivers. > I found no skb usage after can_put_echo_skb() in the other drivers. (But > did not check if it's always done before sending the frame) > >>> 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);". > > As I would need dev and skb in esd331_send() then, I would completely > remove the esd331_send() function and do its stuff in the > esd331_start_xmit() function. Will that be OK then? Yes, that's what I would have suggested as well. Wolfgang. _______________________________________________ Socketcan-core mailing list [email protected] https://lists.berlios.de/mailman/listinfo/socketcan-core
