svn commit: r297143 - head/sys/dev/hyperv/vmbus

Sepherosa Ziehau sephe at FreeBSD.org
Mon Mar 21 07:16:31 UTC 2016


Author: sephe
Date: Mon Mar 21 07:16:30 2016
New Revision: 297143
URL: https://svnweb.freebsd.org/changeset/base/297143

Log:
  hyperv/vmbus: Implement bus_child_pnpinfo_str method
  
  Submitted by:	Jun Su <junsu microsoft com>
  Sponsored by:	Microsoft OSTC
  Differential Revision:	https://reviews.freebsd.org/D5669

Modified:
  head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c

Modified: head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c	Mon Mar 21 06:54:21 2016	(r297142)
+++ head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c	Mon Mar 21 07:16:30 2016	(r297143)
@@ -280,6 +280,23 @@ vmbus_write_ivar(
 	return (ENOENT);
 }
 
+static int
+vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen)
+{
+	char guidbuf[40];
+	struct hv_device *dev_ctx = device_get_ivars(child);
+
+	strlcat(buf, "classid=", buflen);
+	snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->class_id);
+	strlcat(buf, guidbuf, buflen);
+
+	strlcat(buf, " deviceid=", buflen);
+	snprintf_hv_guid(guidbuf, sizeof(guidbuf), &dev_ctx->device_id);
+	strlcat(buf, guidbuf, buflen);
+
+	return (0);
+}
+
 struct hv_device*
 hv_vmbus_child_device_create(
 	hv_guid		type,
@@ -720,6 +737,7 @@ static device_method_t vmbus_methods[] =
 	DEVMETHOD(bus_print_child, bus_generic_print_child),
 	DEVMETHOD(bus_read_ivar, vmbus_read_ivar),
 	DEVMETHOD(bus_write_ivar, vmbus_write_ivar),
+	DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str),
 
 	{ 0, 0 } };
 


More information about the svn-src-all mailing list