svn commit: r302802 - in head/sys/dev/hyperv: include netvsc storvsc utilities vmbus
Sepherosa Ziehau
sephe at FreeBSD.org
Thu Jul 14 05:25:33 UTC 2016
Author: sephe
Date: Thu Jul 14 05:25:31 2016
New Revision: 302802
URL: https://svnweb.freebsd.org/changeset/base/302802
Log:
hyperv: hv_guid -> struct hyperv_guid.
This paves way for the further cleanup/disentangle.
MFC after: 1 week
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7092
Modified:
head/sys/dev/hyperv/include/hyperv.h
head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
head/sys/dev/hyperv/utilities/hv_heartbeat.c
head/sys/dev/hyperv/utilities/hv_kvp.c
head/sys/dev/hyperv/utilities/hv_shutdown.c
head/sys/dev/hyperv/utilities/hv_timesync.c
head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
head/sys/dev/hyperv/vmbus/hyperv.c
head/sys/dev/hyperv/vmbus/vmbus.c
head/sys/dev/hyperv/vmbus/vmbus_if.m
Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/include/hyperv.h Thu Jul 14 05:25:31 2016 (r302802)
@@ -121,25 +121,13 @@ typedef uint8_t hv_bool_uint8_t;
((HV_ALIGN_UP(addr+len, PAGE_SIZE) - \
HV_ALIGN_DOWN(addr, PAGE_SIZE)) >> PAGE_SHIFT )
-typedef struct hv_guid {
- uint8_t data[16];
-} __packed hv_guid;
+struct hyperv_guid {
+ uint8_t hv_guid[16];
+} __packed;
#define HYPERV_GUID_STRLEN 40
-int hyperv_guid2str(const struct hv_guid *, char *, size_t);
-
-#define HV_NIC_GUID \
- .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46, \
- 0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}
-
-#define HV_IDE_GUID \
- .data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44, \
- 0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}
-
-#define HV_SCSI_GUID \
- .data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d, \
- 0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}
+int hyperv_guid2str(const struct hyperv_guid *, char *, size_t);
/*
* At the center of the Channel Management library is
@@ -148,8 +136,8 @@ int hyperv_guid2str(const struct hv_guid
*/
typedef struct hv_vmbus_channel_offer {
- hv_guid interface_type;
- hv_guid interface_instance;
+ struct hyperv_guid interface_type;
+ struct hyperv_guid interface_instance;
uint64_t interrupt_latency_in_100ns_units;
uint32_t interface_revision;
uint32_t server_context_area_size; /* in bytes */
@@ -477,8 +465,8 @@ typedef struct hv_vmbus_channel {
TAILQ_ENTRY(hv_vmbus_channel) ch_link;
uint32_t ch_subidx; /* subchan index */
- struct hv_guid ch_guid_type;
- struct hv_guid ch_guid_inst;
+ struct hyperv_guid ch_guid_type;
+ struct hyperv_guid ch_guid_inst;
struct sysctl_ctx_list ch_sysctl_ctx;
} hv_vmbus_channel;
Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -399,8 +399,8 @@ hn_ifmedia_sts(struct ifnet *ifp, struct
}
/* {F8615163-DF3E-46c5-913F-F2D2F965ED0E} */
-static const hv_guid g_net_vsc_device_type = {
- .data = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
+static const struct hyperv_guid g_net_vsc_device_type = {
+ .hv_guid = {0x63, 0x51, 0x61, 0xF8, 0x3E, 0xDF, 0xc5, 0x46,
0x91, 0x3F, 0xF2, 0xD2, 0xF9, 0x65, 0xED, 0x0E}
};
Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -180,14 +180,14 @@ enum hv_storage_type {
#define HV_STORAGE_SUPPORTS_MULTI_CHANNEL 0x1
/* {ba6163d9-04a1-4d29-b605-72e2ffb1dc7f} */
-static const hv_guid gStorVscDeviceType={
- .data = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
+static const struct hyperv_guid gStorVscDeviceType={
+ .hv_guid = {0xd9, 0x63, 0x61, 0xba, 0xa1, 0x04, 0x29, 0x4d,
0xb6, 0x05, 0x72, 0xe2, 0xff, 0xb1, 0xdc, 0x7f}
};
/* {32412632-86cb-44a2-9b5c-50d1417354f5} */
-static const hv_guid gBlkVscDeviceType={
- .data = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
+static const struct hyperv_guid gBlkVscDeviceType={
+ .hv_guid = {0x32, 0x26, 0x41, 0x32, 0xcb, 0x86, 0xa2, 0x44,
0x9b, 0x5c, 0x50, 0xd1, 0x41, 0x73, 0x54, 0xf5}
};
Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c
==============================================================================
--- head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -39,7 +39,7 @@
#include "vmbus_if.h"
/* Heartbeat Service */
-static const hv_guid service_guid = { .data =
+static const struct hyperv_guid service_guid = { .hv_guid =
{0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e,
0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} };
Modified: head/sys/dev/hyperv/utilities/hv_kvp.c
==============================================================================
--- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -90,7 +90,7 @@ static int hv_kvp_log = 0;
log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \
} while (0)
-static const hv_guid service_guid = { .data =
+static const struct hyperv_guid service_guid = { .hv_guid =
{0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d,
0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} };
Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c
==============================================================================
--- head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/utilities/hv_shutdown.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -43,7 +43,7 @@
#include "hv_util.h"
#include "vmbus_if.h"
-static const hv_guid service_guid = { .data =
+static const struct hyperv_guid service_guid = { .hv_guid =
{0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49,
0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} };
Modified: head/sys/dev/hyperv/utilities/hv_timesync.c
==============================================================================
--- head/sys/dev/hyperv/utilities/hv_timesync.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/utilities/hv_timesync.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -55,7 +55,7 @@ typedef struct {
} time_sync_data;
/* Time Synch Service */
-static const hv_guid service_guid = {.data =
+static const struct hyperv_guid service_guid = {.hv_guid =
{0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } };
Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -128,9 +128,9 @@ vmbus_channel_process_offer(hv_vmbus_cha
TAILQ_FOREACH(channel, &sc->vmbus_chlist, ch_link) {
if (memcmp(&channel->ch_guid_type, &new_channel->ch_guid_type,
- sizeof(hv_guid)) == 0 &&
+ sizeof(struct hyperv_guid)) == 0 &&
memcmp(&channel->ch_guid_inst, &new_channel->ch_guid_inst,
- sizeof(hv_guid)) == 0)
+ sizeof(struct hyperv_guid)) == 0)
break;
}
Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Thu Jul 14 05:25:31 2016 (r302802)
@@ -56,8 +56,8 @@ typedef struct {
typedef struct {
uint32_t rel_id;
hv_vmbus_channel_state state;
- hv_guid interface_type;
- hv_guid interface_instance;
+ struct hyperv_guid interface_type;
+ struct hyperv_guid interface_instance;
uint32_t monitor_id;
uint32_t server_monitor_pending;
uint32_t server_monitor_latency;
Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/vmbus/hyperv.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -116,9 +116,9 @@ hypercall_signal_event(bus_addr_t monprm
}
int
-hyperv_guid2str(const struct hv_guid *guid, char *buf, size_t sz)
+hyperv_guid2str(const struct hyperv_guid *guid, char *buf, size_t sz)
{
- const uint8_t *d = guid->data;
+ const uint8_t *d = guid->hv_guid;
return snprintf(buf, sz, "%02x%02x%02x%02x-"
"%02x%02x-%02x%02x-%02x%02x-"
Modified: head/sys/dev/hyperv/vmbus/vmbus.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 14 05:25:31 2016 (r302802)
@@ -1051,11 +1051,12 @@ vmbus_get_version_method(device_t bus, d
}
static int
-vmbus_probe_guid_method(device_t bus, device_t dev, const struct hv_guid *guid)
+vmbus_probe_guid_method(device_t bus, device_t dev,
+ const struct hyperv_guid *guid)
{
const struct hv_vmbus_channel *chan = vmbus_get_channel(dev);
- if (memcmp(&chan->ch_guid_type, guid, sizeof(struct hv_guid)) == 0)
+ if (memcmp(&chan->ch_guid_type, guid, sizeof(struct hyperv_guid)) == 0)
return 0;
return ENXIO;
}
Modified: head/sys/dev/hyperv/vmbus/vmbus_if.m
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_if.m Thu Jul 14 05:14:12 2016 (r302801)
+++ head/sys/dev/hyperv/vmbus/vmbus_if.m Thu Jul 14 05:25:31 2016 (r302802)
@@ -32,7 +32,7 @@
INTERFACE vmbus;
HEADER {
- struct hv_guid;
+ struct hyperv_guid;
};
METHOD uint32_t get_version {
@@ -43,5 +43,5 @@ METHOD uint32_t get_version {
METHOD int probe_guid {
device_t bus;
device_t dev;
- const struct hv_guid *guid;
+ const struct hyperv_guid *guid;
};
More information about the svn-src-all
mailing list