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 Rename rumpusbhc to ugenhc, as that better ...



details:   https://anonhg.NetBSD.org/src/rev/8ceb0e24cd55
branches:  trunk
changeset: 751976:8ceb0e24cd55
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Feb 10 02:26:23 2010 +0000

description:
Rename rumpusbhc to ugenhc, as that better describes what it does.
(the full component name is rumpdev_ugenhc)

diffstat:

 sys/rump/dev/wip/Makefile                          |    4 +-
 sys/rump/dev/wip/files.rump                        |   16 +-
 sys/rump/dev/wip/librumpusbhc/Makefile             |   11 -
 sys/rump/dev/wip/librumpusbhc/rumpusbhc.c          |  995 ---------------------
 sys/rump/dev/wip/librumpusbhc/shlib_version        |    4 -
 sys/rump/dev/wip/libucom/ucom_at_usb.c             |    6 +-
 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/libukbd/ukbd_at_usb.c             |    6 +-
 sys/rump/dev/wip/libulpt/ulpt_at_usb.c             |    7 +-
 sys/rump/dev/wip/libumass/sd_at_scsibus_at_umass.c |    8 +-
 sys/rump/dev/wip/libums/ums_at_usb.c               |    6 +-
 sys/rump/dev/wip/libusbrum/rum_at_usb.c            |    8 +-
 sys/rump/dev/wip/libwscons/component.c             |    6 +-
 15 files changed, 1039 insertions(+), 1048 deletions(-)

diffs (truncated from 2257 to 300 lines):

diff -r 436a6b449051 -r 8ceb0e24cd55 sys/rump/dev/wip/Makefile
--- a/sys/rump/dev/wip/Makefile Wed Feb 10 02:08:34 2010 +0000
+++ b/sys/rump/dev/wip/Makefile Wed Feb 10 02:26:23 2010 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile,v 1.5 2010/02/05 22:01:38 pooka Exp $
+#      $NetBSD: Makefile,v 1.6 2010/02/10 02:26:23 pooka Exp $
 #
 
-SUBDIR=        librumpusbhc libucom libumass libulpt libusb libusbrum
+SUBDIR=        libugenhc libucom libumass libulpt libusb libusbrum
 SUBDIR+=libums libukbd
 
 SUBDIR+=libwscons
diff -r 436a6b449051 -r 8ceb0e24cd55 sys/rump/dev/wip/files.rump
--- a/sys/rump/dev/wip/files.rump       Wed Feb 10 02:08:34 2010 +0000
+++ b/sys/rump/dev/wip/files.rump       Wed Feb 10 02:26:23 2010 +0000
@@ -1,20 +1,20 @@
-#      $NetBSD: files.rump,v 1.1 2010/02/04 00:37:08 pooka Exp $
+#      $NetBSD: files.rump,v 1.2 2010/02/10 02:26:23 pooka Exp $
 #
 
 device mainbus { }
 attach mainbus at root
-device rumpusbhc: usbus, usbroothub
-attach rumpusbhc at mainbus
+device ugenhc: usbus, usbroothub
+attach ugenhc at mainbus
 
 # ugen0 - ugen3
 mainbus0 at root
-rumpusbhc0 at mainbus0
-rumpusbhc1 at mainbus0
-rumpusbhc2 at mainbus0
-rumpusbhc3 at mainbus0
+ugenhc0 at mainbus0
+ugenhc1 at mainbus0
+ugenhc2 at mainbus0
+ugenhc3 at mainbus0
 
 # USB bus support
-usb*    at rumpusbhc?
+usb*    at ugenhc?
 
 # USB ROOT Hub
 #
