summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/sllin
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-kernel/sllin')
-rw-r--r--recipes-kernel/sllin/files/0001-Disable-sllin-driver-debug-log.patch27
-rw-r--r--recipes-kernel/sllin/files/0002_fix_null_operation_check.patch176
-rw-r--r--recipes-kernel/sllin/files/0003-Allow-recent-kernels-newer-4.11.x-to-build.patch69
-rw-r--r--recipes-kernel/sllin/files/0005-Fix-build-with-5.13-kernel.patch24
-rw-r--r--recipes-kernel/sllin/files/0006-Fix-build-with-5.14-kernel.patch108
-rw-r--r--recipes-kernel/sllin/files/lin_config.conf10
-rw-r--r--recipes-kernel/sllin/files/sllin-demo-virtual.service12
-rw-r--r--recipes-kernel/sllin/files/sllin-demo.service13
-rwxr-xr-xrecipes-kernel/sllin/files/start_lin_demo.sh58
-rw-r--r--recipes-kernel/sllin/sllin.bb51
-rw-r--r--recipes-kernel/sllin/sllin/0001-update-makefile.patch (renamed from recipes-kernel/sllin/files/0001_update_makefile.patch)0
-rw-r--r--recipes-kernel/sllin/sllin/0002-5.4-less-than-110-fix.patch25
-rw-r--r--recipes-kernel/sllin/sllin_git.bb22
13 files changed, 179 insertions, 416 deletions
diff --git a/recipes-kernel/sllin/files/0001-Disable-sllin-driver-debug-log.patch b/recipes-kernel/sllin/files/0001-Disable-sllin-driver-debug-log.patch
deleted file mode 100644
index 99d6183a..00000000
--- a/recipes-kernel/sllin/files/0001-Disable-sllin-driver-debug-log.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 04ffb4b8f828c19e914987e271aaf3aa7eab28bf Mon Sep 17 00:00:00 2001
-From: Yuichi Kusakabe <yuichi.kusakabe@denso-ten.com>
-Date: Thu, 29 Nov 2018 22:12:00 +0900
-Subject: [PATCH] Disable sllin driver debug log
-
-Signed-off-by: Yuichi Kusakabe <yuichi.kusakabe@denso-ten.com>
----
- sllin/sllin.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/sllin/sllin.c b/sllin/sllin.c
-index 77b2cb8..133d6e9 100644
---- a/sllin/sllin.c
-+++ b/sllin/sllin.c
-@@ -41,7 +41,9 @@
- * Funded by: Volkswagen Group Research
- */
-
-+#if 0
- #define DEBUG 1 /* Enables pr_debug() printouts */
-+#endif
-
- #include <linux/module.h>
- #include <linux/moduleparam.h>
---
-2.7.4
-
diff --git a/recipes-kernel/sllin/files/0002_fix_null_operation_check.patch b/recipes-kernel/sllin/files/0002_fix_null_operation_check.patch
deleted file mode 100644
index 896e2680..00000000
--- a/recipes-kernel/sllin/files/0002_fix_null_operation_check.patch
+++ /dev/null
@@ -1,176 +0,0 @@
-diff --git a/sllin/sllin.c b/sllin/sllin.c
-index 2db896f..2969448 100644
---- a/sllin/sllin.c
-+++ b/sllin/sllin.c
-@@ -869,7 +869,6 @@ static int sllin_send_tx_buff(struct sllin *sl)
- #else
- remains = sl->tx_lim - sl->tx_cnt;
- #endif
--
- res = tty->ops->write(tty, sl->tx_buff + sl->tx_cnt, remains);
- if (res < 0)
- goto error_in_write;
-@@ -916,10 +915,25 @@ static int sllin_send_break(struct sllin *sl)
- unsigned long break_baud;
- int res;
-
-+ netdev_dbg(sl->dev, "%s()#<BREAK_BY_BAUD> invoke.\n", __func__);
-+ if (tty == NULL) {
-+ netdev_dbg(sl->dev, "%s() tty == NULL.\n", __func__);
-+ sl->lin_state = SLSTATE_IDLE;
-+ return -1;
-+ }
-+ if (tty->ops == NULL) {
-+ netdev_dbg(sl->dev, "%s() tty->ops == NULL.\n", __func__);
-+ sl->lin_state = SLSTATE_IDLE;
-+ return -1;
-+ }
- break_baud = ((sl->lin_baud * 2) / 3);
- sltty_change_speed(tty, break_baud);
-
-- tty->ops->flush_buffer(tty);
-+ if (tty->ops->flush_buffer) {
-+ tty->ops->flush_buffer(tty);
-+ } else {
-+ netdev_dbg(sl->dev, "%s() tty->ops->flush_buffer is NULL.\n", __func__);
-+ }
- sl->rx_cnt = SLLIN_BUFF_BREAK;
-
- sl->rx_expect = SLLIN_BUFF_BREAK + 1;
-@@ -943,6 +957,17 @@ static int sllin_send_break(struct sllin *sl)
- unsigned long usleep_range_min;
- unsigned long usleep_range_max;
-
-+ netdev_dbg(sl->dev, "%s() invoke.\n", __func__);
-+ if (tty == NULL) {
-+ netdev_dbg(sl->dev, "%s() tty == NULL.\n", __func__);
-+ sl->lin_state = SLSTATE_IDLE;
-+ return -1;
-+ }
-+ if (tty->ops == NULL) {
-+ netdev_dbg(sl->dev, "%s() tty->ops == NULL.\n", __func__);
-+ sl->lin_state = SLSTATE_IDLE;
-+ return -1;
-+ }
- break_baud = ((sl->lin_baud * 2) / 3);
- sl->rx_cnt = SLLIN_BUFF_BREAK;
- sl->rx_expect = SLLIN_BUFF_BREAK + 1;
-@@ -950,21 +975,31 @@ static int sllin_send_break(struct sllin *sl)
-
- /* Do the break ourselves; Inspired by
- http://lxr.linux.no/#linux+v3.1.2/drivers/tty/tty_io.c#L2452 */
-- retval = tty->ops->break_ctl(tty, -1);
-- if (retval)
-- return retval;
-+ if (tty->ops->break_ctl) {
-+ retval = tty->ops->break_ctl(tty, -1);
-+ if (retval)
-+ return retval;
-+ } else {
-+ netdev_dbg(sl->dev, "%s() tty->ops->break_ctl is NULL.\n", __func__);
-+ }
-
- /* udelay(712); */
- usleep_range_min = (1000000l * SLLIN_SAMPLES_PER_CHAR) / break_baud;
- usleep_range_max = usleep_range_min + 50;
- usleep_range(usleep_range_min, usleep_range_max);
-
-- retval = tty->ops->break_ctl(tty, 0);
-+ if(tty->ops->break_ctl) {
-+ retval = tty->ops->break_ctl(tty, 0);
-+ }
- usleep_range_min = (1000000l * 1 /* 1 bit */) / break_baud;
- usleep_range_max = usleep_range_min + 30;
- usleep_range(usleep_range_min, usleep_range_max);
-
-- tty->ops->flush_buffer(tty);
-+ if ( tty->ops->flush_buffer) {
-+ tty->ops->flush_buffer(tty);
-+ } else {
-+ netdev_dbg(sl->dev, "%s() tty->ops->flush_buffer is NULL.\n", __func__);
-+ }
-
- sl->tx_cnt = SLLIN_BUFF_SYNC;
-
-@@ -1028,6 +1063,12 @@ static int sllin_kwthread(void *ptr)
- int lin_dlc;
- u8 lin_data_buff[SLLIN_DATA_MAX];
-
-+ if (sl == NULL) {
-+ pr_err("sllin: sl is NULL\n");
-+ }
-+ if (sl->dev == NULL) {
-+ pr_err("sllin: sl->dev is NULL\n");
-+ }
-
- if ((sl->lin_state == SLSTATE_IDLE) && sl->lin_master &&
- sl->id_to_send) {
-@@ -1036,6 +1077,7 @@ static int sllin_kwthread(void *ptr)
- }
- }
-
-+ netdev_dbg(sl->dev, "sllin_kthread <WAIT_EVENT>\n");
- wait_event_killable(sl->kwt_wq, kthread_should_stop() ||
- test_bit(SLF_RXEVENT, &sl->flags) ||
- test_bit(SLF_TXEVENT, &sl->flags) ||
-@@ -1046,6 +1088,7 @@ static int sllin_kwthread(void *ptr)
- (sl->lin_state == SLSTATE_RESPONSE_WAIT))
- && test_bit(SLF_MSGEVENT, &sl->flags)));
-
-+ netdev_dbg(sl->dev, "sllin_kthread <WAKEUPED>\n");
- if (test_and_clear_bit(SLF_RXEVENT, &sl->flags)) {
- netdev_dbg(sl->dev, "sllin_kthread RXEVENT\n");
- }
-@@ -1078,21 +1121,25 @@ static int sllin_kwthread(void *ptr)
- sl->lin_state = SLSTATE_IDLE;
- }
-
-+ netdev_dbg(sl->dev, "sllin_kthread: lin_state <%08x>\n",sl->lin_state);
- switch (sl->lin_state) {
- case SLSTATE_IDLE:
- if (!test_bit(SLF_MSGEVENT, &sl->flags))
- break;
--
-+ if (sl->tx_req_skb == NULL)
-+ netdev_dbg(sl->dev, "sl->tx_req_skb == NULL\n");
-+ if (sl->tx_req_skb->data == NULL)
-+ netdev_dbg(sl->dev, "sl->tx_req_skb->data == NULL\n");
- cf = (struct can_frame *)sl->tx_req_skb->data;
-
- /* SFF RTR CAN frame -> LIN header */
- if (cf->can_id & CAN_RTR_FLAG) {
- struct sllin_conf_entry *sce;
-
-- netdev_dbg(sl->dev, "%s: RTR SFF CAN frame, ID = %x\n",
-- __func__, cf->can_id & LIN_ID_MASK);
-
- sce = &sl->linfr_cache[cf->can_id & LIN_ID_MASK];
-+ netdev_dbg(sl->dev, "%s: RTR SFF CAN frame, ID = %x dlc=%d\n",
-+ __func__, cf->can_id & LIN_ID_MASK, sce->dlc);
- spin_lock_irqsave(&sl->linfr_lock, flags);
-
- /* Is there Slave response in linfr_cache to be sent? */
-@@ -1114,8 +1161,8 @@ static int sllin_kwthread(void *ptr)
- spin_unlock_irqrestore(&sl->linfr_lock, flags);
-
- } else { /* SFF NON-RTR CAN frame -> LIN header + LIN response */
-- netdev_dbg(sl->dev, "%s: NON-RTR SFF CAN frame, ID = %x\n",
-- __func__, (int)cf->can_id & LIN_ID_MASK);
-+ netdev_dbg(sl->dev, "%s: NON-RTR SFF CAN frame, ID = %x\n dlc=%d",
-+ __func__, (int)cf->can_id & LIN_ID_MASK, cf->can_dlc);
-
- lin_data = cf->data;
- lin_dlc = cf->can_dlc;
-@@ -1140,6 +1187,7 @@ static int sllin_kwthread(void *ptr)
- hrtimer_start(&sl->rx_timer,
- ktime_add(ktime_get(), sl->rx_timer_timeout),
- HRTIMER_MODE_ABS);
-+ netdev_dbg(sl->dev, "sllin_kthread: SLSTATE finish\n");
- break;
-
- case SLSTATE_BREAK_SENT:
-@@ -1654,3 +1702,4 @@ static void __exit sllin_exit(void)
-
- module_init(sllin_init);
- module_exit(sllin_exit);
-+
diff --git a/recipes-kernel/sllin/files/0003-Allow-recent-kernels-newer-4.11.x-to-build.patch b/recipes-kernel/sllin/files/0003-Allow-recent-kernels-newer-4.11.x-to-build.patch
deleted file mode 100644
index c8f2f926..00000000
--- a/recipes-kernel/sllin/files/0003-Allow-recent-kernels-newer-4.11.x-to-build.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From fcebb8f510bbb5c681f1f9af4506b4de241837dd Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jan-Simon=20M=C3=B6ller?= <jsmoeller@linuxfoundation.org>
-Date: Wed, 31 Oct 2018 20:48:20 +0000
-Subject: [PATCH] Allow recent kernels newer 4.11.x to build
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-API changes enforce porting.
-
-Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
----
- sllin/sllin.c | 13 +++++++++++++
- 1 file changed, 13 insertions(+)
-
-diff --git a/sllin/sllin.c b/sllin/sllin.c
-index 2969448..7e17127 100644
---- a/sllin/sllin.c
-+++ b/sllin/sllin.c
-@@ -56,7 +56,12 @@
- #include <linux/rtnetlink.h>
- #include <linux/if_arp.h>
- #include <linux/if_ether.h>
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
- #include <linux/sched.h>
-+#else
-+#include <uapi/linux/sched/types.h>
-+#endif
- #include <linux/delay.h>
- #include <linux/init.h>
- #include <linux/can.h>
-@@ -447,7 +451,9 @@ static int sll_open(struct net_device *dev)
- static void sll_free_netdev(struct net_device *dev)
- {
- int i = dev->base_addr;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,9)
- free_netdev(dev);
-+#endif
- sllin_devs[i] = NULL;
- }
-
-@@ -460,7 +466,12 @@ static const struct net_device_ops sll_netdev_ops = {
- static void sll_setup(struct net_device *dev)
- {
- dev->netdev_ops = &sll_netdev_ops;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,9)
- dev->destructor = sll_free_netdev;
-+#else
-+ dev->needs_free_netdev = true;
-+ dev->priv_destructor = sll_free_netdev;
-+#endif
-
- dev->hard_header_len = 0;
- dev->addr_len = 0;
-@@ -1685,8 +1696,10 @@ static void __exit sllin_exit(void)
- sl = netdev_priv(dev);
- if (sl->tty) {
- netdev_dbg(sl->dev, "tty discipline still running\n");
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,9)
- /* Intentionally leak the control block. */
- dev->destructor = NULL;
-+#endif
- }
-
- unregister_netdev(dev);
---
-2.13.7
-
diff --git a/recipes-kernel/sllin/files/0005-Fix-build-with-5.13-kernel.patch b/recipes-kernel/sllin/files/0005-Fix-build-with-5.13-kernel.patch
new file mode 100644
index 00000000..51147081
--- /dev/null
+++ b/recipes-kernel/sllin/files/0005-Fix-build-with-5.13-kernel.patch
@@ -0,0 +1,24 @@
+Remove TTY_LDISC_MAGIC usage
+
+The 5.13 kernel removed the .magic field from tty_ldisc_ops and
+the associated TTY_LDISC_MAGIC #define, so remove their use when
+building for 5.13 or newer.
+
+Upstream-Status: Inappropriate [no upstream]
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+---
+diff --git a/sllin/sllin.c b/sllin/sllin.c
+index 92c52ad..904cff9 100644
+--- a/sllin/sllin.c
++++ b/sllin/sllin.c
+@@ -1619,7 +1619,9 @@ static int sllin_ioctl(struct tty_struct *tty, struct file *file,
+
+ static struct tty_ldisc_ops sll_ldisc = {
+ .owner = THIS_MODULE,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+ .magic = TTY_LDISC_MAGIC,
++#endif
+ .name = "sllin",
+ .open = sllin_open,
+ .close = sllin_close,
diff --git a/recipes-kernel/sllin/files/0006-Fix-build-with-5.14-kernel.patch b/recipes-kernel/sllin/files/0006-Fix-build-with-5.14-kernel.patch
new file mode 100644
index 00000000..bb0049f0
--- /dev/null
+++ b/recipes-kernel/sllin/files/0006-Fix-build-with-5.14-kernel.patch
@@ -0,0 +1,108 @@
+Updates for 5.14
+
+The 5.14 kernel reworked the tty register and unregister call
+arguments, and made one of the arguments to the receive_buf
+callback const, add some kernel version conditionals to handle
+those.
+
+Upstream-Status: Inappropriate [no upstream]
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+---
+ sllin/sllin.c | 29 ++++++++++++++++++++++++-----
+ 1 file changed, 24 insertions(+), 5 deletions(-)
+
+diff --git a/sllin/sllin.c b/sllin/sllin.c
+index 904cff9..b89d06d 100644
+--- a/sllin/sllin.c
++++ b/sllin/sllin.c
+@@ -72,6 +72,12 @@
+ #include <linux/version.h>
+ #include "linux/lin_bus.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++#define FP_CONST const
++#else
++#define FP_CONST
++#endif
++
+ /* Should be in include/linux/tty.h */
+ #define N_SLLIN 25
+ /* -------------------------------- */
+@@ -185,9 +191,9 @@ struct sllin {
+ static struct net_device **sllin_devs;
+ static int sllin_configure_frame_cache(struct sllin *sl, struct can_frame *cf);
+ static void sllin_slave_receive_buf(struct tty_struct *tty,
+- const unsigned char *cp, char *fp, int count);
++ const unsigned char *cp, FP_CONST char *fp, int count);
+ static void sllin_master_receive_buf(struct tty_struct *tty,
+- const unsigned char *cp, char *fp, int count);
++ const unsigned char *cp, FP_CONST char *fp, int count);
+
+
+ /* Values of two parity bits in LIN Protected
+@@ -492,7 +498,7 @@ static void sll_setup(struct net_device *dev)
+ Routines looking at TTY side.
+ ******************************************/
+ static void sllin_master_receive_buf(struct tty_struct *tty,
+- const unsigned char *cp, char *fp, int count)
++ const unsigned char *cp, FP_CONST char *fp, int count)
+ {
+ struct sllin *sl = (struct sllin *) tty->disc_data;
+
+@@ -735,7 +741,7 @@ static void sllin_slave_finish_rx_msg(struct sllin *sl)
+ }
+
+ static void sllin_slave_receive_buf(struct tty_struct *tty,
+- const unsigned char *cp, char *fp, int count)
++ const unsigned char *cp, FP_CONST char *fp, int count)
+ {
+ struct sllin *sl = (struct sllin *) tty->disc_data;
+ int lin_id;
+@@ -842,7 +848,7 @@ static void sllin_slave_receive_buf(struct tty_struct *tty,
+ }
+
+ static void sllin_receive_buf(struct tty_struct *tty,
+- const unsigned char *cp, char *fp, int count)
++ const unsigned char *cp, FP_CONST char *fp, int count)
+ {
+ struct sllin *sl = (struct sllin *) tty->disc_data;
+ netdev_dbg(sl->dev, "sllin_receive_buf invoked, count = %u\n", count);
+@@ -1619,6 +1625,9 @@ static int sllin_ioctl(struct tty_struct *tty, struct file *file,
+
+ static struct tty_ldisc_ops sll_ldisc = {
+ .owner = THIS_MODULE,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++ .num = N_SLLIN,
++#endif
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5,13,0)
+ .magic = TTY_LDISC_MAGIC,
+ #endif
+@@ -1648,7 +1657,11 @@ static int __init sllin_init(void)
+ }
+
+ /* Fill in our line protocol discipline, and register it */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++ status = tty_register_ldisc(&sll_ldisc);
++#else
+ status = tty_register_ldisc(N_SLLIN, &sll_ldisc);
++#endif
+ if (status) {
+ pr_err("sllin: can't register line discipline\n");
+ kfree(sllin_devs);
+@@ -1719,9 +1732,15 @@ static void __exit sllin_exit(void)
+ kfree(sllin_devs);
+ sllin_devs = NULL;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)
++ tty_unregister_ldisc(&sll_ldisc);
++
++#else
+ i = tty_unregister_ldisc(N_SLLIN);
++
+ if (i)
+ pr_err("sllin: can't unregister ldisc (err %d)\n", i);
++#endif
+ }
+
+ module_init(sllin_init);
diff --git a/recipes-kernel/sllin/files/lin_config.conf b/recipes-kernel/sllin/files/lin_config.conf
deleted file mode 100644
index 9775b8b3..00000000
--- a/recipes-kernel/sllin/files/lin_config.conf
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--PCAN-LIN CT profile.-->
-<PCLIN_PROFILE Version="1">
- <LIN Group="2">
- <Scheduler_Entries Count="1">
- <!-- Poll steering wheel adapter at address 0x21 every 100 ms -->
- <Entry Time="100">33</Entry>
- </Scheduler_Entries>
- </LIN>
-</PCLIN_PROFILE>
diff --git a/recipes-kernel/sllin/files/sllin-demo-virtual.service b/recipes-kernel/sllin/files/sllin-demo-virtual.service
deleted file mode 100644
index 78824219..00000000
--- a/recipes-kernel/sllin/files/sllin-demo-virtual.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=LIN demo configuration (virtual)
-ConditionPathExists=!/dev/ttyUSB0
-After=afm-system-daemon.service
-
-[Service]
-Type=oneshot
-ExecStart=/usr/bin/start_lin_demo.sh
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/recipes-kernel/sllin/files/sllin-demo.service b/recipes-kernel/sllin/files/sllin-demo.service
deleted file mode 100644
index 2f2f5ac2..00000000
--- a/recipes-kernel/sllin/files/sllin-demo.service
+++ /dev/null
@@ -1,13 +0,0 @@
-[Unit]
-Description=LIN demo configuration
-ConditionPathExists=/dev/ttyUSB0
-After=afm-system-daemon.service
-
-[Service]
-Type=forking
-PIDFile=/var/run/lin_config.pid
-ExecStart=/usr/bin/start_lin_demo.sh
-RemainAfterExit=yes
-
-[Install]
-WantedBy=multi-user.target
diff --git a/recipes-kernel/sllin/files/start_lin_demo.sh b/recipes-kernel/sllin/files/start_lin_demo.sh
deleted file mode 100755
index 26f64c0a..00000000
--- a/recipes-kernel/sllin/files/start_lin_demo.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/sh
-
-# Attach serial LIN->CAN bridge and set up LIN polling
-if [ -c /dev/ttyUSB0 ]; then
- sleep 1
- /usr/bin/lin_config -c /etc/lin_config.conf -a sllin:/dev/ttyUSB0
- pidof lin_config > /var/run/lin_config.pid
- sleep 1
-else
- ip link add dev sllin0 type vcan
-fi
-ip link set sllin0 up
-
-# Initialize HVAC controller
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 02A#
-usleep 100000
-cansend sllin0 02B#
-usleep 100000
-cansend sllin0 032#F0F8FFFFFFFFFFFF
-usleep 100000
-cansend sllin0 032#F0F8FFFFFFFFFFFF
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 030#
-usleep 100000
-cansend sllin0 02D#
-usleep 100000
-cansend sllin0 02C#
-usleep 100000
-cansend sllin0 02D#
-usleep 100000
-cansend sllin0 02C#
-usleep 100000
-
diff --git a/recipes-kernel/sllin/sllin.bb b/recipes-kernel/sllin/sllin.bb
deleted file mode 100644
index 7c4313f1..00000000
--- a/recipes-kernel/sllin/sllin.bb
+++ /dev/null
@@ -1,51 +0,0 @@
-DESCRIPTION = "slLIN driver module"
-LICENSE = "GPLv2"
-LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
-
-inherit module systemd
-
-DEPENDS = "virtual/kernel"
-
-SRC_URI = "git://github.com/trainman419/linux-lin.git;protocol=https"
-SRCREV = "155d885e8ccc907a56f6c86c4b159fac27ef6fec"
-S = "${WORKDIR}/git/sllin"
-
-PV = "0.1+git${SRCPV}"
-
-SRC_URI_append = " \
- file://0001_update_makefile.patch;pnum=2 \
- file://0002_fix_null_operation_check.patch;pnum=2 \
- file://0003-Allow-recent-kernels-newer-4.11.x-to-build.patch;pnum=2 \
- file://0001-Disable-sllin-driver-debug-log.patch;pnum=2 \
- file://sllin-demo.service \
- file://sllin-demo-virtual.service \
- file://start_lin_demo.sh \
- file://lin_config.conf \
-"
-
-KERNEL_MODULE_AUTOLOAD_append = " sllin"
-KERNEL_MODULE_PROBECONF_append = " sllin"
-
-SLLINBAUDRATE ??= "9600"
-module_conf_sllin = "options sllin baudrate=${SLLINBAUDRATE}"
-
-SYSTEMD_SERVICE_${PN} = "sllin-demo.service"
-SYSTEMD_SERVICE_${PN}-virtual = "sllin-demo-virtual.service"
-
-do_install_append () {
- install -d 644 ${D}/${bindir}
- install -m 755 ${WORKDIR}/start_lin_demo.sh ${D}/${bindir}/start_lin_demo.sh
- install -d ${D}${systemd_system_unitdir}
- install -m 0644 ${WORKDIR}/sllin-demo.service ${D}${systemd_system_unitdir}/
- install -m 0644 ${WORKDIR}/sllin-demo-virtual.service ${D}${systemd_system_unitdir}/
- install -d ${D}${sysconfdir}
- install -m 0644 ${WORKDIR}/lin_config.conf ${D}${sysconfdir}/
-}
-
-PACKAGES =+ "${PN}-virtual"
-
-FILES_${PN} += "${bindir}/start_lin_demo.sh ${sysconfdir}/lin_config.conf"
-
-FILES_${PN}-virtual = "${systemd_system_unitdir}/sllin-demo-virtual.service"
-
-RDEPENDS_${PN} += "lin-config"
diff --git a/recipes-kernel/sllin/files/0001_update_makefile.patch b/recipes-kernel/sllin/sllin/0001-update-makefile.patch
index 7db57802..7db57802 100644
--- a/recipes-kernel/sllin/files/0001_update_makefile.patch
+++ b/recipes-kernel/sllin/sllin/0001-update-makefile.patch
diff --git a/recipes-kernel/sllin/sllin/0002-5.4-less-than-110-fix.patch b/recipes-kernel/sllin/sllin/0002-5.4-less-than-110-fix.patch
new file mode 100644
index 00000000..8c13bfb5
--- /dev/null
+++ b/recipes-kernel/sllin/sllin/0002-5.4-less-than-110-fix.patch
@@ -0,0 +1,25 @@
+Fix compilation against kernels < 5.4.110
+
+The fix to handle the backport of 4e096a18 to linux-5.4.y is a bit
+too broad, as it breaks building against kernels older than 5.4.110,
+add a version check to fix.
+
+Upstream-Status: pending
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+
+diff --git a/sllin/sllin.c b/sllin/sllin.c
+index b3f2636..a6fb120 100644
+--- a/sllin/sllin.c
++++ b/sllin/sllin.c
+@@ -1604,7 +1604,11 @@ static struct sllin *sll_alloc(dev_t line)
+ sl = netdev_priv(dev);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)
+ can_ml = (void *)sl + ALIGN(sizeof(*sl), NETDEV_ALIGN);
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 110)
+ can_set_ml_priv(dev, can_ml);
++ #else
++ dev->ml_priv = can_ml;
++ #endif
+ #endif
+ /* Initialize channel control data */
+ sl->magic = SLLIN_MAGIC;
diff --git a/recipes-kernel/sllin/sllin_git.bb b/recipes-kernel/sllin/sllin_git.bb
new file mode 100644
index 00000000..f13bcd55
--- /dev/null
+++ b/recipes-kernel/sllin/sllin_git.bb
@@ -0,0 +1,22 @@
+DESCRIPTION = "slLIN driver module"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://sllin.c;beginline=7;endline=37;md5=6408e14dba951f8cbe3c2a003a0d89d2"
+
+inherit module
+
+DEPENDS = "virtual/kernel"
+
+SRC_URI = "git://github.com/lin-bus/linux-lin.git;protocol=https;branch=master \
+ file://0001-update-makefile.patch;pnum=2 \
+ file://0002-5.4-less-than-110-fix.patch;pnum=2 \
+"
+SRCREV = "beb057d7505e0c4d7c61f3f4927b76916ec00e88"
+S = "${WORKDIR}/git/sllin"
+
+PV = "0.1+git${SRCPV}"
+
+KERNEL_MODULE_AUTOLOAD:append = " sllin"
+KERNEL_MODULE_PROBECONF:append = " sllin"
+
+SLLINBAUDRATE ??= "9600"
+module_conf_sllin = "options sllin baudrate=${SLLINBAUDRATE}"