]> git.baikalelectronics.ru Git - kernel.git/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)
commit04594ae5b229ac5b2a64fd1eb8f3bc9bd68547b0
tree210da3ec770010d9e814a368de051ad01e0e6bb3
parent8591c318fdf46f997f0f8e46a2fde35ea8f3e03f
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