Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev/wip Convert to ioconf new world order: define a...



details:   https://anonhg.NetBSD.org/src/rev/83e1e3257a34
branches:  trunk
changeset: 751428:83e1e3257a34
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Feb 03 21:18:38 2010 +0000

description:
Convert to ioconf new world order: define attachments using config(1)
grammar instead of wildly copypasted, hand-edited and glue-sniffed
C files.

diffstat:

 sys/rump/dev/wip/librumpusbhc/rumpusbhc.c          |   46 +-
 sys/rump/dev/wip/libucom/Makefile                  |    4 +-
 sys/rump/dev/wip/libucom/UCOM.ioconf               |   33 +
 sys/rump/dev/wip/libucom/locators.h                |    7 -
 sys/rump/dev/wip/libucom/ucom_at_usb.c             |  410 +-----------------
 sys/rump/dev/wip/libukbd/Makefile                  |    4 +-
 sys/rump/dev/wip/libukbd/UKBD.ioconf               |   43 +
 sys/rump/dev/wip/libukbd/locators.h                |    3 -
 sys/rump/dev/wip/libukbd/ukbd_at_usb.c             |  446 +-------------------
 sys/rump/dev/wip/libulpt/Makefile                  |    4 +-
 sys/rump/dev/wip/libulpt/ULPT.ioconf               |   31 +
 sys/rump/dev/wip/libumass/Makefile                 |    5 +-
 sys/rump/dev/wip/libumass/UMASS.ioconf             |   38 +
 sys/rump/dev/wip/libumass/locators.h               |   38 -
 sys/rump/dev/wip/libumass/opt/atapibus.h           |    4 +-
 sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c |  470 +--------------------
 sys/rump/dev/wip/libums/Makefile                   |    4 +-
 sys/rump/dev/wip/libums/UMS.ioconf                 |   43 +
 sys/rump/dev/wip/libums/locators.h                 |    3 -
 sys/rump/dev/wip/libums/ums_at_usb.c               |  458 +--------------------
 sys/rump/dev/wip/libusb/Makefile                   |    4 +-
 sys/rump/dev/wip/libusbrum/rum_at_usb.c            |    5 +-
 22 files changed, 258 insertions(+), 1845 deletions(-)

diffs (truncated from 2416 to 300 lines):

diff -r fad53ca33239 -r 83e1e3257a34 sys/rump/dev/wip/librumpusbhc/rumpusbhc.c
--- a/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c Wed Feb 03 21:15:39 2010 +0000
+++ b/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c Wed Feb 03 21:18:38 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpusbhc.c,v 1.13 2010/02/03 18:14:56 pooka Exp $     */
+/*     $NetBSD: rumpusbhc.c,v 1.14 2010/02/03 21:18:38 pooka Exp $     */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.13 2010/02/03 18:14:56 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpusbhc.c,v 1.14 2010/02/03 21:18:38 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -100,28 +100,11 @@
        int sc_conf;
 };
 
-static const struct cfiattrdata usb_iattrdata = {
-        "usbus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata *const rumpusbhc_attrs[] = {
-       &usb_iattrdata,
-       NULL,
-};
-
 static int     rumpusbhc_probe(struct device *, struct cfdata *, void *);
 static void    rumpusbhc_attach(struct device *, struct device *, void *);
 
 CFATTACH_DECL_NEW(rumpusbhc, sizeof(struct rumpusbhc_softc),
        rumpusbhc_probe, rumpusbhc_attach, NULL, NULL);
-CFDRIVER_DECL(rumpusbhc, DV_DULL, rumpusbhc_attrs);
-
-struct cfparent rumpusbhcpar = {
-       "mainbus",
-       "mainbus",
-       DVUNIT_ANY
-};
 
 struct rusb_xfer {
        struct usbd_xfer rusb_xfer;
@@ -129,15 +112,6 @@
 };
 #define RUSB(x) ((struct rusb_xfer *)x)
 
