summaryrefslogtreecommitdiffstats
path: root/sys/dev/hyperv/utilities/hv_timesync.c
diff options
context:
space:
mode:
authorsephe <sephe@FreeBSD.org>2016-10-13 02:45:08 +0000
committersephe <sephe@FreeBSD.org>2016-10-13 02:45:08 +0000
commit4eba089e0941ca313b7a477ead5ef9370fac5257 (patch)
tree1490eced8a9acf855c52122d1cb59a60cabc393c /sys/dev/hyperv/utilities/hv_timesync.c
parentb8a954894105ede942a8dd90e34b80e5bcc7ad00 (diff)
downloadFreeBSD-src-4eba089e0941ca313b7a477ead5ef9370fac5257.zip
FreeBSD-src-4eba089e0941ca313b7a477ead5ef9370fac5257.tar.gz
MFC 304270,304273
304270 hyperv/util: Don't reference hn_softc in KVP hn_softc is private data struct. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7519 304273 hyperv/util: Factor out helper for IC device_probe DEVMETHOD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7530
Diffstat (limited to 'sys/dev/hyperv/utilities/hv_timesync.c')
-rw-r--r--sys/dev/hyperv/utilities/hv_timesync.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/hyperv/utilities/hv_timesync.c b/sys/dev/hyperv/utilities/hv_timesync.c
index 1cd7bc2..4f3c9fa 100644
--- a/sys/dev/hyperv/utilities/hv_timesync.c
+++ b/sys/dev/hyperv/utilities/hv_timesync.c
@@ -58,10 +58,15 @@ typedef struct {
uint64_t data;
} time_sync_data;
- /* Time Synch Service */
-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 } };
+static const struct vmbus_ic_desc vmbus_timesync_descs[] = {
+ {
+ .ic_guid = { .hv_guid = {
+ 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49,
+ 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } },
+ .ic_desc = "Hyper-V Timesync"
+ },
+ VMBUS_IC_DESC_END
+};
struct hv_ictimesync_data {
uint64_t parenttime;
@@ -174,14 +179,8 @@ hv_timesync_cb(struct vmbus_channel *channel, void *context)
static int
hv_timesync_probe(device_t dev)
{
- if (resource_disabled("hvtimesync", 0))
- return ENXIO;
- if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) {
- device_set_desc(dev, "Hyper-V Time Synch Service");
- return BUS_PROBE_DEFAULT;
- }
- return ENXIO;
+ return (vmbus_ic_probe(dev, vmbus_timesync_descs));
}
static int
OpenPOWER on IntegriCloud