Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/utilities/hv_timesync.c
Show First 20 Lines • Show All 154 Lines • ▼ Show 20 Lines | hv_timesync_cb(struct vmbus_channel *channel, void *context) | ||||
KASSERT(ret != ENOBUFS, ("hvtimesync recvbuf is not large enough")); | KASSERT(ret != ENOBUFS, ("hvtimesync recvbuf is not large enough")); | ||||
/* XXX check recvlen to make sure that it contains enough data */ | /* XXX check recvlen to make sure that it contains enough data */ | ||||
if ((ret == 0) && recvlen > 0) { | if ((ret == 0) && recvlen > 0) { | ||||
icmsghdrp = (struct hv_vmbus_icmsg_hdr *) &time_buf[ | icmsghdrp = (struct hv_vmbus_icmsg_hdr *) &time_buf[ | ||||
sizeof(struct hv_vmbus_pipe_hdr)]; | sizeof(struct hv_vmbus_pipe_hdr)]; | ||||
if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | ||||
hv_negotiate_version(icmsghdrp, time_buf); | int error; | ||||
error = vmbus_ic_negomsg(&softc->util_sc, time_buf, recvlen); | |||||
if (error) | |||||
return; | |||||
} else { | } else { | ||||
timedatap = (struct hv_ictimesync_data *) &time_buf[ | timedatap = (struct hv_ictimesync_data *) &time_buf[ | ||||
sizeof(struct hv_vmbus_pipe_hdr) + | sizeof(struct hv_vmbus_pipe_hdr) + | ||||
sizeof(struct hv_vmbus_icmsg_hdr)]; | sizeof(struct hv_vmbus_icmsg_hdr)]; | ||||
hv_adj_guesttime(softc, timedatap->parenttime, timedatap->flags); | hv_adj_guesttime(softc, timedatap->parenttime, timedatap->flags); | ||||
} | } | ||||
icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | icmsghdrp->icflags = HV_ICMSGHDRFLAG_TRANSACTION | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |