Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/utilities/hv_heartbeat.c
Show First 20 Lines • Show All 74 Lines • ▼ Show 20 Lines | hv_heartbeat_cb(struct vmbus_channel *channel, void *context) | ||||
/* 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 *) | icmsghdrp = (struct hv_vmbus_icmsg_hdr *) | ||||
&buf[sizeof(struct hv_vmbus_pipe_hdr)]; | &buf[sizeof(struct hv_vmbus_pipe_hdr)]; | ||||
if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { | ||||
hv_negotiate_version(icmsghdrp, buf); | int error; | ||||
error = vmbus_ic_negomsg(softc, buf, recvlen); | |||||
if (error) | |||||
return; | |||||
} else { | } else { | ||||
heartbeat_msg = | heartbeat_msg = | ||||
(struct hv_vmbus_heartbeat_msg_data *) | (struct hv_vmbus_heartbeat_msg_data *) | ||||
&buf[sizeof(struct hv_vmbus_pipe_hdr) + | &buf[sizeof(struct hv_vmbus_pipe_hdr) + | ||||
sizeof(struct hv_vmbus_icmsg_hdr)]; | sizeof(struct hv_vmbus_icmsg_hdr)]; | ||||
heartbeat_msg->seq_num += 1; | heartbeat_msg->seq_num += 1; | ||||
} | } | ||||
Show All 37 Lines |