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/libusbrum Support rum@usb. Currently manag...



details:   https://anonhg.NetBSD.org/src/rev/b57f8f358409
branches:  trunk
changeset: 747875:b57f8f358409
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Oct 04 10:43:03 2009 +0000

description:
Support rum@usb.  Currently manages to configure and attach:

pain-rustique:66:~> ./rumpusbprobe
mainbus0 (root)
rumpusbhc2 at mainbus0
usb0 at rumpusbhc2: USB revision 2.0
uhub0 at usb0: vendor 0x0000 product 0x0000, class 9/0, rev 0.00/0.00, addr 1
rum0 at uhub0 port 1
rum0: D-Link DWA-111, rev 2.00/0.01, addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:24:01:31:98:9a
rum0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
rum0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps

diffstat:

 sys/rump/dev/wip/libusbrum/Makefile      |   16 ++++
 sys/rump/dev/wip/libusbrum/rum_at_usb.c  |  108 +++++++++++++++++++++++++++++++
 sys/rump/dev/wip/libusbrum/shlib_version |    4 +
 3 files changed, 128 insertions(+), 0 deletions(-)

diffs (140 lines):

diff -r 7b810c9c55d2 -r b57f8f358409 sys/rump/dev/wip/libusbrum/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libusbrum/Makefile       Sun Oct 04 10:43:03 2009 +0000
@@ -0,0 +1,16 @@
+#      $NetBSD: Makefile,v 1.1 2009/10/04 10:43:03 pooka Exp $
+#
+
+.PATH: ${.CURDIR}/../../../../dev/usb
+
+LIB=   rumpdev_usbrum
+
+SRCS=   if_rum.c
+
+SRCS+= rum_at_usb.c
+
+CFLAGS+=       -Wno-pointer-sign
+CPPFLAGS+=     -I${.CURDIR}/opt -I${RUMPTOP}/librump/rumpnet/opt
+
+.include <bsd.lib.mk>
+.include <bsd.klinks.mk>
diff -r 7b810c9c55d2 -r b57f8f358409 sys/rump/dev/wip/libusbrum/rum_at_usb.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libusbrum/rum_at_usb.c   Sun Oct 04 10:43:03 2009 +0000
@@ -0,0 +1,108 @@
+/*     $NetBSD: rum_at_usb.c,v 1.1 2009/10/04 10:43:03 pooka Exp $     */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/conf.h>
+#include <sys/device.h>
+#include <sys/kmem.h>
+
+/*
+ * rum @ usb
+ *
+ * handwritten device configuration.... 'nuf said
+ */
+
+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);
+
+CFDRIVER_DECL(rum, DV_IFNET, NULL);
+
+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 usbdevif_pspec = {
+       "usbdevif",
+       "uhub",
+       DVUNIT_ANY
+};
+
+struct cfdata rum_cfdata[] = {
+       { "rum", "rum", 0, FSTATE_STAR, NULL, 0, &usbdevif_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, rum_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(&rum_cd));
+       FLAWLESSCALL(config_cfattach_attach("rum", &rum_ca));
+       FLAWLESSCALL(config_cfdata_attach(rum_cfdata, 0));
+
+       FLAWLESSCALL(config_cfattach_attach("uhub", &uroothub_ca));
+}
diff -r 7b810c9c55d2 -r b57f8f358409 sys/rump/dev/wip/libusbrum/shlib_version
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/dev/wip/libusbrum/shlib_version  Sun Oct 04 10:43:03 2009 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: shlib_version,v 1.1 2009/10/04 10:43:03 pooka Exp $
+#
+major=0
+minor=0



Home | Main Index | Thread Index | Old Index