Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Jan 2017 02:39:01 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r311230 - stable/10/sys/dev/hyperv/utilities
Message-ID:  <201701040239.v042d1qc035007@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Wed Jan  4 02:39:00 2017
New Revision: 311230
URL: https://svnweb.freebsd.org/changeset/base/311230

Log:
  MFC 310312-310314
  
  310312
      hyperv/ic: Factor out function to send IC response
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D8844
  
  310313
      hyperv/ic: Cleanup common struct and functions.
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D8845
  
  310314
      hyperv/ic: Rename cleaned up header file.
  
      Sponsored by:   Microsoft
      Differential Revision:  https://reviews.freebsd.org/D8846

Added:
  stable/10/sys/dev/hyperv/utilities/vmbus_icvar.h
     - copied unchanged from r310314, head/sys/dev/hyperv/utilities/vmbus_icvar.h
Deleted:
  stable/10/sys/dev/hyperv/utilities/hv_util.h
Modified:
  stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c
  stable/10/sys/dev/hyperv/utilities/hv_kvp.c
  stable/10/sys/dev/hyperv/utilities/hv_shutdown.c
  stable/10/sys/dev/hyperv/utilities/hv_snapshot.c
  stable/10/sys/dev/hyperv/utilities/hv_timesync.c
  stable/10/sys/dev/hyperv/utilities/hv_util.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -35,8 +35,8 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/include/vmbus.h>
-#include <dev/hyperv/utilities/hv_util.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
 #include "vmbus_if.h"
 
