Commit 358d2ee2 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman

Staging: hv: Replace struct hv_guid with the uuid type already defined in Linux

Replace struct hv_guid with the uuid type already defined in Linux.
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 32a753ff
...@@ -112,8 +112,8 @@ struct block_device_context { ...@@ -112,8 +112,8 @@ struct block_device_context {
static const char *drv_name = "blkvsc"; static const char *drv_name = "blkvsc";
/* {32412632-86cb-44a2-9b5c-50d1417354f5} */ /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
static const struct hv_guid dev_type = { static const uuid_le dev_type = {
.data = { .b = {
0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
} }
...@@ -155,13 +155,13 @@ static int blkvsc_device_add(struct hv_device *device, ...@@ -155,13 +155,13 @@ static int blkvsc_device_add(struct hv_device *device,
* id. For IDE devices, the device instance id is formatted as * id. For IDE devices, the device instance id is formatted as
* <bus id> * - <device id> - 8899 - 000000000000. * <bus id> * - <device id> - 8899 - 000000000000.
*/ */
device_info->path_id = device->dev_instance.data[3] << 24 | device_info->path_id = device->dev_instance.b[3] << 24 |
device->dev_instance.data[2] << 16 | device->dev_instance.b[2] << 16 |
device->dev_instance.data[1] << 8 | device->dev_instance.b[1] << 8 |
device->dev_instance.data[0]; device->dev_instance.b[0];
device_info->target_id = device->dev_instance.data[5] << 8 | device_info->target_id = device->dev_instance.b[5] << 8 |
device->dev_instance.data[4]; device->dev_instance.b[4];
return ret; return ret;
} }
...@@ -829,7 +829,7 @@ static int blkvsc_drv_init(void) ...@@ -829,7 +829,7 @@ static int blkvsc_drv_init(void)
BUILD_BUG_ON(sizeof(sector_t) != 8); BUILD_BUG_ON(sizeof(sector_t) != 8);
memcpy(&drv->dev_type, &dev_type, sizeof(struct hv_guid)); memcpy(&drv->dev_type, &dev_type, sizeof(uuid_le));
drv->driver.name = drv_name; drv->driver.name = drv_name;
/* The driver belongs to vmbus */ /* The driver belongs to vmbus */
......
...@@ -81,10 +81,10 @@ void vmbus_get_debug_info(struct vmbus_channel *channel, ...@@ -81,10 +81,10 @@ void vmbus_get_debug_info(struct vmbus_channel *channel,
debuginfo->relid = channel->offermsg.child_relid; debuginfo->relid = channel->offermsg.child_relid;
debuginfo->state = channel->state; debuginfo->state = channel->state;
memcpy(&debuginfo->interfacetype, memcpy(&debuginfo->interfacetype,
&channel->offermsg.offer.if_type, sizeof(struct hv_guid)); &channel->offermsg.offer.if_type, sizeof(uuid_le));
memcpy(&debuginfo->interface_instance, memcpy(&debuginfo->interface_instance,
&channel->offermsg.offer.if_instance, &channel->offermsg.offer.if_instance,
sizeof(struct hv_guid)); sizeof(uuid_le));
monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages; monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages;
......
...@@ -40,12 +40,12 @@ struct vmbus_channel_message_table_entry { ...@@ -40,12 +40,12 @@ struct vmbus_channel_message_table_entry {
#define MAX_MSG_TYPES 4 #define MAX_MSG_TYPES 4
#define MAX_NUM_DEVICE_CLASSES_SUPPORTED 8 #define MAX_NUM_DEVICE_CLASSES_SUPPORTED 8
static const struct hv_guid static const uuid_le
supported_device_classes[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = { supported_device_classes[MAX_NUM_DEVICE_CLASSES_SUPPORTED] = {
/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
/* Storage - SCSI */ /* Storage - SCSI */
{ {
.data = { .b = {
0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
} }
...@@ -54,7 +54,7 @@ static const struct hv_guid ...@@ -54,7 +54,7 @@ static const struct hv_guid
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
/* Network */ /* Network */
{ {
.data = { .b = {
0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
} }
...@@ -63,7 +63,7 @@ static const struct hv_guid ...@@ -63,7 +63,7 @@ static const struct hv_guid
/* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */ /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
/* Input */ /* Input */
{ {
.data = { .b = {
0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c, 0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A
} }
...@@ -72,7 +72,7 @@ static const struct hv_guid ...@@ -72,7 +72,7 @@ static const struct hv_guid
/* {32412632-86cb-44a2-9b5c-50d1417354f5} */ /* {32412632-86cb-44a2-9b5c-50d1417354f5} */
/* IDE */ /* IDE */
{ {
.data = { .b = {
0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, 0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5
} }
...@@ -80,7 +80,7 @@ static const struct hv_guid ...@@ -80,7 +80,7 @@ static const struct hv_guid
/* 0E0B6031-5213-4934-818B-38D90CED39DB */ /* 0E0B6031-5213-4934-818B-38D90CED39DB */
/* Shutdown */ /* Shutdown */
{ {
.data = { .b = {
0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
} }
...@@ -88,7 +88,7 @@ static const struct hv_guid ...@@ -88,7 +88,7 @@ static const struct hv_guid
/* {9527E630-D0AE-497b-ADCE-E80AB0175CAF} */ /* {9527E630-D0AE-497b-ADCE-E80AB0175CAF} */
/* TimeSync */ /* TimeSync */
{ {
.data = { .b = {
0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
} }
...@@ -96,7 +96,7 @@ static const struct hv_guid ...@@ -96,7 +96,7 @@ static const struct hv_guid
/* {57164f39-9115-4e78-ab55-382f3bd5422d} */ /* {57164f39-9115-4e78-ab55-382f3bd5422d} */
/* Heartbeat */ /* Heartbeat */
{ {
.data = { .b = {
0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
} }
...@@ -104,7 +104,7 @@ static const struct hv_guid ...@@ -104,7 +104,7 @@ static const struct hv_guid
/* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */ /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
/* KVP */ /* KVP */
{ {
.data = { .b = {
0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
} }
...@@ -231,7 +231,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = { ...@@ -231,7 +231,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
/* Shutdown */ /* Shutdown */
{ {
.msg_type = HV_SHUTDOWN_MSG, .msg_type = HV_SHUTDOWN_MSG,
.data = { .data.b = {
0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, 0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB
}, },
...@@ -242,7 +242,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = { ...@@ -242,7 +242,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
/* TimeSync */ /* TimeSync */
{ {
.msg_type = HV_TIMESYNC_MSG, .msg_type = HV_TIMESYNC_MSG,
.data = { .data.b = {
0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf
}, },
...@@ -252,7 +252,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = { ...@@ -252,7 +252,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
/* Heartbeat */ /* Heartbeat */
{ {
.msg_type = HV_HEARTBEAT_MSG, .msg_type = HV_HEARTBEAT_MSG,
.data = { .data.b = {
0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d
}, },
...@@ -261,7 +261,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = { ...@@ -261,7 +261,7 @@ struct hyperv_service_callback hv_cb_utils[MAX_MSG_TYPES] = {
/* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */ /* {A9A0F4E7-5A45-4d96-B827-8A841E8C03E6} */
/* KVP */ /* KVP */
{ {
.data = { .data.b = {
0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6
}, },
...@@ -358,12 +358,10 @@ static void vmbus_process_offer(struct work_struct *work) ...@@ -358,12 +358,10 @@ static void vmbus_process_offer(struct work_struct *work)
spin_lock_irqsave(&vmbus_connection.channel_lock, flags); spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
if (!memcmp(&channel->offermsg.offer.if_type, if (!uuid_le_cmp(channel->offermsg.offer.if_type,
&newchannel->offermsg.offer.if_type, newchannel->offermsg.offer.if_type) &&
sizeof(struct hv_guid)) && !uuid_le_cmp(channel->offermsg.offer.if_instance,
!memcmp(&channel->offermsg.offer.if_instance, newchannel->offermsg.offer.if_instance)) {
&newchannel->offermsg.offer.if_instance,
sizeof(struct hv_guid))) {
fnew = false; fnew = false;
break; break;
} }
...@@ -416,9 +414,8 @@ static void vmbus_process_offer(struct work_struct *work) ...@@ -416,9 +414,8 @@ static void vmbus_process_offer(struct work_struct *work)
/* Open IC channels */ /* Open IC channels */
for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) { for (cnt = 0; cnt < MAX_MSG_TYPES; cnt++) {
if (memcmp(&newchannel->offermsg.offer.if_type, if (!uuid_le_cmp(newchannel->offermsg.offer.if_type,
&hv_cb_utils[cnt].data, hv_cb_utils[cnt].data) &&
sizeof(struct hv_guid)) == 0 &&
vmbus_open(newchannel, 2 * PAGE_SIZE, vmbus_open(newchannel, 2 * PAGE_SIZE,
2 * PAGE_SIZE, NULL, 0, 2 * PAGE_SIZE, NULL, 0,
chn_cb_negotiate, chn_cb_negotiate,
...@@ -444,16 +441,15 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) ...@@ -444,16 +441,15 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr)
{ {
struct vmbus_channel_offer_channel *offer; struct vmbus_channel_offer_channel *offer;
struct vmbus_channel *newchannel; struct vmbus_channel *newchannel;
struct hv_guid *guidtype; uuid_le *guidtype;
struct hv_guid *guidinstance; uuid_le *guidinstance;
int i; int i;
int fsupported = 0; int fsupported = 0;
offer = (struct vmbus_channel_offer_channel *)hdr; offer = (struct vmbus_channel_offer_channel *)hdr;
for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) { for (i = 0; i < MAX_NUM_DEVICE_CLASSES_SUPPORTED; i++) {
if (memcmp(&offer->offer.if_type, if (!uuid_le_cmp(offer->offer.if_type,
&supported_device_classes[i], supported_device_classes[i])) {
sizeof(struct hv_guid)) == 0) {
fsupported = 1; fsupported = 1;
break; break;
} }
......
...@@ -179,8 +179,8 @@ struct mousevsc_dev { ...@@ -179,8 +179,8 @@ struct mousevsc_dev {
static const char *driver_name = "mousevsc"; static const char *driver_name = "mousevsc";
/* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */ /* {CFA8B69E-5B4A-4cc0-B98B-8BA1A1F3F95A} */
static const struct hv_guid mouse_guid = { static const uuid_le mouse_guid = {
.data = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c, .b = {0x9E, 0xB6, 0xA8, 0xCF, 0x4A, 0x5B, 0xc0, 0x4c,
0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A} 0xB9, 0x8B, 0x8B, 0xA1, 0xA1, 0xF3, 0xF9, 0x5A}
}; };
...@@ -932,7 +932,7 @@ static int __init mousevsc_init(void) ...@@ -932,7 +932,7 @@ static int __init mousevsc_init(void)
DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing."); DPRINT_INFO(INPUTVSC_DRV, "Hyper-V Mouse driver initializing.");
memcpy(&drv->dev_type, &mouse_guid, memcpy(&drv->dev_type, &mouse_guid,
sizeof(struct hv_guid)); sizeof(uuid_le));
drv->driver.name = driver_name; drv->driver.name = driver_name;
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/uuid.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/completion.h> #include <linux/completion.h>
...@@ -35,9 +36,6 @@ ...@@ -35,9 +36,6 @@
#include <asm/hyperv.h> #include <asm/hyperv.h>
struct hv_guid {
unsigned char data[16];
};
#define MAX_PAGE_BUFFER_COUNT 16 #define MAX_PAGE_BUFFER_COUNT 16
#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */ #define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
...@@ -156,8 +154,8 @@ struct hv_ring_buffer_debug_info { ...@@ -156,8 +154,8 @@ struct hv_ring_buffer_debug_info {
* struct contains the fundamental information about an offer. * struct contains the fundamental information about an offer.
*/ */
struct vmbus_channel_offer { struct vmbus_channel_offer {
struct hv_guid if_type; uuid_le if_type;
struct hv_guid if_instance; uuid_le if_instance;
u64 int_latency; /* in 100ns units */ u64 int_latency; /* in 100ns units */
u32 if_revision; u32 if_revision;
u32 server_ctx_size; /* in bytes */ u32 server_ctx_size; /* in bytes */
...@@ -526,8 +524,8 @@ enum vmbus_channel_state { ...@@ -526,8 +524,8 @@ enum vmbus_channel_state {
struct vmbus_channel_debug_info { struct vmbus_channel_debug_info {
u32 relid; u32 relid;
enum vmbus_channel_state state; enum vmbus_channel_state state;
struct hv_guid interfacetype; uuid_le interfacetype;
struct hv_guid interface_instance; uuid_le interface_instance;
u32 monitorid; u32 monitorid;
u32 servermonitor_pending; u32 servermonitor_pending;
u32 servermonitor_latency; u32 servermonitor_latency;
...@@ -786,8 +784,8 @@ struct hv_dev_port_info { ...@@ -786,8 +784,8 @@ struct hv_dev_port_info {
struct hv_device_info { struct hv_device_info {
u32 chn_id; u32 chn_id;
u32 chn_state; u32 chn_state;
struct hv_guid chn_type; uuid_le chn_type;
struct hv_guid chn_instance; uuid_le chn_instance;
u32 monitor_id; u32 monitor_id;
u32 server_monitor_pending; u32 server_monitor_pending;
...@@ -806,7 +804,7 @@ struct hv_driver { ...@@ -806,7 +804,7 @@ struct hv_driver {
const char *name; const char *name;
/* the device type supported by this driver */ /* the device type supported by this driver */
struct hv_guid dev_type; uuid_le dev_type;
struct device_driver driver; struct device_driver driver;
...@@ -819,10 +817,10 @@ struct hv_driver { ...@@ -819,10 +817,10 @@ struct hv_driver {
/* Base device object */ /* Base device object */
struct hv_device { struct hv_device {
/* the device type id of this device */ /* the device type id of this device */
struct hv_guid dev_type; uuid_le dev_type;
/* the device instance id of this device */ /* the device instance id of this device */
struct hv_guid dev_instance; uuid_le dev_instance;
struct device device; struct device device;
...@@ -935,7 +933,7 @@ struct ictimesync_data { ...@@ -935,7 +933,7 @@ struct ictimesync_data {
struct hyperv_service_callback { struct hyperv_service_callback {
u8 msg_type; u8 msg_type;
char *log_msg; char *log_msg;
unsigned char data[16]; uuid_le data;
struct vmbus_channel *channel; struct vmbus_channel *channel;
void (*callback) (void *context); void (*callback) (void *context);
}; };
......
...@@ -451,8 +451,8 @@ enum { ...@@ -451,8 +451,8 @@ enum {
/* #define VMBUS_PORT_ID 11 */ /* #define VMBUS_PORT_ID 11 */
/* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */ /* 628180B8-308D-4c5e-B7DB-1BEB62E62EF4 */
static const struct hv_guid VMBUS_SERVICE_ID = { static const uuid_le VMBUS_SERVICE_ID = {
.data = { .b = {
0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c, 0xb8, 0x80, 0x81, 0x62, 0x8d, 0x30, 0x5e, 0x4c,
0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4 0xb7, 0xdb, 0x1b, 0xeb, 0x62, 0xe6, 0x2e, 0xf4
}, },
...@@ -601,8 +601,8 @@ extern struct vmbus_connection vmbus_connection; ...@@ -601,8 +601,8 @@ extern struct vmbus_connection vmbus_connection;
/* General vmbus interface */ /* General vmbus interface */
struct hv_device *vmbus_child_device_create(struct hv_guid *type, struct hv_device *vmbus_child_device_create(uuid_le *type,
struct hv_guid *instance, uuid_le *instance,
struct vmbus_channel *channel); struct vmbus_channel *channel);
int vmbus_child_device_register(struct hv_device *child_device_obj); int vmbus_child_device_register(struct hv_device *child_device_obj);
......
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
static const char *driver_name = "netvsc"; static const char *driver_name = "netvsc";
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */ /* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
static const struct hv_guid netvsc_device_type = { static const uuid_le netvsc_device_type = {
.data = { .b = {
0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, 0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E
} }
...@@ -1009,7 +1009,7 @@ int netvsc_initialize(struct hv_driver *drv) ...@@ -1009,7 +1009,7 @@ int netvsc_initialize(struct hv_driver *drv)
{ {
drv->name = driver_name; drv->name = driver_name;
memcpy(&drv->dev_type, &netvsc_device_type, sizeof(struct hv_guid)); memcpy(&drv->dev_type, &netvsc_device_type, sizeof(uuid_le));
return 0; return 0;
} }
...@@ -45,8 +45,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)"); ...@@ -45,8 +45,8 @@ MODULE_PARM_DESC(storvsc_ringbuffer_size, "Ring buffer size (bytes)");
static const char *driver_name = "storvsc"; static const char *driver_name = "storvsc";
/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */ /* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
static const struct hv_guid stor_vsci_device_type = { static const uuid_le stor_vsci_device_type = {
.data = { .b = {
0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, 0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f
} }
...@@ -765,7 +765,7 @@ static int __init storvsc_drv_init(void) ...@@ -765,7 +765,7 @@ static int __init storvsc_drv_init(void)
sizeof(u64))); sizeof(u64)));
memcpy(&drv->dev_type, &stor_vsci_device_type, memcpy(&drv->dev_type, &stor_vsci_device_type,
sizeof(struct hv_guid)); sizeof(uuid_le));
if (max_outstanding_req_per_channel < if (max_outstanding_req_per_channel <
STORVSC_MAX_IO_REQUESTS) STORVSC_MAX_IO_REQUESTS)
......
...@@ -64,9 +64,9 @@ static void get_channel_info(struct hv_device *device, ...@@ -64,9 +64,9 @@ static void get_channel_info(struct hv_device *device,
info->chn_id = debug_info.relid; info->chn_id = debug_info.relid;
info->chn_state = debug_info.state; info->chn_state = debug_info.state;
memcpy(&info->chn_type, &debug_info.interfacetype, memcpy(&info->chn_type, &debug_info.interfacetype,
sizeof(struct hv_guid)); sizeof(uuid_le));
memcpy(&info->chn_instance, &debug_info.interface_instance, memcpy(&info->chn_instance, &debug_info.interface_instance,
sizeof(struct hv_guid)); sizeof(uuid_le));
info->monitor_id = debug_info.monitorid; info->monitor_id = debug_info.monitorid;
...@@ -116,41 +116,41 @@ static ssize_t vmbus_show_device_attr(struct device *dev, ...@@ -116,41 +116,41 @@ static ssize_t vmbus_show_device_attr(struct device *dev,
if (!strcmp(dev_attr->attr.name, "class_id")) { if (!strcmp(dev_attr->attr.name, "class_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-" return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x%02x%02x}\n", "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
device_info.chn_type.data[3], device_info.chn_type.b[3],
device_info.chn_type.data[2], device_info.chn_type.b[2],
device_info.chn_type.data[1], device_info.chn_type.b[1],
device_info.chn_type.data[0], device_info.chn_type.b[0],
device_info.chn_type.data[5], device_info.chn_type.b[5],
device_info.chn_type.data[4], device_info.chn_type.b[4],
device_info.chn_type.data[7], device_info.chn_type.b[7],
device_info.chn_type.data[6], device_info.chn_type.b[6],
device_info.chn_type.data[8], device_info.chn_type.b[8],
device_info.chn_type.data[9], device_info.chn_type.b[9],
device_info.chn_type.data[10], device_info.chn_type.b[10],
device_info.chn_type.data[11], device_info.chn_type.b[11],
device_info.chn_type.data[12], device_info.chn_type.b[12],
device_info.chn_type.data[13], device_info.chn_type.b[13],
device_info.chn_type.data[14], device_info.chn_type.b[14],
device_info.chn_type.data[15]); device_info.chn_type.b[15]);
} else if (!strcmp(dev_attr->attr.name, "device_id")) { } else if (!strcmp(dev_attr->attr.name, "device_id")) {
return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-" return sprintf(buf, "{%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x%02x%02x}\n", "%02x%02x%02x%02x%02x%02x%02x%02x}\n",
device_info.chn_instance.data[3], device_info.chn_instance.b[3],
device_info.chn_instance.data[2], device_info.chn_instance.b[2],
device_info.chn_instance.data[1], device_info.chn_instance.b[1],
device_info.chn_instance.data[0], device_info.chn_instance.b[0],
device_info.chn_instance.data[5], device_info.chn_instance.b[5],
device_info.chn_instance.data[4], device_info.chn_instance.b[4],
device_info.chn_instance.data[7], device_info.chn_instance.b[7],
device_info.chn_instance.data[6], device_info.chn_instance.b[6],
device_info.chn_instance.data[8], device_info.chn_instance.b[8],
device_info.chn_instance.data[9], device_info.chn_instance.b[9],
device_info.chn_instance.data[10], device_info.chn_instance.b[10],
device_info.chn_instance.data[11], device_info.chn_instance.b[11],
device_info.chn_instance.data[12], device_info.chn_instance.b[12],
device_info.chn_instance.data[13], device_info.chn_instance.b[13],
device_info.chn_instance.data[14], device_info.chn_instance.b[14],
device_info.chn_instance.data[15]); device_info.chn_instance.b[15]);
} else if (!strcmp(dev_attr->attr.name, "state")) { } else if (!strcmp(dev_attr->attr.name, "state")) {
return sprintf(buf, "%d\n", device_info.chn_state); return sprintf(buf, "%d\n", device_info.chn_state);
} else if (!strcmp(dev_attr->attr.name, "id")) { } else if (!strcmp(dev_attr->attr.name, "id")) {
...@@ -246,22 +246,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env) ...@@ -246,22 +246,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
ret = add_uevent_var(env, "VMBUS_DEVICE_CLASS_GUID={" 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-"
"%02x%02x%02x%02x%02x%02x%02x%02x}", "%02x%02x%02x%02x%02x%02x%02x%02x}",
dev->dev_type.data[3], dev->dev_type.b[3],
dev->dev_type.data[2], dev->dev_type.b[2],
dev->dev_type.data[1], dev->dev_type.b[1],
dev->dev_type.data[0], dev->dev_type.b[0],
dev->dev_type.data[5], dev->dev_type.b[5],
dev->dev_type.data[4], dev->dev_type.b[4],
dev->dev_type.data[7], dev->dev_type.b[7],
dev->dev_type.data[6], dev->dev_type.b[6],
dev->dev_type.data[8], dev->dev_type.b[8],
dev->dev_type.data[9], dev->dev_type.b[9],
dev->dev_type.data[10], dev->dev_type.b[10],
dev->dev_type.data[11], dev->dev_type.b[11],
dev->dev_type.data[12], dev->dev_type.b[12],
dev->dev_type.data[13], dev->dev_type.b[13],
dev->dev_type.data[14], dev->dev_type.b[14],
dev->dev_type.data[15]); dev->dev_type.b[15]);
if (ret) if (ret)
return ret; return ret;
...@@ -269,22 +269,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env) ...@@ -269,22 +269,22 @@ static int vmbus_uevent(struct device *device, struct kobj_uevent_env *env)
ret = add_uevent_var(env, "VMBUS_DEVICE_DEVICE_GUID={" 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-"
"%02x%02x%02x%02x%02x%02x%02x%02x}", "%02x%02x%02x%02x%02x%02x%02x%02x}",
dev->dev_instance.data[3], dev->dev_instance.b[3],
dev->dev_instance.data[2], dev->dev_instance.b[2],
dev->dev_instance.data[1], dev->dev_instance.b[1],
dev->dev_instance.data[0], dev->dev_instance.b[0],
dev->dev_instance.data[5], dev->dev_instance.b[5],
dev->dev_instance.data[4], dev->dev_instance.b[4],
dev->dev_instance.data[7], dev->dev_instance.b[7],
dev->dev_instance.data[6], dev->dev_instance.b[6],
dev->dev_instance.data[8], dev->dev_instance.b[8],
dev->dev_instance.data[9], dev->dev_instance.b[9],
dev->dev_instance.data[10], dev->dev_instance.b[10],
dev->dev_instance.data[11], dev->dev_instance.b[11],
dev->dev_instance.data[12], dev->dev_instance.b[12],
dev->dev_instance.data[13], dev->dev_instance.b[13],
dev->dev_instance.data[14], dev->dev_instance.b[14],
dev->dev_instance.data[15]); dev->dev_instance.b[15]);
if (ret) if (ret)
return ret; return ret;
...@@ -303,7 +303,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver) ...@@ -303,7 +303,7 @@ static int vmbus_match(struct device *device, struct device_driver *driver)
/* We found our driver ? */ /* We found our driver ? */
if (memcmp(&hv_dev->dev_type, &drv->dev_type, if (memcmp(&hv_dev->dev_type, &drv->dev_type,
sizeof(struct hv_guid)) == 0) sizeof(uuid_le)) == 0)
match = 1; match = 1;
return match; return match;
...@@ -630,8 +630,8 @@ EXPORT_SYMBOL(vmbus_child_driver_unregister); ...@@ -630,8 +630,8 @@ EXPORT_SYMBOL(vmbus_child_driver_unregister);
* vmbus_child_device_create - Creates and registers a new child device * vmbus_child_device_create - Creates and registers a new child device
* on the vmbus. * on the vmbus.
*/ */
struct hv_device *vmbus_child_device_create(struct hv_guid *type, struct hv_device *vmbus_child_device_create(uuid_le *type,
struct hv_guid *instance, uuid_le *instance,
struct vmbus_channel *channel) struct vmbus_channel *channel)
{ {
struct hv_device *child_device_obj; struct hv_device *child_device_obj;
...@@ -644,9 +644,9 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type, ...@@ -644,9 +644,9 @@ struct hv_device *vmbus_child_device_create(struct hv_guid *type,
} }
child_device_obj->channel = channel; child_device_obj->channel = channel;
memcpy(&child_device_obj->dev_type, type, sizeof(struct hv_guid)); memcpy(&child_device_obj->dev_type, type, sizeof(uuid_le));
memcpy(&child_device_obj->dev_instance, instance, memcpy(&child_device_obj->dev_instance, instance,
sizeof(struct hv_guid)); sizeof(uuid_le));
return child_device_obj; return child_device_obj;
......
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