summaryrefslogtreecommitdiffstats
path: root/sys/pccard/pcic_isa.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2001-05-16 07:32:04 +0000
committerimp <imp@FreeBSD.org>2001-05-16 07:32:04 +0000
commit14f69765f80179935dde831c6a056b8f17d3ae17 (patch)
tree38a2bdb455f4cbdd56cb49fb1f5e9d2a9cb7e487 /sys/pccard/pcic_isa.c
parent3d149ae334a8c3b6c576bde6f670d2e693ea5e51 (diff)
downloadFreeBSD-src-14f69765f80179935dde831c6a056b8f17d3ae17.zip
FreeBSD-src-14f69765f80179935dde831c6a056b8f17d3ae17.tar.gz
Separate out isa attachment to its own file. The pci attachment will
soon attach directly to pcic rather than the kludge pci-pcic device we have now. In some ways, this is similar to the work PAO3 did to try to support cardbus bridges. In some ways different. This and future commits will be taking from the spirit of many of those changes. pcicvar.h is completely different from the pcicvar.h that appeared in PAO3, but similar in concept.
Diffstat (limited to 'sys/pccard/pcic_isa.c')
-rw-r--r--sys/pccard/pcic_isa.c108
1 files changed, 108 insertions, 0 deletions
diff --git a/sys/pccard/pcic_isa.c b/sys/pccard/pcic_isa.c
new file mode 100644
index 0000000..46a3cb9
--- /dev/null
+++ b/sys/pccard/pcic_isa.c
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2001 M. Warner Losh. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/module.h>
+
+#include <pccard/i82365.h>
+#include <pccard/cardinfo.h>
+#include <pccard/slot.h>
+#include <pccard/pcicvar.h>
+
+/* Get pnp IDs */
+#include <isa/isavar.h>
+#include <dev/pcic/i82365reg.h>
+
+#include <dev/pccard/pccardvar.h>
+#include "card_if.h"
+
+static struct isa_pnp_id pcic_ids[] = {
+ {PCIC_PNP_ACTIONTEC, NULL}, /* AEI0218 */
+ {PCIC_PNP_IBM3765, NULL}, /* IBM3765 */
+ {PCIC_PNP_82365, NULL}, /* PNP0E00 */
+ {PCIC_PNP_CL_PD6720, NULL}, /* PNP0E01 */
+ {PCIC_PNP_VLSI_82C146, NULL}, /* PNP0E02 */
+ {PCIC_PNP_82365_CARDBUS, NULL}, /* PNP0E03 */
+ {PCIC_PNP_SCM_SWAPBOX, NULL}, /* SCM0469 */
+ {0}
+};
+
+static int
+pcic_isa_probe(device_t dev)
+{
+ int error;
+
+ /* Check isapnp ids */
+ error = ISA_PNP_PROBE(device_get_parent(dev), dev, pcic_ids);
+ if (error == ENXIO)
+ return (ENXIO);
+
+ return (pcic_probe(dev));
+}
+
+static int
+pcic_isa_attach(device_t dev)
+{
+ return (pcic_attach(dev));
+}
+
+static device_method_t pcic_methods[] = {
+ /* Device interface */
+ DEVMETHOD(device_probe, pcic_isa_probe),
+ DEVMETHOD(device_attach, pcic_isa_attach),
+ DEVMETHOD(device_detach, bus_generic_detach),
+ DEVMETHOD(device_shutdown, bus_generic_shutdown),
+ DEVMETHOD(device_suspend, bus_generic_suspend),
+ DEVMETHOD(device_resume, bus_generic_resume),
+
+ /* Bus interface */
+ DEVMETHOD(bus_print_child, bus_generic_print_child),
+ DEVMETHOD(bus_alloc_resource, bus_generic_alloc_resource),
+ DEVMETHOD(bus_release_resource, bus_generic_release_resource),
+ DEVMETHOD(bus_activate_resource, pcic_activate_resource),
+ DEVMETHOD(bus_deactivate_resource, pcic_deactivate_resource),
+ DEVMETHOD(bus_setup_intr, pcic_setup_intr),
+ DEVMETHOD(bus_teardown_intr, pcic_teardown_intr),
+
+ /* Card interface */
+ DEVMETHOD(card_set_res_flags, pcic_set_res_flags),
+ DEVMETHOD(card_get_res_flags, pcic_get_res_flags),
+ DEVMETHOD(card_set_memory_offset, pcic_set_memory_offset),
+ DEVMETHOD(card_get_memory_offset, pcic_get_memory_offset),
+
+ { 0, 0 }
+};
+
+static driver_t pcic_driver = {
+ "pcic",
+ pcic_methods,
+ sizeof(struct pcic_softc)
+};
+
+DRIVER_MODULE(pcic, isa, pcic_driver, pcic_devclass, 0, 0);
OpenPOWER on IntegriCloud