Staging: hv: make the Hyper-V virtual network driver build

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, September 16, 2009 - 9:04 am

Gitweb:     http://git.kernel.org/linus/c86f3e2a73f4924b20ed7a56ebdaf874af861911
Commit:     c86f3e2a73f4924b20ed7a56ebdaf874af861911
Parent:     b57a68dcd9030515763133f79c5a4a7c572e45d6
Author:     Greg Kroah-Hartman <gregkh@suse.de>
AuthorDate: Tue Jul 14 10:59:56 2009 -0700
Committer:  Greg Kroah-Hartman <gregkh@suse.de>
CommitDate: Tue Sep 15 12:01:45 2009 -0700

    Staging: hv: make the Hyper-V virtual network driver build
    
    The #define KERNEL_2_6_27 needs to be set, and I adjusted the include
    directories a bit to get things to build properly.
    
    The driver was changed to use net_device_ops, as that is needed to build
    and operate properly now.
    
    The hv_netvsc code should now build with no errors.
    
    Cc: Hank Janssen <hjanssen@microsoft.com>
    Cc: Haiyang Zhang <haiyangz@microsoft.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/staging/hv/NetVsc.c               |    3 ++-
 drivers/staging/hv/NetVsc.h               |    8 ++++----
 drivers/staging/hv/RndisFilter.c          |    5 +++--
 drivers/staging/hv/RndisFilter.h          |    4 ++--
 drivers/staging/hv/include/nvspprotocol.h |    2 +-
 drivers/staging/hv/netvsc_drv.c           |   21 +++++++++++++--------
 6 files changed, 25 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index 6cc3143..f9a3d18 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -20,8 +20,9 @@
  *
  */
 
+#define KERNEL_2_6_27
 
-#include "logging.h"
+#include "include/logging.h"
 #include "NetVsc.h"
 #include "RndisFilter.h"
 
diff --git a/drivers/staging/hv/NetVsc.h b/drivers/staging/hv/NetVsc.h
index 37d0744..e92cfc1 100644
--- a/drivers/staging/hv/NetVsc.h
+++ b/drivers/staging/hv/NetVsc.h
@@ -24,12 +24,12 @@
 #ifndef _NETVSC_H_
 #define _NETVSC_H_
 
-#include "VmbusPacketFormat.h"
-#include "nvspprotocol.h"
+#include "include/VmbusPacketFormat.h"
+#include "include/nvspprotocol.h"
 
-#include "List.h"
+#include "include/List.h"
 
-#include "NetVscApi.h"
+#include "include/NetVscApi.h"
 //
 // #defines
 //
diff --git a/drivers/staging/hv/RndisFilter.c b/drivers/staging/hv/RndisFilter.c
index 57b828b..c2cac21 100644
--- a/drivers/staging/hv/RndisFilter.c
+++ b/drivers/staging/hv/RndisFilter.c
@@ -21,10 +21,11 @@
  *
  */
 
+#define KERNEL_2_6_27
 
-#include "logging.h"
+#include "include/logging.h"
 
-#include "NetVscApi.h"
+#include "include/NetVscApi.h"
 #include "RndisFilter.h"
 
 //
diff --git a/drivers/staging/hv/RndisFilter.h b/drivers/staging/hv/RndisFilter.h
index f31e7bc..1231d6f 100644
--- a/drivers/staging/hv/RndisFilter.h
+++ b/drivers/staging/hv/RndisFilter.h
@@ -27,10 +27,10 @@
 
 #define __struct_bcount(x)
 
-#include "osd.h"
+#include "include/osd.h"
 #include "NetVsc.h"
 
-#include "rndis.h"
+#include "include/rndis.h"
 
 #define RNDIS_HEADER_SIZE	(sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER))
 
diff --git a/drivers/staging/hv/include/nvspprotocol.h b/drivers/staging/hv/include/nvspprotocol.h
index 834dbae..60091a4 100644
--- a/drivers/staging/hv/include/nvspprotocol.h
+++ b/drivers/staging/hv/include/nvspprotocol.h
@@ -24,7 +24,7 @@
 
 #pragma once
 
-#include <VmbusChannelInterface.h>
+#include "VmbusChannelInterface.h"
 
 #define NVSP_INVALID_PROTOCOL_VERSION           ((UINT32)0xFFFFFFFF)
 
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 1b3174a..71931f5 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -20,6 +20,7 @@
  *
  */
 
+#define KERNEL_2_6_27
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -41,10 +42,10 @@
 #include <net/sock.h>
 #include <net/pkt_sched.h>
 
-#include "logging.h"
-#include "vmbus.h"
+#include "include/logging.h"
+#include "include/vmbus.h"
 
-#include "NetVscApi.h"
+#include "include/NetVscApi.h"
 
 MODULE_LICENSE("GPL");
 
@@ -158,6 +159,14 @@ static void netvsc_set_multicast_list(UNUSED_VAR(struct net_device *net))
 }
 
 
+static const struct net_device_ops device_ops = {
+	.ndo_open = netvsc_open,
+	.ndo_stop = netvsc_close,
+	.ndo_start_xmit	= netvsc_start_xmit,
+	.ndo_get_stats = netvsc_get_stats,
+	.ndo_set_multicast_list = netvsc_set_multicast_list,
+};
+
 /*++
 
 Name:	netvsc_probe()
@@ -225,11 +234,7 @@ static int netvsc_probe(struct device *device)
 
 	memcpy(net->dev_addr, device_info.MacAddr, ETH_ALEN);
 
-	net->open				= netvsc_open;
-	net->hard_start_xmit	= netvsc_start_xmit;
-	net->stop				= netvsc_close;
-	net->get_stats			= netvsc_get_stats;
-	net->set_multicast_list = netvsc_set_multicast_list;
+	net->netdev_ops = &device_ops;
 
 #if !defined(KERNEL_2_6_27)
 	SET_MODULE_OWNER(net);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Staging: hv: make the Hyper-V virtual network driver build, Linux Kernel Mailing ..., (Wed Sep 16, 9:04 am)