Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F81970372
D8844.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D8844.diff
View Options
Index: head/sys/dev/hyperv/utilities/hv_heartbeat.c
===================================================================
--- head/sys/dev/hyperv/utilities/hv_heartbeat.c
+++ head/sys/dev/hyperv/utilities/hv_heartbeat.c
@@ -110,13 +110,9 @@
}
/*
- * Send response by echoing the updated request back.
+ * Send response by echoing the request back.
*/
- hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP;
- error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0,
- data, dlen, xactid);
- if (error)
- device_printf(sc->ic_dev, "resp send failed: %d\n", error);
+ vmbus_ic_sendresp(sc, chan, data, dlen, xactid);
}
static int
Index: head/sys/dev/hyperv/utilities/hv_shutdown.c
===================================================================
--- head/sys/dev/hyperv/utilities/hv_shutdown.c
+++ head/sys/dev/hyperv/utilities/hv_shutdown.c
@@ -122,13 +122,9 @@
}
/*
- * Send response by echoing the updated request back.
+ * Send response by echoing the request back.
*/
- hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP;
- error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0,
- data, dlen, xactid);
- if (error)
- device_printf(sc->ic_dev, "resp send failed: %d\n", error);
+ vmbus_ic_sendresp(sc, chan, data, dlen, xactid);
if (do_shutdown)
shutdown_nice(RB_POWEROFF);
Index: head/sys/dev/hyperv/utilities/hv_timesync.c
===================================================================
--- head/sys/dev/hyperv/utilities/hv_timesync.c
+++ head/sys/dev/hyperv/utilities/hv_timesync.c
@@ -203,13 +203,9 @@
}
/*
- * Send response by echoing the updated request back.
+ * Send response by echoing the request back.
*/
- hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP;
- error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0,
- data, dlen, xactid);
- if (error)
- device_printf(sc->ic_dev, "resp send failed: %d\n", error);
+ vmbus_ic_sendresp(sc, chan, data, dlen, xactid);
}
static int
Index: head/sys/dev/hyperv/utilities/hv_util.h
===================================================================
--- head/sys/dev/hyperv/utilities/hv_util.h
+++ head/sys/dev/hyperv/utilities/hv_util.h
@@ -58,5 +58,8 @@
int vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]);
int vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int *dlen,
uint32_t fw_ver, uint32_t msg_ver);
+int vmbus_ic_sendresp(struct hv_util_sc *sc,
+ struct vmbus_channel *chan, void *data, int dlen,
+ uint64_t xactid);
#endif
Index: head/sys/dev/hyperv/utilities/hv_util.c
===================================================================
--- head/sys/dev/hyperv/utilities/hv_util.c
+++ head/sys/dev/hyperv/utilities/hv_util.c
@@ -287,3 +287,21 @@
return (0);
}
+
+int
+vmbus_ic_sendresp(struct hv_util_sc *sc, struct vmbus_channel *chan,
+ void *data, int dlen, uint64_t xactid)
+{
+ struct vmbus_icmsg_hdr *hdr;
+ int error;
+
+ KASSERT(dlen >= sizeof(*hdr), ("invalid data length %d", dlen));
+ hdr = data;
+
+ hdr->ic_flags = VMBUS_ICMSG_FLAG_XACT | VMBUS_ICMSG_FLAG_RESP;
+ error = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, 0,
+ data, dlen, xactid);
+ if (error)
+ device_printf(sc->ic_dev, "resp send failed: %d\n", error);
+ return (error);
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 15, 5:36 PM (22 h, 46 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
9091820
Default Alt Text
D8844.diff (3 KB)
Attached To
Mode
D8844: hyperv/utils: Factor out function to send IC response
Attached
Detach File
Event Timeline
Log In to Comment