Module: xenomai-3
Branch: next
Commit: feb778e5f9800419fb0525855baf1a8915c429e4
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=feb778e5f9800419fb0525855baf1a8915c429e4

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Thu Apr 23 19:16:17 2015 +0200

rtnet: fix alloc_netdev arguments after Linux 3.17

---

 kernel/cobalt/include/asm-generic/xenomai/wrappers.h |    8 ++++++++
 kernel/drivers/net/addons/cap.c                      |    4 ++--
 kernel/drivers/net/addons/proxy.c                    |    2 +-
 kernel/drivers/net/stack/rtmac/rtmac_vnic.c          |    3 ++-
 4 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h 
b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
index 2a2172d..61b8a54 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
@@ -60,4 +60,12 @@
 #define smp_mb__after_atomic()   smp_mb()
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+#include <linux/netdevice.h>
+
+#undef alloc_netdev
+#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
+       alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
+#endif
+
 #endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
diff --git a/kernel/drivers/net/addons/cap.c b/kernel/drivers/net/addons/cap.c
index 605a1d8..7b8f4fe 100644
--- a/kernel/drivers/net/addons/cap.c
+++ b/kernel/drivers/net/addons/cap.c
@@ -401,7 +401,7 @@ int __init rtcap_init(void)
                   sizeof(struct net_device_stats));
 
            dev = alloc_netdev(sizeof(struct rtnet_device *), rtdev->name,
-                              tap_dev_setup);
+                           NET_NAME_UNKNOWN, tap_dev_setup);
            if (!dev) {
                ret = -ENOMEM;
                goto error3;
@@ -420,7 +420,7 @@ int __init rtcap_init(void)
 
            if ((rtdev->flags & IFF_LOOPBACK) == 0) {
                dev = alloc_netdev(sizeof(struct rtnet_device *), rtdev->name,
-                                  tap_dev_setup);
+                               NET_NAME_UNKNOWN, tap_dev_setup);
                if (!dev) {
                    ret = -ENOMEM;
                    goto error3;
diff --git a/kernel/drivers/net/addons/proxy.c 
b/kernel/drivers/net/addons/proxy.c
index f26ba8d..9b459eb 100644
--- a/kernel/drivers/net/addons/proxy.c
+++ b/kernel/drivers/net/addons/proxy.c
@@ -357,7 +357,7 @@ static int __init rtnetproxy_init_module(void)
        goto err1;
     }
 
-    dev_rtnetproxy = alloc_netdev(0, "rtproxy", rtnetproxy_init);
+    dev_rtnetproxy = alloc_netdev(0, "rtproxy", NET_NAME_UNKNOWN, 
rtnetproxy_init);
     if (!dev_rtnetproxy) {
        err = -ENOMEM;
        goto err1;
diff --git a/kernel/drivers/net/stack/rtmac/rtmac_vnic.c 
b/kernel/drivers/net/stack/rtmac/rtmac_vnic.c
index ac081a7..e17405e 100644
--- a/kernel/drivers/net/stack/rtmac/rtmac_vnic.c
+++ b/kernel/drivers/net/stack/rtmac/rtmac_vnic.c
@@ -271,7 +271,8 @@ int rtmac_vnic_add(struct rtnet_device *rtdev, 
vnic_xmit_handler vnic_xmit)
 
     snprintf(buf, sizeof(buf), "vnic%d", rtdev->ifindex-1);
 
-    vnic = alloc_netdev(sizeof(struct rtnet_device *), buf, rtmac_vnic_setup);
+    vnic = alloc_netdev(sizeof(struct rtnet_device *), buf,
+                   NET_NAME_UNKNOWN, rtmac_vnic_setup);
     if (!vnic) {
        res = -ENOMEM;
        goto error;


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to