]> git.karo-electronics.de Git - karo-tx-linux.git/commit
can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS
authorIra W. Snyder <iws@ovro.caltech.edu>
Thu, 19 Jul 2012 15:54:42 +0000 (08:54 -0700)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 20 Jul 2012 15:49:04 +0000 (17:49 +0200)
commit83702f69272e4591a91a27eb58eade1bcd361dae
tree7e0c4a6c702c3fd5e11b553099998b6cba21bd44
parent88b587039c1ad4e7a981bea3269eeb02a1a2a14b
can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS

The Janz VMOD-ICAN3 firmware does not support any sort of TX-done
notification or interrupt. The driver previously used the hardware
loopback to attempt to work around this deficiency, but this caused all
sockets to receive all messages, even if CAN_RAW_RECV_OWN_MSGS is off.

Using the new function ican3_cmp_echo_skb(), we can drop the loopback
messages and return the original skbs. This fixes the issues with
CAN_RAW_RECV_OWN_MSGS.

A private skb queue is used to store the echo skbs. This avoids the need
for any index management.

Due to a lack of TX-error interrupts, bus errors are permanently
enabled, and are used as a TX-error notification. This is used to drop
an echo skb when transmission fails. Bus error packets are not generated
if the user has not enabled bus error reporting.

Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/janz-ican3.c