diff options
author | sephe <sephe@FreeBSD.org> | 2016-10-11 07:30:59 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-10-11 07:30:59 +0000 |
commit | e454e6f1254efd4b2d767a04a4e076f85863c58c (patch) | |
tree | 7062d628c193dc4f758f1b55865b14a9e36a53b0 /sys/dev/hyperv/utilities/hv_timesync.c | |
parent | 5aca196a1235050ca5edda3bcef3ce631a06097b (diff) | |
download | FreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.zip FreeBSD-src-e454e6f1254efd4b2d767a04a4e076f85863c58c.tar.gz |
MFC 302698-302704,302706
302698
hyperv/vmbus: Add vmbus method for GUID base device probing.
Reduce the exposure of hv_device.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7024
302699
hyperv/vmbus: All ivars are read-only; nuke unnecessary write_ivar
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7025
302700
hyperv/vmbus: Add channel ivar accessor.
This makes life easier during the transition period to nuke the hv_device.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7026
302701
hyperv/stor: Avoid the hv_device and nuke the broken get_stor_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7027
302702
hyperv/util: Avoid the hv_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7028
302703
hyperv/vmbus: Deprecate the usage of hv_device.
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7032
302704
hyperv/hn: Avoid the hv_device
This paves way to nuke the hv_device, which is actually an unncessary
indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7033
302706
hyperv: Get rid of hv_device, which is unnecessary indirection.
Sponsored by: Microsoft OSTC
Differential Revision: https://reviews.freebsd.org/D7034
Diffstat (limited to 'sys/dev/hyperv/utilities/hv_timesync.c')
-rw-r--r-- | sys/dev/hyperv/utilities/hv_timesync.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/hyperv/utilities/hv_timesync.c b/sys/dev/hyperv/utilities/hv_timesync.c index eeb0434..c114858 100644 --- a/sys/dev/hyperv/utilities/hv_timesync.c +++ b/sys/dev/hyperv/utilities/hv_timesync.c @@ -41,6 +41,7 @@ #include <dev/hyperv/include/hyperv.h> #include "hv_util.h" +#include "vmbus_if.h" #define HV_WLTIMEDELTA 116444736000000000L /* in 100ns unit */ #define HV_ICTIMESYNCFLAG_PROBE 0 @@ -54,7 +55,7 @@ typedef struct { } time_sync_data; /* Time Synch Service */ -static hv_guid service_guid = {.data = +static const hv_guid service_guid = {.data = {0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } }; @@ -139,7 +140,7 @@ hv_timesync_cb(void *context) hv_timesync_sc *softc; softc = (hv_timesync_sc*)context; - channel = softc->util_sc.hv_dev->channel; + channel = softc->util_sc.channel; time_buf = softc->util_sc.receive_buffer; ret = hv_vmbus_channel_recv_packet(channel, time_buf, @@ -170,16 +171,13 @@ hv_timesync_cb(void *context) static int hv_timesync_probe(device_t dev) { - const char *p = vmbus_get_type(dev); - if (resource_disabled("hvtimesync", 0)) return ENXIO; - if (!memcmp(p, &service_guid, sizeof(hv_guid))) { + 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; } |