static const char* gBlkDriverName="blkvsc";
/* {32412632-86cb-44a2-9b5c-50d1417354f5} */
-static const GUID gBlkVscDeviceType={
- .Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}
+static const struct hv_guid gBlkVscDeviceType={
+ .data = {
+ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+ }
};
/* Static routines */
ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
Driver->name = gBlkDriverName;
- memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(GUID));
+ memcpy(&Driver->deviceType, &gBlkVscDeviceType, sizeof(struct hv_guid));
storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
/* 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) */
/* We need to use the device instance guid to set the path and target id. For IDE devices, the */
/* device instance id is formatted as <bus id> - <device id> - 8899 - 000000000000. */
- deviceInfo->PathId = Device->deviceInstance.Data[3] << 24 | Device->deviceInstance.Data[2] << 16 |
- Device->deviceInstance.Data[1] << 8 |Device->deviceInstance.Data[0];
+ deviceInfo->PathId = Device->deviceInstance.data[3] << 24 |
+ Device->deviceInstance.data[2] << 16 |
+ Device->deviceInstance.data[1] << 8 |
+ Device->deviceInstance.data[0];
- deviceInfo->TargetId = Device->deviceInstance.Data[5] << 8 | Device->deviceInstance.Data[4];
+ deviceInfo->TargetId = Device->deviceInstance.data[5] << 8 |
+ Device->deviceInstance.data[4];
DPRINT_EXIT(BLKVSC);
DebugInfo->RelId = Channel->OfferMsg.ChildRelId;
DebugInfo->State = Channel->State;
- memcpy(&DebugInfo->InterfaceType, &Channel->OfferMsg.Offer.InterfaceType, sizeof(GUID));
- memcpy(&DebugInfo->InterfaceInstance, &Channel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID));
+ memcpy(&DebugInfo->InterfaceType, &Channel->OfferMsg.Offer.InterfaceType, sizeof(struct hv_guid));
+ memcpy(&DebugInfo->InterfaceInstance, &Channel->OfferMsg.Offer.InterfaceInstance, sizeof(struct hv_guid));
monitorPage = (HV_MONITOR_PAGE*)gVmbusConnection.MonitorPages;
DeviceInfo->ChannelId = debugInfo.RelId;
DeviceInfo->ChannelState = debugInfo.State;
- memcpy(&DeviceInfo->ChannelType, &debugInfo.InterfaceType, sizeof(GUID));
- memcpy(&DeviceInfo->ChannelInstance, &debugInfo.InterfaceInstance, sizeof(GUID));
+ memcpy(&DeviceInfo->ChannelType, &debugInfo.InterfaceType, sizeof(struct hv_guid));
+ memcpy(&DeviceInfo->ChannelInstance, &debugInfo.InterfaceInstance, sizeof(struct hv_guid));
DeviceInfo->MonitorId = debugInfo.MonitorId;
#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 4
-static const GUID gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED]= {
+static const struct hv_guid gSupportedDeviceClasses[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
- {.Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}},/* Storage - SCSI */
+ /* Storage - SCSI */
+ {
+ .data = {
+ 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+ }
+ },
+
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
- {.Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}}, /* Network */
+ /* Network */
+ {
+ .data = {
+ 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+ }
+ },
+
/* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
- {.Data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c, 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}}, /* Input */
- /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
- {.Data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}}, /* IDE */
+ /* Input */
+ {
+ .data = {
+ 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
+ 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
+ }
+ },
+ /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
+ /* IDE */
+ {
+ .data = {
+ 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+ 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
+ }
+ },
};
/* Channel message dispatch table */
{
channel = CONTAINING_RECORD(curr, struct vmbus_channel, ListEntry);
- if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(GUID)) &&
- !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(GUID)))
+ if (!memcmp(&channel->OfferMsg.Offer.InterfaceType, &newChannel->OfferMsg.Offer.InterfaceType,sizeof(struct hv_guid)) &&
+ !memcmp(&channel->OfferMsg.Offer.InterfaceInstance, &newChannel->OfferMsg.Offer.InterfaceInstance, sizeof(struct hv_guid)))
{
fNew = false;
break;
VMBUS_CHANNEL_OFFER_CHANNEL* offer = (VMBUS_CHANNEL_OFFER_CHANNEL*)hdr;
struct vmbus_channel *newChannel;
- GUID *guidType;
- GUID *guidInstance;
+ struct hv_guid *guidType;
+ struct hv_guid *guidInstance;
int i;
int fSupported=0;
for (i=0; i<MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++)
{
- if (memcmp(&offer->Offer.InterfaceType, &gSupportedDeviceClasses[i], sizeof(GUID)) == 0)
+ if (memcmp(&offer->Offer.InterfaceType, &gSupportedDeviceClasses[i], sizeof(struct hv_guid)) == 0)
{
fSupported = 1;
break;
offer->ChildRelId,
offer->MonitorId,
offer->MonitorAllocated,
- 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],
- 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]);
+ 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],
+ 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]);
/* Allocate the channel object and save this offer. */
newChannel = AllocVmbusChannel();
struct vmbus_channel_debug_info {
u32 RelId;
enum vmbus_channel_state State;
- GUID InterfaceType;
- GUID InterfaceInstance;
+ struct hv_guid InterfaceType;
+ struct hv_guid InterfaceInstance;
u32 MonitorId;
u32 ServerMonitorPending;
u32 ServerMonitorLatency;
/* #define VMBUS_PORT_ID 11 */
/* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */
-static const GUID VMBUS_SERVICE_ID = {
- .Data = {
+static const struct hv_guid VMBUS_SERVICE_ID = {
+ .data = {
0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c,
0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4
},
static const char* gDriverName="netvsc";
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
-static const GUID gNetVscDeviceType={
- .Data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}
+static const struct hv_guid gNetVscDeviceType = {
+ .data = {
+ 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+ 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
+ }
};
ASSERT(driver->RingBufferSize >= (PAGE_SIZE << 1));
drv->name = gDriverName;
- memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(GUID));
+ memcpy(&drv->deviceType, &gNetVscDeviceType, sizeof(struct hv_guid));
/* Make sure it is set by the caller */
ASSERT(driver->OnReceiveCallback);
static const char* gDriverName="storvsc";
/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
-static const GUID gStorVscDeviceType={
- .Data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}
+static const struct hv_guid gStorVscDeviceType = {
+ .data = {
+ 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+ 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
+ }
};
ASSERT(storDriver->RingBufferSize >= (PAGE_SIZE << 1));
Driver->name = gDriverName;
- memcpy(&Driver->deviceType, &gStorVscDeviceType, sizeof(GUID));
+ memcpy(&Driver->deviceType, &gStorVscDeviceType, sizeof(struct hv_guid));
storDriver->RequestExtSize = sizeof(STORVSC_REQUEST_EXTENSION);
* We defined this to be consistent with other devices
*/
/* {c5295816-f63a-4d5f-8d1a-4daf999ca185} */
-static const GUID gVmbusDeviceType={
- .Data = {0x16, 0x58, 0x29, 0xc5, 0x3a, 0xf6, 0x5f, 0x4d, 0x8d, 0x1a, 0x4d, 0xaf, 0x99, 0x9c, 0xa1, 0x85}
+static const struct hv_guid gVmbusDeviceType = {
+ .data = {
+ 0x16, 0x58, 0x29, 0xc5, 0x3a, 0xf6, 0x5f, 0x4d,
+ 0x8d, 0x1a, 0x4d, 0xaf, 0x99, 0x9c, 0xa1, 0x85
+ }
};
/* {ac3760fc-9adf-40aa-9427-a70ed6de95c5} */
-static const GUID gVmbusDeviceId={
- .Data = {0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40, 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5}
+static const struct hv_guid gVmbusDeviceId = {
+ .data = {
+ 0xfc, 0x60, 0x37, 0xac, 0xdf, 0x9a, 0xaa, 0x40,
+ 0x94, 0x27, 0xa7, 0x0e, 0xd6, 0xde, 0x95, 0xc5
+ }
};
static struct hv_driver *gDriver; /* vmbus driver object */
sizeof(struct VMBUS_CHANNEL_PACKET_PAGE_BUFFER), sizeof(struct VMBUS_CHANNEL_PACKET_MULITPAGE_BUFFER));
drv->name = gDriverName;
- memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(GUID));
+ memcpy(&drv->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
/* Setup dispatch table */
driver->Base.OnDeviceAdd = VmbusOnDeviceAdd;
--*/
-struct hv_device *VmbusChildDeviceCreate(GUID DeviceType,
- GUID DeviceInstance,
+struct hv_device *VmbusChildDeviceCreate(struct hv_guid DeviceType,
+ struct hv_guid DeviceInstance,
void *Context)
{
VMBUS_DRIVER_OBJECT* vmbusDriver = (VMBUS_DRIVER_OBJECT*)gDriver;
gDevice = dev;
- memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(GUID));
- memcpy(&gDevice->deviceInstance, &gVmbusDeviceId, sizeof(GUID));
+ memcpy(&gDevice->deviceType, &gVmbusDeviceType, sizeof(struct hv_guid));
+ memcpy(&gDevice->deviceInstance, &gVmbusDeviceId, sizeof(struct hv_guid));
/* strcpy(dev->name, "vmbus"); */
/* SynIC setup... */
/* General vmbus interface */
-struct hv_device *VmbusChildDeviceCreate(GUID deviceType,
- GUID deviceInstance,
+struct hv_device *VmbusChildDeviceCreate(struct hv_guid deviceType,
+ struct hv_guid deviceInstance,
void *context);
int VmbusChildDeviceAdd(struct hv_device *Device);
pfn_drv_init(&storvsc_drv_obj->Base);
drv_ctx->driver.name = storvsc_drv_obj->Base.name;
- memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID));
+ memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(struct hv_guid));
drv_ctx->probe = blkvsc_probe;
drv_ctx->remove = blkvsc_remove;
*
*/
-typedef DLIST_ENTRY LIST_ENTRY;
-typedef DLIST_ENTRY *PLIST_ENTRY;
-
-/* typedef struct LIST_ENTRY { */
-/* struct LIST_ENTRY * volatile Flink; */
-/* struct LIST_ENTRY * volatile Blink; */
-/* } LIST_ENTRY, *PLIST_ENTRY; */
-
-
+typedef struct _LIST_ENTRY {
+ struct _LIST_ENTRY *Flink;
+ struct _LIST_ENTRY *Blink;
+} LIST_ENTRY, *PLIST_ENTRY;
/*
* void
#define _NETVSC_API_H_
#include "VmbusApi.h"
-
+#include "List.h"
/* Defines */
/* Represent the xfer page packet which contains 1 or more netvsc packet */
typedef struct _XFERPAGE_PACKET {
- DLIST_ENTRY ListEntry;
+ LIST_ENTRY ListEntry;
/* # of netvsc packets this xfer packet contains */
u32 Count;
*/
struct hv_netvsc_packet {
/* Bookkeeping stuff */
- DLIST_ENTRY ListEntry;
+ LIST_ENTRY ListEntry;
struct hv_device *Device;
bool IsDataPacket;
typedef void (*PFN_ON_DPC)(struct hv_driver *drv);
typedef void (*PFN_GET_CHANNEL_OFFERS)(void);
-typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(GUID DeviceType, GUID DeviceInstance, void *Context);
+typedef struct hv_device *(*PFN_ON_CHILDDEVICE_CREATE)(struct hv_guid DeviceType, struct hv_guid DeviceInstance, void *Context);
typedef void (*PFN_ON_CHILDDEVICE_DESTROY)(struct hv_device *Device);
typedef int (*PFN_ON_CHILDDEVICE_ADD)(struct hv_device *RootDevice, struct hv_device *ChildDevice);
typedef void (*PFN_ON_CHILDDEVICE_REMOVE)(struct hv_device *Device);
typedef struct _DEVICE_INFO {
u32 ChannelId;
u32 ChannelState;
- GUID ChannelType;
- GUID ChannelInstance;
+ struct hv_guid ChannelType;
+ struct hv_guid ChannelInstance;
u32 MonitorId;
u32 ServerMonitorPending;
/* Base driver object */
struct hv_driver {
const char* name;
- GUID deviceType; /* the device type supported by this driver */
+ struct hv_guid deviceType; /* the device type supported by this driver */
PFN_ON_DEVICEADD OnDeviceAdd;
PFN_ON_DEVICEREMOVE OnDeviceRemove;
struct hv_device {
struct hv_driver *Driver; /* the driver for this device */
char name[64];
- GUID deviceType; /* the device type id of this device */
- GUID deviceInstance; /* the device instance id of this device */
+ struct hv_guid deviceType; /* the device type id of this device */
+ struct hv_guid deviceInstance; /* the device instance id of this device */
void* context;
void* Extension; /* Device extension; */
};
typedef struct
{
- GUID InterfaceType;
- GUID InterfaceInstance;
+ struct hv_guid InterfaceType;
+ struct hv_guid InterfaceInstance;
u64 InterruptLatencyIn100nsUnits;
u32 InterfaceRevision;
u32 ServerContextAreaSize; /* in bytes */
typedef int (*PFN_DRIVEREXIT)(struct hv_driver *drv);
struct driver_context {
- GUID class_id;
+ struct hv_guid class_id;
struct device_driver driver;
struct device_context {
struct work_struct probe_failed_work_item;
- GUID class_id;
- GUID device_id;
+ struct hv_guid class_id;
+ struct hv_guid device_id;
int probe_error;
struct device device;
struct hv_device device_obj;
pfn_drv_init(&net_drv_obj->Base);
drv_ctx->driver.name = net_drv_obj->Base.name;
- memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(GUID));
+ memcpy(&drv_ctx->class_id, &net_drv_obj->Base.deviceType, sizeof(struct hv_guid));
drv_ctx->probe = netvsc_probe;
drv_ctx->remove = netvsc_remove;
#define LOWORD(dw) ((unsigned short)(dw))
#define HIWORD(dw) ((unsigned short)(((unsigned int) (dw) >> 16) & 0xFFFF))
-typedef struct _DLIST_ENTRY {
- struct _DLIST_ENTRY *Flink;
- struct _DLIST_ENTRY *Blink;
-} DLIST_ENTRY;
-
-typedef struct {
- unsigned char Data[16];
-} GUID;
+struct hv_guid {
+ unsigned char data[16];
+};
struct osd_waitevent {
int condition;
}
drv_ctx->driver.name = storvsc_drv_obj->Base.name;
- memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(GUID));
+ memcpy(&drv_ctx->class_id, &storvsc_drv_obj->Base.deviceType, sizeof(struct hv_guid));
drv_ctx->probe = storvsc_probe;
drv_ctx->remove = storvsc_remove;
static void vmbus_device_release(struct device *device);
static void vmbus_bus_release(struct device *device);
-static struct hv_device *vmbus_child_device_create(GUID type, GUID instance, void* context);
+static struct hv_device *vmbus_child_device_create(struct hv_guid type, struct hv_guid instance, void* context);
static void vmbus_child_device_destroy(struct hv_device *device_obj);
static int vmbus_child_device_register(struct hv_device *root_device_obj, struct hv_device *child_device_obj);
static void vmbus_child_device_unregister(struct hv_device *child_device_obj);
if (!strcmp(dev_attr->attr.name, "class_id"))
{
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n",
- device_info.ChannelType.Data[3], device_info.ChannelType.Data[2], device_info.ChannelType.Data[1], device_info.ChannelType.Data[0],
- device_info.ChannelType.Data[5], device_info.ChannelType.Data[4],
- device_info.ChannelType.Data[7], device_info.ChannelType.Data[6],
- 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]);
+ device_info.ChannelType.data[3], device_info.ChannelType.data[2],
+ device_info.ChannelType.data[1], device_info.ChannelType.data[0],
+ device_info.ChannelType.data[5], device_info.ChannelType.data[4],
+ device_info.ChannelType.data[7], device_info.ChannelType.data[6],
+ 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]);
}
else if (!strcmp(dev_attr->attr.name, "device_id"))
{
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}\n",
- device_info.ChannelInstance.Data[3], device_info.ChannelInstance.Data[2], device_info.ChannelInstance.Data[1], device_info.ChannelInstance.Data[0],
- device_info.ChannelInstance.Data[5], device_info.ChannelInstance.Data[4],
- device_info.ChannelInstance.Data[7], device_info.ChannelInstance.Data[6],
- 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]);
+ device_info.ChannelInstance.data[3], device_info.ChannelInstance.data[2],
+ device_info.ChannelInstance.data[1], device_info.ChannelInstance.data[0],
+ device_info.ChannelInstance.data[5], device_info.ChannelInstance.data[4],
+ device_info.ChannelInstance.data[7], device_info.ChannelInstance.data[6],
+ 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]);
}
else if (!strcmp(dev_attr->attr.name, "state"))
{
}
/* strcpy(dev_ctx->device.bus_id, dev_ctx->device_obj.name); */
dev_set_name(&dev_ctx->device, "vmbus_0_0");
- memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(GUID));
- memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(GUID));
+ memcpy(&dev_ctx->class_id, &dev_ctx->device_obj.deviceType, sizeof(struct hv_guid));
+ memcpy(&dev_ctx->device_id, &dev_ctx->device_obj.deviceInstance, sizeof(struct hv_guid));
/* No need to bind a driver to the root device. */
dev_ctx->device.parent = NULL;
Desc: Creates and registers a new child device on the vmbus.
--*/
-static struct hv_device *vmbus_child_device_create(GUID type, GUID instance, void* context)
+static struct hv_device *vmbus_child_device_create(struct hv_guid type, struct hv_guid instance, void* context)
{
struct device_context *child_device_ctx;
struct hv_device *child_device_obj;
"type {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x},"
"id {%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
&child_device_ctx->device,
- 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],
- 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]);
+ 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],
+ 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]);
child_device_obj = &child_device_ctx->device_obj;
child_device_obj->context = context;
- memcpy(&child_device_obj->deviceType, &type, sizeof(GUID));
- memcpy(&child_device_obj->deviceInstance, &instance, sizeof(GUID));
+ memcpy(&child_device_obj->deviceType, &type, sizeof(struct hv_guid));
+ memcpy(&child_device_obj->deviceInstance, &instance, sizeof(struct hv_guid));
- memcpy(&child_device_ctx->class_id, &type, sizeof(GUID));
- memcpy(&child_device_ctx->device_id, &instance, sizeof(GUID));
+ memcpy(&child_device_ctx->class_id, &type, sizeof(struct hv_guid));
+ memcpy(&child_device_ctx->device_id, &instance, sizeof(struct hv_guid));
DPRINT_EXIT(VMBUS_DRV);
DPRINT_ENTER(VMBUS_DRV);
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}",
- device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0],
- device_ctx->class_id.Data[5], device_ctx->class_id.Data[4],
- device_ctx->class_id.Data[7], device_ctx->class_id.Data[6],
- device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11],
- device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]);
+ device_ctx->class_id.data[3], device_ctx->class_id.data[2],
+ device_ctx->class_id.data[1], device_ctx->class_id.data[0],
+ device_ctx->class_id.data[5], device_ctx->class_id.data[4],
+ device_ctx->class_id.data[7], device_ctx->class_id.data[6],
+ device_ctx->class_id.data[8], device_ctx->class_id.data[9],
+ device_ctx->class_id.data[10], device_ctx->class_id.data[11],
+ device_ctx->class_id.data[12], device_ctx->class_id.data[13],
+ device_ctx->class_id.data[14], device_ctx->class_id.data[15]);
env->envp_idx = i;
env->buflen = len;
ret = add_uevent_var(env,
"VMBUS_DEVICE_CLASS_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
- device_ctx->class_id.Data[3], device_ctx->class_id.Data[2], device_ctx->class_id.Data[1], device_ctx->class_id.Data[0],
- device_ctx->class_id.Data[5], device_ctx->class_id.Data[4],
- device_ctx->class_id.Data[7], device_ctx->class_id.Data[6],
- device_ctx->class_id.Data[8], device_ctx->class_id.Data[9], device_ctx->class_id.Data[10], device_ctx->class_id.Data[11],
- device_ctx->class_id.Data[12], device_ctx->class_id.Data[13], device_ctx->class_id.Data[14], device_ctx->class_id.Data[15]);
+ device_ctx->class_id.data[3], device_ctx->class_id.data[2],
+ device_ctx->class_id.data[1], device_ctx->class_id.data[0],
+ device_ctx->class_id.data[5], device_ctx->class_id.data[4],
+ device_ctx->class_id.data[7], device_ctx->class_id.data[6],
+ device_ctx->class_id.data[8], device_ctx->class_id.data[9],
+ device_ctx->class_id.data[10], device_ctx->class_id.data[11],
+ device_ctx->class_id.data[12], device_ctx->class_id.data[13],
+ device_ctx->class_id.data[14], device_ctx->class_id.data[15]);
if (ret)
{
ret = add_uevent_var(env,
"VMBUS_DEVICE_DEVICE_GUID={%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x%02x%02x}",
- device_ctx->device_id.Data[3], device_ctx->device_id.Data[2], device_ctx->device_id.Data[1], device_ctx->device_id.Data[0],
- device_ctx->device_id.Data[5], device_ctx->device_id.Data[4],
- device_ctx->device_id.Data[7], device_ctx->device_id.Data[6],
- device_ctx->device_id.Data[8], device_ctx->device_id.Data[9], device_ctx->device_id.Data[10], device_ctx->device_id.Data[11],
- device_ctx->device_id.Data[12], device_ctx->device_id.Data[13], device_ctx->device_id.Data[14], device_ctx->device_id.Data[15]);
+ device_ctx->device_id.data[3], device_ctx->device_id.data[2],
+ device_ctx->device_id.data[1], device_ctx->device_id.data[0],
+ device_ctx->device_id.data[5], device_ctx->device_id.data[4],
+ device_ctx->device_id.data[7], device_ctx->device_id.data[6],
+ device_ctx->device_id.data[8], device_ctx->device_id.data[9],
+ device_ctx->device_id.data[10], device_ctx->device_id.data[11],
+ device_ctx->device_id.data[12], device_ctx->device_id.data[13],
+ device_ctx->device_id.data[14], device_ctx->device_id.data[15]);
if (ret)
{
DPRINT_ENTER(VMBUS_DRV);
/* We found our driver ? */
- if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(GUID)) == 0)
+ if (memcmp(&device_ctx->class_id, &driver_ctx->class_id, sizeof(struct hv_guid)) == 0)
{
/* !! NOTE: The driver_ctx is not a vmbus_drv_ctx. We typecast it here to access the */
/* struct hv_driver field */