Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Add module crud to uatp(4).



details:   https://anonhg.NetBSD.org/src/rev/b38a0d2dba46
branches:  trunk
changeset: 330584:b38a0d2dba46
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Jul 14 14:58:32 2014 +0000

description:
Add module crud to uatp(4).

Compile-tested only; hardware not available right now.

diffstat:

 sys/dev/usb/uatp.c |  34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diffs (59 lines):

diff -r e2550a7fd388 -r b38a0d2dba46 sys/dev/usb/uatp.c
--- a/sys/dev/usb/uatp.c        Mon Jul 14 14:56:10 2014 +0000
+++ b/sys/dev/usb/uatp.c        Mon Jul 14 14:58:32 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uatp.c,v 1.8 2014/07/14 14:56:10 riastradh Exp $       */
+/*     $NetBSD: uatp.c,v 1.9 2014/07/14 14:58:32 riastradh Exp $       */
 
 /*-
  * Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.8 2014/07/14 14:56:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.9 2014/07/14 14:58:32 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -155,6 +155,7 @@
 #include <sys/errno.h>
 #include <sys/ioctl.h>
 #include <sys/kernel.h>
+#include <sys/module.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
 #include <sys/time.h>
@@ -2645,3 +2646,32 @@
 
 #undef CHECK_
 }
+
+MODULE(MODULE_CLASS_DRIVER, uatp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+uatp_modcmd(modcmd_t cmd, void *aux)
+{
+       int error = 0;
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+#ifdef _MODULE
+               error = config_init_component(cfdriver_ioconf_uatp,
+                   cfattach_ioconf_uatp, cfdata_ioconf_uatp);
+#endif
+               return error;
+       case MODULE_CMD_FINI:
+#ifdef _MODULE
+               error = config_fini_component(cfdriver_ioconf_uatp,
+                   cfattach_ioconf_uatp, cfdata_ioconf_uatp);
+#endif
+               return error;
+       default:
+               return ENOTTY;
+       }
+}



Home | Main Index | Thread Index | Old Index