-/* probe ugen0 through ugen3 */
-struct cfdata rumpusbhc_cfdata[] = {
-       { "rumpusbhc", "rumpusbhc", 0, FSTATE_NOTFOUND, NULL, 0, &rumpusbhcpar},
-       { "rumpusbhc", "rumpusbhc", 1, FSTATE_NOTFOUND, NULL, 0, &rumpusbhcpar},
-       { "rumpusbhc", "rumpusbhc", 2, FSTATE_NOTFOUND, NULL, 0, &rumpusbhcpar},
-       { "rumpusbhc", "rumpusbhc", 3, FSTATE_NOTFOUND, NULL, 0, &rumpusbhcpar},
-       { NULL,         NULL,       0, 0,               NULL, 0, NULL         },
-};
-
 #define UGENDEV_BASESTR "/dev/ugen"
 #define UGENDEV_BUFSIZE 32
 static void
@@ -966,22 +940,6 @@
        .freex =        rumpusbhc_freex,
 };
 
-void
-rump_dev_rumpusbhc_init()
-{
-       int error;
-
-       error = config_cfdriver_attach(&rumpusbhc_cd);
-       if (error)
-               panic("rumpusbhc cfdriver attach failed: %d", error);
-       error = config_cfattach_attach("rumpusbhc", &rumpusbhc_ca);
-       if (error)
-               panic("rumpusbhc cfattach attach failed: %d", error);
-       error = config_cfdata_attach(rumpusbhc_cfdata, 0);
-       if (error)
-               panic("rumpusbhc cfdata attach failed: %d", error);
-}
-
 static int
 rumpusbhc_probe(struct device *parent, struct cfdata *match, void *aux)
 {
diff -r fad53ca33239 -r 83e1e3257a34 sys/rump/dev/wip/libucom/Makefile
--- a/sys/rump/dev/wip/libucom/Makefile Wed Feb 03 21:15:39 2010 +0000
+++ b/sys/rump/dev/wip/libucom/Makefile Wed Feb 03 21:18:38 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 2009/12/20 19:44:21 pooka Exp $
+#      $NetBSD: Makefile,v 1.3 2010/02/03 21:18:38 pooka Exp $
 #
 
 .PATH: ${.CURDIR}/../../../../dev/usb ${.CURDIR}/../../../../kern
@@ -10,6 +10,8 @@
 SRCS+= ucom_at_usb.c
 SRCS+= tty.c tty_conf.c tty_tty.c tty_subr.c
 
+IOCONFIG= UCOM.ioconf
+
 CFLAGS+=       -Wno-pointer-sign
 CPPFLAGS+=     -I${RUMPTOP}/librump/rumpvfs
 
diff -r fad53ca33239 -r 83e1e3257a34 sys/rump/dev/wip/libucom/UCOM.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libucom/UCOM.ioconf      Wed Feb 03 21:18:38 2010 +0000
@@ -0,0 +1,33 @@
+#      $NetBSD: UCOM.ioconf,v 1.1 2010/02/03 21:18:38 pooka Exp $
+#
+
+ioconf ucom
+
+include "conf/files"
+include "dev/usb/files.usb"
+include "dev/scsipi/files.scsipi"
+
+device mainbus { }
+attach mainbus at root
+device rumpusbhc: usbus, usbroothub
+attach rumpusbhc at mainbus
+
+# ugen0 - ugen3
+mainbus0 at root
+rumpusbhc0 at mainbus0
+rumpusbhc1 at mainbus0
+rumpusbhc2 at mainbus0
+rumpusbhc3 at mainbus0
+
+# USB bus support
+usb*    at rumpusbhc?
+
+# USB ROOT Hub
+#
+# Do *NOT* configure uhub @ uhub.
+# That is not compatible with ugen.
+#
+uhub*   at usb?
+
+uplcom*        at uhub?
+ucom*  at uplcom? portno ?
diff -r fad53ca33239 -r 83e1e3257a34 sys/rump/dev/wip/libucom/locators.h
--- a/sys/rump/dev/wip/libucom/locators.h       Wed Feb 03 21:15:39 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,7 +0,0 @@
-/*     $NetBSD: locators.h,v 1.1 2009/12/20 15:43:13 pooka Exp $       */
-
-/* locators borrowed from config.  redo properly some day */
-
-#define UCOMBUSCF_PORTNO 0
-#define UCOMBUSCF_PORTNO_DEFAULT -1
-#define UCOMBUSCF_NLOCS 1
diff -r fad53ca33239 -r 83e1e3257a34 sys/rump/dev/wip/libucom/ucom_at_usb.c
--- a/sys/rump/dev/wip/libucom/ucom_at_usb.c    Wed Feb 03 21:15:39 2010 +0000
+++ b/sys/rump/dev/wip/libucom/ucom_at_usb.c    Wed Feb 03 21:18:38 2010 +0000
@@ -1,406 +1,13 @@
-/*     $NetBSD: ucom_at_usb.c,v 1.2 2009/12/20 19:44:21 pooka Exp $    */
+/*     $NetBSD: ucom_at_usb.c,v 1.3 2010/02/03 21:18:38 pooka Exp $    */
 
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/conf.h>
 #include <sys/device.h>
 #include <sys/kmem.h>
-
-/*
- * MACHINE GENERATED: DO NOT EDIT
- *
- * ioconf.c, from "TESTI_ucom"
- */
-
-#include <sys/param.h>
-#include <sys/conf.h>
-#include <sys/device.h>
-#include <sys/mount.h>
+#include <sys/stat.h>
 
-static const struct cfiattrdata gpibdevcf_iattrdata = {
-       "gpibdev", 1,
-       {
-               { "address", "-1", -1 },
-       }
-};
-static const struct cfiattrdata acpibuscf_iattrdata = {
-       "acpibus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata caccf_iattrdata = {
-       "cac", 1,
-       {
-               { "unit", "-1", -1 },
-       }
-};
-static const struct cfiattrdata spicf_iattrdata = {
-       "spi", 1,
-       {
-               { "slave", "NULL", 0 },
-       }
-};
-static const struct cfiattrdata radiodevcf_iattrdata = {
-       "radiodev", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata mlxcf_iattrdata = {
-       "mlx", 1,
-       {
-               { "unit", "-1", -1 },
-       }
-};
-static const struct cfiattrdata ucombuscf_iattrdata = {
-       "ucombus", 1,
-       {
-               { "portno", "-1", -1 },
-       }
-};
-static const struct cfiattrdata videobuscf_iattrdata = {
-       "videobus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata isabuscf_iattrdata = {
-       "isabus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata i2cbuscf_iattrdata = {
-       "i2cbus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata ata_hlcf_iattrdata = {
-       "ata_hl", 1,
-       {
-               { "drive", "-1", -1 },
-       }
-};
-static const struct cfiattrdata depcacf_iattrdata = {
-       "depca", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata ppbuscf_iattrdata = {
-       "ppbus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata eisabuscf_iattrdata = {
-       "eisabus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata atapicf_iattrdata = {
-       "atapi", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata usbroothubifcf_iattrdata = {
-       "usbroothubif", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata altmemdevcf_iattrdata = {
-       "altmemdev", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata tcbuscf_iattrdata = {
-       "tcbus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata onewirebuscf_iattrdata = {
-       "onewirebus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata gpiocf_iattrdata = {
-       "gpio", 2,
-       {
-               { "offset", "-1", -1 },
-               { "mask", "0", 0 },
-       }
-};
-static const struct cfiattrdata cbbuscf_iattrdata = {
-       "cbbus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata gpiobuscf_iattrdata = {
-       "gpiobus", 0, {
-               { NULL, NULL, 0 },
-       }
-};
-static const struct cfiattrdata drmcf_iattrdata = {
-       "drm", 0, {
-               { NULL, NULL, 0 },
-       }
-};



Home | Main Index | Thread Index | Old Index