]> Pileus Git - ~andy/linux/commit
can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK
authorReuben Dowle <Reuben.Dowle@navico.com>
Mon, 31 Oct 2011 22:18:03 +0000 (11:18 +1300)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 3 Feb 2012 00:21:25 +0000 (01:21 +0100)
commit9a12349663061d25b49e6542d005fa7193a2cb44
tree210da3ec770010d9e814a368de051ad01e0e6bb3
parentcf5046b309b3a05c444a8edba6b44108510b7d7d
can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK

Currently the flexcan driver uses hardware local echo. This blindly
echos all transmitted frames to all receiving sockets, regardless what
CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK are set to.

This patch now submits transmitted frames to be echoed in the transmit
complete interrupt, preserving the reference to the sending
socket. This allows the can protocol to correctly handle the local
echo.

Further this patch moves tx_bytes statistic accounting into the tx_complete
handler.

Signed-off-by: Reuben Dowle <reuben.dowle@navico.com>
[mkl: move tx_bytes accounting into tx_complete handler; cleanups]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan.c