diff -r 436a6b449051 -r 8ceb0e24cd55 sys/rump/dev/wip/librumpusbhc/Makefile
--- a/sys/rump/dev/wip/librumpusbhc/Makefile    Wed Feb 10 02:08:34 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-#      $NetBSD: Makefile,v 1.2 2009/10/05 13:00:37 pooka Exp $
-#
-
-LIB=   rumpdev_usbhc
-
-SRCS=  rumpusbhc.c
-
-CPPFLAGS+=     -I${RUMPTOP}/librump/rumpkern
-
-.include <bsd.lib.mk>
-.include <bsd.klinks.mk>
diff -r 436a6b449051 -r 8ceb0e24cd55 sys/rump/dev/wip/librumpusbhc/rumpusbhc.c
--- a/sys/rump/dev/wip/librumpusbhc/rumpusbhc.c Wed Feb 10 02:08:34 2010 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,995 +0,0 @@
-/*     $NetBSD: rumpusbhc.c,v 1.15 2010/02/09 18:27:17 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: rumpusbhc.c,v 1.15 2010/02/09 18:27:17 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 rumpusbhc_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     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);
-
-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
-                                 + USB_INTERFACE_DESCRIPTOR_SIZE
-                                 + USB_ENDPOINT_DESCRIPTOR_SIZE },
-       .bNumInterface          = 1,
-       .bmAttributes           = UC_SELF_POWERED | UC_ATTR_MBO,
-};
-/* XXX: spec says UC_ATTR_MBO is reserved and set to one.  required? */
-
-static const usb_interface_descriptor_t rumphub_uid = {
-       .bLength                = USB_INTERFACE_DESCRIPTOR_SIZE,
-       .bDescriptorType        = UDESC_INTERFACE,
-       .bInterfaceNumber       = 0,
-       .bNumEndpoints          = 1,
-       .bInterfaceClass        = UICLASS_HUB,
-       .bInterfaceSubClass     = UISUBCLASS_HUB,
-       .bInterfaceProtocol     = UIPROTO_FSHUB,
-};
-
-static const usb_endpoint_descriptor_t rumphub_epd = {
-       .bLength                = USB_ENDPOINT_DESCRIPTOR_SIZE,
-       .bDescriptorType        = UDESC_ENDPOINT,
-       .bmAttributes           = UE_INTERRUPT,
-       .wMaxPacketSize         = {64, 0},
-};
-
-static const usb_hub_descriptor_t rumphub_hdd = {
-       .bDescLength            = USB_HUB_DESCRIPTOR_SIZE,
-       .bDescriptorType        = UDESC_HUB,
-       .bNbrPorts              = 1,
-};
-
-static usbd_status
-rumpusb_root_ctrl_start(usbd_xfer_handle xfer)
-{
-       usb_device_request_t *req = &xfer->request;
-       struct rumpusbhc_softc *sc = xfer->pipe->device->bus->hci_private;
-       int len, totlen, value, curlen, err;
-       uint8_t *buf = NULL;
-
-       len = totlen = UGETW(req->wLength);
-       if (len)
-               buf = KERNADDR(&xfer->dmabuf, 0);
-       value = UGETW(req->wValue);
-
-#define C(x,y) ((x) | ((y) << 8))
-       switch(C(req->bRequest, req->bmRequestType)) {
-
-       case C(UR_GET_CONFIG, UT_READ_DEVICE):
-               if (len > 0) {
-                       *buf = sc->sc_conf;
-                       totlen = 1;
-               }
-               break;
-
-       case C(UR_GET_DESCRIPTOR, UT_READ_DEVICE):
-               switch (value >> 8) {
-               case UDESC_DEVICE:
-                       totlen = min(len, USB_DEVICE_DESCRIPTOR_SIZE);
-                       memcpy(buf, &rumphub_udd, totlen);
-                       break;
-
-               case UDESC_CONFIG:
-                       totlen = 0;
-                       curlen = min(len, USB_CONFIG_DESCRIPTOR_SIZE);
-                       memcpy(buf, &rumphub_ucd, curlen);
-                       len -= curlen;
-                       buf += curlen;
-                       totlen += curlen;
-
-                       curlen = min(len, USB_INTERFACE_DESCRIPTOR_SIZE);
-                       memcpy(buf, &rumphub_uid, curlen);
-                       len -= curlen;
-                       buf += curlen;
-                       totlen += curlen;
-
-                       curlen = min(len, USB_ENDPOINT_DESCRIPTOR_SIZE);
-                       memcpy(buf, &rumphub_epd, curlen);
-                       len -= curlen;
-                       buf += curlen;
-                       totlen += curlen;
-                       break;
-
-               case UDESC_STRING:
-#define sd ((usb_string_descriptor_t *)buf)
-                       switch (value & 0xff) {
-                       case 0: /* Language table */
-                               totlen = usb_makelangtbl(sd, len);
-                               break;
-                       case 1: /* Vendor */
-                               totlen = usb_makestrdesc(sd, len, "rod nevada");
-                               break;
-                       case 2: /* Product */
-                               totlen = usb_makestrdesc(sd, len,
-                                   "RUMPUSBHC root hub");
-                               break;



Home | Main Index | Thread Index | Old Index