can: c_can: add ethtool support
Subsystems (3)
PATCH v3 1/2 can: c_can: add ethtool support
With commit 132f2d45fb23 ("can: c_can: add support to 64 message objects") the number of message objects used for reception / transmission depends on FIFO size.
The ethtools API support allows you to retrieve this info. Driver info has been added too.
---
Changes in v3:
- Remove the version info so that ethtool will return the version of the kernel the driver is actually being used in.
Changes in v2:
- Use get_ringparam instead of get_channels.
drivers/net/can/c_can/Makefile | 3 ++
drivers/net/can/c_can/c_can.h | 2 +
drivers/net/can/c_can/c_can_ethtool.c | 43 +++++++++++++++++++
.../net/can/c_can/{c_can.c => c_can_main.c} | 1 +
4 files changed, 49 insertions(+)
create mode 100644 drivers/net/can/c_can/c_can_ethtool.c
rename drivers/net/can/c_can/{c_can.c => c_can_main.c} (99%)drivers/net/can/c_can/Makefile +3 -0
@@ -4,5 +4,8 @@ # obj-$(CONFIG_CAN_C_CAN) += c_can.o + +c_can-objs := c_can_main.o c_can_ethtool.o + obj-$(CONFIG_CAN_C_CAN_PLATFORM) += c_can_platform.o obj-$(CONFIG_CAN_C_CAN_PCI) += c_can_pci.o
drivers/net/can/c_can/c_can.h +2 -0
@@ -219,4 +219,6 @@ int c_can_power_up(struct net_device *dev);int c_can_power_down (struct net_device *dev);#endif +void c_can_set_ethtool_ops (struct net_device *dev); +#endif /* C_CAN_H */
drivers/net/can/c_can/c_can_ethtool.c new file +43 -0
43 lines not on this page · raw message
drivers/net/can/c_can/c_can_main.c renamed from drivers/net/can/c_can/c_can.c +1 -0
@@ -1335,6 +1335,7 @@ int register_c_can_dev(struct net_device *dev) dev->flags |=IFF_ECHO ;/* we support local echo */ dev->netdev_ops = &c_can_netdev_ops; +c_can_set_ethtool_ops (dev); err =register_candev (dev);if (!err)
Signature · 1 line
2.17.1
Quoted 7 lines · Dario Binacchi
With commit
132f2d45fb23("can:c_can: add support to 64 message objects") the number of message objects used for reception / transmission depends on FIFO size.
The ethtools API support allows you to retrieve this info. Driver info has been added too.Signed-off-by Dario Binacchi <[email protected]>
Andrew
Marc Kleine-Budde
maintainerQuoted 7 lines · Dario Binacchi
With commit
132f2d45fb23("can:c_can: add support to 64 message objects") the number of message objects used for reception / transmission depends on FIFO size.
The ethtools API support allows you to retrieve this info. Driver info has been added too.Signed-off-by Dario Binacchi <[email protected]>
Applied to linux-can-next/testing
Thanks,
Marc
Signature · 4 lines
Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |