Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/dev Move a bunch of rump components from dev/wip to...



details:   https://anonhg.NetBSD.org/src/rev/3bb50ecb0349
branches:  trunk
changeset: 752007:3bb50ecb0349
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Feb 11 02:22:09 2010 +0000

description:
Move a bunch of rump components from dev/wip to dev/lib now that
they've reached a certain maturity.

diffstat:

 sys/rump/dev/Makefile.rumpdev                      |    6 +-
 sys/rump/dev/lib/libucom/Makefile                  |   19 +
 sys/rump/dev/lib/libucom/UCOM.ioconf               |   11 +
 sys/rump/dev/lib/libucom/shlib_version             |    4 +
 sys/rump/dev/lib/libucom/ucom.h                    |    3 +
 sys/rump/dev/lib/libucom/ucom_at_usb.c             |   59 +
 sys/rump/dev/lib/libugenhc/Makefile                |   11 +
 sys/rump/dev/lib/libugenhc/shlib_version           |    4 +
 sys/rump/dev/lib/libugenhc/ugenhc.c                |  995 +++++++++++++++++++++
 sys/rump/dev/lib/libulpt/Makefile                  |   18 +
 sys/rump/dev/lib/libulpt/ULPT.ioconf               |   10 +
 sys/rump/dev/lib/libulpt/shlib_version             |    4 +
 sys/rump/dev/lib/libulpt/ulpt_at_usb.c             |  419 ++++++++
 sys/rump/dev/lib/libumass/Makefile                 |   26 +
 sys/rump/dev/lib/libumass/UMASS.ioconf             |   31 +
 sys/rump/dev/lib/libumass/opt/atapibus.h           |    3 +
 sys/rump/dev/lib/libumass/opt/opt_compat_freebsd.h |    1 +
 sys/rump/dev/lib/libumass/opt/opt_scsi.h           |    1 +
 sys/rump/dev/lib/libumass/opt/scsibus.h            |    3 +
 sys/rump/dev/lib/libumass/opt/wd.h                 |    1 +
 sys/rump/dev/lib/libumass/sd_at_scsibus_at_umass.c |   77 +
 sys/rump/dev/lib/libumass/shlib_version            |    4 +
 sys/rump/dev/lib/libusb/Makefile                   |   17 +
 sys/rump/dev/lib/libusb/locators.h                 |   30 +
 sys/rump/dev/lib/libusb/opt/opt_usbverbose.h       |    3 +
 sys/rump/dev/lib/libusb/shlib_version              |    4 +
 sys/rump/dev/lib/libwscons/Makefile                |   16 +
 sys/rump/dev/lib/libwscons/component.c             |  457 +++++++++
 sys/rump/dev/lib/libwscons/locators.h              |    8 +
 sys/rump/dev/lib/libwscons/opt/wskbd.h             |    1 +
 sys/rump/dev/lib/libwscons/opt/wsmouse.h           |    1 +
 sys/rump/dev/lib/libwscons/shlib_version           |    4 +
 sys/rump/dev/wip/Makefile                          |    7 +-
 sys/rump/dev/wip/libucom/Makefile                  |   19 -
 sys/rump/dev/wip/libucom/UCOM.ioconf               |   11 -
 sys/rump/dev/wip/libucom/shlib_version             |    4 -
 sys/rump/dev/wip/libucom/ucom.h                    |    3 -
 sys/rump/dev/wip/libucom/ucom_at_usb.c             |   59 -
 sys/rump/dev/wip/libugenhc/Makefile                |   11 -
 sys/rump/dev/wip/libugenhc/shlib_version           |    4 -
 sys/rump/dev/wip/libugenhc/ugenhc.c                |  995 ---------------------
 sys/rump/dev/wip/libulpt/Makefile                  |   18 -
 sys/rump/dev/wip/libulpt/ULPT.ioconf               |   10 -
 sys/rump/dev/wip/libulpt/shlib_version             |    4 -
 sys/rump/dev/wip/libulpt/ulpt_at_usb.c             |  419 --------
 sys/rump/dev/wip/libumass/Makefile                 |   26 -
 sys/rump/dev/wip/libumass/UMASS.ioconf             |   31 -
 sys/rump/dev/wip/libumass/opt/atapibus.h           |    3 -
 sys/rump/dev/wip/libumass/opt/opt_compat_freebsd.h |    1 -
 sys/rump/dev/wip/libumass/opt/opt_scsi.h           |    1 -
 sys/rump/dev/wip/libumass/opt/scsibus.h            |    3 -
 sys/rump/dev/wip/libumass/opt/wd.h                 |    1 -
 sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c |   77 -
 sys/rump/dev/wip/libumass/shlib_version            |    4 -
 sys/rump/dev/wip/libusb/Makefile                   |   17 -
 sys/rump/dev/wip/libusb/locators.h                 |   30 -
 sys/rump/dev/wip/libusb/opt/opt_usbverbose.h       |    3 -
 sys/rump/dev/wip/libusb/shlib_version              |    4 -
 sys/rump/dev/wip/libwscons/Makefile                |   16 -
 sys/rump/dev/wip/libwscons/component.c             |  457 ---------
 sys/rump/dev/wip/libwscons/locators.h              |    8 -
 sys/rump/dev/wip/libwscons/opt/wskbd.h             |    1 -
 sys/rump/dev/wip/libwscons/opt/wsmouse.h           |    1 -
 sys/rump/dev/wip/libwscons/shlib_version           |    4 -
 64 files changed, 2251 insertions(+), 2252 deletions(-)

