Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/rump/librump/rumpdev children of mainbus, attach (well, ...



details:   https://anonhg.NetBSD.org/src/rev/8e9f93fae3bc
branches:  trunk
changeset: 747762:8e9f93fae3bc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Oct 01 15:21:38 2009 +0000

description:
children of mainbus, attach (well, one child, iff it happens to be around)

diffstat:

 sys/rump/librump/rumpdev/autoconf.c |  34 +++++++++++++++++++++++++++++-----
 1 files changed, 29 insertions(+), 5 deletions(-)

diffs (63 lines):

diff -r ff4226ee45fa -r 8e9f93fae3bc sys/rump/librump/rumpdev/autoconf.c
--- a/sys/rump/librump/rumpdev/autoconf.c       Thu Oct 01 12:28:34 2009 +0000
+++ b/sys/rump/librump/rumpdev/autoconf.c       Thu Oct 01 15:21:38 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.2 2009/09/20 23:16:09 pooka Exp $       */
+/*     $NetBSD: autoconf.c,v 1.3 2009/10/01 15:21:38 pooka Exp $       */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,20 +26,32 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.2 2009/09/20 23:16:09 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2009/10/01 15:21:38 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
 #include <sys/kernel.h>
 
-int    mainbus_match(struct device *, struct cfdata *, void *);
-void   mainbus_attach(struct device *, struct device *, void *);
+static int     mainbus_match(struct device *, struct cfdata *, void *);
+static void    mainbus_attach(struct device *, struct device *, void *);
+static int     mainbus_search(struct device *, struct cfdata *,
+                              const int *, void *);
 
 struct mainbus_softc {
        int mb_nada;
 };
 
-CFDRIVER_DECL(mainbus, DV_DULL, NULL);
+static const struct cfiattrdata mainbus_iattrdata = {
+        "mainbus", 0, {
+               { NULL, NULL, 0 },
+       }
+};
+static const struct cfiattrdata * const mainbus_attrs[] = {
+       &mainbus_iattrdata,
+       NULL,
+};
+
+CFDRIVER_DECL(mainbus, DV_DULL, mainbus_attrs);
 CFATTACH_DECL_NEW(mainbus, sizeof(struct mainbus_softc),
        mainbus_match, mainbus_attach, NULL, NULL);
 
@@ -106,4 +118,16 @@
 {
 
        aprint_normal("\n");
+       config_search_ia(mainbus_search, self, "mainbus", NULL);
 }
+
+static int
+mainbus_search(struct device *parent, struct cfdata *cf,
+       const int *ldesc, void *aux)
+{
+
+       if (config_match(parent, cf, NULL) > 0)
+               config_attach(parent, cf, NULL, NULL);
+
+       return 0;
+}



Home | Main Index | Thread Index | Old Index