On 07/19/2011 09:51 AM, Oliver Hartkopp wrote:
On 18.07.2011 20:03, Mike Brown wrote:
All appears fine with the vcan interface - tst_rcv_own_msgs runs with both
echo=1 or echo=0.   I suspected this would be case, since the CAN utilities
candump and cansend work as expected when run on the vcan interface as well.
tst_rcv_own_msgs with echo=0 is trivial and does not check the complete loop
down to the CAN netdevice and up again.

Btw. does your 'real' flexcan work now as expected?
No... but I'm suspecting something fundamental with the flexcan driver...

This pair of commands works (can2 is a vcan interface)

candump -a can2,0:0
cansend can2 001#48

These two don't (can0 is the flexcan device):

candump -a can0,0:0
cansend can0 001#48
@Marc/Sascha: I just realized the line

     dev->flags |= IFF_ECHO; /* we support local echo in hardware */

in the flexcan source at

     http://lxr.linux.no/#linux+v2.6.39/drivers/net/can/flexcan.c#L943

But do you really mean, that the sent frames are pushed into the rx queue when
the TX is complete according

http://lxr.linux.no/#linux+v2.6.39/Documentation/networking/can.txt#L580

???

The tx complete interrupt in flexcan.c

http://lxr.linux.no/#linux+v2.6.39/drivers/net/can/flexcan.c#L585

does not do anything with can_[put|get|free]_echo_skb() ?!?

When the sent CAN frames are not pushed into the rx queue on successful
transmit IFF_ECHO must not be set in the device flags.
I didn't dig this deep into the flexcan driver but did got deep enough to see this flag being set as well. If read the SocketCAN documentation correctly, then if the driver doesn't set this flag then the PF_CAN layer should handle the loopback??? I'm trying to get a build with the flag cleared in flexcan.c
This mechanic does not really stick together with CAN_CTRLMODE_LOOPBACK

     http://lxr.linux.no/#linux+v2.6.39/drivers/net/can/flexcan.c#L619

as nothing is sent onto the bus, when CAN_CTRLMODE_LOOPBACK is enabled.

Regards,
Oliver

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

Reply via email to