diffs (truncated from 4768 to 300 lines):

diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/Makefile.rumpdev
--- a/sys/rump/dev/Makefile.rumpdev     Thu Feb 11 01:13:58 2010 +0000
+++ b/sys/rump/dev/Makefile.rumpdev     Thu Feb 11 02:22:09 2010 +0000
@@ -1,7 +1,9 @@
-#      $NetBSD: Makefile.rumpdev,v 1.8 2010/01/31 03:06:59 pooka Exp $
+#      $NetBSD: Makefile.rumpdev,v 1.9 2010/02/11 02:22:09 pooka Exp $
 #
 
-RUMPDEVLIST=   bpf cgd disk dm netsmb raidframe rnd sysmon
+RUMPDEVLIST=   bpf cgd disk dm netsmb raidframe rnd sysmon ucom        \
+               ugenhc ulpt umass usb wscons
+
 
 .for var in ${RUMPDEVLIST}
 RUMPDEVLIBS+=lib${var}
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libucom/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libucom/Makefile Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,19 @@
+#      $NetBSD: Makefile,v 1.1 2010/02/11 02:22:09 pooka Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../dev/usb ${.CURDIR}/../../../../kern
+
+LIB=   rumpdev_ucom
+
+SRCS=  ucom.c uplcom.c
+
+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
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libucom/UCOM.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libucom/UCOM.ioconf      Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,11 @@
+#      $NetBSD: UCOM.ioconf,v 1.1 2010/02/11 02:22:09 pooka Exp $
+#
+
+ioconf ucom
+
+include "conf/files"
+include "dev/usb/files.usb"
+include "rump/dev/wip/files.rump"
+
+uplcom*        at uhub?
+ucom*  at uplcom? portno ?
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libucom/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libucom/shlib_version    Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2010/02/11 02:22:09 pooka Exp $
+#
+major=0
+minor=0
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libucom/ucom.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libucom/ucom.h   Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,3 @@
+/*     $NetBSD: ucom.h,v 1.1 2010/02/11 02:22:09 pooka Exp $   */
+
+#define NUCOM 1
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libucom/ucom_at_usb.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libucom/ucom_at_usb.c    Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,59 @@
+/*     $NetBSD: ucom_at_usb.c,v 1.1 2010/02/11 02:22:09 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_dev_private.h"
+#include "rump_vfs_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);
+
+void
+rump_device_configuration(void)
+{
+       extern struct cdevsw ucom_cdevsw;
+       devmajor_t cmaj, bmaj;
+
+       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));
+
+       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));
+
+       FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/ttyU", '0',
+           cmaj, 0, 1));
+       FLAWLESSCALL(rump_vfs_makedevnodes(S_IFCHR, "/dev/dtyU", '0',
+           cmaj, 0x80000, 1));
+
+       tty_init();
+}
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libugenhc/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/Makefile       Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,11 @@
+#      $NetBSD: Makefile,v 1.1 2010/02/11 02:22:09 pooka Exp $
+#
+
+LIB=   rumpdev_ugenhc
+
+SRCS=  ugenhc.c
+
+CPPFLAGS+=     -I${RUMPTOP}/librump/rumpkern
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libugenhc/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/shlib_version  Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2010/02/11 02:22:09 pooka Exp $
+#
+major=0
+minor=0
diff -r 297b5f5a706a -r 3bb50ecb0349 sys/rump/dev/lib/libugenhc/ugenhc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/lib/libugenhc/ugenhc.c       Thu Feb 11 02:22:09 2010 +0000
@@ -0,0 +1,995 @@
+/*     $NetBSD: ugenhc.c,v 1.1 2010/02/11 02:22:09 pooka Exp $ */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+ * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (lennart%augustsson.net@localhost) at
+ * Carlstedt Research & Technology.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * This rump driver attaches ugen as a kernel usb host controller.
+ * It's still somewhat under the hammer ....
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: ugenhc.c,v 1.1 2010/02/11 02:22:09 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/fcntl.h>
+#include <sys/kmem.h>
+#include <sys/kernel.h>
+#include <sys/kthread.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbhid.h>
+#include <dev/usb/usbdivar.h>
+#include <dev/usb/usb_mem.h>
+#include <dev/usb/usbroothub_subr.h>
+
+#include <rump/rumpuser.h>
+
+#include "rump_private.h"
+#include "rump_dev_private.h"
+
+#define UGEN_NEPTS 16
+#define UGEN_EPT_CTRL 0 /* ugenx.00 is the control endpoint */
+
+struct ugenhc_softc {
+       struct usbd_bus sc_bus;
+       int sc_devnum;
+
+       int sc_ugenfd[UGEN_NEPTS];
+       int sc_fdmodes[UGEN_NEPTS];
+
+       int sc_port_status;
+       int sc_port_change;
+       int sc_addr;
+       int sc_conf;
+};
+
+static int     ugenhc_probe(struct device *, struct cfdata *, void *);
+static void    ugenhc_attach(struct device *, struct device *, void *);
+
+CFATTACH_DECL_NEW(ugenhc, sizeof(struct ugenhc_softc),
+       ugenhc_probe, ugenhc_attach, NULL, NULL);
+
+struct rusb_xfer {
+       struct usbd_xfer rusb_xfer;
+       int rusb_status; /* now this is a cheap trick */
+};
+#define RUSB(x) ((struct rusb_xfer *)x)
+
+#define UGENDEV_BASESTR "/dev/ugen"
+#define UGENDEV_BUFSIZE 32
+static void
+makeugendevstr(int devnum, int endpoint, char *buf)
+{
+
+       CTASSERT(UGENDEV_BUFSIZE > sizeof(UGENDEV_BASESTR)+sizeof("0.00")+1);
+       sprintf(buf, "%s%d.%02d", UGENDEV_BASESTR, devnum, endpoint);
+}
+
+/*
+ * Our fictional hubbie.
+ */
+
+static const usb_device_descriptor_t rumphub_udd = {
+       .bLength                = USB_DEVICE_DESCRIPTOR_SIZE,
+       .bDescriptorType        = UDESC_DEVICE,
+       .bDeviceClass           = UDCLASS_HUB,
+       .bDeviceSubClass        = UDSUBCLASS_HUB,
+       .bDeviceProtocol        = UDPROTO_FSHUB,
+       .bMaxPacketSize         = 64,
+       .bNumConfigurations     = 1,
+};
+
+static const usb_config_descriptor_t rumphub_ucd = {
+       .bLength                = USB_CONFIG_DESCRIPTOR_SIZE,
+       .bDescriptorType        = UDESC_CONFIG,
+       .wTotalLength           = { USB_CONFIG_DESCRIPTOR_SIZE



Home | Main Index | Thread Index | Old Index