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 Checkpoint some work-in-progress for USB su...
details: https://anonhg.NetBSD.org/src/rev/f0e5e4fc1c27
branches: trunk
changeset: 747768:f0e5e4fc1c27
user: pooka <pooka%NetBSD.org@localhost>
date: Thu Oct 01 21:46:30 2009 +0000
description:
Checkpoint some work-in-progress for USB support in rump (currently
with limited scsi@umass support). However, not useful for anything
before I get the ugen-to-rump usb host controller cleaned up and
checkpointed.
diffstat:
sys/rump/dev/wip/Makefile.inc | 8 +
sys/rump/dev/wip/libumass/Makefile | 21 ++
sys/rump/dev/wip/libumass/locators.h | 38 +++++
sys/rump/dev/wip/libumass/opt/atapibus.h | 1 +
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 | 154 +++++++++++++++++++++
sys/rump/dev/wip/libumass/shlib_version | 4 +
sys/rump/dev/wip/libusb/Makefile | 18 ++
sys/rump/dev/wip/libusb/bus_dma.c | 85 +++++++++++
sys/rump/dev/wip/libusb/locators.h | 38 +++++
sys/rump/dev/wip/libusb/opt/ohci.h | 1 +
sys/rump/dev/wip/libusb/opt/opt_usbverbose.h | 1 +
sys/rump/dev/wip/libusb/opt/uhci.h | 1 +
sys/rump/dev/wip/libusb/shlib_version | 4 +
17 files changed, 380 insertions(+), 0 deletions(-)
diffs (truncated from 448 to 300 lines):
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/Makefile.inc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/Makefile.inc Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,8 @@
+# $NetBSD: Makefile.inc,v 1.1 2009/10/01 21:46:30 pooka Exp $
+#
+
+RUMPTOP= ${.CURDIR}/../../..
+
+CPPFLAGS+= -I${RUMPTOP}/librump/rumpdev
+
+.include "${RUMPTOP}/Makefile.rump"
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/Makefile Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: Makefile,v 1.1 2009/10/01 21:46:30 pooka Exp $
+#
+#
+# umass. includes scsibus+sd for simplicity due to the umass code
+# needing compile time knowledge of its presence. fixxxme
+#
+
+.PATH: ${.CURDIR}/../../../../dev/usb ${.CURDIR}/../../../../dev/scsipi
+
+LIB= rumpdev_umass
+
+SRCS= umass.c umass_isdata.c umass_quirks.c umass_scsipi.c
+SRCS+= scsipiconf.c scsipi_base.c scsipi_ioctl.c scsi_base.c scsiconf.c sd.c
+
+SRCS+= sd_at_scsibus_at_umass.c
+
+CFLAGS+= -Wno-pointer-sign
+CPPFLAGS+= -I${.CURDIR}/opt
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/locators.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/locators.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,38 @@
+/* $NetBSD: locators.h,v 1.1 2009/10/01 21:46:30 pooka Exp $ */
+
+/* locators borrowed from config. redo properly some day */
+
+#define SCSIBUSCF_TARGET 0
+#define SCSIBUSCF_TARGET_DEFAULT -1
+#define SCSIBUSCF_LUN 1
+#define SCSIBUSCF_LUN_DEFAULT -1
+#define SCSIBUSCF_NLOCS 2
+#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
+#define SCSICF_CHANNEL 0
+#define SCSICF_CHANNEL_DEFAULT -1
+#define SCSICF_NLOCS 1
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/opt/atapibus.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/opt/atapibus.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,1 @@
+/* $NetBSD: atapibus.h,v 1.1 2009/10/01 21:46:30 pooka Exp $ */
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/opt/opt_compat_freebsd.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/opt/opt_compat_freebsd.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,1 @@
+/* $NetBSD: opt_compat_freebsd.h,v 1.1 2009/10/01 21:46:30 pooka Exp $ */
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/opt/opt_scsi.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/opt/opt_scsi.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,1 @@
+/* $NetBSD: opt_scsi.h,v 1.1 2009/10/01 21:46:31 pooka Exp $ */
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/opt/scsibus.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/opt/scsibus.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,3 @@
+/* $NetBSD: scsibus.h,v 1.1 2009/10/01 21:46:31 pooka Exp $ */
+
+#define NSCSIBUS 1
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/opt/wd.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/opt/wd.h Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,1 @@
+/* $NetBSD: wd.h,v 1.1 2009/10/01 21:46:31 pooka Exp $ */
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,154 @@
+/* $NetBSD: sd_at_scsibus_at_umass.c,v 1.1 2009/10/01 21:46:30 pooka Exp $ */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/kmem.h>
+
+/*
+ * sd @ scsibus @ umass @ usb
+ *
+ * handwritten device configuration.... 'nuf said
+ */
+
+static const struct cfiattrdata scsicf_iattrdata = {
+ "scsi", 1, {
+ { "channel", "-1", -1 },
+ }
+};
+static const struct cfiattrdata scsibuscf_iattrdata = {
+ "scsibus", 0, {
+ { NULL, NULL, 0},
+ }
+};
+static const struct cfiattrdata *const scsibuscf_attrs[] = {
+ &scsibuscf_iattrdata,
+ NULL,
+};
+CFDRIVER_DECL(scsibus, DV_DULL, scsibuscf_attrs);
+CFDRIVER_DECL(sd, DV_DISK, NULL);
+
+static const struct cfiattrdata uroothub_iattrdata = {
+ "usbroothubif", 0, {
+ { NULL, NULL, 0 },
+ }
+};
+static const struct cfiattrdata *const usb_attrs[] = {
+ &uroothub_iattrdata,
+ NULL,
+};
+CFDRIVER_DECL(usb, DV_DULL, usb_attrs);
+
+static const struct cfiattrdata usbdevif_iattrdata = {
+ "usbdevif", 0, {
+ { NULL, NULL, 0 },
+ }
+};
+static const struct cfiattrdata usbifif_iattrdata = {
+ "usbifif", 0, {
+ { NULL, NULL, 0 },
+ }
+};
+static const struct cfiattrdata *const uhub_attrs[] = {
+ &usbdevif_iattrdata,
+ &usbifif_iattrdata,
+ NULL,
+};
+CFDRIVER_DECL(uhub, DV_DULL, uhub_attrs);
+
+static const struct cfiattrdata *const umass_attrs[] = {
+ &scsicf_iattrdata,
+ NULL,
+};
+CFDRIVER_DECL(umass, DV_DULL, umass_attrs);
+
+struct cfparent rumpusbhc_pspec = {
+ "usbus",
+ "rumpusbhc",
+ DVUNIT_ANY
+};
+
+struct cfdata usb_cfdata[] = {
+ { "usb", "usb", 0, FSTATE_STAR, NULL, 0, &rumpusbhc_pspec },
+};
+
+struct cfparent usb_pspec = {
+ "usbroothubif",
+ "usb",
+ DVUNIT_ANY
+};
+
+struct cfdata uhub_cfdata[] = {
+ { "uhub", "uroothub", 0, FSTATE_STAR, NULL, 0, &usb_pspec },
+};
+
+struct cfparent usbifif_pspec = {
+ "usbifif",
+ "uhub",
+ DVUNIT_ANY
+};
+
+struct cfparent scsi_pspec = {
+ "scsi",
+ NULL,
+ 0
+};
+
+struct cfdata umass_cfdata[] = {
+ { "umass", "umass", 0, FSTATE_STAR, NULL, 0, &usbifif_pspec },
+};
+
+int scsiloc[] = {-1,-1,-1,-1,-1,-1};
+
+struct cfdata scsibus_cfdata[] = {
+ { "scsibus", "scsibus", 0, FSTATE_STAR, scsiloc, 0, &scsi_pspec },
+};
+
+struct cfparent scsibus_pspec = {
+ "scsibus",
+ "scsibus",
+ DVUNIT_ANY
+};
+
+struct cfdata sd_cfdata[] = {
+ { "sd", "sd", 0, FSTATE_STAR, NULL, 0, &scsibus_pspec },
+};
+
+#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
+rump_device_configuration(void)
+{
+ extern struct cfattach usb_ca, uhub_ca, uroothub_ca, umass_ca;
+ extern struct cfattach scsibus_ca, sd_ca;
+
+ FLAWLESSCALL(config_cfdriver_attach(&usb_cd));
+ FLAWLESSCALL(config_cfattach_attach("usb", &usb_ca));
+ FLAWLESSCALL(config_cfdata_attach(usb_cfdata, 0));
+
+ FLAWLESSCALL(config_cfdriver_attach(&uhub_cd));
+ FLAWLESSCALL(config_cfattach_attach("uhub", &uhub_ca));
+ FLAWLESSCALL(config_cfdata_attach(uhub_cfdata, 0));
+
+ FLAWLESSCALL(config_cfdriver_attach(&umass_cd));
+ FLAWLESSCALL(config_cfattach_attach("umass", &umass_ca));
+ FLAWLESSCALL(config_cfdata_attach(umass_cfdata, 0));
+
+ FLAWLESSCALL(config_cfdriver_attach(&scsibus_cd));
+ FLAWLESSCALL(config_cfattach_attach("scsibus", &scsibus_ca));
+ FLAWLESSCALL(config_cfdata_attach(scsibus_cfdata, 0));
+
+ FLAWLESSCALL(config_cfdriver_attach(&sd_cd));
+ FLAWLESSCALL(config_cfattach_attach("sd", &sd_ca));
+ FLAWLESSCALL(config_cfdata_attach(sd_cfdata, 0));
+
+ FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
+}
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libumass/shlib_version
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libumass/shlib_version Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,4 @@
+# $NetBSD: shlib_version,v 1.1 2009/10/01 21:46:30 pooka Exp $
+#
+major=0
+minor=0
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libusb/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libusb/Makefile Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,18 @@
+# $NetBSD: Makefile,v 1.1 2009/10/01 21:46:31 pooka Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../dev/usb
+
+LIB= rumpdev_usb
+
+# sys/kern
+SRCS= usb.c usbdi.c usbdi_util.c usb_mem.c usb_subr.c usb_quirks.c uhub.c
+
+# XXX: doesn't belong here by a longshot, but it's the easy choice for now
+SRCS+= bus_dma.c
+
+CFLAGS+= -Wno-pointer-sign
+CPPFLAGS+= -I${.CURDIR}/opt
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 6c192751f023 -r f0e5e4fc1c27 sys/rump/dev/wip/libusb/bus_dma.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libusb/bus_dma.c Thu Oct 01 21:46:30 2009 +0000
@@ -0,0 +1,85 @@
+/* $NetBSD: bus_dma.c,v 1.1 2009/10/01 21:46:31 pooka Exp $ */
+
Home |
Main Index |
Thread Index |
Old Index