diff mbox series

[2/3,SRU,J] UBUNTU: SAUCE: ODM: can: usb: f81604: backport of Fintek F81604

Message ID 20231228032934.1149161-3-acelan.kao@canonical.com
State New
Headers show
Series Add ODM driver f81604 usb-can | expand

Commit Message

AceLan Kao Dec. 28, 2023, 3:29 a.m. UTC
From: Filippo Copetti <filippo.copetti@eurotech.com>

BugLink: https://bugs.launchpad.net/bugs/2045387

F81604 implements USB to 2xCAN interfaces, this is the backporting to
kernel 5.15

This commit is manually fixed the missing definition CAN_ERR_CNT and the
missing function can_dev_dropped_skb().

Signed-off-by: Filippo Copetti <filippo.copetti@eurotech.com>
Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@canonical.com>
---
 drivers/net/can/usb/f81604.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/can/usb/f81604.c b/drivers/net/can/usb/f81604.c
index ec8cef7fd2d53..7b0de76646ef6 100644
--- a/drivers/net/can/usb/f81604.c
+++ b/drivers/net/can/usb/f81604.c
@@ -8,6 +8,8 @@ 
 #include <linux/units.h>
 #include <linux/usb.h>
 
+#include <linux/ethtool.h>
+
 #include <linux/can.h>
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
@@ -114,6 +116,7 @@ 
 
 /* ALC register */
 #define F81604_SJA1000_ALC_MASK 0x1f
+#define CAN_ERR_CNT 0x00000200U
 
 /* table of devices that work with this driver */
 static const struct usb_device_id f81604_table[] = {
@@ -906,7 +909,7 @@  static netdev_tx_t f81604_start_xmit(struct sk_buff *skb,
 	struct urb *write_urb;
 	int ret;
 
-	if (can_dev_dropped_skb(netdev, skb))
+	if (can_dropped_invalid_skb(netdev, skb))
 		return NETDEV_TX_OK;
 
 	netif_stop_queue(netdev);