1 From foo@baz Mon Jul 13 17:09:34 PDT 2009
2 Date: Mon, 13 Jul 2009 17:09:34 -0700
3 From: Greg Kroah-Hartman <gregkh@suse.de>
4 Subject: Staging: hv: make the Hyper-V virtual bus code build
6 From: Greg Kroah-Hartman <gregkh@suse.de>
8 The #define KERNEL_2_6_27 needs to be set, and I adjusted the include
9 directories a bit to get things to build properly.
11 I also fixed up the direct access of bus_id, as that field is now gone.
13 The hv_vmbus code should now build properly, with no errors.
15 Cc: Hank Janssen <hjanssen@microsoft.com>
16 Cc: Haiyang Zhang <haiyangz@microsoft.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
20 drivers/staging/hv/Channel.c | 4 ++--
21 drivers/staging/hv/Channel.h | 2 +-
22 drivers/staging/hv/ChannelInterface.h | 2 +-
23 drivers/staging/hv/ChannelMgmt.c | 4 ++--
24 drivers/staging/hv/ChannelMgmt.h | 8 ++++----
25 drivers/staging/hv/Connection.c | 2 +-
26 drivers/staging/hv/Hv.c | 2 +-
27 drivers/staging/hv/Hv.h | 16 ++++++++--------
28 drivers/staging/hv/RingBuffer.c | 2 +-
29 drivers/staging/hv/RingBuffer.h | 2 +-
30 drivers/staging/hv/Sources.c | 1 +
31 drivers/staging/hv/Vmbus.c | 2 +-
32 drivers/staging/hv/VmbusPrivate.h | 4 ++--
33 drivers/staging/hv/include/ChannelMessages.h | 2 +-
34 drivers/staging/hv/osd.c | 3 ++-
35 drivers/staging/hv/vmbus_drv.c | 15 ++++++++-------
36 16 files changed, 37 insertions(+), 34 deletions(-)
38 --- a/drivers/staging/hv/Channel.c
39 +++ b/drivers/staging/hv/Channel.c
46 +#include "include/osd.h"
47 +#include "include/logging.h"
49 #include "VmbusPrivate.h"
51 --- a/drivers/staging/hv/Channel.h
52 +++ b/drivers/staging/hv/Channel.h
58 +#include "include/osd.h"
59 #include "ChannelMgmt.h"
62 --- a/drivers/staging/hv/ChannelInterface.h
63 +++ b/drivers/staging/hv/ChannelInterface.h
65 #ifndef _CHANNEL_INTERFACE_H_
66 #define _CHANNEL_INTERFACE_H_
68 -#include "VmbusApi.h"
69 +#include "include/VmbusApi.h"
73 --- a/drivers/staging/hv/ChannelMgmt.c
74 +++ b/drivers/staging/hv/ChannelMgmt.c
81 +#include "include/osd.h"
82 +#include "include/logging.h"
84 #include "VmbusPrivate.h"
86 --- a/drivers/staging/hv/ChannelMgmt.h
87 +++ b/drivers/staging/hv/ChannelMgmt.h
89 #ifndef _CHANNEL_MGMT_H_
90 #define _CHANNEL_MGMT_H_
94 +#include "include/osd.h"
95 +#include "include/List.h"
96 #include "RingBuffer.h"
98 -#include "VmbusChannelInterface.h"
99 -#include "ChannelMessages.h"
100 +#include "include/VmbusChannelInterface.h"
101 +#include "include/ChannelMessages.h"
105 --- a/drivers/staging/hv/Connection.c
106 +++ b/drivers/staging/hv/Connection.c
111 -#include "logging.h"
112 +#include "include/logging.h"
114 #include "VmbusPrivate.h"
116 --- a/drivers/staging/hv/Hv.c
117 +++ b/drivers/staging/hv/Hv.c
122 -#include "logging.h"
123 +#include "include/logging.h"
124 #include "VmbusPrivate.h"
127 --- a/drivers/staging/hv/Hv.h
128 +++ b/drivers/staging/hv/Hv.h
134 +#include "include/osd.h"
136 -#include "HvTypes.h"
137 -#include "HvStatus.h"
138 +#include "include/HvTypes.h"
139 +#include "include/HvStatus.h"
140 //#include "HvVmApi.h"
141 //#include "HvKeApi.h"
142 //#include "HvMmApi.h"
143 //#include "HvCpuApi.h"
144 -#include "HvHalApi.h"
145 -#include "HvVpApi.h"
146 +#include "include/HvHalApi.h"
147 +#include "include/HvVpApi.h"
148 //#include "HvTrApi.h"
149 -#include "HvSynicApi.h"
150 +#include "include/HvSynicApi.h"
151 //#include "HvAmApi.h"
152 //#include "HvHkApi.h"
153 //#include "HvValApi.h"
154 -#include "HvHcApi.h"
155 -#include "HvPtApi.h"
156 +#include "include/HvHcApi.h"
157 +#include "include/HvPtApi.h"
161 --- a/drivers/staging/hv/include/ChannelMessages.h
162 +++ b/drivers/staging/hv/include/ChannelMessages.h
167 -#include <VmbusPacketFormat.h>
168 +#include "VmbusPacketFormat.h"
171 typedef UINT32 NTSTATUS;
172 --- a/drivers/staging/hv/osd.c
173 +++ b/drivers/staging/hv/osd.c
178 +#define KERNEL_2_6_27
180 #include <linux/module.h>
181 #include <linux/init.h>
183 #include <asm/kmap_types.h>
184 #include <asm/atomic.h>
187 +#include "include/osd.h"
191 --- a/drivers/staging/hv/RingBuffer.c
192 +++ b/drivers/staging/hv/RingBuffer.c
197 -#include "logging.h"
198 +#include "include/logging.h"
199 #include "RingBuffer.h"
202 --- a/drivers/staging/hv/RingBuffer.h
203 +++ b/drivers/staging/hv/RingBuffer.h
205 #ifndef _RING_BUFFER_H_
206 #define _RING_BUFFER_H_
209 +#include "include/osd.h"
211 typedef struct _SG_BUFFER_LIST {
213 --- a/drivers/staging/hv/Sources.c
214 +++ b/drivers/staging/hv/Sources.c
219 +#define KERNEL_2_6_27
223 --- a/drivers/staging/hv/Vmbus.c
224 +++ b/drivers/staging/hv/Vmbus.c
229 -#include "logging.h"
230 +#include "include/logging.h"
231 #include "VersionInfo.h"
232 #include "VmbusPrivate.h"
234 --- a/drivers/staging/hv/vmbus_drv.c
235 +++ b/drivers/staging/hv/vmbus_drv.c
240 +#define KERNEL_2_6_27
242 #include <linux/init.h>
243 #include <linux/module.h>
245 #include <linux/interrupt.h>
246 #include <linux/sysctl.h>
248 -#include "logging.h"
250 +#include "include/logging.h"
251 +#include "include/vmbus.h"
255 @@ -451,7 +452,7 @@ int vmbus_bus_init(PFN_DRIVERINITIALIZE
258 //strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name);
259 - sprintf(dev_ctx->device.bus_id, "vmbus_0_0");
260 + dev_set_name(&dev_ctx->device, "vmbus_0_0");
261 memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(GUID));
262 memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(GUID));
264 @@ -656,16 +657,16 @@ static int vmbus_child_device_register(D
266 // Make sure we are not registered already
268 - if (child_device_ctx->device.bus_id[0] != '\0')
269 + if (strlen(dev_name(&child_device_ctx->device)) != 0)
271 - DPRINT_ERR(VMBUS_DRV, "child device (%p) already registered - busid %s", child_device_ctx, child_device_ctx->device.bus_id);
272 + DPRINT_ERR(VMBUS_DRV, "child device (%p) already registered - busid %s", child_device_ctx, dev_name(&child_device_ctx->device));
278 // Set the device bus id. Otherwise, device_register()will fail.
279 - sprintf(child_device_ctx->device.bus_id, "vmbus_0_%d", InterlockedIncrement(&device_num));
280 + dev_set_name(&child_device_ctx->device, "vmbus_0_%d", InterlockedIncrement(&device_num));
282 // The new device belongs to this bus
283 child_device_ctx->device.bus = &g_vmbus_drv.bus; //device->dev.bus;
284 @@ -924,7 +925,7 @@ static int vmbus_probe(struct device *ch
285 ret = device_ctx->probe_error = driver_ctx->probe(child_device);
288 - DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s (%p) on driver %s (%d)...", child_device->bus_id, child_device, child_device->driver->name, ret);
289 + DPRINT_ERR(VMBUS_DRV, "probe() failed for device %s (%p) on driver %s (%d)...", dev_name(child_device), child_device, child_device->driver->name, ret);
292 INIT_WORK(&device_ctx->probe_failed_work_item, vmbus_probe_failed_cb);
293 --- a/drivers/staging/hv/VmbusPrivate.h
294 +++ b/drivers/staging/hv/VmbusPrivate.h
299 -#include "VmbusApi.h"
300 +#include "include/VmbusApi.h"
302 #include "ChannelMgmt.h"
303 #include "ChannelInterface.h"
304 //#include "ChannelMessages.h"
305 #include "RingBuffer.h"
306 //#include "Packet.h"
308 +#include "include/List.h"