Commit e576ee40 authored by thomasl's avatar thomasl
Browse files

alloc_netdev changed in kernel 3.17



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6050 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent bbaa0633
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
//:::::::::::::::::::::::::::::::::::::::;; //:::::::::::::::::::::::::::::::::::::::;;
//#include <linux/module.h> //#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
...@@ -453,7 +454,11 @@ int init_module (void) { ...@@ -453,7 +454,11 @@ int init_module (void) {
// Allocate device structure // Allocate device structure
sprintf(devicename,"oai%d",inst); sprintf(devicename,"oai%d",inst);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
gdev = alloc_netdev(sizeof(struct nas_priv), devicename, nasmt_init); 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); priv = netdev_priv(gdev);
//// ////
#ifndef NAS_NETLINK #ifndef NAS_NETLINK
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
//:::::::::::::::::::::::::::::::::::::::;; //:::::::::::::::::::::::::::::::::::::::;;
//#include <linux/module.h> //#include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/version.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#ifdef NAS_DRIVER_TYPE_ETHERNET #ifdef NAS_DRIVER_TYPE_ETHERNET
...@@ -438,7 +439,11 @@ int init_module (void) { ...@@ -438,7 +439,11 @@ int init_module (void) {
// Allocate device structure // Allocate device structure
sprintf(devicename,"oai%d",inst); sprintf(devicename,"oai%d",inst);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
gdev = alloc_netdev(sizeof(struct nas_priv), devicename, nasrg_init); 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"); printk("nasrg_init_module: after alloc_netdev \n");
priv = netdev_priv(gdev); priv = netdev_priv(gdev);
//// ////
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment