diff options
author | sephe <sephe@FreeBSD.org> | 2016-03-21 07:16:30 +0000 |
---|---|---|
committer | sephe <sephe@FreeBSD.org> | 2016-03-21 07:16:30 +0000 |
commit | ec5a1ffccc7228677634b794bff1cdea613a3536 (patch) | |
tree | 8b2f1e7f6ff6c8a348ed823ca5bf63c4cc8c679f /sys/dev/hyperv/vmbus | |
parent | 69c67129ef741e6f5b0a83aad47136a2cb177916 (diff) | |
download | FreeBSD-src-ec5a1ffccc7228677634b794bff1cdea613a3536.zip FreeBSD-src-ec5a1ffccc7228677634b794bff1cdea613a3536.tar.gz |
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
Diffstat (limited to 'sys/dev/hyperv/vmbus')
-rw-r--r-- | sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c index 2862110..7c39f73 100644 --- a/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c +++ b/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c @@ -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 } }; |