Commit c86f3e2a authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b57a68dc
...@@ -20,8 +20,9 @@ ...@@ -20,8 +20,9 @@
* *
*/ */
#define KERNEL_2_6_27
#include "logging.h" #include "include/logging.h"
#include "NetVsc.h" #include "NetVsc.h"
#include "RndisFilter.h" #include "RndisFilter.h"
......
...@@ -24,12 +24,12 @@ ...@@ -24,12 +24,12 @@
#ifndef _NETVSC_H_ #ifndef _NETVSC_H_
#define _NETVSC_H_ #define _NETVSC_H_
#include "VmbusPacketFormat.h" #include "include/VmbusPacketFormat.h"
#include "nvspprotocol.h" #include "include/nvspprotocol.h"
#include "List.h" #include "include/List.h"
#include "NetVscApi.h" #include "include/NetVscApi.h"
// //
// #defines // #defines
// //
......
...@@ -21,10 +21,11 @@ ...@@ -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" #include "RndisFilter.h"
// //
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
#define __struct_bcount(x) #define __struct_bcount(x)
#include "osd.h" #include "include/osd.h"
#include "NetVsc.h" #include "NetVsc.h"
#include "rndis.h" #include "include/rndis.h"
#define RNDIS_HEADER_SIZE (sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER)) #define RNDIS_HEADER_SIZE (sizeof(RNDIS_MESSAGE) - sizeof(RNDIS_MESSAGE_CONTAINER))
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#pragma once #pragma once
#include <VmbusChannelInterface.h> #include "VmbusChannelInterface.h"
#define NVSP_INVALID_PROTOCOL_VERSION ((UINT32)0xFFFFFFFF) #define NVSP_INVALID_PROTOCOL_VERSION ((UINT32)0xFFFFFFFF)
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
* *
*/ */
#define KERNEL_2_6_27
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -41,10 +42,10 @@ ...@@ -41,10 +42,10 @@
#include <net/sock.h> #include <net/sock.h>
#include <net/pkt_sched.h> #include <net/pkt_sched.h>
#include "logging.h" #include "include/logging.h"
#include "vmbus.h" #include "include/vmbus.h"
#include "NetVscApi.h" #include "include/NetVscApi.h"
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
...@@ -158,6 +159,14 @@ static void netvsc_set_multicast_list(UNUSED_VAR(struct net_device *net)) ...@@ -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() Name: netvsc_probe()
...@@ -225,11 +234,7 @@ static int netvsc_probe(struct device *device) ...@@ -225,11 +234,7 @@ static int netvsc_probe(struct device *device)
memcpy(net->dev_addr, device_info.MacAddr, ETH_ALEN); memcpy(net->dev_addr, device_info.MacAddr, ETH_ALEN);
net->open = netvsc_open; net->netdev_ops = &device_ops;
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;
#if !defined(KERNEL_2_6_27) #if !defined(KERNEL_2_6_27)
SET_MODULE_OWNER(net); SET_MODULE_OWNER(net);
......
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