Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/usbd usbd is dead. And gone!
details: https://anonhg.NetBSD.org/src/rev/c635435cffc4
branches: trunk
changeset: 474165:c635435cffc4
user: augustss <augustss%NetBSD.org@localhost>
date: Wed Jun 30 06:56:11 1999 +0000
description:
usbd is dead. And gone!
diffstat:
usr.sbin/usbd/Makefile | 9 --
usr.sbin/usbd/usbd.8 | 82 ----------------------
usr.sbin/usbd/usbd.c | 181 -------------------------------------------------
3 files changed, 0 insertions(+), 272 deletions(-)
diffs (284 lines):
diff -r a39af008a760 -r c635435cffc4 usr.sbin/usbd/Makefile
--- a/usr.sbin/usbd/Makefile Wed Jun 30 06:48:05 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,9 +0,0 @@
-# $NetBSD: Makefile,v 1.3 1999/06/06 03:40:27 thorpej Exp $
-
-PROG= usbd
-MAN= usbd.8
-
-LDADD+= -lutil
-DPADD+= ${LIBUTIL}
-
-.include <bsd.prog.mk>
diff -r a39af008a760 -r c635435cffc4 usr.sbin/usbd/usbd.8
--- a/usr.sbin/usbd/usbd.8 Wed Jun 30 06:48:05 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-.\" $NetBSD: usbd.8,v 1.3 1999/04/13 20:50:49 augustss Exp $
-.\"
-.\" Copyright (c) 1998 The NetBSD Foundation, Inc.
-.\" All rights reserved.
-.\"
-.\" This code is derived from software contributed to The NetBSD Foundation
-.\" by Lennart Augustsson.
-.\"
-.\" 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.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the NetBSD
-.\" Foundation, Inc. and its contributors.
-.\" 4. Neither the name of The NetBSD Foundation nor the names of its
-.\" contributors may be used to endorse or promote products derived
-.\" from this software without specific prior written permission.
-.\"
-.\" 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.
-.\"
-.Dd July 12, 1998
-.Dt USBD 8
-.Os
-.Sh NAME
-.Nm usbd
-.Nd supervise USB attach/detach
-.Sh SYNOPSIS
-.Nm
-.Op Fl d
-.Op Fl f Ar device
-.Op Fl t Ar timeout
-.Op Fl v
-.Sh DESCRIPTION
-.Nm
-handles the USB device attachment and detachment.
-.Pp
-The options are as follows:
-.Bl -tag -width Ds
-.It Fl d
-Enable debugging to the standard output,
-and do not disassociate from the controlling terminal.
-.It Fl e
-Do one device tree exploration and then exit.
-.It Fl f Ar device
-Specify the pathname of a USB controller device file.
-The flag may be repeated to watch more than one USB controller.
-The default is
-.Pa /dev/usb0 ,
-.Pa /dev/usb1 ,
-.Pa /dev/usb2 ,
-and
-.Pa /dev/usb3 .
-.It Fl t Ar timeout
-Set the timeout interval (in seconds) before an exploration happens
-without being triggered by a connect or disconnect.
-A timeout of 0 means that there is no timeout. The default is 30.
-.It Fl v
-Be verbose.
-.El
-.Sh SEE ALSO
-.Xr usb 4
-.Sh HISTORY
-The
-.Nm
-command appeared in
-.Nx 1.4 .
diff -r a39af008a760 -r c635435cffc4 usr.sbin/usbd/usbd.c
--- a/usr.sbin/usbd/usbd.c Wed Jun 30 06:48:05 1999 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,181 +0,0 @@
-/* $NetBSD: usbd.c,v 1.5 1999/06/06 03:40:27 thorpej Exp $ */
-
-/*
- * Copyright (c) 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (augustss%netbsd.org@localhost).
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * 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.
- */
-
-#include <err.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <util.h>
-#include <sys/time.h>
-#include <dev/usb/usb.h>
-
-#define USBDEV "/dev/usb"
-#define MAXUSBDEV 4
-
-extern char *__progname;
-
-void usage(void);
-
-void
-usage(void)
-{
- fprintf(stderr, "Usage: %s [-d] [-e] [-f dev] [-t timeout] [-v]\n",
- __progname);
- exit(1);
-}
-
-#define NDEVS 20 /* maximum number of usb controllers */
-
-/*
- * Sometimes a device does not respond in time for interrupt
- * driven explore to find it. Therefore we run an exploration
- * at regular intervals to catch those.
- */
-#define TIMEOUT 30
-
-int
-main(int argc, char **argv)
-{
- int r, i;
- char *devs[NDEVS];
- int ndevs = 0;
- int fds[NDEVS];
- fd_set fdset;
- int ch, verbose = 0;
- int debug = 0;
- int explore = 0;
- int itimo = TIMEOUT;
- int maxfd;
- char buf[50];
- struct timeval timo;
- extern char *optarg;
- extern int optind;
-
- while ((ch = getopt(argc, argv, "def:t:v")) != -1) {
- switch(ch) {
- case 'd':
- debug++;
- break;
- case 'e':
- explore++;
- break;
- case 'f':
- if (ndevs < NDEVS)
- devs[ndevs++] = optarg;
- break;
- case 't':
- itimo = atoi(optarg);
- break;
- case 'v':
- verbose++;
- break;
- case '?':
- default:
- usage();
- }
- }
- argc -= optind;
- argv += optind;
-
- maxfd = 0;
- if (ndevs == 0) {
- for (i = 0; i < MAXUSBDEV; i++) {
- sprintf(buf, "%s%d", USBDEV, i);
- fds[ndevs] = open(buf, O_RDWR);
- if (fds[ndevs] >= 0) {
- devs[ndevs] = strdup(buf);
- if (verbose)
- printf("%s: opening %s\n",
- __progname, devs[ndevs]);
- if (fds[ndevs] > maxfd)
- maxfd = fds[ndevs];
- ndevs++;
- }
- }
- } else {
- for (i = 0; i < ndevs; i++) {
- fds[i] = open(devs[i], O_RDWR);
- if (fds[i] < 0)
- err(1, "%s", devs[i]);
- else if (fds[i] > maxfd)
- maxfd = fds[i];
- }
- }
- if (ndevs == 0) {
- if (verbose)
- printf("%s: no USB controllers found\n", __progname);
- exit(0);
- }
-
- if (explore) {
- for (i = 0; i < ndevs; i++) {
- r = ioctl(fds[i], USB_DISCOVER);
- if (r < 0)
- err(1, "USB_DISCOVER");
- }
- exit(0);
- }
-
- if (!debug) {
- daemon(0, 0);
- pidfile(NULL);
- }
-
- for (;;) {
- FD_ZERO(&fdset);
- for (i = 0; i < ndevs; i++)
- FD_SET(fds[i], &fdset);
- timo.tv_usec = 0;
- timo.tv_sec = itimo;
- r = select(maxfd+1, 0, &fdset, 0, itimo ? &timo : 0);
- if (r < 0)
- warn("select failed\n");
- for (i = 0; i < ndevs; i++)
- if (r == 0 || FD_ISSET(fds[i], &fdset)) {
- if (verbose)
- printf("%s: doing %sdiscovery on %s\n",
- __progname, r ? "" : "timeout ",
- devs[i]);
- if (ioctl(fds[i], USB_DISCOVER) < 0)
- err(1, "USB_DISCOVER");
- }
- }
-}
Home |
Main Index |
Thread Index |
Old Index