From e576ee40462540422ab5884a867d5a13c9765fe8 Mon Sep 17 00:00:00 2001 From: thomasl Date: Thu, 20 Nov 2014 14:38:34 +0000 Subject: [PATCH] alloc_netdev changed in kernel 3.17 git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6050 818b1a75-f10b-46b9-bf7c-635c3b92a50f --- openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c | 5 +++++ openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c b/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c index 6cd2a38a0d..1e22396e1a 100755 --- a/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c +++ b/openair2/NAS/DRIVER/CELLULAR/NASMT/nasmt_device.c @@ -47,6 +47,7 @@ //:::::::::::::::::::::::::::::::::::::::;; //#include #include +#include #include #include #include @@ -453,7 +454,11 @@ int init_module (void) { // Allocate device structure sprintf(devicename,"oai%d",inst); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) gdev = alloc_netdev(sizeof(struct nas_priv), devicename, nasmt_init); +#else + gdev = alloc_netdev(sizeof(struct nas_priv), devicename, NET_NAME_PREDICTABLE, nasmt_init); +#endif priv = netdev_priv(gdev); //// #ifndef NAS_NETLINK diff --git a/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c b/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c index 19ad74578a..1da48cd724 100755 --- a/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c +++ b/openair2/NAS/DRIVER/CELLULAR/NASRG/nasrg_device.c @@ -47,6 +47,7 @@ //:::::::::::::::::::::::::::::::::::::::;; //#include #include +#include #include #include #ifdef NAS_DRIVER_TYPE_ETHERNET @@ -438,7 +439,11 @@ int init_module (void) { // Allocate device structure sprintf(devicename,"oai%d",inst); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) gdev = alloc_netdev(sizeof(struct nas_priv), devicename, nasrg_init); +#else + gdev = alloc_netdev(sizeof(struct nas_priv), devicename, NET_NAME_PREDICTABLE, nasrg_init); +#endif printk("nasrg_init_module: after alloc_netdev \n"); priv = netdev_priv(gdev); ////