Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump Use config pseudo-root keyword instead of monolithi...
details: https://anonhg.NetBSD.org/src/rev/3ca0dcab1090
branches: trunk
changeset: 752845:3ca0dcab1090
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Mar 08 10:24:37 2010 +0000
description:
Use config pseudo-root keyword instead of monolithic configurations
starting from root.
diffstat:
sys/rump/dev/files.rump | 20 +-----------
sys/rump/dev/lib/libucom/UCOM.ioconf | 4 +-
sys/rump/dev/lib/libucom/ucom_at_usb.c | 14 +--------
sys/rump/dev/lib/libugenhc/Makefile | 5 +-
sys/rump/dev/lib/libugenhc/UGENHC.ioconf | 15 +++++++++
sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c | 31 ++++++++++++++++++++
sys/rump/dev/lib/libumass/UMASS.ioconf | 4 +-
sys/rump/dev/lib/libumass/sd_at_scsibus_at_umass.c | 19 +-----------
sys/rump/dev/lib/libusb/Makefile | 5 ++-
sys/rump/dev/lib/libusb/USB.ioconf | 20 ++++++++++++
sys/rump/dev/lib/libusb/locators.h | 30 -------------------
sys/rump/dev/lib/libusb/usb_at_ugenhc.c | 34 ++++++++++++++++++++++
sys/rump/librump/rumpdev/autoconf.c | 15 ++++++++-
sys/rump/librump/rumpdev/rump_dev.c | 11 +++++-
14 files changed, 140 insertions(+), 87 deletions(-)
diffs (truncated from 403 to 300 lines):
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/files.rump
--- a/sys/rump/dev/files.rump Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/files.rump Mon Mar 08 10:24:37 2010 +0000
@@ -1,24 +1,8 @@
-# $NetBSD: files.rump,v 1.1 2010/02/12 04:20:51 pooka Exp $
+# $NetBSD: files.rump,v 1.2 2010/03/08 10:24:37 pooka Exp $
#
device mainbus { }
attach mainbus at root
+
device ugenhc: usbus, usbroothub
attach ugenhc at mainbus
-
-# ugen0 - ugen3
-mainbus0 at root
-ugenhc0 at mainbus0
-ugenhc1 at mainbus0
-ugenhc2 at mainbus0
-ugenhc3 at mainbus0
-
-# USB bus support
-usb* at ugenhc?
-
-# USB ROOT Hub
-#
-# Do *NOT* configure uhub @ uhub.
-# That is not compatible with ugen.
-#
-uhub* at usb?
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libucom/UCOM.ioconf
--- a/sys/rump/dev/lib/libucom/UCOM.ioconf Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libucom/UCOM.ioconf Mon Mar 08 10:24:37 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: UCOM.ioconf,v 1.3 2010/03/01 11:34:27 pooka Exp $
+# $NetBSD: UCOM.ioconf,v 1.4 2010/03/08 10:24:37 pooka Exp $
#
ioconf ucom
@@ -7,6 +7,8 @@
include "dev/usb/files.usb"
include "rump/dev/files.rump"
+pseudo-root uhub*
+
# I/O DATA USB-RSAQ2 serial adapter
uplcom* at uhub?
ucom* at uplcom? portno ?
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libucom/ucom_at_usb.c
--- a/sys/rump/dev/lib/libucom/ucom_at_usb.c Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libucom/ucom_at_usb.c Mon Mar 08 10:24:37 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ucom_at_usb.c,v 1.4 2010/03/07 17:44:40 pooka Exp $ */
+/* $NetBSD: ucom_at_usb.c,v 1.5 2010/03/08 10:24:37 pooka Exp $ */
#include <sys/param.h>
#include <sys/types.h>
@@ -29,15 +29,6 @@
FLAWLESSCALL(config_cfdata_attach(cfdata_ucom, 0));
- FLAWLESSCALL(config_cfdriver_attach(&mainbus_cd));
- FLAWLESSCALL(config_cfattach_attach("mainbus", &mainbus_ca));
-
- FLAWLESSCALL(config_cfdriver_attach(&ugenhc_cd));
- FLAWLESSCALL(config_cfattach_attach("ugenhc", &ugenhc_ca));
-
- FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
- FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
-
FLAWLESSCALL(config_cfdriver_attach(&uplcom_cd));
FLAWLESSCALL(config_cfattach_attach("uplcom", &uplcom_ca));
@@ -50,9 +41,6 @@
FLAWLESSCALL(config_cfdriver_attach(&ucom_cd));
FLAWLESSCALL(config_cfattach_attach("ucom", &ucom_ca));
- FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
- FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
-
bmaj = cmaj = -1;
FLAWLESSCALL(devsw_attach("ucom", NULL, &bmaj, &ucom_cdevsw, &cmaj));
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libugenhc/Makefile
--- a/sys/rump/dev/lib/libugenhc/Makefile Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libugenhc/Makefile Mon Mar 08 10:24:37 2010 +0000
@@ -1,9 +1,10 @@
-# $NetBSD: Makefile,v 1.1 2010/02/11 02:22:09 pooka Exp $
+# $NetBSD: Makefile,v 1.2 2010/03/08 10:24:37 pooka Exp $
#
LIB= rumpdev_ugenhc
+IOCONF= UGENHC.ioconf
-SRCS= ugenhc.c
+SRCS= ugenhc.c ugenhc_at_mainbus.c
CPPFLAGS+= -I${RUMPTOP}/librump/rumpkern
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libugenhc/UGENHC.ioconf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/UGENHC.ioconf Mon Mar 08 10:24:37 2010 +0000
@@ -0,0 +1,15 @@
+# $NetBSD: UGENHC.ioconf,v 1.1 2010/03/08 10:24:37 pooka Exp $
+#
+
+ioconf ugenhc
+
+include "conf/files"
+include "dev/usb/files.usb"
+include "rump/dev/files.rump"
+
+pseudo-root mainbus*
+
+ugenhc0 at mainbus?
+ugenhc1 at mainbus?
+ugenhc2 at mainbus?
+ugenhc3 at mainbus?
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/ugenhc_at_mainbus.c Mon Mar 08 10:24:37 2010 +0000
@@ -0,0 +1,31 @@
+/* $NetBSD: ugenhc_at_mainbus.c,v 1.1 2010/03/08 10:24:37 pooka Exp $ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/kmem.h>
+#include <sys/stat.h>
+
+#include "ioconf.c"
+
+#include "rump_private.h"
+#include "rump_dev_private.h"
+
+#define FLAWLESSCALL(call) \
+do { \
+ int att_error; \
+ if ((att_error = call) != 0) \
+ panic("\"%s\" failed", #call); \
+} while (/*CONSTCOND*/0)
+
+void tty_init(void);
+
+RUMP_COMPONENT(RUMP_COMPONENT_DEV)
+{
+
+ FLAWLESSCALL(config_cfdata_attach(cfdata_ugenhc, 0));
+
+ FLAWLESSCALL(config_cfdriver_attach(&ugenhc_cd));
+ FLAWLESSCALL(config_cfattach_attach("ugenhc", &ugenhc_ca));
+}
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libumass/UMASS.ioconf
--- a/sys/rump/dev/lib/libumass/UMASS.ioconf Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libumass/UMASS.ioconf Mon Mar 08 10:24:37 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: UMASS.ioconf,v 1.2 2010/02/12 04:20:51 pooka Exp $
+# $NetBSD: UMASS.ioconf,v 1.3 2010/03/08 10:24:37 pooka Exp $
#
#
@@ -15,6 +15,8 @@
include "dev/scsipi/files.scsipi"
include "rump/dev/files.rump"
+pseudo-root uhub*
+
# USB Mass Storage
umass* at uhub? port ? configuration ? interface ?
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libumass/sd_at_scsibus_at_umass.c
--- a/sys/rump/dev/lib/libumass/sd_at_scsibus_at_umass.c Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libumass/sd_at_scsibus_at_umass.c Mon Mar 08 10:24:37 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sd_at_scsibus_at_umass.c,v 1.2 2010/03/01 13:12:20 pooka Exp $ */
+/* $NetBSD: sd_at_scsibus_at_umass.c,v 1.3 2010/03/08 10:24:37 pooka Exp $ */
#include <sys/param.h>
#include <sys/conf.h>
@@ -21,8 +21,7 @@
RUMP_COMPONENT(RUMP_COMPONENT_DEV)
{
- extern struct cfattach ugenhc_ca;
- extern struct cfattach usb_ca, uhub_ca, uroothub_ca, umass_ca;
+ extern struct cfattach umass_ca;
extern struct cfattach scsibus_ca, atapibus_ca, sd_ca, cd_ca;
extern struct bdevsw sd_bdevsw, cd_bdevsw;
extern struct cdevsw sd_cdevsw, cd_cdevsw;
@@ -30,18 +29,6 @@
FLAWLESSCALL(config_cfdata_attach(cfdata_umass, 0));
- FLAWLESSCALL(config_cfdriver_attach(&mainbus_cd));
- FLAWLESSCALL(config_cfattach_attach("mainbus", &mainbus_ca));
-
- FLAWLESSCALL(config_cfdriver_attach(&ugenhc_cd));
- FLAWLESSCALL(config_cfattach_attach("ugenhc", &ugenhc_ca));
-
- FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
- FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
-
- FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
- FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca));
-
FLAWLESSCALL(config_cfdriver_attach(&umass_cd));
FLAWLESSCALL(config_cfattach_attach("umass", &umass_ca));
@@ -57,8 +44,6 @@
FLAWLESSCALL(config_cfdriver_attach(&cd_cd));
FLAWLESSCALL(config_cfattach_attach("cd", &cd_ca));
- FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
-
bmaj = cmaj = -1;
FLAWLESSCALL(devsw_attach("sd", &sd_bdevsw, &bmaj, &sd_cdevsw, &cmaj));
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libusb/Makefile
--- a/sys/rump/dev/lib/libusb/Makefile Mon Mar 08 10:19:14 2010 +0000
+++ b/sys/rump/dev/lib/libusb/Makefile Mon Mar 08 10:24:37 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2010/02/16 20:42:45 pooka Exp $
+# $NetBSD: Makefile,v 1.4 2010/03/08 10:24:37 pooka Exp $
#
.PATH: ${.CURDIR}/../../../../dev/usb
@@ -6,8 +6,11 @@
LIB= rumpdev_usb
.if ${MACHINE} == "i386"
+IOCONF= USB.ioconf
+
SRCS= usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c \
uhub.c usbroothub_subr.c
+SRCS+= usb_at_ugenhc.c
.else
SRCS= dummy.c
.endif
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libusb/USB.ioconf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libusb/USB.ioconf Mon Mar 08 10:24:37 2010 +0000
@@ -0,0 +1,20 @@
+# $NetBSD: USB.ioconf,v 1.1 2010/03/08 10:24:37 pooka Exp $
+#
+
+ioconf usb
+
+include "conf/files"
+include "dev/usb/files.usb"
+include "rump/dev/files.rump"
+
+pseudo-root ugenhc*
+
+# USB bus support
+usb* at ugenhc?
+
+# USB ROOT Hub
+#
+# Do *NOT* configure uhub @ uhub.
+# That is not compatible with ugen.
+#
+uhub* at usb?
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libusb/locators.h
--- a/sys/rump/dev/lib/libusb/locators.h Mon Mar 08 10:19:14 2010 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/* $NetBSD: locators.h,v 1.1 2010/02/11 02:22:10 pooka Exp $ */
-
-/* locators borrowed from config. redo properly some day */
-
-#define USBIFIFCF_PORT 0
-#define USBIFIFCF_PORT_DEFAULT -1
-#define USBIFIFCF_CONFIGURATION 1
-#define USBIFIFCF_CONFIGURATION_DEFAULT -1
-#define USBIFIFCF_INTERFACE 2
-#define USBIFIFCF_INTERFACE_DEFAULT -1
-#define USBIFIFCF_VENDOR 3
-#define USBIFIFCF_VENDOR_DEFAULT -1
-#define USBIFIFCF_PRODUCT 4
-#define USBIFIFCF_PRODUCT_DEFAULT -1
-#define USBIFIFCF_RELEASE 5
-#define USBIFIFCF_RELEASE_DEFAULT -1
-#define USBIFIFCF_NLOCS 6
-#define USBDEVIFCF_PORT 0
-#define USBDEVIFCF_PORT_DEFAULT -1
-#define USBDEVIFCF_CONFIGURATION 1
-#define USBDEVIFCF_CONFIGURATION_DEFAULT -1
-#define USBDEVIFCF_INTERFACE 2
-#define USBDEVIFCF_INTERFACE_DEFAULT -1
-#define USBDEVIFCF_VENDOR 3
-#define USBDEVIFCF_VENDOR_DEFAULT -1
-#define USBDEVIFCF_PRODUCT 4
-#define USBDEVIFCF_PRODUCT_DEFAULT -1
-#define USBDEVIFCF_RELEASE 5
-#define USBDEVIFCF_RELEASE_DEFAULT -1
-#define USBDEVIFCF_NLOCS 6
diff -r f8d3a172d69d -r 3ca0dcab1090 sys/rump/dev/lib/libusb/usb_at_ugenhc.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libusb/usb_at_ugenhc.c Mon Mar 08 10:24:37 2010 +0000
Home |
Main Index |
Thread Index |
Old Index