Module Name:    src
Committed By:   jmcneill
Date:           Sun Feb 20 03:56:45 UTC 2011

Modified Files:
        src/sys/dev/pci: if_ath_pci.c

Log Message:
support building as a module


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/pci/if_ath_pci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_ath_pci.c
diff -u src/sys/dev/pci/if_ath_pci.c:1.39 src/sys/dev/pci/if_ath_pci.c:1.40
--- src/sys/dev/pci/if_ath_pci.c:1.39	Wed Jan 26 00:08:30 2011
+++ src/sys/dev/pci/if_ath_pci.c	Sun Feb 20 03:56:45 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ath_pci.c,v 1.39 2011/01/26 00:08:30 dyoung Exp $	*/
+/*	$NetBSD: if_ath_pci.c,v 1.40 2011/02/20 03:56:45 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.39 2011/01/26 00:08:30 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ath_pci.c,v 1.40 2011/02/20 03:56:45 jmcneill Exp $");
 
 /*
  * PCI/Cardbus front-end for the Atheros Wireless LAN controller driver.
@@ -48,6 +48,7 @@
 #include <sys/kernel.h>
 #include <sys/errno.h>
 #include <sys/device.h>
+#include <sys/module.h>
 
 #include <external/isc/atheros_hal/dist/ah.h>
 
@@ -274,3 +275,32 @@
 	}
 	return true;
 }
+
+MODULE(MODULE_CLASS_DRIVER, if_ath_pci, "ath");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+if_ath_pci_modcmd(modcmd_t cmd, void *opaque)
+{
+	int error = 0;
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+#ifdef _MODULE
+		error = config_init_component(cfdriver_ioconf_if_ath_pci,
+		    cfattach_ioconf_if_ath_pci, cfdata_ioconf_if_ath_pci);
+#endif
+		return error;
+	case MODULE_CMD_FINI:
+#ifdef _MODULE
+		error = config_fini_component(cfdriver_ioconf_if_ath_pci,
+		    cfattach_ioconf_if_ath_pci, cfdata_ioconf_if_ath_pci);
+#endif
+		return error;
+	default:
+		return ENOTTY;
+	}
+}

Reply via email to