@@ -61,7 +61,7 @@ static const struct vmbus_ic_desc vmbus_
 static void
 vmbus_heartbeat_cb(struct vmbus_channel *chan, void *xsc)
 {
-	struct hv_util_sc *sc = xsc;
+	struct vmbus_ic_softc *sc = xsc;
 	struct vmbus_icmsg_hdr *hdr;
 	int dlen, error;
 	uint64_t xactid;
@@ -70,7 +70,7 @@ vmbus_heartbeat_cb(struct vmbus_channel 
 	/*
 	 * Receive request.
 	 */
-	data = sc->receive_buffer;
+	data = sc->ic_buf;
 	dlen = sc->ic_buflen;
 	error = vmbus_chan_recv(chan, data, &dlen, &xactid);
 	KASSERT(error != ENOBUFS, ("icbuf is not large enough"));
@@ -110,13 +110,9 @@ vmbus_heartbeat_cb(struct vmbus_channel 
 	}
 
 	/*
-	 * 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
@@ -130,18 +126,22 @@ static int
 hv_heartbeat_attach(device_t dev)
 {
 
-	return (hv_util_attach(dev, vmbus_heartbeat_cb));
+	return (vmbus_ic_attach(dev, vmbus_heartbeat_cb));
 }
 
 static device_method_t heartbeat_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe, hv_heartbeat_probe),
 	DEVMETHOD(device_attach, hv_heartbeat_attach),
-	DEVMETHOD(device_detach, hv_util_detach),
+	DEVMETHOD(device_detach, vmbus_ic_detach),
 	{ 0, 0 }
 };
 
-static driver_t heartbeat_driver = { "hvheartbeat", heartbeat_methods, sizeof(hv_util_sc)};
+static driver_t heartbeat_driver = {
+	"hvheartbeat",
+	heartbeat_methods,
+	sizeof(struct vmbus_ic_softc)
+};
 
 static devclass_t heartbeat_devclass;
 

Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_kvp.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -64,8 +64,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/hyperv/include/vmbus.h>
 #include <dev/hyperv/utilities/hv_utilreg.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
-#include "hv_util.h"
 #include "unicode.h"
 #include "hv_kvp.h"
 #include "vmbus_if.h"
@@ -128,7 +128,7 @@ static struct cdevsw hv_kvp_cdevsw =
  * KVP transaction requests from the host.
  */
 typedef struct hv_kvp_sc {
-	struct hv_util_sc	util_sc;
+	struct vmbus_ic_softc	util_sc;
 	device_t		dev;
 
 	/* Unless specified the pending mutex should be
@@ -590,7 +590,7 @@ hv_kvp_process_request(void *context, in
 	hv_kvp_log_info("%s: entering hv_kvp_process_request\n", __func__);
 
 	sc = (hv_kvp_sc*)context;
-	kvp_buf = sc->util_sc.receive_buffer;;
+	kvp_buf = sc->util_sc.ic_buf;
 	channel = vmbus_get_channel(sc->dev);
 
 	recvlen = sc->util_sc.ic_buflen;
@@ -885,7 +885,7 @@ hv_kvp_attach(device_t dev)
 		return (error);
 	sc->hv_kvp_dev->si_drv1 = sc;
 
-	return hv_util_attach(dev, hv_kvp_callback);
+	return (vmbus_ic_attach(dev, hv_kvp_callback));
 }
 
 static int
@@ -900,7 +900,7 @@ hv_kvp_detach(device_t dev)
 	}
 
 	destroy_dev(sc->hv_kvp_dev);
-	return hv_util_detach(dev);
+	return (vmbus_ic_detach(dev));
 }
 
 static device_method_t kvp_methods[] = {

Modified: stable/10/sys/dev/hyperv/utilities/hv_shutdown.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_shutdown.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_shutdown.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -36,8 +36,8 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/include/vmbus.h>
-#include <dev/hyperv/utilities/hv_util.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
 #include "vmbus_if.h"
 
@@ -62,7 +62,7 @@ static const struct vmbus_ic_desc vmbus_
 static void
 vmbus_shutdown_cb(struct vmbus_channel *chan, void *xsc)
 {
-	struct hv_util_sc *sc = xsc;
+	struct vmbus_ic_softc *sc = xsc;
 	struct vmbus_icmsg_hdr *hdr;
 	struct vmbus_icmsg_shutdown *msg;
 	int dlen, error, do_shutdown = 0;
@@ -72,7 +72,7 @@ vmbus_shutdown_cb(struct vmbus_channel *
 	/*
 	 * Receive request.
 	 */
-	data = sc->receive_buffer;
+	data = sc->ic_buf;
 	dlen = sc->ic_buflen;
 	error = vmbus_chan_recv(chan, data, &dlen, &xactid);
 	KASSERT(error != ENOBUFS, ("icbuf is not large enough"));
@@ -122,13 +122,9 @@ vmbus_shutdown_cb(struct vmbus_channel *
 	}
 
 	/*
-	 * 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);
@@ -145,18 +141,22 @@ static int
 hv_shutdown_attach(device_t dev)
 {
 
-	return (hv_util_attach(dev, vmbus_shutdown_cb));
+	return (vmbus_ic_attach(dev, vmbus_shutdown_cb));
 }
 
 static device_method_t shutdown_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe, hv_shutdown_probe),
 	DEVMETHOD(device_attach, hv_shutdown_attach),
-	DEVMETHOD(device_detach, hv_util_detach),
+	DEVMETHOD(device_detach, vmbus_ic_detach),
 	{ 0, 0 }
 };
 
-static driver_t shutdown_driver = { "hvshutdown", shutdown_methods, sizeof(hv_util_sc)};
+static driver_t shutdown_driver = {
+	"hvshutdown",
+	shutdown_methods,
+	sizeof(struct vmbus_ic_softc)
+};
 
 static devclass_t shutdown_devclass;
 

Modified: stable/10/sys/dev/hyperv/utilities/hv_snapshot.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_snapshot.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_snapshot.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -57,8 +57,8 @@ __FBSDID("$FreeBSD$");
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/utilities/hv_utilreg.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
-#include "hv_util.h"
 #include "hv_snapshot.h"
 #include "vmbus_if.h"
 
@@ -204,7 +204,7 @@ struct hv_vss_dev_sc {
  * https://clovertrail.github.io/assets/vssdot.png
  */
 typedef struct hv_vss_sc {
-	struct hv_util_sc			util_sc;
+	struct vmbus_ic_softc			util_sc;
 	device_t				dev;
 
 	struct task				task;
@@ -808,7 +808,7 @@ hv_vss_process_request(void *context, in
 	hv_vss_log_info("%s: entering hv_vss_process_request\n", __func__);
 
 	sc = (hv_vss_sc*)context;
-	vss_buf = sc->util_sc.receive_buffer;
+	vss_buf = sc->util_sc.ic_buf;
 	channel = vmbus_get_channel(sc->dev);
 
 	recvlen = sc->util_sc.ic_buflen;
@@ -1020,7 +1020,7 @@ hv_vss_attach(device_t dev)
 	sc->hv_appvss_dev->si_drv1 = &sc->app_sc;
 	sc->app_sc.sc = sc;
 
-	return hv_util_attach(dev, hv_vss_callback);
+	return (vmbus_ic_attach(dev, hv_vss_callback));
 }
 
 static int
@@ -1041,7 +1041,7 @@ hv_vss_detach(device_t dev)
 	hv_vss_destroy_send_receive_queue(dev);
 	destroy_dev(sc->hv_vss_dev);
 	destroy_dev(sc->hv_appvss_dev);
-	return hv_util_detach(dev);
+	return (vmbus_ic_detach(dev));
 }
 
 static device_method_t vss_methods[] = {

Modified: stable/10/sys/dev/hyperv/utilities/hv_timesync.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_timesync.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_timesync.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -37,8 +37,8 @@ __FBSDID("$FreeBSD$");
 
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/include/vmbus.h>
-#include <dev/hyperv/utilities/hv_util.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
 #include "vmbus_if.h"
 
@@ -85,7 +85,7 @@ SYSCTL_INT(_hw_hvtimesync, OID_AUTO, sam
     &vmbus_ts_sample_verbose, 0, "Increase sample request verbosity.");
 
 static void
-vmbus_timesync(struct hv_util_sc *sc, uint64_t hvtime, uint64_t sent_tc,
+vmbus_timesync(struct vmbus_ic_softc *sc, uint64_t hvtime, uint64_t sent_tc,
     uint8_t tsflags)
 {
 	struct timespec vm_ts;
@@ -150,7 +150,7 @@ vmbus_timesync(struct hv_util_sc *sc, ui
 static void
 vmbus_timesync_cb(struct vmbus_channel *chan, void *xsc)
 {
-	struct hv_util_sc *sc = xsc;
+	struct vmbus_ic_softc *sc = xsc;
 	struct vmbus_icmsg_hdr *hdr;
 	const struct vmbus_icmsg_timesync *msg;
 	int dlen, error;
@@ -160,7 +160,7 @@ vmbus_timesync_cb(struct vmbus_channel *
 	/*
 	 * Receive request.
 	 */
-	data = sc->receive_buffer;
+	data = sc->ic_buf;
 	dlen = sc->ic_buflen;
 	error = vmbus_chan_recv(chan, data, &dlen, &xactid);
 	KASSERT(error != ENOBUFS, ("icbuf is not large enough"));
@@ -203,13 +203,9 @@ vmbus_timesync_cb(struct vmbus_channel *
 	}
 
 	/*
-	 * 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
@@ -223,18 +219,22 @@ static int
 hv_timesync_attach(device_t dev)
 {
 
-	return (hv_util_attach(dev, vmbus_timesync_cb));
+	return (vmbus_ic_attach(dev, vmbus_timesync_cb));
 }
 
 static device_method_t timesync_methods[] = {
 	/* Device interface */
 	DEVMETHOD(device_probe, hv_timesync_probe),
 	DEVMETHOD(device_attach, hv_timesync_attach),
-	DEVMETHOD(device_detach, hv_util_detach),
+	DEVMETHOD(device_detach, vmbus_ic_detach),
 	{ 0, 0 }
 };
 
-static driver_t timesync_driver = { "hvtimesync", timesync_methods, sizeof(hv_util_sc)};
+static driver_t timesync_driver = {
+	"hvtimesync",
+	timesync_methods,
+	sizeof(struct vmbus_ic_softc)
+};
 
 static devclass_t timesync_devclass;
 

Modified: stable/10/sys/dev/hyperv/utilities/hv_util.c
==============================================================================
--- stable/10/sys/dev/hyperv/utilities/hv_util.c	Wed Jan  4 02:38:14 2017	(r311229)
+++ stable/10/sys/dev/hyperv/utilities/hv_util.c	Wed Jan  4 02:39:00 2017	(r311230)
@@ -42,8 +42,8 @@
 
 #include <dev/hyperv/include/hyperv.h>
 #include <dev/hyperv/include/vmbus.h>
-#include <dev/hyperv/utilities/hv_util.h>
 #include <dev/hyperv/utilities/vmbus_icreg.h>
+#include <dev/hyperv/utilities/vmbus_icvar.h>
 
 #include "vmbus_if.h"
 
@@ -58,7 +58,7 @@ static int	vmbus_ic_fwver_sysctl(SYSCTL_
 static int	vmbus_ic_msgver_sysctl(SYSCTL_HANDLER_ARGS);
 
 int
-vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int *dlen0,
+vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data, int *dlen0,
     uint32_t fw_ver, uint32_t msg_ver)
 {
 	struct vmbus_icmsg_negotiate *nego;
@@ -214,9 +214,9 @@ vmbus_ic_probe(device_t dev, const struc
 }
 
 int
-hv_util_attach(device_t dev, vmbus_chan_callback_t cb)
+vmbus_ic_attach(device_t dev, vmbus_chan_callback_t cb)
 {
-	struct hv_util_sc *sc = device_get_softc(dev);
+	struct vmbus_ic_softc *sc = device_get_softc(dev);
 	struct vmbus_channel *chan = vmbus_get_channel(dev);
 	struct sysctl_oid_list *child;
 	struct sysctl_ctx_list *ctx;
@@ -224,8 +224,7 @@ hv_util_attach(device_t dev, vmbus_chan_
 
 	sc->ic_dev = dev;
 	sc->ic_buflen = VMBUS_IC_BRSIZE;
-	sc->receive_buffer = malloc(VMBUS_IC_BRSIZE, M_DEVBUF,
-	    M_WAITOK | M_ZERO);
+	sc->ic_buf = malloc(VMBUS_IC_BRSIZE, M_DEVBUF, M_WAITOK | M_ZERO);
 
 	/*
 	 * These services are not performance critical and do not need
@@ -239,7 +238,7 @@ hv_util_attach(device_t dev, vmbus_chan_
 	error = vmbus_chan_open(chan, VMBUS_IC_BRSIZE, VMBUS_IC_BRSIZE, NULL, 0,
 	    cb, sc);
 	if (error) {
-		free(sc->receive_buffer, M_DEVBUF);
+		free(sc->ic_buf, M_DEVBUF);
 		return (error);
 	}
 
@@ -258,7 +257,7 @@ hv_util_attach(device_t dev, vmbus_chan_
 static int
 vmbus_ic_fwver_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	struct hv_util_sc *sc = arg1;
+	struct vmbus_ic_softc *sc = arg1;
 	char verstr[16];
 
 	snprintf(verstr, sizeof(verstr), "%u.%u",
@@ -269,7 +268,7 @@ vmbus_ic_fwver_sysctl(SYSCTL_HANDLER_ARG
 static int
 vmbus_ic_msgver_sysctl(SYSCTL_HANDLER_ARGS)
 {
-	struct hv_util_sc *sc = arg1;
+	struct vmbus_ic_softc *sc = arg1;
 	char verstr[16];
 
 	snprintf(verstr, sizeof(verstr), "%u.%u",
@@ -278,12 +277,30 @@ vmbus_ic_msgver_sysctl(SYSCTL_HANDLER_AR
 }
 
 int
-hv_util_detach(device_t dev)
+vmbus_ic_detach(device_t dev)
 {
-	struct hv_util_sc *sc = device_get_softc(dev);
+	struct vmbus_ic_softc *sc = device_get_softc(dev);
 
 	vmbus_chan_close(vmbus_get_channel(dev));
-	free(sc->receive_buffer, M_DEVBUF);
+	free(sc->ic_buf, M_DEVBUF);
 
 	return (0);
 }
+
+int
+vmbus_ic_sendresp(struct vmbus_ic_softc *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);
+}

Copied: stable/10/sys/dev/hyperv/utilities/vmbus_icvar.h (from r310314, head/sys/dev/hyperv/utilities/vmbus_icvar.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/10/sys/dev/hyperv/utilities/vmbus_icvar.h	Wed Jan  4 02:39:00 2017	(r311230, copy of r310314, head/sys/dev/hyperv/utilities/vmbus_icvar.h)
@@ -0,0 +1,61 @@
+/*-
+ * Copyright (c) 2009-2012,2016 Microsoft Corp.
+ * Copyright (c) 2012 NetApp Inc.
+ * Copyright (c) 2012 Citrix Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice unmodified, this list of conditions, and the following
+ *    disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _VMBUS_ICVAR_H_
+#define _VMBUS_ICVAR_H_
+
+#include <dev/hyperv/include/hyperv.h>
+#include <dev/hyperv/include/vmbus.h>
+
+struct vmbus_ic_softc {
+	device_t		ic_dev;
+	uint8_t			*ic_buf;
+	int			ic_buflen;
+	uint32_t		ic_fwver;	/* framework version */
+	uint32_t		ic_msgver;	/* message version */
+};
+
+struct vmbus_ic_desc {
+	const struct hyperv_guid	ic_guid;
+	const char			*ic_desc;
+};
+
+#define VMBUS_IC_DESC_END	{ .ic_desc = NULL }
+
+int		vmbus_ic_attach(device_t dev, vmbus_chan_callback_t cb);
+int		vmbus_ic_detach(device_t dev);
+int		vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]);
+int		vmbus_ic_negomsg(struct vmbus_ic_softc *sc, void *data,
+		    int *dlen, uint32_t fw_ver, uint32_t msg_ver);
+int		vmbus_ic_sendresp(struct vmbus_ic_softc *sc,
+		    struct vmbus_channel *chan, void *data, int dlen,
+		    uint64_t xactid);
+
+#endif	/* !_VMBUS_ICVAR_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701040239.v042d1qc035007>