summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade/usb.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2000-05-12 03:01:17 +0000
committerjhb <jhb@FreeBSD.org>2000-05-12 03:01:17 +0000
commit1ec3688bd005be0ac734c873c8de9e941e8ee02c (patch)
treed77f0c1a643acb787894f1743d1bbcf6fb5abc70 /usr.sbin/sade/usb.c
parentc97d9a50e81a6408372441d5846eacb938a646db (diff)
downloadFreeBSD-src-1ec3688bd005be0ac734c873c8de9e941e8ee02c.zip
FreeBSD-src-1ec3688bd005be0ac734c873c8de9e941e8ee02c.tar.gz
Add support for USB to sysinstall. This includes running usbd and
setting 'usbd_enable' in rc.conf during nwe installs if USB is detected. Also, since usbd already handles USB mice automatically, note that the mouse setup section in sysinstall only applies to non-USB mice.
Diffstat (limited to 'usr.sbin/sade/usb.c')
-rw-r--r--usr.sbin/sade/usb.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/usr.sbin/sade/usb.c b/usr.sbin/sade/usb.c
new file mode 100644
index 0000000..4eedbd5
--- /dev/null
+++ b/usr.sbin/sade/usb.c
@@ -0,0 +1,44 @@
+/*
+ * USB support for sysinstall
+ *
+ * $FreeBSD$
+ *
+ * Copyright (c) 2000 John Baldwin <jhb@FreeBSD.org>. All rights reserved.
+ *
+ * This software may be used, modified, copied, and distributed, in
+ * both source and binary form provided that the above copyright and
+ * these terms are retained. Under no circumstances is the author
+ * responsible for the proper functioning of this software, nor does
+ * the author assume any responsibility for damages incurred with its
+ * use.
+ */
+
+#include "sysinstall.h"
+#include <sys/fcntl.h>
+#include <sys/time.h>
+
+void
+usbInitialize(void)
+{
+ int fd;
+ WINDOW *w;
+
+ if (!RunningAsInit && !Fake) {
+ /* It's not my job... */
+ return;
+ }
+
+ if ((fd = open("/dev/usb", O_RDONLY)) < 0) {
+ msgDebug("Can't open USB controller.\n");
+ return;
+ }
+ close(fd);
+
+ w = savescr();
+ msgNotify("Initializing USB controller....");
+
+ variable_set2("usbd_enable", "YES", 1);
+
+ vsystem("/stand/usbd");
+ restorescr(w);
+}
OpenPOWER on IntegriCloud