#include <linux/version.h>
#include "linux/lin_bus.h"
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
+#include <uapi/linux/sched/types.h>
+#endif
+
/* Should be in include/linux/tty.h */
#define N_SLLIN 25
/* -------------------------------- */
static void sll_setup(struct net_device *dev)
{
dev->netdev_ops = &sll_netdev_ops;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
dev->destructor = sll_free_netdev;
+#else /* Linux 4.12.0+ */
+ dev->priv_destructor = sll_free_netdev;
+#endif /* Linux 4.12.0+ */
dev->hard_header_len = 0;
dev->addr_len = 0;
/* 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);
spin_unlock_irqrestore(&sl->linfr_lock, flags);
} else { /* SFF NON-RTR CAN frame -> LIN header + LIN response */
- struct sllin_conf_entry *sce;
-
netdev_dbg(sl->dev, "%s: NON-RTR SFF CAN frame, ID = %x\n",
__func__, (int)cf->can_id & LIN_ID_MASK);
if (sl->tty) {
netdev_dbg(sl->dev, "tty discipline still running\n");
/* Intentionally leak the control block. */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0)
dev->destructor = NULL;
+#else /* Linux 4.12.0+ */
+ dev->priv_destructor = NULL;
+#endif /* Linux 4.12.0+ */
}
unregister_netdev(dev);