aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/hv/TODO2
-rw-r--r--drivers/staging/hv/channel_interface.c29
-rw-r--r--drivers/staging/hv/channel_interface.h2
-rw-r--r--drivers/staging/hv/vmbus.c9
-rw-r--r--drivers/staging/hv/vmbus_api.h4
-rw-r--r--drivers/staging/hv/vmbus_drv.c4
6 files changed, 19 insertions, 31 deletions
diff --git a/drivers/staging/hv/TODO b/drivers/staging/hv/TODO
index 66a89c809dd..582fd4ab3f1 100644
--- a/drivers/staging/hv/TODO
+++ b/drivers/staging/hv/TODO
@@ -2,8 +2,6 @@ TODO:
2 - fix remaining checkpatch warnings and errors 2 - fix remaining checkpatch warnings and errors
3 - audit the vmbus to verify it is working properly with the 3 - audit the vmbus to verify it is working properly with the
4 driver model 4 driver model
5 - convert vmbus driver interface function pointer tables
6 to constant, a.k.a vmbus_ops
7 - see if the vmbus can be merged with the other virtual busses 5 - see if the vmbus can be merged with the other virtual busses
8 in the kernel 6 in the kernel
9 - audit the network driver 7 - audit the network driver
diff --git a/drivers/staging/hv/channel_interface.c b/drivers/staging/hv/channel_interface.c
index d9f51ac75ea..3f6a1cb9cd8 100644
--- a/drivers/staging/hv/channel_interface.c
+++ b/drivers/staging/hv/channel_interface.c
@@ -97,20 +97,6 @@ static int IVmbusChannelTeardownGpadl(struct hv_device *device, u32 GpadlHandle)
97 97
98} 98}
99 99
100void GetChannelInterface(struct vmbus_channel_interface *iface)
101{
102 iface->Open = IVmbusChannelOpen;
103 iface->Close = IVmbusChannelClose;
104 iface->SendPacket = IVmbusChannelSendPacket;
105 iface->SendPacketPageBuffer = IVmbusChannelSendPacketPageBuffer;
106 iface->SendPacketMultiPageBuffer =
107 IVmbusChannelSendPacketMultiPageBuffer;
108 iface->RecvPacket = IVmbusChannelRecvPacket;
109 iface->RecvPacketRaw = IVmbusChannelRecvPacketRaw;
110 iface->EstablishGpadl = IVmbusChannelEstablishGpadl;
111 iface->TeardownGpadl = IVmbusChannelTeardownGpadl;
112 iface->GetInfo = GetChannelInfo;
113}
114 100
115void GetChannelInfo(struct hv_device *device, struct hv_device_info *info) 101void GetChannelInfo(struct hv_device *device, struct hv_device_info *info)
116{ 102{
@@ -150,3 +136,18 @@ void GetChannelInfo(struct hv_device *device, struct hv_device_info *info)
150 info->Outbound.BytesAvailToRead = debugInfo.Outbound.BytesAvailToRead; 136 info->Outbound.BytesAvailToRead = debugInfo.Outbound.BytesAvailToRead;
151 info->Outbound.BytesAvailToWrite = debugInfo.Outbound.BytesAvailToWrite; 137 info->Outbound.BytesAvailToWrite = debugInfo.Outbound.BytesAvailToWrite;
152} 138}
139
140
141/* vmbus interface function pointer table */
142const struct vmbus_channel_interface vmbus_ops = {
143 .Open = IVmbusChannelOpen,
144 .Close = IVmbusChannelClose,
145 .SendPacket = IVmbusChannelSendPacket,
146 .SendPacketPageBuffer = IVmbusChannelSendPacketPageBuffer,
147 .SendPacketMultiPageBuffer = IVmbusChannelSendPacketMultiPageBuffer,
148 .RecvPacket = IVmbusChannelRecvPacket,
149 .RecvPacketRaw = IVmbusChannelRecvPacketRaw,
150 .EstablishGpadl = IVmbusChannelEstablishGpadl,
151 .TeardownGpadl = IVmbusChannelTeardownGpadl,
152 .GetInfo = GetChannelInfo,
153};
diff --git a/drivers/staging/hv/channel_interface.h b/drivers/staging/hv/channel_interface.h
index 6acaf6ce2c4..ec882192c73 100644
--- a/drivers/staging/hv/channel_interface.h
+++ b/drivers/staging/hv/channel_interface.h
@@ -27,8 +27,6 @@
27 27
28#include "vmbus_api.h" 28#include "vmbus_api.h"
29 29
30void GetChannelInterface(struct vmbus_channel_interface *ChannelInterface);
31
32void GetChannelInfo(struct hv_device *Device, 30void GetChannelInfo(struct hv_device *Device,
33 struct hv_device_info *DeviceInfo); 31 struct hv_device_info *DeviceInfo);
34 32
diff --git a/drivers/staging/hv/vmbus.c b/drivers/staging/hv/vmbus.c
index ca1e18a6200..db2afa33eac 100644
--- a/drivers/staging/hv/vmbus.c
+++ b/drivers/staging/hv/vmbus.c
@@ -61,14 +61,6 @@ static void VmbusGetChannelOffers(void)
61} 61}
62 62
63/* 63/*
64 * VmbusGetChannelInterface - Get the channel interface
65 */
66static void VmbusGetChannelInterface(struct vmbus_channel_interface *Interface)
67{
68 GetChannelInterface(Interface);
69}
70
71/*
72 * VmbusGetChannelInfo - Get the device info for the specified device object 64 * VmbusGetChannelInfo - Get the device info for the specified device object
73 */ 65 */
74static void VmbusGetChannelInfo(struct hv_device *DeviceObject, 66static void VmbusGetChannelInfo(struct hv_device *DeviceObject,
@@ -279,7 +271,6 @@ int VmbusInitialize(struct hv_driver *drv)
279 driver->OnMsgDpc = VmbusOnMsgDPC; 271 driver->OnMsgDpc = VmbusOnMsgDPC;
280 driver->OnEventDpc = VmbusOnEventDPC; 272 driver->OnEventDpc = VmbusOnEventDPC;
281 driver->GetChannelOffers = VmbusGetChannelOffers; 273 driver->GetChannelOffers = VmbusGetChannelOffers;
282 driver->GetChannelInterface = VmbusGetChannelInterface;
283 driver->GetChannelInfo = VmbusGetChannelInfo; 274 driver->GetChannelInfo = VmbusGetChannelInfo;
284 275
285 /* Hypervisor initialization...setup hypercall page..etc */ 276 /* Hypervisor initialization...setup hypercall page..etc */
diff --git a/drivers/staging/hv/vmbus_api.h b/drivers/staging/hv/vmbus_api.h
index 4275be3292c..7f3d7dcb96a 100644
--- a/drivers/staging/hv/vmbus_api.h
+++ b/drivers/staging/hv/vmbus_api.h
@@ -129,6 +129,9 @@ struct vmbus_channel_interface {
129 void (*GetInfo)(struct hv_device *dev, struct hv_device_info *devinfo); 129 void (*GetInfo)(struct hv_device *dev, struct hv_device_info *devinfo);
130}; 130};
131 131
132extern const struct vmbus_channel_interface vmbus_ops;
133
134
132/* Base driver object */ 135/* Base driver object */
133struct hv_driver { 136struct hv_driver {
134 const char *name; 137 const char *name;
@@ -183,7 +186,6 @@ struct vmbus_driver {
183 void (*OnEventDpc)(struct hv_driver *driver); 186 void (*OnEventDpc)(struct hv_driver *driver);
184 void (*GetChannelOffers)(void); 187 void (*GetChannelOffers)(void);
185 188
186 void (*GetChannelInterface)(struct vmbus_channel_interface *i);
187 void (*GetChannelInfo)(struct hv_device *dev, 189 void (*GetChannelInfo)(struct hv_device *dev,
188 struct hv_device_info *devinfo); 190 struct hv_device_info *devinfo);
189}; 191};
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index 092f02ed6be..ad298871d3f 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -458,9 +458,7 @@ EXPORT_SYMBOL(vmbus_child_driver_unregister);
458 */ 458 */
459void vmbus_get_interface(struct vmbus_channel_interface *interface) 459void vmbus_get_interface(struct vmbus_channel_interface *interface)
460{ 460{
461 struct vmbus_driver *vmbus_drv_obj = &g_vmbus_drv.drv_obj; 461 *interface = vmbus_ops;
462
463 vmbus_drv_obj->GetChannelInterface(interface);
464} 462}
465EXPORT_SYMBOL(vmbus_get_interface); 463EXPORT_SYMBOL(vmbus_get_interface);
466 464