can: flexcan: add ethtool support to change rx-rtr setting during runtime
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 4 Jan 2022 15:28:00 +0000 (16:28 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sat, 8 Jan 2022 20:22:26 +0000 (21:22 +0100)
commit1c45f5778a3be5a67e8b318ab83664014ffa1f3e
treed5e02608a80420e0cc53339e40934297fe175c16
parentc5c88591040ee7d84d037328eed9019d3ffab821
can: flexcan: add ethtool support to change rx-rtr setting during runtime

This patch adds a private flag to the flexcan driver to switch the
"rx-rtr" setting on and off.

"rx-rtr" on  - Receive RTR frames. (default)
               The CAN controller can and will receive RTR frames.

       On some IP cores the controller cannot receive RTR
       frames in the more performant "RX mailbox" mode and
       will use "RX FIFO" mode instead.

"rx-rtr" off - Waive ability to receive RTR frames. (not supported on all IP cores)
               This mode activates the "RX mailbox mode" for better
       performance, on some IP cores RTR frames cannot be
       received anymore.

The "RX FIFO" mode uses a FIFO with a depth of 6 CAN frames.
The "RX mailbox" mode uses up to 62 mailboxes.

Link: https://lore.kernel.org/all/20220107193105.1699523-6-mkl@pengutronix.de
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Co-developed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/flexcan/Makefile
drivers/net/can/flexcan/flexcan-core.c
drivers/net/can/flexcan/flexcan-ethtool.c [new file with mode: 0644]
drivers/net/can/flexcan/flexcan.h [new file with mode: 0644]