• Reuben Dowle's avatar
    can: flexcan: Fix CAN_RAW_RECV_OWN_MSGS and CAN_RAW_LOOPBACK · 9a123496
    Reuben Dowle authored
    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: default avatarReuben Dowle <reuben.dowle@navico.com>
    [mkl: move tx_bytes accounting into tx_complete handler; cleanups]
    Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
    9a123496
flexcan.c 26.5 KB