Home | History | Annotate | Line # | Download | only in isa
      1  1.24  jakllsch /*	$NetBSD: lm_isa.c,v 1.24 2012/01/17 16:50:07 jakllsch Exp $ */
      2   1.1      groo 
      3   1.1      groo /*-
      4   1.1      groo  * Copyright (c) 2000 The NetBSD Foundation, Inc.
      5   1.1      groo  * All rights reserved.
      6   1.1      groo  *
      7   1.1      groo  * This code is derived from software contributed to The NetBSD Foundation
      8   1.1      groo  * by Bill Squier.
      9   1.1      groo  *
     10   1.1      groo  * Redistribution and use in source and binary forms, with or without
     11   1.1      groo  * modification, are permitted provided that the following conditions
     12   1.1      groo  * are met:
     13   1.1      groo  * 1. Redistributions of source code must retain the above copyright
     14   1.1      groo  *    notice, this list of conditions and the following disclaimer.
     15   1.1      groo  * 2. Redistributions in binary form must reproduce the above copyright
     16   1.1      groo  *    notice, this list of conditions and the following disclaimer in the
     17   1.1      groo  *    documentation and/or other materials provided with the distribution.
     18   1.1      groo  *
     19   1.1      groo  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20   1.1      groo  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21   1.1      groo  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22   1.1      groo  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23   1.1      groo  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24   1.1      groo  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25   1.1      groo  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26   1.1      groo  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27   1.1      groo  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28   1.1      groo  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29   1.1      groo  * POSSIBILITY OF SUCH DAMAGE.
     30   1.1      groo  */
     31   1.4     lukem 
     32   1.4     lukem #include <sys/cdefs.h>
     33  1.24  jakllsch __KERNEL_RCSID(0, "$NetBSD: lm_isa.c,v 1.24 2012/01/17 16:50:07 jakllsch Exp $");
     34   1.1      groo 
     35   1.1      groo #include <sys/param.h>
     36   1.1      groo #include <sys/systm.h>
     37   1.1      groo #include <sys/kernel.h>
     38   1.1      groo #include <sys/device.h>
     39  1.24  jakllsch #include <sys/module.h>
     40   1.1      groo #include <sys/conf.h>
     41   1.1      groo 
     42  1.18        ad #include <sys/bus.h>
     43   1.1      groo 
     44   1.1      groo #include <dev/isa/isareg.h>
     45   1.1      groo #include <dev/isa/isavar.h>
     46   1.1      groo 
     47  1.24  jakllsch #include <dev/isa/lm_isa_common_var.h>
     48  1.21  pgoyette 
     49  1.21  pgoyette CFATTACH_DECL_NEW(lm_isa, sizeof(struct lm_isa_softc),
     50  1.17   xtraeme     lm_isa_match, lm_isa_attach, lm_isa_detach, NULL);
     51   1.1      groo 
     52  1.24  jakllsch MODULE(MODULE_CLASS_DRIVER, lm_isa, "lm_isa_common");
     53   1.1      groo 
     54  1.24  jakllsch #ifdef _MODULE
     55  1.24  jakllsch #include "ioconf.c"
     56  1.24  jakllsch #endif
     57   1.1      groo 
     58  1.24  jakllsch static int
     59  1.24  jakllsch lm_isa_modcmd(modcmd_t cmd, void *priv)
     60   1.1      groo {
     61  1.24  jakllsch 	int error = 0;
     62   1.1      groo 
     63  1.24  jakllsch 	switch (cmd) {
     64  1.24  jakllsch 	case MODULE_CMD_INIT:
     65  1.24  jakllsch #ifdef _MODULE
     66  1.24  jakllsch 		error = config_init_component(cfdriver_ioconf_lm_isa,
     67  1.24  jakllsch 		    cfattach_ioconf_lm_isa, cfdata_ioconf_lm_isa);
     68  1.24  jakllsch #endif
     69  1.24  jakllsch 		return error;
     70  1.24  jakllsch 	case MODULE_CMD_FINI:
     71  1.24  jakllsch #ifdef _MODULE
     72  1.24  jakllsch 		error = config_fini_component(cfdriver_ioconf_lm_isa,
     73  1.24  jakllsch 		    cfattach_ioconf_lm_isa, cfdata_ioconf_lm_isa);
     74  1.24  jakllsch #endif
     75  1.24  jakllsch 		return error;
     76  1.24  jakllsch 	default:
     77  1.24  jakllsch 		return ENOTTY;
     78   1.1      groo 	}
     79   1.9        ad }
     80