Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Add cfprint_t virtiobusprint() and use it for virtio...
details: https://anonhg.NetBSD.org/src/rev/2d1bc2ea9589
branches: trunk
changeset: 362557:2d1bc2ea9589
user: jakllsch <jakllsch%NetBSD.org@localhost>
date: Fri Jun 15 17:13:43 2018 +0000
description:
Add cfprint_t virtiobusprint() and use it for virtio_mmio.
diffstat:
sys/dev/fdt/virtio_mmio_fdt.c | 8 +++-----
sys/dev/pci/virtio.c | 15 +++++++++++++--
sys/dev/pci/virtiovar.h | 3 ++-
sys/dev/virtio/virtio_mmio.c | 5 ++---
4 files changed, 20 insertions(+), 11 deletions(-)
diffs (110 lines):
diff -r 297c6196b108 -r 2d1bc2ea9589 sys/dev/fdt/virtio_mmio_fdt.c
--- a/sys/dev/fdt/virtio_mmio_fdt.c Fri Jun 15 16:03:59 2018 +0000
+++ b/sys/dev/fdt/virtio_mmio_fdt.c Fri Jun 15 17:13:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_mmio_fdt.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $ */
+/* $NetBSD: virtio_mmio_fdt.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $ */
/*
* Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio_fdt.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -122,11 +122,9 @@
memset(&va, 0, sizeof(va));
va.sc_childdevid = vsc->sc_childdevid;
- config_found_ia(self, attr, &va, NULL);
+ config_found_ia(self, attr, &va, virtiobusprint);
if (vsc->sc_child == NULL) {
- aprint_error_dev(self,
- "no matching child driver; not configured\n");
return 0;
}
diff -r 297c6196b108 -r 2d1bc2ea9589 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c Fri Jun 15 16:03:59 2018 +0000
+++ b/sys/dev/pci/virtio.c Fri Jun 15 17:13:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio.c,v 1.34 2018/06/15 01:37:40 jakllsch Exp $ */
+/* $NetBSD: virtio.c,v 1.35 2018/06/15 17:13:43 jakllsch Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.34 2018/06/15 01:37:40 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.35 2018/06/15 17:13:43 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -928,6 +928,17 @@
return sc->sc_features;
}
+int
+virtiobusprint(void *aux, const char *pnp)
+{
+ struct virtio_attach_args * const va = aux;
+
+ if (pnp)
+ aprint_normal("Device ID %d at %s", va->sc_childdevid, pnp);
+
+ return UNCONF;
+}
+
MODULE(MODULE_CLASS_DRIVER, virtio, NULL);
#ifdef _MODULE
diff -r 297c6196b108 -r 2d1bc2ea9589 sys/dev/pci/virtiovar.h
--- a/sys/dev/pci/virtiovar.h Fri Jun 15 16:03:59 2018 +0000
+++ b/sys/dev/pci/virtiovar.h Fri Jun 15 17:13:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtiovar.h,v 1.11 2018/06/02 22:43:15 jakllsch Exp $ */
+/* $NetBSD: virtiovar.h,v 1.12 2018/06/15 17:13:43 jakllsch Exp $ */
/*
* Copyright (c) 2010 Minoura Makoto.
@@ -224,6 +224,7 @@
/* autoconf(9) common */
void virtio_set_status(struct virtio_softc *, int);
+int virtiobusprint(void *aux, const char *);
#define virtio_device_reset(sc) virtio_set_status((sc), 0)
diff -r 297c6196b108 -r 2d1bc2ea9589 sys/dev/virtio/virtio_mmio.c
--- a/sys/dev/virtio/virtio_mmio.c Fri Jun 15 16:03:59 2018 +0000
+++ b/sys/dev/virtio/virtio_mmio.c Fri Jun 15 17:13:43 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: virtio_mmio.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $ */
+/* $NetBSD: virtio_mmio.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $ */
/* $OpenBSD: virtio_mmio.c,v 1.2 2017/02/24 17:12:31 patrick Exp $ */
/*
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.1 2018/06/06 20:35:36 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio_mmio.c,v 1.2 2018/06/15 17:13:43 jakllsch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -162,7 +162,6 @@
}
id = bus_space_read_4(sc->sc_iot, sc->sc_ioh, VIRTIO_MMIO_DEVICE_ID);
- aprint_verbose_dev(vsc->sc_dev, "Virtio ID 0x%08x\n", id);
/* we could use PAGE_SIZE, but virtio(4) assumes 4KiB for now */
bus_space_write_4(sc->sc_iot, sc->sc_ioh, VIRTIO_MMIO_GUEST_PAGE_SIZE,
Home |
Main Index |
Thread Index |
Old Index