Support changed sock_create_kern() interface from Linux 4.2.
--- a/devices/generic.c Tue Oct 18 10:20:21 2016 +0200
+++ b/devices/generic.c Tue Oct 18 10:20:47 2016 +0200
@@ -212,8 +212,13 @@
return -ENOMEM;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
+ ret = sock_create_kern(&init_net, PF_PACKET, SOCK_RAW,
+ htons(ETH_P_ETHERCAT), &dev->socket);
+#else
ret = sock_create_kern(PF_PACKET, SOCK_RAW, htons(ETH_P_ETHERCAT),
&dev->socket);
+#endif
if (ret) {
printk(KERN_ERR PFX "Failed to create socket (ret = %i).\n", ret);
return ret;