aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/hv/BlkVsc.c18
-rw-r--r--drivers/staging/hv/Channel.c4
-rw-r--r--drivers/staging/hv/ChannelInterface.c4
-rw-r--r--drivers/staging/hv/ChannelMgmt.c58
-rw-r--r--drivers/staging/hv/ChannelMgmt.h4
-rw-r--r--drivers/staging/hv/Hv.h4
-rw-r--r--drivers/staging/hv/NetVsc.c9
-rw-r--r--drivers/staging/hv/StorVsc.c9
-rw-r--r--drivers/staging/hv/Vmbus.c24
-rw-r--r--drivers/staging/hv/VmbusPrivate.h4
-rw-r--r--drivers/staging/hv/blkvsc_drv.c2
-rw-r--r--drivers/staging/hv/include/List.h13
-rw-r--r--drivers/staging/hv/include/NetVscApi.h6
-rw-r--r--drivers/staging/hv/include/VmbusApi.h12
-rw-r--r--drivers/staging/hv/include/VmbusChannelInterface.h4
-rw-r--r--drivers/staging/hv/include/vmbus.h6
-rw-r--r--drivers/staging/hv/netvsc_drv.c2
-rw-r--r--drivers/staging/hv/osd.h11
-rw-r--r--drivers/staging/hv/storvsc_drv.c2
-rw-r--r--drivers/staging/hv/vmbus_drv.c91
20 files changed, 175 insertions, 112 deletions
diff --git a/drivers/staging/hv/BlkVsc.c b/drivers/staging/hv/BlkVsc.c
index c2e03673cf1..b2e6651b201 100644
--- a/drivers/staging/hv/BlkVsc.c
+++ b/drivers/staging/hv/BlkVsc.c
@@ -28,8 +28,11 @@
28static const char* gBlkDriverName="blkvsc"; 28static const char* gBlkDriverName="blkvsc";
29 29
30/* {32412632-86cb-44a2-9b5c-50d1417354f5} */ 30/* {32412632-86cb-44a2-9b5c-50d1417354f5} */
31static const GUID gBlkVscDeviceType={ 31static const struct hv_guid gBlkVscDeviceType={
32 .Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5} 32 .data = {
33 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
34 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
35 }
33}; 36};
34 37
35/* Static routines */ 38/* Static routines */
@@ -54,7 +57,7 @@ BlkVscInitialize(
54 ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); 57 ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
55 58
56 Driver->name = gBlkDriverName; 59 Driver->name = gBlkDriverName;
57 memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(GUID)); 60 memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid));
58 61
59 storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION); 62 storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
60 /* Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) */ 63 /* Divide the ring buffer data size (which is 1 page less than the ring buffer size since that page is reserved for the ring buffer indices) */
@@ -98,10 +101,13 @@ BlkVscOnDeviceAdd(
98 101
99 /* We need to use the device instance guid to set the path and target id. For IDE devices, the */ 102 /* We need to use the device instance guid to set the path and target id. For IDE devices, the */
100 /* device instance id is formatted as <bus id> - <device id> - 8899 - 000000000000. */ 103 /* device instance id is formatted as <bus id> - <device id> - 8899 - 000000000000. */
101 deviceInfo->PathId = Device->deviceInstance.Data[3] << 24 | Device->deviceInstance.Data[2] << 16 | 104 deviceInfo->PathId = Device->deviceInstance.data[3] << 24 |
102 Device->deviceInstance.Data[1] << 8 |Device->deviceInstance.Data[0]; 105 Device->deviceInstance.data[2] << 16 |
106 Device->deviceInstance.data[1] << 8 |
107 Device->deviceInstance.data[0];
103 108
104 deviceInfo->TargetId = Device->deviceInstance.Data[5] << 8 | Device->deviceInstance.Data[4]; 109 deviceInfo->TargetId = Device->deviceInstance.data[5] << 8 |
110 Device->deviceInstance.data[4];
105 111
106 DPRINT_EXIT(BLKVSC); 112 DPRINT_EXIT(BLKVSC);
107 113
diff --git a/drivers/staging/hv/Channel.c b/drivers/staging/hv/Channel.c
index 5f4016154e8..a200128d0c1 100644
--- a/drivers/staging/hv/Channel.c
+++ b/drivers/staging/hv/Channel.c
@@ -154,8 +154,8 @@ void VmbusChannelGetDebugInfo(struct vmbus_channel *Channel,
154 154
155 DebugInfo->RelId = Channel->OfferMsg.ChildRelId; 155 DebugInfo->RelId = Channel->OfferMsg.ChildRelId;
156 DebugInfo->State = Channel->State; 156 DebugInfo->State = Channel->State;
157 memcpy(&DebugInfo->InterfaceType, &Channel->OfferMsg.Offer.InterfaceType, sizeof(GUID)); 157 memcpy(&DebugInfo->InterfaceType, &Channel->OfferMsg.Offer.InterfaceType, sizeof(struct hv_guid));
158 memcpy(&DebugInfo->InterfaceInstance, &Channel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID)); 158 memcpy(&DebugInfo->InterfaceInstance, &Channel->OfferMsg.Offer.InterfaceInstance, sizeof(struct hv_guid));
159 159
160 monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages; 160 monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
161 161
diff --git a/drivers/staging/hv/ChannelInterface.c b/drivers/staging/hv/ChannelInterface.c
index ffd62bb2914..0d6bef16c74 100644
--- a/drivers/staging/hv/ChannelInterface.c
+++ b/drivers/staging/hv/ChannelInterface.c
@@ -190,8 +190,8 @@ void GetChannelInfo(struct hv_device *Device, DEVICE_INFO *DeviceInfo)
190 190
191 DeviceInfo->ChannelId = debugInfo.RelId; 191 DeviceInfo->ChannelId = debugInfo.RelId;
192 DeviceInfo->ChannelState = debugInfo.State; 192 DeviceInfo->ChannelState = debugInfo.State;
193 memcpy(&DeviceInfo->ChannelType, &debugInfo.InterfaceType, sizeof(GUID)); 193 memcpy(&DeviceInfo->ChannelType, &debugInfo.InterfaceType, sizeof(struct hv_guid));
194 memcpy(&DeviceInfo->ChannelInstance, &debugInfo.InterfaceInstance, sizeof(GUID)); 194 memcpy(&DeviceInfo->ChannelInstance, &debugInfo.InterfaceInstance, sizeof(struct hv_guid));
195 195
196 DeviceInfo->MonitorId = debugInfo.MonitorId; 196 DeviceInfo->MonitorId = debugInfo.MonitorId;
197 197
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 86ce05b4b14..f96cba7fa96 100644
--- a/drivers/staging/hv/ChannelMgmt.c
+++ b/drivers/staging/hv/ChannelMgmt.c
@@ -89,16 +89,42 @@ VmbusChannelProcessRescindOffer(
89 89
90#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 4 90#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 4
91 91
92static const GUID gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED]= { 92static const struct hv_guid gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
93 /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ 93 /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
94 {.Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}},/* Storage - SCSI */ 94 /* Storage - SCSI */
95 {
96 .data = {
97 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
98 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
99 }
100 },
101
95 /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ 102 /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
96 {.Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}}, /* Network */ 103 /* Network */
104 {
105 .data = {
106 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
107 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
108 }
109 },
110
97 /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */ 111 /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
98 {.Data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c, 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}}, /* Input */ 112 /* Input */
99 /* {32412632-86cb-44a2-9b5c-50d1417354f5} */ 113 {
100 {.Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}}, /* IDE */ 114 .data = {
115 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
116 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
117 }
118 },
101 119
120 /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
121 /* IDE */
122 {
123 .data = {
124 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
125 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
126 }
127 },
102}; 128};
103 129
104/* Channel message dispatch table */ 130/* Channel message dispatch table */
@@ -233,8 +259,8 @@ VmbusChannelProcessOffer(
233 { 259 {
234 channel = CONTAINING_RECORD(curr, struct vmbus_channel, ListEntry); 260 channel = CONTAINING_RECORD(curr, struct vmbus_channel, ListEntry);
235 261
236 if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(GUID)) && 262 if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(struct hv_guid)) &&
237 !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID))) 263 !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(struct hv_guid)))
238 { 264 {
239 fNew = false; 265 fNew = false;
240 break; 266 break;
@@ -337,8 +363,8 @@ VmbusChannelOnOffer(
337 VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr; 363 VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr;
338 struct vmbus_channel *newChannel; 364 struct vmbus_channel *newChannel;
339 365
340 GUID *guidType; 366 struct hv_guid *guidType;
341 GUID *guidInstance; 367 struct hv_guid *guidInstance;
342 int i; 368 int i;
343 int fSupported=0; 369 int fSupported=0;
344 370
@@ -346,7 +372,7 @@ VmbusChannelOnOffer(
346 372
347 for (i=0; i<MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) 373 for (i=0; i<MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++)
348 { 374 {
349 if (memcmp(&offer->Offer.InterfaceType, &gSupportedDeviceClasses[i], sizeof(GUID)) == 0) 375 if (memcmp(&offer->Offer.InterfaceType, &gSupportedDeviceClasses[i], sizeof(struct hv_guid)) == 0)
350 { 376 {
351 fSupported = 1; 377 fSupported = 1;
352 break; 378 break;
@@ -370,8 +396,14 @@ VmbusChannelOnOffer(
370 offer->ChildRelId, 396 offer->ChildRelId,
371 offer->MonitorId, 397 offer->MonitorId,
372 offer->MonitorAllocated, 398 offer->MonitorAllocated,
373 guidType->Data[3], guidType->Data[2], guidType->Data[1], guidType->Data[0], guidType->Data[5], guidType->Data[4], guidType->Data[7], guidType->Data[6], guidType->Data[8], guidType->Data[9], guidType->Data[10], guidType->Data[11], guidType->Data[12], guidType->Data[13], guidType->Data[14], guidType->Data[15], 399 guidType->data[3], guidType->data[2], guidType->data[1], guidType->data[0],
374 guidInstance->Data[3], guidInstance->Data[2], guidInstance->Data[1], guidInstance->Data[0], guidInstance->Data[5], guidInstance->Data[4], guidInstance->Data[7], guidInstance->Data[6], guidInstance->Data[8], guidInstance->Data[9], guidInstance->Data[10], guidInstance->Data[11], guidInstance->Data[12], guidInstance->Data[13], guidInstance->Data[14], guidInstance->Data[15]); 400 guidType->data[5], guidType->data[4], guidType->data[7], guidType->data[6],
401 guidType->data[8], guidType->data[9], guidType->data[10], guidType->data[11],
402 guidType->data[12], guidType->data[13], guidType->data[14], guidType->data[15],
403 guidInstance->data[3], guidInstance->data[2], guidInstance->data[1], guidInstance->data[0],
404 guidInstance->data[5], guidInstance->data[4], guidInstance->data[7], guidInstance->data[6],
405 guidInstance->data[8], guidInstance->data[9], guidInstance->data[10], guidInstance->data[11],
406 guidInstance->data[12], guidInstance->data[13], guidInstance->data[14], guidInstance->data[15]);
375 407
376 /* Allocate the channel object and save this offer. */ 408 /* Allocate the channel object and save this offer. */
377 newChannel = AllocVmbusChannel(); 409 newChannel = AllocVmbusChannel();
diff --git a/drivers/staging/hv/ChannelMgmt.h b/drivers/staging/hv/ChannelMgmt.h
index 34eddab6f3b..0eab97e3cb7 100644
--- a/drivers/staging/hv/ChannelMgmt.h
+++ b/drivers/staging/hv/ChannelMgmt.h
@@ -78,8 +78,8 @@ struct vmbus_channel {
78struct vmbus_channel_debug_info { 78struct vmbus_channel_debug_info {
79 u32 RelId; 79 u32 RelId;
80 enum vmbus_channel_state State; 80 enum vmbus_channel_state State;
81 GUID InterfaceType; 81 struct hv_guid InterfaceType;
82 GUID InterfaceInstance; 82 struct hv_guid InterfaceInstance;
83 u32 MonitorId; 83 u32 MonitorId;
84 u32 ServerMonitorPending; 84 u32 ServerMonitorPending;
85 u32 ServerMonitorLatency; 85 u32 ServerMonitorLatency;
diff --git a/drivers/staging/hv/Hv.h b/drivers/staging/hv/Hv.h
index 6df388d741a..8058a534efc 100644
--- a/drivers/staging/hv/Hv.h
+++ b/drivers/staging/hv/Hv.h
@@ -92,8 +92,8 @@ enum {
92/* #define VMBUS_PORT_ID 11 */ 92/* #define VMBUS_PORT_ID 11 */
93 93
94/* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */ 94/* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */
95static const GUID VMBUS_SERVICE_ID = { 95static const struct hv_guid VMBUS_SERVICE_ID = {
96 .Data = { 96 .data = {
97 0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c, 97 0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c,
98 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4 98 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4
99 }, 99 },
diff --git a/drivers/staging/hv/NetVsc.c b/drivers/staging/hv/NetVsc.c
index 0389ef7bedb..4594277f555 100644
--- a/drivers/staging/hv/NetVsc.c
+++ b/drivers/staging/hv/NetVsc.c
@@ -34,8 +34,11 @@
34static const char* gDriverName="netvsc"; 34static const char* gDriverName="netvsc";
35 35
36/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ 36/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
37static const GUID gNetVscDeviceType={ 37static const struct hv_guid gNetVscDeviceType = {
38 .Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E} 38 .data = {
39 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
40 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
41 }
39}; 42};
40 43
41 44
@@ -240,7 +243,7 @@ NetVscInitialize(
240 ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1)); 243 ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1));
241 244
242 drv->name = gDriverName; 245 drv->name = gDriverName;
243 memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(GUID)); 246 memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(struct hv_guid));
244 247
245 /* Make sure it is set by the caller */ 248 /* Make sure it is set by the caller */
246 ASSERT(driver->OnReceiveCallback); 249 ASSERT(driver->OnReceiveCallback);
diff --git a/drivers/staging/hv/StorVsc.c b/drivers/staging/hv/StorVsc.c
index 32fa2914f45..96aab171e73 100644
--- a/drivers/staging/hv/StorVsc.c
+++ b/drivers/staging/hv/StorVsc.c
@@ -87,8 +87,11 @@ typedef struct _STORVSC_DEVICE{
87static const char* gDriverName="storvsc"; 87static const char* gDriverName="storvsc";
88 88
89/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ 89/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
90static const GUID gStorVscDeviceType={ 90static const struct hv_guid gStorVscDeviceType = {
91 .Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f} 91 .data = {
92 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
93 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
94 }
92}; 95};
93 96
94 97
@@ -270,7 +273,7 @@ StorVscInitialize(
270 ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1)); 273 ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
271 274
272 Driver->name = gDriverName; 275 Driver->name = gDriverName;
273 memcpy(&Driver->deviceType, &gStorVscDeviceType, sizeof(GUID)); 276 memcpy(&Driver->deviceType, &gStorVscDeviceType, sizeof(struct hv_guid));
274 277
275 storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION); 278 storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
276 279
diff --git a/drivers/staging/hv/Vmbus.c b/drivers/staging/hv/Vmbus.c
index 2feb7c3cfae..56e8cbb07a7 100644
--- a/drivers/staging/hv/Vmbus.c
+++ b/drivers/staging/hv/Vmbus.c
@@ -37,13 +37,19 @@ static const char* gDriverName="vmbus";
37 * We defined this to be consistent with other devices 37 * We defined this to be consistent with other devices
38 */ 38 */
39/* {c5295816-f63a-4d5f-8d1a-4daf999ca185} */ 39/* {c5295816-f63a-4d5f-8d1a-4daf999ca185} */
40static const GUID gVmbusDeviceType={ 40static const struct hv_guid gVmbusDeviceType = {
41 .Data = {0x16, 0x58, 0x29, 0xc5, 0x3a, 0xf6, 0x5f, 0x4d, 0x8d, 0x1a, 0x4d, 0xaf, 0x99, 0x9c, 0xa1, 0x85} 41 .data = {
42 0x16, 0x58, 0x29, 0xc5, 0x3a, 0xf6, 0x5f, 0x4d,
43 0x8d, 0x1a, 0x4d, 0xaf, 0x99, 0x9c, 0xa1, 0x85
44 }
42}; 45};
43 46
44/* {ac3760fc-9adf-40aa-9427-a70ed6de95c5} */ 47/* {ac3760fc-9adf-40aa-9427-a70ed6de95c5} */
45static const GUID gVmbusDeviceId={ 48static const struct hv_guid gVmbusDeviceId = {
46 .Data = {0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40, 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5} 49 .data = {
50 0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40,
51 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5
52 }
47}; 53};
48 54
49static struct hv_driver *gDriver; /* vmbus driver object */ 55static struct hv_driver *gDriver; /* vmbus driver object */
@@ -130,7 +136,7 @@ VmbusInitialize(
130 sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER), sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER)); 136 sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER), sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER));
131 137
132 drv->name = gDriverName; 138 drv->name = gDriverName;
133 memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(GUID)); 139 memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
134 140
135 /* Setup dispatch table */ 141 /* Setup dispatch table */
136 driver->Base.OnDeviceAdd = VmbusOnDeviceAdd; 142 driver->Base.OnDeviceAdd = VmbusOnDeviceAdd;
@@ -225,8 +231,8 @@ Description:
225 231
226--*/ 232--*/
227 233
228struct hv_device *VmbusChildDeviceCreate(GUID DeviceType, 234struct hv_device *VmbusChildDeviceCreate(struct hv_guid DeviceType,
229 GUID DeviceInstance, 235 struct hv_guid DeviceInstance,
230 void *Context) 236 void *Context)
231{ 237{
232 VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver; 238 VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
@@ -315,8 +321,8 @@ VmbusOnDeviceAdd(
315 321
316 gDevice = dev; 322 gDevice = dev;
317 323
318 memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(GUID)); 324 memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
319 memcpy(&gDevice->deviceInstance, &gVmbusDeviceId, sizeof(GUID)); 325 memcpy(&gDevice->deviceInstance, &gVmbusDeviceId, sizeof(struct hv_guid));
320 326
321 /* strcpy(dev->name, "vmbus"); */ 327 /* strcpy(dev->name, "vmbus"); */
322 /* SynIC setup... */ 328 /* SynIC setup... */
diff --git a/drivers/staging/hv/VmbusPrivate.h b/drivers/staging/hv/VmbusPrivate.h
index 81e28f43393..fed03606800 100644
--- a/drivers/staging/hv/VmbusPrivate.h
+++ b/drivers/staging/hv/VmbusPrivate.h
@@ -103,8 +103,8 @@ extern struct VMBUS_CONNECTION gVmbusConnection;
103 103
104/* General vmbus interface */ 104/* General vmbus interface */
105 105
106struct hv_device *VmbusChildDeviceCreate(GUID deviceType, 106struct hv_device *VmbusChildDeviceCreate(struct hv_guid deviceType,
107 GUID deviceInstance, 107 struct hv_guid deviceInstance,
108 void *context); 108 void *context);
109 109
110int VmbusChildDeviceAdd(struct hv_device *Device); 110int VmbusChildDeviceAdd(struct hv_device *Device);
diff --git a/drivers/staging/hv/blkvsc_drv.c b/drivers/staging/hv/blkvsc_drv.c
index 3107f460d9d..c64ac893076 100644
--- a/drivers/staging/hv/blkvsc_drv.c
+++ b/drivers/staging/hv/blkvsc_drv.c
@@ -186,7 +186,7 @@ static int blkvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
186 pfn_drv_init(&storvsc_drv_obj->Base); 186 pfn_drv_init(&storvsc_drv_obj->Base);
187 187
188 drv_ctx->driver.name = storvsc_drv_obj->Base.name; 188 drv_ctx->driver.name = storvsc_drv_obj->Base.name;
189 memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID)); 189 memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(struct hv_guid));
190 190
191 drv_ctx->probe = blkvsc_probe; 191 drv_ctx->probe = blkvsc_probe;
192 drv_ctx->remove = blkvsc_remove; 192 drv_ctx->remove = blkvsc_remove;
diff --git a/drivers/staging/hv/include/List.h b/drivers/staging/hv/include/List.h
index 3895c328ddd..735a938a218 100644
--- a/drivers/staging/hv/include/List.h
+++ b/drivers/staging/hv/include/List.h
@@ -32,15 +32,10 @@
32 * 32 *
33 */ 33 */
34 34
35typedef DLIST_ENTRY LIST_ENTRY; 35typedef struct _LIST_ENTRY {
36typedef DLIST_ENTRY *PLIST_ENTRY; 36 struct _LIST_ENTRY *Flink;
37 37 struct _LIST_ENTRY *Blink;
38/* typedef struct LIST_ENTRY { */ 38} LIST_ENTRY, *PLIST_ENTRY;
39/* struct LIST_ENTRY * volatile Flink; */
40/* struct LIST_ENTRY * volatile Blink; */
41/* } LIST_ENTRY, *PLIST_ENTRY; */
42
43
44 39
45/* 40/*
46 * void 41 * void
diff --git a/drivers/staging/hv/include/NetVscApi.h b/drivers/staging/hv/include/NetVscApi.h
index 79b9e4b5a3a..f83c6fc8ed1 100644
--- a/drivers/staging/hv/include/NetVscApi.h
+++ b/drivers/staging/hv/include/NetVscApi.h
@@ -26,7 +26,7 @@
26#define _NETVSC_API_H_ 26#define _NETVSC_API_H_
27 27
28#include "VmbusApi.h" 28#include "VmbusApi.h"
29 29#include "List.h"
30 30
31/* Defines */ 31/* Defines */
32 32
@@ -56,7 +56,7 @@ typedef void (*PFN_ON_LINKSTATUS_CHANGED)(struct hv_device *dev, u32 Status);
56 56
57/* Represent the xfer page packet which contains 1 or more netvsc packet */ 57/* Represent the xfer page packet which contains 1 or more netvsc packet */
58typedef struct _XFERPAGE_PACKET { 58typedef struct _XFERPAGE_PACKET {
59 DLIST_ENTRY ListEntry; 59 LIST_ENTRY ListEntry;
60 60
61 /* # of netvsc packets this xfer packet contains */ 61 /* # of netvsc packets this xfer packet contains */
62 u32 Count; 62 u32 Count;
@@ -72,7 +72,7 @@ typedef struct _XFERPAGE_PACKET {
72 */ 72 */
73struct hv_netvsc_packet { 73struct hv_netvsc_packet {
74 /* Bookkeeping stuff */ 74 /* Bookkeeping stuff */
75 DLIST_ENTRY ListEntry; 75 LIST_ENTRY ListEntry;
76 76
77 struct hv_device *Device; 77 struct hv_device *Device;
78 bool IsDataPacket; 78 bool IsDataPacket;
diff --git a/drivers/staging/hv/include/VmbusApi.h b/drivers/staging/hv/include/VmbusApi.h
index 442a2125470..e5a733790d0 100644
--- a/drivers/staging/hv/include/VmbusApi.h
+++ b/drivers/staging/hv/include/VmbusApi.h
@@ -76,7 +76,7 @@ typedef int (*PFN_ON_ISR)(struct hv_driver *drv);
76typedef void (*PFN_ON_DPC)(struct hv_driver *drv); 76typedef void (*PFN_ON_DPC)(struct hv_driver *drv);
77typedef void (*PFN_GET_CHANNEL_OFFERS)(void); 77typedef void (*PFN_GET_CHANNEL_OFFERS)(void);
78 78
79typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context); 79typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(struct hv_guid DeviceType, struct hv_guid DeviceInstance, void *Context);
80typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(struct hv_device *Device); 80typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(struct hv_device *Device);
81typedef int (*PFN_ON_CHILDDEVICE_ADD)(struct hv_device *RootDevice, struct hv_device *ChildDevice); 81typedef int (*PFN_ON_CHILDDEVICE_ADD)(struct hv_device *RootDevice, struct hv_device *ChildDevice);
82typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(struct hv_device *Device); 82typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(struct hv_device *Device);
@@ -165,8 +165,8 @@ typedef struct _PORT_INFO {
165typedef struct _DEVICE_INFO { 165typedef struct _DEVICE_INFO {
166 u32 ChannelId; 166 u32 ChannelId;
167 u32 ChannelState; 167 u32 ChannelState;
168 GUID ChannelType; 168 struct hv_guid ChannelType;
169 GUID ChannelInstance; 169 struct hv_guid ChannelInstance;
170 170
171 u32 MonitorId; 171 u32 MonitorId;
172 u32 ServerMonitorPending; 172 u32 ServerMonitorPending;
@@ -200,7 +200,7 @@ typedef void (*VMBUS_GET_CHANNEL_INTERFACE)(VMBUS_CHANNEL_INTERFACE *Interface);
200/* Base driver object */ 200/* Base driver object */
201struct hv_driver { 201struct hv_driver {
202 const char* name; 202 const char* name;
203 GUID deviceType; /* the device type supported by this driver */ 203 struct hv_guid deviceType; /* the device type supported by this driver */
204 204
205 PFN_ON_DEVICEADD OnDeviceAdd; 205 PFN_ON_DEVICEADD OnDeviceAdd;
206 PFN_ON_DEVICEREMOVE OnDeviceRemove; 206 PFN_ON_DEVICEREMOVE OnDeviceRemove;
@@ -215,8 +215,8 @@ struct hv_driver {
215struct hv_device { 215struct hv_device {
216 struct hv_driver *Driver; /* the driver for this device */ 216 struct hv_driver *Driver; /* the driver for this device */
217 char name[64]; 217 char name[64];
218 GUID deviceType; /* the device type id of this device */ 218 struct hv_guid deviceType; /* the device type id of this device */
219 GUID deviceInstance; /* the device instance id of this device */ 219 struct hv_guid deviceInstance; /* the device instance id of this device */
220 void* context; 220 void* context;
221 void* Extension; /* Device extension; */ 221 void* Extension; /* Device extension; */
222}; 222};
diff --git a/drivers/staging/hv/include/VmbusChannelInterface.h b/drivers/staging/hv/include/VmbusChannelInterface.h
index 881c22d4c0e..8ee8a073c15 100644
--- a/drivers/staging/hv/include/VmbusChannelInterface.h
+++ b/drivers/staging/hv/include/VmbusChannelInterface.h
@@ -64,8 +64,8 @@
64typedef struct 64typedef struct
65{ 65{
66 66
67 GUID InterfaceType; 67 struct hv_guid InterfaceType;
68 GUID InterfaceInstance; 68 struct hv_guid InterfaceInstance;
69 u64 InterruptLatencyIn100nsUnits; 69 u64 InterruptLatencyIn100nsUnits;
70 u32 InterfaceRevision; 70 u32 InterfaceRevision;
71 u32 ServerContextAreaSize; /* in bytes */ 71 u32 ServerContextAreaSize; /* in bytes */
diff --git a/drivers/staging/hv/include/vmbus.h b/drivers/staging/hv/include/vmbus.h
index 6f7eecb4b83..2ea6ce0703c 100644
--- a/drivers/staging/hv/include/vmbus.h
+++ b/drivers/staging/hv/include/vmbus.h
@@ -37,7 +37,7 @@ typedef int (*PFN_DRIVERINITIALIZE)(struct hv_driver *drv);
37typedef int (*PFN_DRIVEREXIT)(struct hv_driver *drv); 37typedef int (*PFN_DRIVEREXIT)(struct hv_driver *drv);
38 38
39struct driver_context { 39struct driver_context {
40 GUID class_id; 40 struct hv_guid class_id;
41 41
42 struct device_driver driver; 42 struct device_driver driver;
43 43
@@ -49,8 +49,8 @@ struct driver_context {
49 49
50struct device_context { 50struct device_context {
51 struct work_struct probe_failed_work_item; 51 struct work_struct probe_failed_work_item;
52 GUID class_id; 52 struct hv_guid class_id;
53 GUID device_id; 53 struct hv_guid device_id;
54 int probe_error; 54 int probe_error;
55 struct device device; 55 struct device device;
56 struct hv_device device_obj; 56 struct hv_device device_obj;
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c
index 43488504a02..e847cb6c266 100644
--- a/drivers/staging/hv/netvsc_drv.c
+++ b/drivers/staging/hv/netvsc_drv.c
@@ -109,7 +109,7 @@ static int netvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
109 pfn_drv_init(&net_drv_obj->Base); 109 pfn_drv_init(&net_drv_obj->Base);
110 110
111 drv_ctx->driver.name = net_drv_obj->Base.name; 111 drv_ctx->driver.name = net_drv_obj->Base.name;
112 memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(GUID)); 112 memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(struct hv_guid));
113 113
114 drv_ctx->probe = netvsc_probe; 114 drv_ctx->probe = netvsc_probe;
115 drv_ctx->remove = netvsc_remove; 115 drv_ctx->remove = netvsc_remove;
diff --git a/drivers/staging/hv/osd.h b/drivers/staging/hv/osd.h
index 1723248db91..9504604c72b 100644
--- a/drivers/staging/hv/osd.h
+++ b/drivers/staging/hv/osd.h
@@ -38,14 +38,9 @@
38#define LOWORD(dw) ((unsigned short)(dw)) 38#define LOWORD(dw) ((unsigned short)(dw))
39#define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF)) 39#define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF))
40 40
41typedef struct _DLIST_ENTRY { 41struct hv_guid {
42 struct _DLIST_ENTRY *Flink; 42 unsigned char data[16];
43 struct _DLIST_ENTRY *Blink; 43};
44} DLIST_ENTRY;
45
46typedef struct {
47 unsigned char Data[16];
48} GUID;
49 44
50struct osd_waitevent { 45struct osd_waitevent {
51 int condition; 46 int condition;
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c
index fc5b02d5121..4574f2b848b 100644
--- a/drivers/staging/hv/storvsc_drv.c
+++ b/drivers/staging/hv/storvsc_drv.c
@@ -156,7 +156,7 @@ static int storvsc_drv_init(PFN_DRIVERINITIALIZE pfn_drv_init)
156 } 156 }
157 157
158 drv_ctx->driver.name = storvsc_drv_obj->Base.name; 158 drv_ctx->driver.name = storvsc_drv_obj->Base.name;
159 memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID)); 159 memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(struct hv_guid));
160 160
161 drv_ctx->probe = storvsc_probe; 161 drv_ctx->probe = storvsc_probe;
162 drv_ctx->remove = storvsc_remove; 162 drv_ctx->remove = storvsc_remove;
diff --git a/drivers/staging/hv/vmbus_drv.c b/drivers/staging/hv/vmbus_drv.c
index bb40c2e15c3..f8620e2185b 100644
--- a/drivers/staging/hv/vmbus_drv.c
+++ b/drivers/staging/hv/vmbus_drv.c
@@ -75,7 +75,7 @@ static irqreturn_t vmbus_isr(int irq, void* dev_id);
75static void vmbus_device_release(struct device *device); 75static void vmbus_device_release(struct device *device);
76static void vmbus_bus_release(struct device *device); 76static void vmbus_bus_release(struct device *device);
77 77
78static struct hv_device *vmbus_child_device_create(GUID type, GUID instance, void* context); 78static struct hv_device *vmbus_child_device_create(struct hv_guid type, struct hv_guid instance, void* context);
79static void vmbus_child_device_destroy(struct hv_device *device_obj); 79static void vmbus_child_device_destroy(struct hv_device *device_obj);
80static int vmbus_child_device_register(struct hv_device *root_device_obj, struct hv_device *child_device_obj); 80static int vmbus_child_device_register(struct hv_device *root_device_obj, struct hv_device *child_device_obj);
81static void vmbus_child_device_unregister(struct hv_device *child_device_obj); 81static void vmbus_child_device_unregister(struct hv_device *child_device_obj);
@@ -168,19 +168,27 @@ static ssize_t vmbus_show_device_attr(struct device *dev, struct device_attribut
168 if (!strcmp(dev_attr->attr.name, "class_id")) 168 if (!strcmp(dev_attr->attr.name, "class_id"))
169 { 169 {
170 return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", 170 return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n",
171 device_info.ChannelType.Data[3], device_info.ChannelType.Data[2], device_info.ChannelType.Data[1], device_info.ChannelType.Data[0], 171 device_info.ChannelType.data[3], device_info.ChannelType.data[2],
172 device_info.ChannelType.Data[5], device_info.ChannelType.Data[4], 172 device_info.ChannelType.data[1], device_info.ChannelType.data[0],
173 device_info.ChannelType.Data[7], device_info.ChannelType.Data[6], 173 device_info.ChannelType.data[5], device_info.ChannelType.data[4],
174 device_info.ChannelType.Data[8], device_info.ChannelType.Data[9], device_info.ChannelType.Data[10], device_info.ChannelType.Data[11], device_info.ChannelType.Data[12], device_info.ChannelType.Data[13], device_info.ChannelType.Data[14], device_info.ChannelType.Data[15]); 174 device_info.ChannelType.data[7], device_info.ChannelType.data[6],
175 device_info.ChannelType.data[8], device_info.ChannelType.data[9],
176 device_info.ChannelType.data[10], device_info.ChannelType.data[11],
177 device_info.ChannelType.data[12], device_info.ChannelType.data[13],
178 device_info.ChannelType.data[14], device_info.ChannelType.data[15]);
175 179
176 } 180 }
177 else if (!strcmp(dev_attr->attr.name, "device_id")) 181 else if (!strcmp(dev_attr->attr.name, "device_id"))
178 { 182 {
179 return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n", 183 return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n",
180 device_info.ChannelInstance.Data[3], device_info.ChannelInstance.Data[2], device_info.ChannelInstance.Data[1], device_info.ChannelInstance.Data[0], 184 device_info.ChannelInstance.data[3], device_info.ChannelInstance.data[2],
181 device_info.ChannelInstance.Data[5], device_info.ChannelInstance.Data[4], 185 device_info.ChannelInstance.data[1], device_info.ChannelInstance.data[0],
182 device_info.ChannelInstance.Data[7], device_info.ChannelInstance.Data[6], 186 device_info.ChannelInstance.data[5], device_info.ChannelInstance.data[4],
183 device_info.ChannelInstance.Data[8], device_info.ChannelInstance.Data[9], device_info.ChannelInstance.Data[10], device_info.ChannelInstance.Data[11], device_info.ChannelInstance.Data[12], device_info.ChannelInstance.Data[13], device_info.ChannelInstance.Data[14], device_info.ChannelInstance.Data[15]); 187 device_info.ChannelInstance.data[7], device_info.ChannelInstance.data[6],
188 device_info.ChannelInstance.data[8], device_info.ChannelInstance.data[9],
189 device_info.ChannelInstance.data[10], device_info.ChannelInstance.data[11],
190 device_info.ChannelInstance.data[12], device_info.ChannelInstance.data[13],
191 device_info.ChannelInstance.data[14], device_info.ChannelInstance.data[15]);
184 } 192 }
185 else if (!strcmp(dev_attr->attr.name, "state")) 193 else if (!strcmp(dev_attr->attr.name, "state"))
186 { 194 {
@@ -396,8 +404,8 @@ static int vmbus_bus_init(PFN_DRIVERINITIALIZE pfn_drv_init)
396 } 404 }
397 /* strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); */ 405 /* strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); */
398 dev_set_name(&dev_ctx->device, "vmbus_0_0"); 406 dev_set_name(&dev_ctx->device, "vmbus_0_0");
399 memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(GUID)); 407 memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(struct hv_guid));
400 memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(GUID)); 408 memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(struct hv_guid));
401 409
402 /* No need to bind a driver to the root device. */ 410 /* No need to bind a driver to the root device. */
403 dev_ctx->device.parent = NULL; 411 dev_ctx->device.parent = NULL;
@@ -557,7 +565,7 @@ Name: vmbus_child_device_create()
557Desc: Creates and registers a new child device on the vmbus. 565Desc: Creates and registers a new child device on the vmbus.
558 566
559--*/ 567--*/
560static struct hv_device *vmbus_child_device_create(GUID type, GUID instance, void* context) 568static struct hv_device *vmbus_child_device_create(struct hv_guid type, struct hv_guid instance, void* context)
561{ 569{
562 struct device_context *child_device_ctx; 570 struct device_context *child_device_ctx;
563 struct hv_device *child_device_obj; 571 struct hv_device *child_device_obj;
@@ -578,16 +586,22 @@ static struct hv_device *vmbus_child_device_create(GUID type, GUID instance, voi
578 "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}," 586 "type {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x},"
579 "id {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", 587 "id {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
580 &child_device_ctx->device, 588 &child_device_ctx->device,
581 type.Data[3], type.Data[2], type.Data[1], type.Data[0], type.Data[5], type.Data[4], type.Data[7], type.Data[6], type.Data[8], type.Data[9], type.Data[10], type.Data[11], type.Data[12], type.Data[13], type.Data[14], type.Data[15], 589 type.data[3], type.data[2], type.data[1], type.data[0],
582 instance.Data[3], instance.Data[2], instance.Data[1], instance.Data[0], instance.Data[5], instance.Data[4], instance.Data[7], instance.Data[6], instance.Data[8], instance.Data[9], instance.Data[10], instance.Data[11], instance.Data[12], instance.Data[13], instance.Data[14], instance.Data[15]); 590 type.data[5], type.data[4], type.data[7], type.data[6],
591 type.data[8], type.data[9], type.data[10], type.data[11],
592 type.data[12], type.data[13], type.data[14], type.data[15],
593 instance.data[3], instance.data[2], instance.data[1], instance.data[0],
594 instance.data[5], instance.data[4], instance.data[7], instance.data[6],
595 instance.data[8], instance.data[9], instance.data[10], instance.data[11],
596 instance.data[12], instance.data[13], instance.data[14], instance.data[15]);
583 597
584 child_device_obj = &child_device_ctx->device_obj; 598 child_device_obj = &child_device_ctx->device_obj;
585 child_device_obj->context = context; 599 child_device_obj->context = context;
586 memcpy(&child_device_obj->deviceType, &type, sizeof(GUID)); 600 memcpy(&child_device_obj->deviceType, &type, sizeof(struct hv_guid));
587 memcpy(&child_device_obj->deviceInstance, &instance, sizeof(GUID)); 601 memcpy(&child_device_obj->deviceInstance, &instance, sizeof(struct hv_guid));
588 602
589 memcpy(&child_device_ctx->class_id, &type, sizeof(GUID)); 603 memcpy(&child_device_ctx->class_id, &type, sizeof(struct hv_guid));
590 memcpy(&child_device_ctx->device_id, &instance, sizeof(GUID)); 604 memcpy(&child_device_ctx->device_id, &instance, sizeof(struct hv_guid));
591 605
592 DPRINT_EXIT(VMBUS_DRV); 606 DPRINT_EXIT(VMBUS_DRV);
593 607
@@ -705,21 +719,27 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
705 DPRINT_ENTER(VMBUS_DRV); 719 DPRINT_ENTER(VMBUS_DRV);
706 720
707 DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", 721 DPRINT_INFO(VMBUS_DRV, "generating uevent - VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
708 device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], 722 device_ctx->class_id.data[3], device_ctx->class_id.data[2],
709 device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], 723 device_ctx->class_id.data[1], device_ctx->class_id.data[0],
710 device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], 724 device_ctx->class_id.data[5], device_ctx->class_id.data[4],
711 device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], 725 device_ctx->class_id.data[7], device_ctx->class_id.data[6],
712 device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); 726 device_ctx->class_id.data[8], device_ctx->class_id.data[9],
727 device_ctx->class_id.data[10], device_ctx->class_id.data[11],
728 device_ctx->class_id.data[12], device_ctx->class_id.data[13],
729 device_ctx->class_id.data[14], device_ctx->class_id.data[15]);
713 730
714 env->envp_idx = i; 731 env->envp_idx = i;
715 env->buflen = len; 732 env->buflen = len;
716 ret = add_uevent_var(env, 733 ret = add_uevent_var(env,
717 "VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", 734 "VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
718 device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0], 735 device_ctx->class_id.data[3], device_ctx->class_id.data[2],
719 device_ctx->class_id.Data[5], device_ctx->class_id.Data[4], 736 device_ctx->class_id.data[1], device_ctx->class_id.data[0],
720 device_ctx->class_id.Data[7], device_ctx->class_id.Data[6], 737 device_ctx->class_id.data[5], device_ctx->class_id.data[4],
721 device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11], 738 device_ctx->class_id.data[7], device_ctx->class_id.data[6],
722 device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]); 739 device_ctx->class_id.data[8], device_ctx->class_id.data[9],
740 device_ctx->class_id.data[10], device_ctx->class_id.data[11],
741 device_ctx->class_id.data[12], device_ctx->class_id.data[13],
742 device_ctx->class_id.data[14], device_ctx->class_id.data[15]);
723 743
724 if (ret) 744 if (ret)
725 { 745 {
@@ -728,11 +748,14 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
728 748
729 ret = add_uevent_var(env, 749 ret = add_uevent_var(env,
730 "VMBUS_DEVICE_DEVICE_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}", 750 "VMBUS_DEVICE_DEVICE_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
731 device_ctx->device_id.Data[3], device_ctx->device_id.Data[2], device_ctx->device_id.Data[1], device_ctx->device_id.Data[0], 751 device_ctx->device_id.data[3], device_ctx->device_id.data[2],
732 device_ctx->device_id.Data[5], device_ctx->device_id.Data[4], 752 device_ctx->device_id.data[1], device_ctx->device_id.data[0],
733 device_ctx->device_id.Data[7], device_ctx->device_id.Data[6], 753 device_ctx->device_id.data[5], device_ctx->device_id.data[4],
734 device_ctx->device_id.Data[8], device_ctx->device_id.Data[9], device_ctx->device_id.Data[10], device_ctx->device_id.Data[11], 754 device_ctx->device_id.data[7], device_ctx->device_id.data[6],
735 device_ctx->device_id.Data[12], device_ctx->device_id.Data[13], device_ctx->device_id.Data[14], device_ctx->device_id.Data[15]); 755 device_ctx->device_id.data[8], device_ctx->device_id.data[9],
756 device_ctx->device_id.data[10], device_ctx->device_id.data[11],
757 device_ctx->device_id.data[12], device_ctx->device_id.data[13],
758 device_ctx->device_id.data[14], device_ctx->device_id.data[15]);
736 759
737 if (ret) 760 if (ret)
738 { 761 {
@@ -762,7 +785,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
762 DPRINT_ENTER(VMBUS_DRV); 785 DPRINT_ENTER(VMBUS_DRV);
763 786
764 /* We found our driver ? */ 787 /* We found our driver ? */
765 if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(GUID)) == 0) 788 if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(struct hv_guid)) == 0)
766 { 789 {
767 /* !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast it here to access the */ 790 /* !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast it here to access the */
768 /* struct hv_driver field */ 791 /* struct hv_driver field */