Skip to contentSkip to conversation

can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

PATCH Superseded Vincent Mailhol 1 participant 1 message Jan 9, 2021

Subsystems (4)

v9 of 15 Superseded Latest is v15 →

lore
Share & tools
lore
#0 lore raw

PATCH v9 1/1 can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces

This driver supports the ES581.4, ES582.1 and ES584.1 interfaces from ETAS GmbH (https://www.etas.com/en/products/es58x.php).

--

Changes in v9 (2021-01-09):
- es58x_start_xmit(): do not use skb anymore after the call of can_put_echo_skb(). Rationale: can_put_echo_skb() calls skb_clone() and thus the original skb gets consumed (i.e. use after free issue).
- es58x_start_xmit(): Add a "drop_skb" label to free the skb when errors occur.

Changes in v8 (2021-01-04):
- The driver requires CRC16. Modified Kconfig accordingly.

Changes in v7 (2020-11-17):
- Fix compilation issue if CONFIG_BQL is not set.
Reference: https://lkml.org/lkml/2020/11/15/163

Changes in v6 (2020-11-15):
- Rebase the patch on the testing branch of linux-can-next.
- Rename the helper functions according latest changes

    (e.g. can_cc_get_len() -> can_cc_dlc2len())
  - Fix comments of enum es58x_physical_layer and enum
    es58x_sync_edge.

Changes in v5 (2020-11-07):
- Add support for DLC greater than 8.
- All other patches from the previous series were either accepted or dismissed. As such, this is not a series any more but a single patch.

Changes in v4 (2020-10-17):
- Remove struct es58x_abstracted_can_frame.
- Fix formatting (spaces, comment style).
- Transform macros into static inline functions when possible.
- Fix the ctrlmode_supported flags in es581_4.c and removed misleading comments in enum es58x_samples_per_bit.
- Rename enums according to the type.
- Remove function es58x_can_put_echo_skb().
Reference: https://lkml.org/lkml/2020/10/10/53

Changes in v3 (2020-10-03):
- Remove all the calls to likely() and unlikely().
Reference: https://lkml.org/lkml/2020/9/30/995

Changes in v2 (2020-09-30):
- Fixed -W1 warnings (v1 was tested with GCC -WExtra but not with -W1).

v1 (2020-09-27):
- First release

---
 drivers/net/can/usb/Kconfig                 |   10 +
 drivers/net/can/usb/Makefile                |    1 +
 drivers/net/can/usb/etas_es58x/Makefile     |    3 +
 drivers/net/can/usb/etas_es58x/es581_4.c    |  552 ++++
 drivers/net/can/usb/etas_es58x/es581_4.h    |  206 ++
 drivers/net/can/usb/etas_es58x/es58x_core.c | 2634 +++++++++++++++++++
 drivers/net/can/usb/etas_es58x/es58x_core.h |  724 +++++
 drivers/net/can/usb/etas_es58x/es58x_fd.c   |  658 +++++
 drivers/net/can/usb/etas_es58x/es58x_fd.h   |  242 ++
 9 files changed, 5030 insertions(+)
 create mode 100644 drivers/net/can/usb/etas_es58x/Makefile
 create mode 100644 drivers/net/can/usb/etas_es58x/es581_4.c
 create mode 100644 drivers/net/can/usb/etas_es58x/es581_4.h
 create mode 100644 drivers/net/can/usb/etas_es58x/es58x_core.c
 create mode 100644 drivers/net/can/usb/etas_es58x/es58x_core.h
 create mode 100644 drivers/net/can/usb/etas_es58x/es58x_fd.c
 create mode 100644 drivers/net/can/usb/etas_es58x/es58x_fd.h
drivers/net/can/usb/Kconfig +10 -0
index c1e5d5b570b6..978746ce8873 100644
@@ -20,6 +20,16 @@ config CAN_ESD_USB2
 	  This driver supports the CAN-USB/2 interface
 	  from esd electronic system design gmbh (http://www.esd.eu).
 
+config CAN_ETAS_ES58X
+	tristate "ETAS ES58X CAN/USB interfaces"
+	select CRC16
+	help
+	  This driver supports the ES581.4, ES582.1 and ES584.1 interfaces
+	  from ETAS GmbH (https://www.etas.com/en/products/es58x.php).
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called etas_es58x.
+
 config CAN_GS_USB
 	tristate "Geschwister Schneider UG interfaces"
 	help
drivers/net/can/usb/Makefile +1 -0
index aa0f17c0b2ed..748cf31a0d53 100644
@@ -6,6 +6,7 @@
 obj-$(CONFIG_CAN_8DEV_USB) += usb_8dev.o
 obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
 obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
+obj-$(CONFIG_CAN_ETAS_ES58X) += etas_es58x/
 obj-$(CONFIG_CAN_GS_USB) += gs_usb.o
 obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb/
 obj-$(CONFIG_CAN_MCBA_USB) += mcba_usb.o
drivers/net/can/usb/etas_es58x/Makefile new file +3 -0
new file mode 100644
index 000000000000..a129b4aa0215
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_CAN_ETAS_ES58X) += etas_es58x.o
+etas_es58x-y = es58x_core.o es581_4.o es58x_fd.o
drivers/net/can/usb/etas_es58x/es581_4.c new file +552 -0

552 lines not on this page · raw message

drivers/net/can/usb/etas_es58x/es581_4.h new file +206 -0

206 lines not on this page · raw message

drivers/net/can/usb/etas_es58x/es58x_core.c new file +2634 -0

2,216 lines not on this page · raw message

drivers/net/can/usb/etas_es58x/es58x_core.h new file +724 -0

724 lines not on this page · raw message

drivers/net/can/usb/etas_es58x/es58x_fd.c new file +658 -0

658 lines not on this page · raw message

drivers/net/can/usb/etas_es58x/es58x_fd.h new file +242 -0

242 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.26.2

Part of the diff is not shown here. View the raw message.