New alloc_netdev() API since kernel 3.17.
authorFlorian Pose <fp@igh-essen.com>
Thu, 07 May 2015 15:53:42 +0200
changeset 2641 535465bf176d
parent 2635 42b62867574d
child 2642 9dc0b2262f90
New alloc_netdev() API since kernel 3.17.
devices/generic.c
master/ethernet.c
--- a/devices/generic.c	Fri Jan 22 13:09:43 2016 +0100
+++ b/devices/generic.c	Thu May 07 15:53:42 2015 +0200
@@ -149,7 +149,12 @@
     dev->socket = NULL;
     dev->rx_buf = NULL;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+    dev->netdev = alloc_netdev(sizeof(ec_gen_device_t *), &null,
+            NET_NAME_UNKNOWN, ether_setup);
+#else
     dev->netdev = alloc_netdev(sizeof(ec_gen_device_t *), &null, ether_setup);
+#endif
     if (!dev->netdev) {
         return -ENOMEM;
     }
--- a/master/ethernet.c	Fri Jan 22 13:09:43 2016 +0100
+++ b/master/ethernet.c	Thu May 07 15:53:42 2015 +0200
@@ -176,7 +176,13 @@
 
     snprintf(eoe->datagram.name, EC_DATAGRAM_NAME_SIZE, name);
 
-    if (!(eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup))) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 17, 0)
+    eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, NET_NAME_UNKNOWN,
+            ether_setup);
+#else
+    eoe->dev = alloc_netdev(sizeof(ec_eoe_t *), name, ether_setup);
+#endif
+    if (!eoe->dev) {
         EC_SLAVE_ERR(slave, "Unable to allocate net_device %s"
                 " for EoE handler!\n", name);
         ret = -ENODEV;