Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Update for modular build



details:   https://anonhg.NetBSD.org/src/rev/30cdc42e7ceb
branches:  trunk
changeset: 768633:30cdc42e7ceb
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Aug 23 12:53:29 2011 +0000

description:
Update for modular build

diffstat:

 sys/dev/usb/if_axe.c |  36 ++++++++++++++++++++++++++++++++++--
 sys/dev/usb/if_rum.c |  34 ++++++++++++++++++++++++++++++++--
 2 files changed, 66 insertions(+), 4 deletions(-)

diffs (126 lines):

diff -r ebe2a151aa2c -r 30cdc42e7ceb sys/dev/usb/if_axe.c
--- a/sys/dev/usb/if_axe.c      Tue Aug 23 12:46:58 2011 +0000
+++ b/sys/dev/usb/if_axe.c      Tue Aug 23 12:53:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axe.c,v 1.47 2010/11/03 22:28:31 dyoung Exp $       */
+/*     $NetBSD: if_axe.c,v 1.48 2011/08/23 12:53:29 pgoyette Exp $     */
 /*     $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
 
 /*
@@ -89,12 +89,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.47 2010/11/03 22:28:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.48 2011/08/23 12:53:29 pgoyette Exp $");
 
 #if defined(__NetBSD__)
+#ifndef _MODULE
 #include "opt_inet.h"
 #include "rnd.h"
 #endif
+#endif
 
 
 #include <sys/param.h>
@@ -102,6 +104,7 @@
 #include <sys/device.h>
 #include <sys/kernel.h>
 #include <sys/mbuf.h>
+#include <sys/module.h>
 #include <sys/mutex.h>
 #include <sys/socket.h>
 #include <sys/sockio.h>
@@ -1455,3 +1458,32 @@
 
        sc->axe_link = 0;
 }
+
+MODULE(MODULE_CLASS_DRIVER, if_axe, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+if_axe_modcmd(modcmd_t cmd, void *aux)
+{
+       int error = 0;
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+#ifdef _MODULE
+               error = config_init_component(cfdriver_ioconf_if_axe,
+                   cfattach_ioconf_if_axe, cfdata_ioconf_if_axe);
+#endif
+               return error;
+       case MODULE_CMD_FINI:
+#ifdef _MODULE
+               error = config_fini_component(cfdriver_ioconf_if_axe,
+                   cfattach_ioconf_if_axe, cfdata_ioconf_if_axe);
+#endif
+               return error;
+       default:
+               return ENOTTY;
+       }
+}
diff -r ebe2a151aa2c -r 30cdc42e7ceb sys/dev/usb/if_rum.c
--- a/sys/dev/usb/if_rum.c      Tue Aug 23 12:46:58 2011 +0000
+++ b/sys/dev/usb/if_rum.c      Tue Aug 23 12:53:29 2011 +0000
@@ -1,5 +1,5 @@
 /*     $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $      */
-/*     $NetBSD: if_rum.c,v 1.37 2011/08/23 12:33:50 pgoyette Exp $     */
+/*     $NetBSD: if_rum.c,v 1.38 2011/08/23 12:53:29 pgoyette Exp $     */
 
 /*-
  * Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini%free.fr@localhost>
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.37 2011/08/23 12:33:50 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.38 2011/08/23 12:53:29 pgoyette Exp $");
 
 
 #include <sys/param.h>
@@ -35,6 +35,7 @@
 #include <sys/socket.h>
 #include <sys/systm.h>
 #include <sys/malloc.h>
+#include <sys/module.h>
 #include <sys/conf.h>
 #include <sys/device.h>
 
@@ -2297,3 +2298,32 @@
                return 0;
        }
 }
+
+MODULE(MODULE_CLASS_DRIVER, if_rum, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+if_rum_modcmd(modcmd_t cmd, void *aux)
+{
+       int error = 0;
+
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+#ifdef _MODULE
+               error = config_init_component(cfdriver_ioconf_if_rum,
+                   cfattach_ioconf_if_rum, cfdata_ioconf_if_rum);
+#endif
+               return error;
+       case MODULE_CMD_FINI:
+#ifdef _MODULE
+               error = config_fini_component(cfdriver_ioconf_if_rum,
+                   cfattach_ioconf_if_rum, cfdata_ioconf_if_rum);
+#endif
+               return error;
+       default:
+               return ENOTTY;
+       }
+}



Home | Main Index | Thread Index | Old Index