Initial backport of NEWCARD from FreeBSD 5.
authorJoerg Sonnenberger <joerg@dragonflybsd.org>
Tue, 10 Feb 2004 07:55:47 +0000 (07:55 +0000)
committerJoerg Sonnenberger <joerg@dragonflybsd.org>
Tue, 10 Feb 2004 07:55:47 +0000 (07:55 +0000)
The included version is from end of November 2002 with the exception of
bus/pccard/pccarddevs which is from November 2003.

Thanks to Warner Losh and the other folks for NEWCARD.

62 files changed:
sys/bus/pccard/Makefile.pccarddevs [new file with mode: 0644]
sys/bus/pccard/card_if.m [new file with mode: 0644]
sys/bus/pccard/devlist2h.awk [moved from sys/dev/misc/pccard/devlist2h.awk with 72% similarity]
sys/bus/pccard/i82365.h [deleted file]
sys/bus/pccard/mecia.c [deleted file]
sys/bus/pccard/meciareg.h [deleted file]
sys/bus/pccard/pccard.c
sys/bus/pccard/pccard_cis.c [moved from sys/dev/misc/pccard/pccard_cis.c with 87% similarity]
sys/bus/pccard/pccard_cis_quirks.c [moved from sys/dev/misc/pccard/pccard_cis_quirks.c with 80% similarity]
sys/bus/pccard/pccard_nbk.c [deleted file]
sys/bus/pccard/pccard_nbk.h [deleted file]
sys/bus/pccard/pccarddevs [new file with mode: 0644]
sys/bus/pccard/pccarddevs.h [new file with mode: 0644]
sys/bus/pccard/pccardreg.h
sys/bus/pccard/pccardvar.h
sys/bus/pccard/pccbb/Makefile [deleted file]
sys/bus/pccard/pcic.c [deleted file]
sys/bus/pccard/pcic_isa.c [deleted file]
sys/bus/pccard/pcic_pci.c [deleted file]
sys/bus/pccard/pcic_pci.h [deleted file]
sys/bus/pccard/pcicvar.h [deleted file]
sys/bus/pccard/power_if.m [moved from sys/dev/misc/pccard/power_if.m with 90% similarity]
sys/conf/files
sys/conf/kmod.mk
sys/config/GENERIC
sys/config/LINT
sys/dev/Makefile
sys/dev/disk/fd/fd.c
sys/dev/misc/Makefile
sys/dev/misc/pccard/Makefile [deleted file]
sys/dev/misc/pccard/Makefile.pccarddevs [deleted file]
sys/dev/misc/pccard/card_if.m [deleted file]
sys/dev/misc/pccard/files.pccard [deleted file]
sys/dev/misc/pccard/pccard.c [deleted file]
sys/dev/misc/pccard/pccardchip.h [deleted file]
sys/dev/misc/pccard/pccarddevs [deleted file]
sys/dev/misc/pccard/pccarddevs.h [deleted file]
sys/dev/misc/pccard/pccarddevs_data.h [deleted file]
sys/dev/misc/pcic/Makefile [deleted file]
sys/dev/pccard/Makefile [new file with mode: 0644]
sys/dev/pccard/cardbus/Makefile [new file with mode: 0644]
sys/dev/pccard/cardbus/cardbus.c [new file with mode: 0644]
sys/dev/pccard/cardbus/cardbus_cis.c [new file with mode: 0644]
sys/dev/pccard/cardbus/cardbus_cis.h [new file with mode: 0644]
sys/dev/pccard/cardbus/cardbusreg.h [new file with mode: 0644]
sys/dev/pccard/cardbus/cardbusvar.h [new file with mode: 0644]
sys/dev/pccard/exca/Makefile [new file with mode: 0644]
sys/dev/pccard/exca/exca.c [new file with mode: 0644]
sys/dev/pccard/exca/excareg.h [new file with mode: 0644]
sys/dev/pccard/exca/excavar.h [new file with mode: 0644]
sys/dev/pccard/pccbb/Makefile [new file with mode: 0644]
sys/dev/pccard/pccbb/pccbb.c [new file with mode: 0644]
sys/dev/pccard/pccbb/pccbbdevid.h [moved from sys/bus/pccard/pccbb/pccbbdevid.h with 87% similarity]
sys/dev/pccard/pccbb/pccbbreg.h [new file with mode: 0644]
sys/dev/pccard/pccbb/pccbbvar.h [new file with mode: 0644]
sys/dev/pccard/pcic/Makefile [new file with mode: 0644]
sys/dev/pccard/pcic/i82365.c [moved from sys/dev/misc/pcic/i82365.c with 92% similarity]
sys/dev/pccard/pcic/i82365_isa.c [moved from sys/dev/misc/pcic/i82365_isa.c with 81% similarity]
sys/dev/pccard/pcic/i82365reg.h [moved from sys/dev/misc/pcic/i82365reg.h with 98% similarity]
sys/dev/pccard/pcic/i82365var.h [moved from sys/dev/misc/pcic/i82365var.h with 80% similarity]
sys/i386/conf/GENERIC
sys/i386/conf/LINT

diff --git a/sys/bus/pccard/Makefile.pccarddevs b/sys/bus/pccard/Makefile.pccarddevs
new file mode 100644 (file)
index 0000000..dd0709a
--- /dev/null
@@ -0,0 +1,9 @@
+#      $NetBSD: Makefile.pcmciadevs,v 1.1 1998/07/19 17:28:15 christos Exp $
+# $FreeBSD: src/sys/dev/pccard/Makefile.pccarddevs,v 1.3 2003/03/28 06:44:57 imp Exp $
+# $DragonFly: src/sys/bus/pccard/Makefile.pccarddevs,v 1.1 2004/02/10 07:55:45 joerg Exp $
+
+AWK=   awk
+
+pccarddevs.h: pccarddevs devlist2h.awk
+       /bin/rm -f pccarddevs.h
+       ${AWK} -f devlist2h.awk pccarddevs
diff --git a/sys/bus/pccard/card_if.m b/sys/bus/pccard/card_if.m
new file mode 100644 (file)
index 0000000..c63b405
--- /dev/null
@@ -0,0 +1,252 @@
+#
+# Copyright (c) 1999 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/dev/pccard/card_if.m,v 1.21 2002/11/02 23:00:28 imp Exp $
+# $DragonFly: src/sys/bus/pccard/card_if.m,v 1.1 2004/02/10 07:55:45 joerg Exp $
+#
+
+#include <sys/bus.h>
+#include <bus/pccard/pccardvar.h>
+
+INTERFACE card;
+
+# WARNING: THIS FILE IS USED BY BOTH OLDCARD AND NEWCARD.  MAKE SURE
+# YOU TEST BOTH KERNELS IF CHANGING THIS FILE.
+
+#
+# Companion interface for pccard.  We need to set attributes for memory
+# and i/o port mappings (as well as other types of attributes) that have
+# a well defined meaning inside the pccard/cardbus system.  The bus
+# methods are inadequate for this because this must be done at the time the
+# resources are set for the device, which predates their activation.  Also,
+# the driver activating the resources doesn't necessarily know or need to know
+# these attributes.
+#
+METHOD int set_res_flags {
+       device_t dev;
+       device_t child;
+       int      restype;
+       int      rid;
+       u_long   value;
+};
+
+METHOD int get_res_flags {
+       device_t dev;
+       device_t child;
+       int      restype;
+       int      rid;
+       u_long   *value;
+};
+
+#
+# Sets the memory offset of the pccard bridge's window into attribute
+# or common memory space.
+#
+METHOD int set_memory_offset {
+       device_t  dev;
+       device_t  child;
+       int       rid;
+       u_int32_t cardaddr;
+       u_int32_t *deltap;
+}
+
+METHOD int get_memory_offset {
+       device_t  dev;
+       device_t  child;
+       int       rid;
+       u_int32_t *offset;
+}
+
+#
+# pccard bridges call this method to initate the attachment of a card
+#
+METHOD int attach_card {
+       device_t  dev;
+}
+
+#
+# pccard bridges call this to detach a card.
+#
+METHOD int detach_card {
+       device_t  dev;
+}
+
+#
+# Returns the type of card this is.  Maybe we don't need this.
+#
+METHOD int get_type {
+       device_t  dev;
+       int       *type;
+}
+
+#
+# Returns the function number for this device.
+#
+METHOD int get_function {
+       device_t  dev;
+       device_t  child;
+       int       *func;
+}
+
+#
+# Activates (and powers up if necessary) the card's nth function
+# since each function gets its own device, there is no need to
+# to specify a function number
+#
+METHOD int activate_function {
+       device_t  dev;
+       device_t  child;
+}
+
+METHOD int deactivate_function {
+       device_t  dev;
+       device_t  child;
+}
+
+#
+# Compatibility methods for OLDCARD drivers.  We use these routines to make
+# it possible to call the OLDCARD driver's probe routine in the context that
+# it expects.  For OLDCARD these are implemented as pass throughs to the
+# device_{probe,attach} routines.  For NEWCARD they are implemented such
+# such that probe becomes strictly a matching routine and attach does both
+# the old probe and old attach.
+#
+# compat devices should use the following:
+#
+#      /* Device interface */
+#      DEVMETHOD(device_probe),        pccard_compat_probe),
+#      DEVMETHOD(device_attach),       pccard_compat_attach),
+#      /* Card interface */
+#      DEVMETHOD(card_compat_match,    foo_match),     /* newly written */
+#      DEVMETHOD(card_compat_probe,    foo_probe),     /* old probe */
+#      DEVMETHOD(card_compat_attach,   foo_attach),    /* old attach */
+#
+# This will allow a single driver binary image to be used for both
+# OLDCARD and NEWCARD.
+#
+# Drivers wishing to not retain OLDCARD compatibility needn't do this.
+#
+# The compat_do_* versions are so that we can make the pccard_compat_probe
+# and _attach static lines and have the bus system pick the right version
+# to use so we don't enshrine pccard_* symbols in the driver's module.
+#
+METHOD int compat_probe {
+       device_t dev;
+}
+
+METHOD int compat_attach {
+       device_t dev;
+}
+
+CODE {
+       static int null_do_probe(device_t bus, device_t dev)
+       {
+               return (CARD_COMPAT_DO_PROBE(device_get_parent(bus), dev));
+       }
+
+       static int null_do_attach(device_t bus, device_t dev)
+       {
+               return (CARD_COMPAT_DO_ATTACH(device_get_parent(bus), dev));
+       }
+}
+
+METHOD int compat_do_probe {
+       device_t bus;
+       device_t dev;
+} DEFAULT null_do_probe;
+
+METHOD int compat_do_attach {
+       device_t bus;
+       device_t dev;
+} DEFAULT null_do_attach;
+
+#
+# Find "dev" in the passed table of devices.  Return it or NULL.
+#
+METHOD struct pccard_product * do_product_lookup {
+       device_t bus;
+       device_t dev;
+       const struct pccard_product *tab;
+       size_t ent_size;
+       pccard_product_match_fn matchfn;
+}
+
+#
+# Helper method for the above.  When a compatibility driver is converted,
+# one must write a match routine.  This routine is unused on OLDCARD but
+# is used as a discriminator for NEWCARD.
+#
+METHOD int compat_match {
+       device_t dev;
+}
+
+#
+# Method for devices to ask its CIS-enabled parent bus for CIS info.
+# Device driver requests all tuples if type 'id', the routine places
+# 'nret' number of tuples in 'buff'.  Returns 0 if all tuples processed,
+# or an error code if processing was aborted.
+# Users of this method will be responsible for freeing the memory allocated
+# by calling the cis_free method.
+#
+
+HEADER {
+       struct cis_tupleinfo {
+               u_int8_t id;
+               int len;
+               char *data;
+       };
+};
+
+CODE  {
+       static int
+       null_cis_read(device_t dev, device_t child, u_int8_t id,
+           struct cis_tupleinfo **buff, int *nret)
+       {
+               *nret = 0;
+               *buff = NULL;
+               return ENXIO;
+       }
+
+       static void
+       null_cis_free(device_t dev, struct cis_tupleinfo *buff, int *nret)
+       {
+               return;
+       }
+};
+
+METHOD int cis_read {
+       device_t dev;
+       device_t child;
+       u_int8_t id;
+       struct   cis_tupleinfo **buff;
+       int      *nret;
+} DEFAULT null_cis_read;
+
+METHOD int cis_free {
+       device_t dev;
+       struct   cis_tupleinfo *buff;
+       int      nret;
+} DEFAULT null_cis_free;
+
similarity index 72%
rename from sys/dev/misc/pccard/devlist2h.awk
rename to sys/bus/pccard/devlist2h.awk
index a62ab5c..caf1a7a 100644 (file)
@@ -1,7 +1,7 @@
 #! /usr/bin/awk -f
 #      $NetBSD: devlist2h.awk,v 1.3 1998/09/05 14:42:06 christos Exp $
-# $FreeBSD: src/sys/dev/pccard/devlist2h.awk,v 1.1 1999/10/26 06:52:28 imp Exp $
-# $DragonFly: src/sys/dev/misc/pccard/Attic/devlist2h.awk,v 1.2 2003/06/17 04:28:29 dillon Exp $
+# $FreeBSD: src/sys/dev/pccard/devlist2h.awk,v 1.3 2003/03/28 06:43:50 imp Exp $
+# $DragonFly: src/sys/bus/pccard/devlist2h.awk,v 1.1 2004/02/10 07:55:45 joerg Exp $
 #
 # Copyright (c) 1998 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -94,23 +94,13 @@ function collectline(f, line) {
 }
 BEGIN {
        nproducts = nvendors = 0
-       dfile="pccarddevs_data.h"
        hfile="pccarddevs.h"
 }
 NR == 1 {
        VERSION = $0
        gsub("\\$", "", VERSION)
 
-       printf("/*\t\$FreeBSD\$\t*/\n\n") > dfile
-       printf("/*\n") > dfile
-       printf(" * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
-           > dfile
-       printf(" *\n") > dfile
-       printf(" * generated from:\n") > dfile
-       printf(" *\t%s\n", VERSION) > dfile
-       printf(" */\n") > dfile
-
-       printf("/*\t\$FreeBSD\$\t*/\n\n") > hfile
+       printf("/*\t\$DragonFly\$\t*/\n\n") > hfile
        printf("/*\n") > hfile
        printf(" * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.\n") \
            > hfile
@@ -126,8 +116,10 @@ $1 == "vendor" {
 
        vendorindex[$2] = nvendors;             # record index for this name, for later.
        vendors[nvendors, 1] = $2;              # name
+       if ($3 == "-1")
+               $3 = "0xffffffff";
        vendors[nvendors, 2] = $3;              # id
-       printf("#define\tPCCARD_VENDOR_%s\t%s\t", vendors[nvendors, 1],
+       printf("#define\tPCMCIA_VENDOR_%s\t%s\t", vendors[nvendors, 1],
            vendors[nvendors, 2]) > hfile
        vendors[nvendors, 3] = collectline(4, line)
        printf("/* %s */\n", vendors[nvendors, 3]) > hfile
@@ -137,13 +129,15 @@ $1 == "product" {
        nproducts++
 
        products[nproducts, 1] = $2;            # vendor name
+       if ($3 == "-1")
+               $3 = "0xffffffff";
        products[nproducts, 2] = $3;            # product id
        products[nproducts, 3] = $4;            # id
 
        f = 5;
 
        if ($4 == "{") {
-               products[nproducts, 3] = -1
+               products[nproducts, 3] = "0xffffffff";
                z = "{ "
                for (i = 0; i < 4; i++) {
                        if (f <= NF) {
@@ -166,62 +160,20 @@ $1 == "product" {
        else {
                products[nproducts, 4] = "{ NULL, NULL, NULL, NULL }"
        }
-       printf("#define\tPCCARD_CIS_%s_%s\t%s\n",
+       printf("#define\tPCMCIA_CIS_%s_%s\t%s\n",
            products[nproducts, 1], products[nproducts, 2],
            products[nproducts, 4]) > hfile
-       printf("#define\tPCCARD_PRODUCT_%s_%s\t%s\n", products[nproducts, 1],
+       printf("#define\tPCMCIA_PRODUCT_%s_%s\t%s\n", products[nproducts, 1],
            products[nproducts, 2], products[nproducts, 3]) > hfile
 
        products[nproducts, 5] = collectline(f, line)
 
-       printf("#define\tPCCARD_STR_%s_%s\t\"%s\"\n",
+       printf("#define\tPCMCIA_STR_%s_%s\t\"%s\"\n",
            products[nproducts, 1], products[nproducts, 2],
            products[nproducts, 5]) > hfile
 
        next
 }
 {
-       if ($0 == "")
-               blanklines++
        print $0 > hfile
-       if (blanklines < 2)
-               print $0 > dfile
-}
-END {
-       # print out the match tables
-
-       printf("\n") > dfile
-
-       printf("struct pccard_knowndev pccard_knowndevs[] = {\n") > dfile
-       for (i = 1; i <= nproducts; i++) {
-               printf("\t{\n") > dfile
-               if (products[i, 3] == -1) {
-                       printf("\t    PCCARD_VENDOR_UNKNOWN, PCCARD_PRODUCT_%s_%s,\n",
-                           products[i, 1], products[i, 2]) > dfile
-               } else {
-                       printf("\t    PCCARD_VENDOR_%s, PCCARD_PRODUCT_%s_%s,\n",
-                           products[i, 1], products[i, 1], products[i, 2]) > dfile
-               }
-               printf("\t    PCCARD_CIS_%s_%s,\n", 
-                   products[i, 1], products[i, 2]) > dfile
-               printf("\t    ") > dfile
-               printf("0") > dfile
-               printf(",\n") > dfile
-
-               vendi = vendorindex[products[i, 1]];
-               printf("\t    \"%s\",\n", vendors[vendi, 3]) > dfile
-               printf("\t    \"%s\"\t},\n", products[i, 5]) > dfile
-               printf("\t},\n") > dfile
-       }
-       for (i = 1; i <= nvendors; i++) {
-               printf("\t{\n") > dfile
-               printf("\t    PCCARD_VENDOR_%s, 0,\n", vendors[i, 1]) > dfile
-               printf("\t    PCCARD_KNOWNDEV_NOPROD,\n") > dfile
-               printf("\t    PCCARD_CIS_INVALID,\n") > dfile
-               printf("\t    \"%s\",\n", vendors[i, 3]) > dfile
-               printf("\t    NULL,\n") > dfile
-               printf("\t},\n") > dfile
-       }
-       printf("\t{ 0, 0, { NULL, NULL, NULL, NULL }, 0, NULL, NULL, }\n") > dfile
-       printf("};\n") > dfile
 }
diff --git a/sys/bus/pccard/i82365.h b/sys/bus/pccard/i82365.h
deleted file mode 100644 (file)
index cac33fd..0000000
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- *     i82365.h - Definitions for Intel 82365 PCIC
- *     PCMCIA Card Interface Controller
- *
- * originally by Barry Jaspan; hacked over by Keith Moore
- * hacked to unrecognisability by Andrew McRae (andrew@mega.com.au)
- *
- * Updated 3/3/95 to include Cirrus Logic stuff.
- *-------------------------------------------------------------------------
- *
- * Copyright (c) 2001 M. Warner Losh.  All rights reserved.
- * Copyright (c) 1995 Andrew McRae.  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.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * 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: src/sys/pccard/i82365.h,v 1.10.2.9 2002/09/22 20:26:58 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/i82365.h,v 1.2 2003/06/17 04:28:55 dillon Exp $
- */
-
-#define        PCIC_I82365     0               /* Intel i82365SL-A/B or clone */
-#define        PCIC_IBM        1               /* IBM clone */
-#define        PCIC_VLSI       2               /* VLSI chip */
-#define        PCIC_PD6722     3               /* Cirrus logic PD6722 */
-#define        PCIC_PD6710     4               /* Cirrus logic PD6710 */
-#define        PCIC_VG365      5               /* Vadem 365 */
-#define        PCIC_VG465      6               /* Vadem 465 */
-#define        PCIC_VG468      7               /* Vadem 468 */
-#define        PCIC_VG469      8               /* Vadem 469 */
-#define        PCIC_RF5C296    9               /* Ricoh RF5C296 */
-#define        PCIC_RF5C396    10              /* Ricoh RF5C396 */
-#define        PCIC_IBM_KING   11              /* IBM KING PCMCIA Controller */
-#define PCIC_I82365SL_DF 12            /* Intel i82365sl-DF step */
-#define PCIC_PD6729    13              /* Cirrus Logic PD6729 */
-#define PCIC_PD673X    14              /* Cirrus Logic PD673x */
-
-/*
- *     Address of the controllers. Each controller can manage
- *     two PCMCIA slots. Up to 8 slots are supported in total.
- *     The PCIC controller is accessed via an index port and a
- *     data port. The index port has the 8 bit address of the
- *     register accessed via the data port. How I long for
- *     real memory mapped I/O!
- *     The top two bits of the index address are used to
- *     identify the port number, and the lower 6 bits
- *     select one of the 64 possible data registers.
- */
-#define PCIC_INDEX     0                       /* Index register */
-#define PCIC_DATA      1                       /* Data register */
-#define PCIC_NPORT     2                       /* Number of ports */
-#define PCIC_PORT_0    0x3e0                   /* index reg, chips 0 and 1 */
-
-/*
- *     Register index addresses.
- */
-#define PCIC_ID_REV    0x00    /* Identification and Revision */
-#define PCIC_STATUS    0x01    /* Interface Status */
-#define PCIC_POWER     0x02    /* Power and RESETDRV control */
-#define PCIC_INT_GEN   0x03    /* Interrupt and General Control */
-#define PCIC_STAT_CHG  0x04    /* Card Status Change */
-#define PCIC_STAT_INT  0x05    /* Card Status Change Interrupt Config */
-#define PCIC_ADDRWINE  0x06    /* Address Window Enable */
-#define PCIC_IOCTL     0x07    /* I/O Control */
-#define PCIC_IO0       0x08    /* I/O Address 0 */
-#define PCIC_IO1       0x0c    /* I/O Address 1 */
-#define        PCIC_MEMBASE    0x10    /* Base of memory window registers */
-#define PCIC_CDGC      0x16    /* Card Detect and General Control */
-#define PCIC_MISC1     0x16    /* PD67xx: Misc control register 1 per slot */
-#define PCIC_GLO_CTRL  0x1e    /* Global Control Register */
-#define PCIC_MISC2     0x1e    /* PD67xx: Misc control register 2 per chip */
-#define PCIC_CLCHIP    0x1f    /* PD67xx: Chip I/D */
-#define PCIC_EXT_IND   0x2e    /* PD67xx: Extended Index */
-#define PCIC_EXTENDED  0x2f    /* PD67xx: Extended register */
-#define PCIC_CVSR      0x2f    /* Vadem: Voltage select register */
-#define PCIC_RICOH_MCR2 0x2f   /* Ricoh: Mode Control Register 2 */
-
-#define PCIC_VMISC     0x3a    /* Vadem: Misc control register */
-#define PCIC_RICOH_ID  0x3a    /* Ricoh: ID register */
-
-#define PCIC_TOPIC_FCR 0x3e    /* Toshiba ToPIC: Function Control Register */
-
-#define        PCIC_TIME_SETUP0        0x3a
-#define        PCIC_TIME_CMD0          0x3b
-#define        PCIC_TIME_RECOV0        0x3c
-#define        PCIC_TIME_SETUP1        0x3d
-#define        PCIC_TIME_CMD1          0x3e
-#define        PCIC_TIME_RECOV1        0x3f
-
-/* Yenta only registers */
-#define PCIC_MEMORY_HIGH0      0x40    /* A31..A25 of mapping addres for */
-#define PCIC_MEMORY_HIGH1      0x41    /* the memory windows. */
-#define PCIC_MEMORY_HIGH2      0x42
-#define PCIC_MEMORY_HIGH3      0x43
-
-
-#define        PCIC_SLOT_SIZE  0x40    /* Size of register set for one slot */
-
-/* Now register bits, ordered by reg # */
-
-/* For Identification and Revision (PCIC_ID_REV) */
-#define PCIC_INTEL0    0x82    /* Intel 82365SL Rev. 0; Both Memory and I/O */
-#define PCIC_INTEL1    0x83    /* Intel 82365SL Rev. 1; Both Memory and I/O */
-#define PCIC_INTEL2    0x84    /* Intel 82365SL step D */
-#define PCIC_VLSI82C146        0x84    /* VLSI 82C146 */
-#define PCIC_IBM1      0x88    /* IBM PCIC clone; Both Memory and I/O */
-#define PCIC_IBM2      0x89    /* IBM PCIC clone; Both Memory and I/O */
-#define PCIC_IBM3      0x8a    /* IBM KING PCIC clone; Both Memory and I/O */
-
-/* For Interface Status register (PCIC_STATUS) */
-#define PCIC_VPPV      0x80    /* Vpp_valid or reserved*/
-#define PCIC_RICOH_5VCARD 0x80 /* 5V card detected */
-#define PCIC_POW       0x40    /* PC Card power active */
-#define PCIC_READY     0x20    /* Ready/~Busy */
-#define PCIC_MWP       0x10    /* Memory Write Protect */
-#define PCIC_CD                0x0C    /* Both card detect bits */
-#define PCIC_BVD       0x03    /* Both Battery Voltage Detect bits */
-
-/* For the Power and RESETDRV register (PCIC_POWER) */
-#define PCIC_OUTENA    0x80    /* Output Enable */
-#define PCIC_DISRST    0x40    /* Disable RESETDRV */
-#define PCIC_APSENA    0x20    /* Auto Pwer Switch Enable */
-#define PCIC_PCPWRE    0x10    /* PC Card Power Enable */
-#define        PCIC_VCC        0x18    /* Vcc control bits */
-#define        PCIC_VCC_5V     0x10    /* 5 volts */
-#define        PCIC_VCC_ON     0x10    /* Turn on VCC on some chips. */
-#define        PCIC_VCC_3V     0x18    /* 3 volts */
-#define        PCIC_VCC_5V_KING        0x14    /* 5 volts for KING PCIC */
-#define        PCIC_VPP        0x03    /* Vpp control bits */
-#define        PCIC_VPP_5V     0x01    /* 5 volts */
-#define        PCIC_VPP_12V    0x02    /* 12 volts */
-
-/* For the Interrupt and General Control register (PCIC_INT_GEN) */
-#define PCIC_CARDRESET 0x40    /* Card reset 0 = Reset, 1 = Normal */
-#define PCIC_CARDTYPE  0x20    /* Card Type 0 = memory, 1 = I/O */
-#define                PCIC_IOCARD     0x20
-#define                PCIC_MEMCARD    0x00
-#define        PCIC_INTR_ENA   0x10    /* PCI CSC Interrupt enable */
-
-/* For the Card Status Change register (PCIC_STAT_CHG) */
-#define PCIC_CDTCH     0x08    /* Card Detect Change */
-#define PCIC_RDYCH     0x04    /* Ready Change */
-#define PCIC_BATWRN    0x02    /* Battery Warning */
-#define PCIC_BATDED    0x01    /* Battery Dead */
-
-/* For the Card status change interrupt PCIC_STAT_INT */
-#define PCIC_CSCSELECT         0xf0    /* CSCSELECT */
-#define PCIC_SI_IRQ_SHIFT      4
-#define PCIC_CDEN              0x8
-#define PCIC_READYEN           0x4
-#define PCIC_BATWARNEN         0x2
-#define PCIC_BATDEADEN         0x1
-
-/*
- * For the Address Window Enable Register (PCIC_ADDRWINE)
- * The lower 6 bits contain enable bits for the memory
- * windows (LSB = memory window 0).
- */
-#define PCIC_MEMCS16   0x20    /* ~MEMCS16 Decode A23-A12 */
-#define PCIC_IO0_EN    0x40    /* I/O Window 0 Enable */
-#define PCIC_IO1_EN    0x80    /* I/O Window 1 Enable */
-
-/*
- * For the I/O Control Register (PCIC_IOCTL)
- * The lower nybble is the flags for I/O window 0
- * The upper nybble is the flags for I/O window 1
- */
-#define PCIC_IO_16BIT  0x01    /* I/O to this segment is 16 bit */
-#define PCIC_IO_CS16   0x02    /* I/O cs16 source is the card */
-#define PCIC_IO_0WS    0x04    /* zero wait states added on 8 bit cycles */
-#define PCIC_IO_WS     0x08    /* Wait states added for 16 bit cycles */
-
-/*
- *     The memory window registers contain the start and end
- *     physical host address that the PCIC maps to the card,
- *     and an offset calculated from the card memory address.
- *     All values are shifted down 12 bits, so allocation is
- *     done in 4Kb blocks. Only 12 bits of each value is
- *     stored, limiting the range to the ISA address size of
- *     24 bits. The upper 4 bits of the most significant byte
- *     within the values are used for various flags.
- *
- *     The layout is:
- *
- *     base+0 : lower 8 bits of system memory start address
- *     base+1 : upper 4 bits of system memory start address + flags
- *     base+2 : lower 8 bits of system memory end address
- *     base+3 : upper 4 bits of system memory end address + flags
- *     base+4 : lower 8 bits of offset to card address
- *     base+5 : upper 4 bits of offset to card address + flags
- *
- *     The following two bytes are reserved for other use.
- */
-#define        PCIC_MEMSIZE    8
-/*
- *     Flags for system memory start address upper byte
- */
-#define PCIC_ZEROWS    0x40    /* Zero wait states */
-#define PCIC_DATA16    0x80    /* Data width is 16 bits */
-
-/*
- *     Flags for system memory end address upper byte
- */
-#define PCIC_MW0       0x40    /* Wait state bit 0 */
-#define PCIC_MW1       0x80    /* Wait state bit 1 */
-
-/*
- *     Flags for card offset upper byte
- */
-#define PCIC_REG       0x40    /* Attribute/Common select (why called Reg?) */
-#define PCIC_WP                0x80    /* Write-protect this window */
-
-/* For Card Detect and General Control register (PCIC_CDGC) */
-#define PCIC_16_DL_INH 0x01    /* 16-bit memory delay inhibit */
-#define PCIC_CNFG_RST_EN 0x02  /* configuration reset enable */
-#define PCIC_GPI_EN    0x04    /* GPI Enable */
-#define PCIC_GPI_TRANS 0x08    /* GPI Transition Control */
-#define PCIC_CDRES_EN  0x10    /* card detect resume enable */
-#define PCIC_SW_CD_INT 0x20    /* s/w card detect interrupt */
-#define PCIC_VS1STAT   0x40    /* 0 VS1# low, 1 VS1# high */
-#define PCIC_VS2STAT   0x80    /* 0 VS2# low, 1 VS2# high */
-
-/* CL-PD67[12]x: For 3.3V cards, etc. (PCIC_MISC1) */
-#define PCIC_MISC1_5V_DETECT 0x01      /* PD6710 only */
-#define PCIC_MISC1_VCC_33    0x02      /* Set Vcc is 3.3V, else 5.0V */
-#define PCIC_MISC1_PMINT     0x04      /* Pulse management intr */
-#define PCIC_MISC1_PCINT     0x08      /* Pulse card interrupt */
-#define PCIC_MISC1_SPEAKER   0x10      /* Enable speaker */
-#define PCIC_MISC1_INPACK    0x80      /* INPACK throttles data */
-
-/* i82365B and newer (!PD67xx) Global Control register (PCIC_GLO_CTRL) */
-#define PCIC_PWR_DOWN  0x01    /* power down */
-#define PCIC_LVL_MODE  0x02    /* level mode interrupt enable */
-#define PCIC_WB_CSCINT 0x04    /* explicit write-back csc intr */
-/* Rev B only */
-#define PCIC_IRQ0_LEVEL 0x08   /* irq 14 pulse mode enable */
-#define PCIC_IRQ1_LEVEL 0x10
-
-/* CL-PD67[12]x: For Misc. Control Register 2 (PCIC_MISC2) */
-#define PCIC_LPDM_EN   0x02    /* Cirrus PD672x: low power dynamic mode */
-
-/* CL-PD67[12]x: Chip info (PCIC_CLCHIP) */
-#define PCIC_CLC_TOGGLE 0xc0           /* These bits toggle 1 -> 0 */
-#define PCIC_CLC_DUAL  0x20            /* Single/dual socket version */
-
-/* Cirrus Logic: Extended Registers (PCIC_EXT_IND) */
-#define PCIC_EXT_DATA  0x0a            /* External Data */
-
-/* EXT_DATA */
-#define PCIC_VS1A      0x01
-#define PCIC_VS2A      0x02
-#define PCIC_VS1B      0x04
-#define PCIC_VS2B      0x08
-
-/* Cirrus Logic: Extended register Extension Control 1 */
-#define PCIC_EXTCTRL1  0x03
-#define PCIC_EC1_VCC_LOCK 0x1          /* Vcc Power locked to s/w change */
-#define PCIC_EC1_AUTO_POWER_CLEAR 0x2  /* Vcc power cleared on eject? */
-#define PCIC_EC1_LED_ENABLE 0x4                /* LED activity enable */
-#define PCIC_EC1_CARD_IRQ_INV 0x8      /* Card IRQ level inverted for pci? */
-#define PCIC_EC1_CSC_IRQ_INV 0x10      /* CSC IRQ level inverted for pci? */
-#define PCIC_EC1_PULLUP 0x20           /* Dis pullup when 1. */
-
-/* Vadem: Card Voltage Select register (PCIC_CVSR) */
-#define PCIC_CVSR_VS   0x03            /* Voltage select */
-#define PCIC_CVSR_VS_5 0x00            /* 5.0 V */
-#define PCIC_CVSR_VS_33a 0x01          /* alt 3.3V */
-#define PCIC_CVSR_VS_XX        0x02            /* X.XV when available */
-#define PCIC_CVSR_VS_33 0x03           /* 3.3V */
-
-/* Ricoh: Misc Control Register 2 (PCIC_RICOH_MCR2) */
-#define PCIC_MCR2_VCC_33 0x01          /* 3.3V */
-
-/* Vadem: misc register (PCIC_VMISC) */
-#define PCIC_VADEMREV  0x40
-
-/* Ricoh: ID register values (PCIC_RICOH_ID) */
-#define PCIC_RID_296   0x32
-#define PCIC_RID_396   0xb2
-
-/* Toshiba ToPIC: Function Control Register */
-#define PCIC_FCR_3V_EN         0x01    /* Enable 3V cards */
-#define PCIC_FCR_VS_EN         0x02    /* Voltage Sense enable */
-
-/*
- *     Mask of allowable interrupts.
- *
- *     For IBM-AT machines, irqs 3, 4, 5, 7, 9, 10, 11, 12, 14, 15 are
- *     allowed.  Nearly all IBM-AT machines with pcic cards or bridges
- *     wire these interrupts (or a subset thereof) to the corresponding
- *     pins on the ISA bus.  Some older laptops are reported to not route
- *     all the interrupt pins to the bus because the designers knew that
- *     some would conflict with builtin devices.
- *
- *     For NEC PC98 machines, irq 3, 5, 6, 9, 10, 11, 12, 13 are allowed.
- *     These correspond to the C-BUS signals INT 0, 1, 2, 3, 41, 42, 5, 6
- *     respectively.  This is with the desktop C-BUS addin card.
- *
- *     Hiroshi TSUKADA-san writes in FreeBSD98-testers that cbus IRQ
- *     6 is routed to the IRQ 7 pin of the pcic in pc98 cbus based
- *     cards.  I do not know how pc98 laptop models are wired.
- */
-#ifdef PC98
-#define        PCIC_INT_MASK_ALLOWED   0x3E68          /* PC98 */
-#else
-#define        PCIC_INT_MASK_ALLOWED   0xDEB8          /* AT */
-#endif
-
-#define        PCIC_IO_WIN     2
-#define        PCIC_MEM_WIN    5
-
-#define        PCIC_CARD_SLOTS 4
-#define PCIC_MAX_CARDS 2
-#define PCIC_MAX_SLOTS (PCIC_MAX_CARDS * PCIC_CARD_SLOTS)
diff --git a/sys/bus/pccard/mecia.c b/sys/bus/pccard/mecia.c
deleted file mode 100644 (file)
index 765a854..0000000
+++ /dev/null
@@ -1,767 +0,0 @@
-/*
- *  NEC MECIA controller.
- *-------------------------------------------------------------------------
- *
- * 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: src/sys/pccard/mecia.c,v 1.2.2.4 2001/08/14 23:36:18 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/mecia.c,v 1.3 2003/08/07 21:16:46 dillon Exp $
- *
- * Based heavily on the FreeBSD pcic driver's pcic98 support, derived
- * from PAO3 tree.  This copyright notice likely needs modification for
- * such a linage.  The only authorship I could find was:
- *
- * PC9801 original PCMCIA controller code for NS/A,Ne,NX/C,NR/L.
- * by Noriyuki Hosobuchi <hoso@ce.mbn.or.jp>
- */
-
-#include <sys/param.h>
-#include <sys/bus.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-
-#include "meciareg.h"
-#include "cardinfo.h"
-#include "slot.h"
-#ifndef MECIA_IOBASE
-#define MECIA_IOBASE   0x80d0
-#endif
-
-/* Get pnp IDs */
-#include <bus/isa/isavar.h>
-
-#include <dev/misc/pccard/pccardvar.h>
-#include "card_if.h"
-
-#define MECIA_DEVICE2SOFTC(dev)        ((struct mecia_slot *) device_get_softc(dev))
-
-/*
- *     Prototypes for interrupt handler.
- */
-static driver_intr_t   meciaintr;
-static int             mecia_ioctl(struct slot *, int, caddr_t);
-static int             mecia_power(struct slot *);
-static void            mecia_mapirq(struct slot *, int);
-static timeout_t       mecia_reset;
-static void            mecia_resume(struct slot *);
-static void            mecia_disable(struct slot *);
-static timeout_t       meciatimeout;
-static struct callout_handle meciatimeout_ch
-    = CALLOUT_HANDLE_INITIALIZER(&meciatimeout_ch);
-static int             mecia_memory(struct slot *, int);
-static int             mecia_io(struct slot *, int);
-
-/*
- *     Per-slot data table.
- */
-struct mecia_slot {
-       int             unit;           /* Unit number */
-       int             slotnum;        /* My slot number */
-       struct slot     *slt;           /* Back ptr to slot */
-       device_t        dev;            /* My device */
-       u_char          last_reg1;      /* Last value of change reg */
-};
-
-static struct slot_ctrl mecia_cinfo = {
-       mecia_mapirq,
-       mecia_memory,
-       mecia_io,
-       mecia_reset,
-       mecia_disable,
-       mecia_power,
-       mecia_ioctl,
-       mecia_resume,
-       1,
-#if 0
-       1
-#else
-       2               /* Fake for UE2212 LAN card */
-#endif
-};
-
-static int validunits = 0;
-
-/*
- *     Look for an NEC MECIA.
- *     For each available slot, allocate a PC-CARD slot.
- */
-
-static int
-mecia_probe(device_t dev)
-{
-       int             validslots = 0;
-
-       /* Check isapnp ids */
-       if (isa_get_logicalid(dev))             /* skip PnP probes */
-               return (ENXIO);
-
-       if (inb(MECIA_REG0) != 0xff) {
-               validslots++;
-               /* XXX need to allocated the port resources */
-               device_set_desc(dev, "MECIA PC98 Original PCMCIA Controller");
-       }
-       return (validslots ? 0 : ENXIO);
-}
-
-static int
-mecia_attach(device_t dev)
-{
-       int             error;
-       int             irq;
-       void            *ih;
-       device_t        kid;
-       struct resource *r;
-       int             rid;
-       struct slot     *slt;
-       struct mecia_slot *sp;
-       
-       sp = MECIA_DEVICE2SOFTC(dev);
-       sp->unit = validunits++;
-       kid = device_add_child(dev, NULL, -1);
-       if (kid == NULL) {
-               device_printf(dev, "Can't add pccard bus slot 0\n");
-               return (ENXIO);
-       }
-       device_probe_and_attach(kid);
-       slt = pccard_init_slot(kid, &mecia_cinfo);
-       if (slt == 0) {
-               device_printf(dev, "Can't get pccard info slot 0\n");
-               return (ENXIO);
-       }
-       slt->cdata = sp;
-       sp->slt = slt;
-       validunits++;
-
-       rid = 0;
-       r = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid, 0, ~0, 1, RF_ACTIVE);
-       if (!r)
-               return (ENXIO);
-
-       irq = bus_get_resource_start(dev, SYS_RES_IRQ, 0);
-       if (irq == 0) {
-               /* See if the user has requested a specific IRQ */
-               if (!getenv_int("machdep.pccard.mecia_irq", &irq))
-                       irq = 0;
-       }
-       rid = 0;
-       r = 0;
-       if (irq > 0) {
-               r = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, irq,
-                   irq, 1, RF_ACTIVE);
-       }
-       if (r && ((1 << (rman_get_start(r))) & MECIA_INT_MASK_ALLOWED) == 0) {
-               device_printf(dev,
-                   "Hardware does not support irq %d, trying polling.\n",
-                   irq);
-               bus_release_resource(dev, SYS_RES_IRQ, rid, r);
-               r = 0;
-               irq = 0;
-       }
-       if (r) {
-               error = bus_setup_intr(dev, r, INTR_TYPE_MISC,
-                   meciaintr, (void *) sp, &ih);
-               if (error) {
-                       bus_release_resource(dev, SYS_RES_IRQ, rid, r);
-                       return (error);
-               }
-               irq = rman_get_start(r);
-               device_printf(dev, "management irq %d\n", irq);
-       } else {
-               irq = 0;
-       }
-       if (irq == 0) {
-               meciatimeout_ch = timeout(meciatimeout, (void *) sp, hz/2);
-               device_printf(dev, "Polling mode\n");
-       }
-
-       sp->last_reg1 = inb(MECIA_REG1);
-       if (sp->last_reg1 & MECIA_CARDEXIST) {
-               /* PCMCIA card exist */
-               sp->slt->laststate = sp->slt->state = filled;
-               pccard_event(sp->slt, card_inserted);
-       } else {
-               sp->slt->laststate = sp->slt->state = empty;
-       }
-       sp->slt->irq = irq;
-
-       return (bus_generic_attach(dev));
-}
-
-static int
-mecia_sresource(struct slot *slt, caddr_t data)
-{
-       struct pccard_resource *pr;
-       struct resource *r;
-       int flags;
-       int rid = 0;
-       device_t pccarddev = slt->dev;
-
-       pr = (struct pccard_resource *)data;
-       pr->resource_addr = ~0ul;
-       switch(pr->type) {
-       default:
-               return (EINVAL);
-       case SYS_RES_MEMORY:
-       case SYS_RES_IRQ:
-       case SYS_RES_IOPORT:
-               break;
-       }
-       flags = rman_make_alignment_flags(pr->size);
-       r = bus_alloc_resource(pccarddev, pr->type, &rid, pr->min, pr->max,
-          pr->size, flags);
-       if (r != NULL) {
-               pr->resource_addr = (u_long)rman_get_start(r);
-               bus_release_resource(bridgedev, pr->type, rid, r);
-       }
-       return (0);
-}
-
-/*
- *     ioctl calls - Controller specific ioctls
- */
-static int
-mecia_ioctl(struct slot *slt, int cmd, caddr_t data)
-{
-       switch(cmd) {
-       default:
-               return (ENOTTY);
-       case PIOCSRESOURCE:             /* Can I use this resource? */
-               mecia_sresource(slt, data);
-               break;
-       }
-       return (0);
-}
-
-/*
- *     MECIA timer.  If the controller doesn't have a free IRQ to use
- *     or if interrupt steering doesn't work, poll the controller for
- *     insertion/removal events.
- */
-static void
-meciatimeout(void *chan)
-{
-       meciaintr(chan);
-       meciatimeout_ch = timeout(meciatimeout, chan, hz/2);
-}
-
-/*
- *     MECIA Interrupt handler.
- *     Check the slot and report any changes.
- */
-static void
-meciaintr(void *arg)
-{
-       u_char  reg1;
-       int     s;
-       struct mecia_slot *sp = (struct mecia_slot *) arg;
-
-       s = splhigh();
-       /* Check for a card in this slot */
-       reg1 = inb(MECIA_REG1);
-       if ((sp->last_reg1 ^ reg1) & MECIA_CARDEXIST) {
-               sp->last_reg1 = reg1;
-               if (reg1 & MECIA_CARDEXIST)
-                       pccard_event(sp->slt, card_inserted);
-               else
-                       pccard_event(sp->slt, card_removed);
-       }
-       splx(s);
-}
-
-/*
- * local functions for PC-98 Original PC-Card controller
- */
-#define        MECIA_ALWAYS_128MAPPING 1       /* trick for using UE2212  */
-
-int mecia_mode = 0;    /* almost the same as the value in MECIA_REG2 */
-
-static unsigned char reg_winsel = MECIA_UNMAPWIN;
-static unsigned short reg_pagofs = 0;
-
-static int
-mecia_memory(struct slot *slt, int win)
-{
-       struct mem_desc *mp = &slt->mem[win];
-       unsigned char x;
-
-       if (mp->flags & MDF_ACTIVE) {
-               /* slot = 0, window = 0, sys_addr = 0xda000, length = 8KB */
-               if ((unsigned long)mp->start != 0xda000) {
-                       printf(
-                       "sys_addr must be 0xda000. requested address = %p\n",
-                       mp->start);
-                       return (EINVAL);
-               }
-
-               /* omajinai ??? */
-               outb(MECIA_REG0, 0);
-               x = inb(MECIA_REG1);
-               x &= 0xfc;
-               x |= 0x02;
-               outb(MECIA_REG1, x);
-               reg_winsel = inb(MECIA_REG_WINSEL);
-               reg_pagofs = inw(MECIA_REG_PAGOFS);
-               outb(MECIA_REG_WINSEL, MECIA_MAPWIN);
-               outw(MECIA_REG_PAGOFS, (mp->card >> 13)); /* 8KB */
-
-               if (mp->flags & MDF_ATTR)
-                       outb(MECIA_REG7, inb(MECIA_REG7) | MECIA_ATTRMEM);
-               else
-                       outb(MECIA_REG7, inb(MECIA_REG7) & (~MECIA_ATTRMEM));
-
-               outb(MECIA_REG_WINSEL, MECIA_MAPWIN);
-#if 0
-               if ((mp->flags & MDF_16BITS) == 1)      /* 16bit */
-                       outb(MECIA_REG2, inb(MECIA_REG2) & (~MECIA_8BIT));
-               else                                    /* 8bit */
-                       outb(MECIA_REG2, inb(MECIA_REG2) | MECIA_8BIT);
-#endif
-       } else {  /* !(mp->flags & MDF_ACTIVE) */
-               outb(MECIA_REG0, 0);
-               x = inb(MECIA_REG1);
-               x &= 0xfc;
-               x |= 0x02;
-               outb(MECIA_REG1, x);
-#if 0
-               outb(MECIA_REG_WINSEL, MECIA_UNMAPWIN);
-               outw(MECIA_REG_PAGOFS, 0);
-#else
-               outb(MECIA_REG_WINSEL, reg_winsel);
-               outw(MECIA_REG_PAGOFS, reg_pagofs);
-#endif
-       }
-       return (0);
-}
-
-static int
-mecia_io(struct slot *slt, int win)
-{
-       struct io_desc *ip = &slt->io[win];
-       unsigned char x;
-       unsigned short cardbase;
-       u_short ofst;
-
-       if (win != 0) {
-               /* ignore for UE2212 */
-               printf(
-               "mecia:Illegal MECIA I/O window(%d) request! Ignored.\n", win);
-/*             return (EINVAL);*/
-               return (0);
-       }
-
-       if (ip->flags & IODF_ACTIVE) {
-               x = inb(MECIA_REG2) & 0x0f;
-#if 0
-               if (! (ip->flags & IODF_CS16))
-                       x |= MECIA_8BIT;
-#else
-               if (! (ip->flags & IODF_16BIT)) {
-                       x |= MECIA_8BIT;
-                       mecia_mode |= MECIA_8BIT;
-               }
-#endif
-
-               ofst = ip->start & 0xf;
-               cardbase = ip->start & ~0xf;
-#ifndef MECIA_ALWAYS_128MAPPING
-               if (ip->size + ofst > 16)
-#endif
-               {       /* 128bytes mapping */
-                       x |= MECIA_MAP128;
-                       mecia_mode |= MECIA_MAP128;
-                       ofst |= ((cardbase & 0x70) << 4);
-                       cardbase &= ~0x70;
-               }
-
-               x |= MECIA_MAPIO;
-               outb(MECIA_REG2, x);
-    
-               outw(MECIA_REG4, MECIA_IOBASE); /* 98side I/O base */
-               outw(MECIA_REG5, cardbase);     /* card side I/O base */
-
-               if (bootverbose) {
-                       printf("mecia: I/O mapped 0x%04x(98) -> "
-                              "0x%04x(Card) and width %d bytes\n",
-                               MECIA_IOBASE+ofst, ip->start, ip->size);
-                       printf("mecia: reg2=0x%02x reg3=0x%02x reg7=0x%02x\n",
-                               inb(MECIA_REG2), inb(MECIA_REG3),
-                               inb(MECIA_REG7));
-                       printf("mecia: mode=%d\n", mecia_mode);
-               }
-
-               ip->start = MECIA_IOBASE + ofst;
-       } else {
-               outb(MECIA_REG2, inb(MECIA_REG2) & (~MECIA_MAPIO));
-               mecia_mode = 0;
-       }
-       return (0);
-}
-
-static int
-mecia_power(struct slot *slt)
-{
-       unsigned char reg;
-
-       reg = inb(MECIA_REG7) & (~MECIA_VPP12V);
-       switch(slt->pwr.vpp) {
-       default:
-               return (EINVAL);
-       case 50:
-               break;
-       case 120:
-               reg |= MECIA_VPP12V;
-               break;
-       }
-       outb(MECIA_REG7, reg);
-       DELAY(100*1000);
-
-       reg = inb(MECIA_REG2) & (~MECIA_VCC3P3V);
-       switch(slt->pwr.vcc) {
-       default:
-               return (EINVAL);
-       case 33:
-               reg |= MECIA_VCC3P3V;
-               break;
-       case 50:
-               break;
-       }
-       outb(MECIA_REG2, reg);
-       DELAY(100*1000);
-       return (0);
-}
-
-static void
-mecia_mapirq(struct slot *slt, int irq)
-{
-       u_char x;
-
-       switch (irq) {
-       case 3:
-               x = MECIA_INT0;
-               break;
-       case 5:
-               x = MECIA_INT1;
-               break;
-       case 6:
-               x = MECIA_INT2;
-               break;
-       case 10:
-               x = MECIA_INT4;
-               break;
-       case 12:
-               x = MECIA_INT5;
-               break;
-       case 0:         /* disable */
-               x = MECIA_INTDISABLE;
-               break;
-       default:
-               printf("mecia: illegal irq %d\n", irq);
-               return;
-       }
-#ifdef MECIA_DEBUG
-       printf("mecia: irq=%d mapped.\n", irq);
-#endif
-       outb(MECIA_REG3, x);
-}
-
-static void
-mecia_reset(void *chan)
-{
-       struct slot *slt = chan;
-
-       outb(MECIA_REG0, 0);
-       outb(MECIA_REG2, inb(MECIA_REG2) & (~MECIA_MAPIO));
-       outb(MECIA_REG3, MECIA_INTDISABLE);
-#if 0
-/* mecia_reset() is called after mecia_power() */
-       outb(MECIA_REG2, inb(MECIA_REG2) & (~MECIA_VCC3P3V));
-       outb(MECIA_REG7, inb(MECIA_REG7) & (~MECIA_VPP12V));
-#endif
-       outb(MECIA_REG1, 0);
-
-       selwakeup(&slt->selp);
-}
-
-static void
-mecia_disable(struct slot *slt)
-{
-       /* null function */
-}
-
-static void
-mecia_resume(struct slot *slt)
-{
-       /* XXX MECIA How ? */
-}
-
-static int
-mecia_activate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       int err;
-
-       if (dev != device_get_parent(device_get_parent(child)) || devi == NULL)
-               return (bus_generic_activate_resource(dev, child, type,
-                   rid, r));
-
-       switch (type) {
-       case SYS_RES_IOPORT: {
-               struct io_desc *ip;
-               ip = &devi->slt->io[rid];
-               if (ip->flags == 0) {
-                       if (rid == 0)
-                               ip->flags = IODF_WS | IODF_16BIT | IODF_CS16;
-                       else
-                               ip->flags = devi->slt->io[0].flags;
-               }
-               ip->flags |= IODF_ACTIVE;
-               ip->start = rman_get_start(r);
-               ip->size = rman_get_end(r) - rman_get_start(r) + 1;
-               err = mecia_cinfo.mapio(devi->slt, rid);
-               if (err)
-                       return (err);
-               break;
-       }
-       case SYS_RES_IRQ:
-               /*
-                * We actually defer the activation of the IRQ resource
-                * until the interrupt is registered to avoid stray
-                * interrupt messages.
-                */
-               break;
-       case SYS_RES_MEMORY: {
-               struct mem_desc *mp;
-               if (rid >= NUM_MEM_WINDOWS)
-                       return (EINVAL);
-               mp = &devi->slt->mem[rid];
-               mp->flags |= MDF_ACTIVE;
-               mp->start = (caddr_t) rman_get_start(r);
-               mp->size = rman_get_end(r) - rman_get_start(r) + 1;
-               err = mecia_cinfo.mapmem(devi->slt, rid);
-               if (err)
-                       return (err);
-               break;
-       }
-       default:
-               break;
-       }
-       err = bus_generic_activate_resource(dev, child, type, rid, r);
-       return (err);
-}
-
-static int
-mecia_deactivate_resource(device_t dev, device_t child, int type, int rid,
-    struct resource *r)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       int err;
-
-       if (dev != device_get_parent(device_get_parent(child)) || devi == NULL)
-               return (bus_generic_deactivate_resource(dev, child, type,
-                   rid, r));
-
-       switch (type) {
-       case SYS_RES_IOPORT: {
-               struct io_desc *ip = &devi->slt->io[rid];
-               ip->flags &= ~IODF_ACTIVE;
-               err = mecia_cinfo.mapio(devi->slt, rid);
-               if (err)
-                       return (err);
-               break;
-       }
-       case SYS_RES_IRQ:
-               break;
-       case SYS_RES_MEMORY: {
-               struct mem_desc *mp = &devi->slt->mem[rid];
-               mp->flags &= ~(MDF_ACTIVE | MDF_ATTR);
-               err = mecia_cinfo.mapmem(devi->slt, rid);
-               if (err)
-                       return (err);
-               break;
-       }
-       default:
-               break;
-       }
-       err = bus_generic_deactivate_resource(dev, child, type, rid, r);
-       return (err);
-}
-
-static int
-mecia_setup_intr(device_t dev, device_t child, struct resource *irq,
-    int flags, driver_intr_t *intr, void *arg, void **cookiep)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       int err;
-
-       if (((1 << rman_get_start(irq)) & MECIA_INT_MASK_ALLOWED) == 0) {
-               device_printf(dev, "Hardware does not support irq %ld.\n",
-                   rman_get_start(irq));
-               return (EINVAL);
-       }
-
-       err = bus_generic_setup_intr(dev, child, irq, flags, intr, arg,
-           cookiep);
-       if (err == 0)
-               mecia_cinfo.mapirq(devi->slt, rman_get_start(irq));
-       else
-               device_printf(dev, "Error %d irq %ld\n", err,
-                   rman_get_start(irq));
-       return (err);
-}
-
-static int
-mecia_teardown_intr(device_t dev, device_t child, struct resource *irq,
-    void *cookie)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-
-       mecia_cinfo.mapirq(devi->slt, 0);
-       return (bus_generic_teardown_intr(dev, child, irq, cookie));
-}
-
-static int
-mecia_set_res_flags(device_t bus, device_t child, int restype, int rid,
-    u_long value)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       int err = 0;
-
-       switch (restype) {
-       case SYS_RES_MEMORY: {
-               struct mem_desc *mp = &devi->slt->mem[rid];
-               switch (value) {
-               case PCCARD_A_MEM_COM:
-                       mp->flags &= ~MDF_ATTR;
-                       break;
-               case PCCARD_A_MEM_ATTR:
-                       mp->flags |= MDF_ATTR;
-                       break;
-               case PCCARD_A_MEM_8BIT:
-                       mp->flags &= ~MDF_16BITS;
-                       break;
-               case PCCARD_A_MEM_16BIT:
-                       mp->flags |= MDF_16BITS;
-                       break;
-               }
-               err = mecia_cinfo.mapmem(devi->slt, rid);
-               break;
-       }
-       default:
-               err = EOPNOTSUPP;
-       }
-       return (err);
-}
-
-static int
-mecia_get_res_flags(device_t bus, device_t child, int restype, int rid,
-    u_long *value)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       int err = 0;
-
-       if (value == 0)
-               return (ENOMEM);
-
-       switch (restype) {
-       case SYS_RES_IOPORT: {
-               struct io_desc *ip = &devi->slt->io[rid];
-               *value = ip->flags;
-               break;
-       }
-       case SYS_RES_MEMORY: {
-               struct mem_desc *mp = &devi->slt->mem[rid];
-               *value = mp->flags;
-               break;
-       }
-       default:
-               err = EOPNOTSUPP;
-       }
-       return (err);
-}
-
-static int
-mecia_set_memory_offset(device_t bus, device_t child, int rid,
-    u_int32_t offset, u_int32_t *deltap)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       struct mem_desc *mp = &devi->slt->mem[rid];
-
-       mp->card = offset;
-       if (deltap)
-               *deltap = 0;                    /* XXX BAD XXX */
-       return (mecia_cinfo.mapmem(devi->slt, rid));
-}
-
-static int
-mecia_get_memory_offset(device_t bus, device_t child, int rid,
-    u_int32_t *offset)
-{
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       struct mem_desc *mp = &devi->slt->mem[rid];
-
-       if (offset == 0)
-               return (ENOMEM);
-
-       *offset = mp->card;
-
-       return (0);
-}
-
-static device_method_t mecia_methods[] = {
-       /* Device interface */
-       DEVMETHOD(device_probe,         mecia_probe),
-       DEVMETHOD(device_attach,        mecia_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, mecia_activate_resource),
-       DEVMETHOD(bus_deactivate_resource, mecia_deactivate_resource),
-       DEVMETHOD(bus_setup_intr,       mecia_setup_intr),
-       DEVMETHOD(bus_teardown_intr,    mecia_teardown_intr),
-
-       /* Card interface */
-       DEVMETHOD(card_set_res_flags,   mecia_set_res_flags),
-       DEVMETHOD(card_get_res_flags,   mecia_get_res_flags),
-       DEVMETHOD(card_set_memory_offset, mecia_set_memory_offset),
-       DEVMETHOD(card_get_memory_offset, mecia_get_memory_offset),
-
-       { 0, 0 }
-};
-
-devclass_t     mecia_devclass;
-
-static driver_t mecia_driver = {
-       "mecia",
-       mecia_methods,
-       sizeof(struct mecia_slot)
-};
-
-DRIVER_MODULE(mecia, isa, mecia_driver, mecia_devclass, 0, 0);
diff --git a/sys/bus/pccard/meciareg.h b/sys/bus/pccard/meciareg.h
deleted file mode 100644 (file)
index 403761e..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * meciareg.h
- *
- * PC9801 original PCMCIA controller code for NS/A,Ne,NX/C,NR/L.
- * by Noriyuki Hosobuchi <hoso@ce.mbn.or.jp>
- *
- * $FreeBSD: src/sys/pccard/meciareg.h,v 1.2.2.1 2001/07/06 22:58:49 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/meciareg.h,v 1.2 2003/06/17 04:28:55 dillon Exp $
- */
-
-/*--- I/O port definition */
-#define        MECIA_REG0              0x0a8e  /* byte */
-#define        MECIA_REG1              0x1a8e  /* byte */
-#define        MECIA_REG2              0x2a8e  /* byte */
-#define        MECIA_REG3              0x3a8e  /* byte : Interrupt */
-#define        MECIA_REG4              0x4a8e  /* word : PC98 side I/O base */
-#define        MECIA_REG5              0x5a8e  /* word : Card side I/O base */
-#define        MECIA_REG7              0x7a8e  /* byte */
-
-#define        MECIA_REG_WINSEL        0x1e8e  /* byte : win bank select register */
-#define        MECIA_REG_PAGOFS        0x0e8e  /* word */
-
-/* PC98_REG_WINSEL */
-#define        MECIA_MAPWIN            0x84    /* map Card on 0xda0000 - 0xdbffff */
-#define        MECIA_UNMAPWIN          0x00
-
-/* MECIA_REG1 */
-#define        MECIA_CARDEXIST         0x08    /* 1:exist 0:not exist */
-
-/* MECIA_REG2 */
-#define        MECIA_MAPIO             0x80    /* 1:I/O 0:Memory */
-#define        MECIA_IOTHROUGH         0x40    /* 0:I/O map 1:I/O addr-through */
-#define        MECIA_8BIT              0x20    /* bit width 1:8bit 0:16bit */
-#define        MECIA_MAP128            0x10    /* I/O map size 1:128byte 0:16byte */
-#define        MECIA_VCC3P3V           0x02    /* Vcc 1:3.3V 0:5.0V */
-
-/* MECIA_REG3 */
-#define        MECIA_INT0              (0xf8 + 0x0)    /* INT0(IRQ3) */
-#define        MECIA_INT1              (0xf8 + 0x1)    /* INT1(IRQ5) */
-#define        MECIA_INT2              (0xf8 + 0x2)    /* INT2(IRQ6) */
-#define        MECIA_INT4              (0xf8 + 0x4)    /* INT4(IRQ10) */
-#define        MECIA_INT5              (0xf8 + 0x5)    /* INT5(IRQ12) */
-#define        MECIA_INTDISABLE        (0xf8 + 0x7)    /* disable interrupt */
-
-/* MECIA_REG7 */
-#define        MECIA_ATTRMEM           0x20    /* 1:attr mem 0:common mem */
-#define        MECIA_VPP12V            0x10    /* Vpp 0:5V 1:12V */
-
-
-#ifdef KERNEL
-extern int mecia_mode;         /* in 'pccard/pcic.c' */
-#define mecia_8bit_on()        \
-       if (mecia_mode & MECIA_8BIT)    \
-               outb(MECIA_REG2, inb(MECIA_REG2) | MECIA_8BIT)
-#define mecia_8bit_off()       \
-       if (mecia_mode & MECIA_8BIT)    \
-               outb(MECIA_REG2, inb(MECIA_REG2) & ~MECIA_8BIT)
-#define mecia_map128()         (mecia_mode & MECIA_MAP128)
-#endif
-
-#define        MECIA_INT_MASK_ALLOWED  0x3E68          /* PC98 */
index 889ab4d..5c8bd26 100644 (file)
@@ -1,11 +1,9 @@
+/*     $NetBSD: pcmcia.c,v 1.23 2000/07/28 19:17:02 drochner Exp $     */
+/* $FreeBSD: src/sys/dev/pccard/pccard.c,v 1.70 2002/11/14 14:02:32 mux Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccard.c,v 1.8 2004/02/10 07:55:45 joerg Exp $
+
 /*
- *     pccard.c - Interface code for PC-CARD controllers.
- *
- *     June 1995, Andrew McRae (andrew@mega.com.au)
- *-------------------------------------------------------------------------
- *
- * Copyright (c) 2001 M. Warner Losh.  All rights reserved.
- * Copyright (c) 1995 Andrew McRae.  All rights reserved.
+ * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * 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.
- * 3. The name of the author may not be used to endorse or promote products
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by Marc Horowitz.
+ * 4. The name of the author may not be used to endorse or promote products
  *    derived from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * 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: src/sys/pccard/pccard.c,v 1.106.2.15 2003/02/26 18:42:00 imp Exp $
- * $DragonFly: src/sys/bus/pccard/pccard.c,v 1.7 2003/08/07 21:16:46 dillon Exp $
  */
 
 #include <sys/param.h>
-#include <sys/types.h>
 #include <sys/systm.h>
-#include <sys/kernel.h>
 #include <sys/malloc.h>
+#include <sys/module.h>
+#include <sys/kernel.h>
+#include <sys/queue.h>
 #include <sys/sysctl.h>
-#include <sys/conf.h>
-#include <sys/uio.h>
-#include <sys/poll.h>
+#include <sys/types.h>
+
 #include <sys/bus.h>
-#include <sys/proc.h>
 #include <machine/bus.h>
+#include <sys/rman.h>
+#include <machine/resource.h>
 
-#include "cardinfo.h"
-#include "driver.h"
-#include "slot.h"
-#include "pccard_nbk.h"
+#include <net/ethernet.h>
 
-#include <machine/md_var.h>
+#include <bus/pccard/pccardreg.h>
+#include <bus/pccard/pccardvar.h>
 
-static int             allocate_driver(struct slot *, struct dev_desc *);
-static void            inserted(void *);
-static void            disable_slot(struct slot *);
-static void            disable_slot_to(struct slot *);
-static void            power_off_slot(void *);
+#include "power_if.h"
+#include "card_if.h"
 
-/*
- *     The driver interface for read/write uses a block
- *     of memory in the ISA I/O memory space allocated via
- *     an ioctl setting.
- *
- *     Now that we have different bus attachments, we should really
- *     use a better algorythm to allocate memory.
- */
-static unsigned long pccard_mem;       /* Physical memory */
-static unsigned char *pccard_kmem;     /* Kernel virtual address */
-static struct resource *pccard_mem_res;
-static int pccard_mem_rid;
-
-static d_open_t        crdopen;
-static d_close_t       crdclose;
-static d_read_t        crdread;
-static d_write_t       crdwrite;
-static d_ioctl_t       crdioctl;
-static d_poll_t        crdpoll;
-
-#define CDEV_MAJOR 50
-static struct cdevsw crd_cdevsw = {
-       /* name */      "crd",
-       /* maj */       CDEV_MAJOR,
-       /* flags */     0,
-       /* port */      NULL,
-       /* autoq */     0,
-
-       /* open */      crdopen,
-       /* close */     crdclose,
-       /* read */      crdread,
-       /* write */     crdwrite,
-       /* ioctl */     crdioctl,
-       /* poll */      crdpoll,
-       /* mmap */      nommap,
-       /* strategy */  nostrategy,
-       /* dump */      nodump,
-       /* psize */     nopsize
-};
+#define PCCARDDEBUG
+
+/* sysctl vars */
+SYSCTL_NODE(_hw, OID_AUTO, pccard, CTLFLAG_RD, 0, "PCCARD parameters");
+
+int    pccard_debug = 0;
+TUNABLE_INT("hw.pccard.debug", &pccard_debug);
+SYSCTL_INT(_hw_pccard, OID_AUTO, debug, CTLFLAG_RW,
+    &pccard_debug, 0,
+  "pccard debug");
+
+int    pccard_cis_debug = 0;
+TUNABLE_INT("hw.pccard.cis_debug", &pccard_cis_debug);
+SYSCTL_INT(_hw_pccard, OID_AUTO, cis_debug, CTLFLAG_RW,
+    &pccard_cis_debug, 0, "pccard CIS debug");
+
+#ifdef PCCARDDEBUG
+#define        DPRINTF(arg) if (pccard_debug) printf arg
+#define        DEVPRINTF(arg) if (pccard_debug) device_printf arg
+#define PRVERBOSE(arg) printf arg
+#define DEVPRVERBOSE(arg) device_printf arg
+#else
+#define        DPRINTF(arg)
+#define        DEVPRINTF(arg)
+#define PRVERBOSE(arg) if (bootverbose) printf arg
+#define DEVPRVERBOSE(arg) if (bootverbose) device_printf arg
+#endif
+
+static int     pccard_ccr_read(struct pccard_function *pf, int ccr);
+static void    pccard_ccr_write(struct pccard_function *pf, int ccr, int val);
+static int     pccard_attach_card(device_t dev);
+static int     pccard_detach_card(device_t dev);
+static int     pccard_card_gettype(device_t dev, int *type);
+static void    pccard_function_init(struct pccard_function *pf);
+static void    pccard_function_free(struct pccard_function *pf);
+static int     pccard_function_enable(struct pccard_function *pf);
+static void    pccard_function_disable(struct pccard_function *pf);
+static int     pccard_compat_do_probe(device_t bus, device_t dev);
+static int     pccard_compat_do_attach(device_t bus, device_t dev);
+static int     pccard_add_children(device_t dev, int busno);
+static int     pccard_probe(device_t dev);
+static int     pccard_attach(device_t dev);
+static int     pccard_detach(device_t dev);
+static void    pccard_print_resources(struct resource_list *rl,
+                   const char *name, int type, int count, const char *format);
+static int     pccard_print_child(device_t dev, device_t child);
+static int     pccard_set_resource(device_t dev, device_t child, int type,
+                   int rid, u_long start, u_long count);
+static int     pccard_get_resource(device_t dev, device_t child, int type,
+                   int rid, u_long *startp, u_long *countp);
+static void    pccard_delete_resource(device_t dev, device_t child, int type,
+                   int rid);
+static int     pccard_set_res_flags(device_t dev, device_t child, int type,
+                   int rid, u_int32_t flags);
+static int     pccard_set_memory_offset(device_t dev, device_t child, int rid,
+                   u_int32_t offset, u_int32_t *deltap);
+static void    pccard_probe_nomatch(device_t cbdev, device_t child);
+static int     pccard_read_ivar(device_t bus, device_t child, int which,
+                   u_char *result);
+static void    pccard_driver_added(device_t dev, driver_t *driver);
+static struct resource *pccard_alloc_resource(device_t dev,
+                   device_t child, int type, int *rid, u_long start,
+                   u_long end, u_long count, u_int flags);
+static int     pccard_release_resource(device_t dev, device_t child, int type,
+                   int rid, struct resource *r);
+static void    pccard_child_detached(device_t parent, device_t dev);
+static void    pccard_intr(void *arg);
+static int     pccard_setup_intr(device_t dev, device_t child,
+                   struct resource *irq, int flags, driver_intr_t *intr,
+                   void *arg, void **cookiep);
+static int     pccard_teardown_intr(device_t dev, device_t child,
+                   struct resource *r, void *cookie);
+
+static const struct pccard_product *
+pccard_do_product_lookup(device_t bus, device_t dev,
+                        const struct pccard_product *tab, size_t ent_size,
+                        pccard_product_match_fn matchfn);
+
+
+static int
+pccard_ccr_read(struct pccard_function *pf, int ccr)
+{
+       return (bus_space_read_1(pf->pf_ccrt, pf->pf_ccrh,
+           pf->pf_ccr_offset + ccr));
+}
 
-/*
- *     Power off the slot.
- *     (doing it immediately makes the removal of some cards unstable)
- */
 static void
-power_off_slot(void *arg)
+pccard_ccr_write(struct pccard_function *pf, int ccr, int val)
+{
+       if ((pf->ccr_mask) & (1 << (ccr / 2))) {
+               bus_space_write_1(pf->pf_ccrt, pf->pf_ccrh,
+                   pf->pf_ccr_offset + ccr, val);
+       }
+}
+
+static int
+pccard_attach_card(device_t dev)
 {
-       struct slot *slt = (struct slot *)arg;
-       int s;
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_function *pf;
+       struct pccard_ivar *ivar;
+       device_t child;
+       int i;
 
        /*
-        * The following will generate an interrupt.  So, to hold off
-        * the interrupt unitl after disable runs so that we can get rid
-        * rid of the interrupt before it becomes unsafe to touch the
-        * device.
-        *
-        * XXX In current, the spl stuff is a nop.
+        * this is here so that when socket_enable calls gettype, trt happens
         */
-       s = splhigh();
-       /* Power off the slot. */
-       slt->pwr_off_pending = 0;
-       slt->ctrl->disable(slt);
-       splx(s);
+       STAILQ_INIT(&sc->card.pf_head);
+
+       DEVPRINTF((dev, "chip_socket_enable\n"));
+       POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
+
+       DEVPRINTF((dev, "read_cis\n"));
+       pccard_read_cis(sc);
+
+       DEVPRINTF((dev, "check_cis_quirks\n"));
+       pccard_check_cis_quirks(dev);
+
+       /*
+        * bail now if the card has no functions, or if there was an error in
+        * the cis.
+        */
+
+       if (sc->card.error) {
+               device_printf(dev, "CARD ERROR!\n");
+               return (1);
+       }
+       if (STAILQ_EMPTY(&sc->card.pf_head)) {
+               device_printf(dev, "Card has no functions!\n");
+               return (1);
+       }
+
+       if (bootverbose || pccard_debug)
+               pccard_print_cis(dev);
+
+       DEVPRINTF((dev, "functions scanning\n"));
+       i = -1;
+       STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
+               i++;
+               if (STAILQ_EMPTY(&pf->cfe_head)) {
+                       device_printf(dev,
+                           "Function %d has no config entries.!\n", i);
+                       continue;
+               }
+               pf->sc = sc;
+               pf->cfe = NULL;
+               pf->dev = NULL;
+       }
+       DEVPRINTF((dev, "Card has %d functions. pccard_mfc is %d\n", i + 1,
+           pccard_mfc(sc)));
+
+       STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
+               if (STAILQ_EMPTY(&pf->cfe_head))
+                       continue;
+               /*
+                * In NetBSD, the drivers are responsible for activating
+                * each function of a card.  I think that in FreeBSD we
+                * want to activate them enough for the usual bus_*_resource
+                * routines will do the right thing.  This many mean a
+                * departure from the current NetBSD model.
+                *
+                * This seems to work well in practice for most cards.
+                * However, there are two cases that are problematic.
+                * If a driver wishes to pick and chose which config
+                * entry to use, then this method falls down.  These
+                * are usually older cards.  In addition, there are
+                * some cards that have multiple hardware units on the
+                * cards, but presents only one CIS chain.  These cards
+                * are combination cards, but only one of these units
+                * can be on at a time.
+                */
+               ivar = malloc(sizeof(struct pccard_ivar), M_DEVBUF,
+                   M_WAITOK | M_ZERO);
+               child = device_add_child(dev, NULL, -1);
+               device_set_ivars(child, ivar);
+               ivar->fcn = pf;
+               pf->dev = child;
+               /*
+                * XXX We might want to move the next two lines into
+                * XXX the pccard interface layer.  For the moment, this
+                * XXX is OK, but some drivers want to pick the config
+                * XXX entry to use as well as some address tweaks (mostly
+                * XXX due to bugs in decode logic that makes some
+                * XXX addresses illegal or broken).
+                */
+               pccard_function_init(pf);
+               if (sc->sc_enabled_count == 0)
+                       POWER_ENABLE_SOCKET(device_get_parent(dev), dev);
+               if (pccard_function_enable(pf) == 0 &&
+                   device_probe_and_attach(child) == 0) {
+                       DEVPRINTF((sc->dev, "function %d CCR at %d "
+                           "offset %x: %x %x %x %x, %x %x %x %x, %x\n",
+                           pf->number, pf->pf_ccr_window, pf->pf_ccr_offset,
+                           pccard_ccr_read(pf, 0x00),
+                       pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04),
+                       pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A),
+                       pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E),
+                       pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12)));
+               } else {
+                       if (pf->cfe != NULL)
+                               pccard_function_disable(pf);
+               }
+       }
+       return (0);
 }
 
-/*
- *     disable_slot - Disables the slot by removing
- *     the power and unmapping the I/O
- */
-static void
-disable_slot(struct slot *slt)
+static int
+pccard_detach_card(device_t dev)
 {
-       device_t pccarddev;
-       device_t *kids;
-       int nkids;
-       int i;
-       int ret;
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_function *pf;
+       struct pccard_config_entry *cfe;
 
        /*
-        * Note that a race condition is possible here; if a
-        * driver is accessing the device and it is removed, then
-        * all bets are off...
+        * We are running on either the PCCARD socket's event thread
+        * or in user context detaching a device by user request.
         */
-       pccarddev = slt->dev;
-       device_get_children(pccarddev, &kids, &nkids);
-       for (i = 0; i < nkids; i++) {
-               if ((ret = device_delete_child(pccarddev, kids[i])) != 0)
-                       printf("pccard: delete of %s failed: %d\n",
-                               device_get_nameunit(kids[i]), ret);
-       }
-       free(kids, M_TEMP);
+       STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
+               int state = device_get_state(pf->dev);
+
+               if (state == DS_ATTACHED || state == DS_BUSY)
+                       device_detach(pf->dev);
+               if (pf->cfe != NULL)
+                       pccard_function_disable(pf);
+               pccard_function_free(pf);
+               device_delete_child(dev, pf->dev);
+       }
+       if (sc->sc_enabled_count == 0)
+               POWER_DISABLE_SOCKET(device_get_parent(dev), dev);
 
-       /* Power off the slot 1/2 second after removal of the card */
-       slt->poff_ch = timeout(power_off_slot, (caddr_t)slt, hz / 2);
-       slt->pwr_off_pending = 1;
+       while (NULL != (pf = STAILQ_FIRST(&sc->card.pf_head))) {
+               while (NULL != (cfe = STAILQ_FIRST(&pf->cfe_head))) {
+                       STAILQ_REMOVE_HEAD(&pf->cfe_head, cfe_list);
+                       free(cfe, M_DEVBUF);
+               }
+               STAILQ_REMOVE_HEAD(&sc->card.pf_head, pf_list);
+               free(pf, M_DEVBUF);
+       }
+       return (0);
 }
 
-static void
-disable_slot_to(struct slot *slt)
+static const struct pccard_product *
+pccard_do_product_lookup(device_t bus, device_t dev,
+                        const struct pccard_product *tab, size_t ent_size,
+                        pccard_product_match_fn matchfn)
 {
-       disable_slot(slt);
-       if (slt->state == empty)
-               printf("pccard: card removed, slot %d\n", slt->slotnum);
+       const struct pccard_product *ent;
+       int matches;
+       u_int32_t fcn;
+       u_int32_t vendor;
+       u_int32_t prod;
+       char *vendorstr;
+       char *prodstr;
+
+#ifdef DIAGNOSTIC
+       if (sizeof *ent > ent_size)
+               panic("pccard_product_lookup: bogus ent_size %ld",
+                   (long) ent_size);
+#endif
+       if (pccard_get_vendor(dev, &vendor))
+               return (NULL);
+       if (pccard_get_product(dev, &prod))
+               return (NULL);
+       if (pccard_get_function_number(dev, &fcn))
+               return (NULL);
+       if (pccard_get_vendor_str(dev, &vendorstr))
+               return (NULL);
+       if (pccard_get_product_str(dev, &prodstr))
+               return (NULL);
+       for (ent = tab; ent->pp_name != NULL; ent =
+           (const struct pccard_product *) ((const char *) ent + ent_size)) {
+               matches = 1;
+               if (ent->pp_vendor == PCCARD_VENDOR_ANY &&
+                   ent->pp_product == PCCARD_VENDOR_ANY &&
+                   ent->pp_cis[0] == NULL &&
+                   ent->pp_cis[1] == NULL) {
+                       device_printf(dev,
+                           "Total wildcard entry ignored for %s\n",
+                           ent->pp_name);
+                       continue;
+               }
+               if (matches && ent->pp_vendor != PCCARD_VENDOR_ANY &&
+                   vendor != ent->pp_vendor)
+                       matches = 0;
+               if (matches && ent->pp_product != PCCARD_PRODUCT_ANY &&
+                   prod != ent->pp_product)
+                       matches = 0;
+               if (matches && fcn != ent->pp_expfunc)
+                       matches = 0;
+               if (matches && ent->pp_cis[0] &&
+                   strcmp(ent->pp_cis[0], vendorstr) != 0)
+                       matches = 0;
+               if (matches && ent->pp_cis[1] &&
+                   strcmp(ent->pp_cis[1], prodstr) != 0)
+                       matches = 0;
+               /* XXX need to match cis[2] and cis[3] also XXX */
+               if (matchfn != NULL)
+                       matches = (*matchfn)(dev, ent, matches);
+               if (matches)
+                       return (ent);
+       }
+       return (NULL);
+}
+
+static int
+pccard_card_gettype(device_t dev, int *type)
+{
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_function *pf;
+
+       /*
+        * set the iftype to memory if this card has no functions (not yet
+        * probed), or only one function, and that is not initialized yet or
+        * that is memory.
+        */
+       pf = STAILQ_FIRST(&sc->card.pf_head);
+       if (pf == NULL ||
+           (STAILQ_NEXT(pf, pf_list) == NULL &&
+           (pf->cfe == NULL || pf->cfe->iftype == PCCARD_IFTYPE_MEMORY)))
+               *type = PCCARD_IFTYPE_MEMORY;
        else
-               printf("pccard: card deactivated, slot %d\n", slt->slotnum);
-       pccard_remove_beep();
-       selwakeup(&slt->selp);
+               *type = PCCARD_IFTYPE_IO;
+       return (0);
 }
 
 /*
- *     pccard_init_slot - Initialize the slot controller and attach various
- * things to it.  We also make the device for it.  We create the device that
- * will be exported to devfs.
+ * Initialize a PCCARD function.  May be called as long as the function is
+ * disabled.
+ *
+ * Note: pccard_function_init should not keep resources allocated.  It should
+ * only set them up ala isa pnp, set the values in the rl lists, and return.
+ * Any resource held after pccard_function_init is called is a bug.  However,
+ * the bus routines to get the resources also assume that pccard_function_init
+ * does this, so they need to be fixed too.
  */
-struct slot *
-pccard_init_slot(device_t dev, struct slot_ctrl *ctrl)
+static void
+pccard_function_init(struct pccard_function *pf)
 {
-       int             slotno;
-       struct slot     *slt;
-
-       slt = PCCARD_DEVICE2SOFTC(dev);
-       slotno = device_get_unit(dev);
-       slt->dev = dev;
-       slt->d = make_dev(&crd_cdevsw, slotno, 0, 0, 0600, "card%d", slotno);
-       slt->d->si_drv1 = slt;
-       slt->ctrl = ctrl;
-       slt->slotnum = slotno;
-       callout_handle_init(&slt->insert_ch);
-       callout_handle_init(&slt->poff_ch);
+       struct pccard_config_entry *cfe;
+       int i;
+       struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
+       struct resource_list *rl = &devi->resources;
+       struct resource_list_entry *rle;
+       struct resource *r = 0;
+       device_t bus;
+       int start;
+       int end;
+       int spaces;
 
-       return (slt);
+       if (pf->pf_flags & PFF_ENABLED) {
+               printf("pccard_function_init: function is enabled");
+               return;
+       }
+       bus = device_get_parent(pf->dev);
+       /* Remember which configuration entry we are using. */
+       STAILQ_FOREACH(cfe, &pf->cfe_head, cfe_list) {
+               for (i = 0; i < cfe->num_iospace; i++)
+                       cfe->iores[i] = NULL;
+               cfe->irqres = NULL;
+               spaces = 0;
+               for (i = 0; i < cfe->num_iospace; i++) {
+                       start = cfe->iospace[i].start;
+                       if (start)
+                               end = start + cfe->iospace[i].length - 1;
+                       else
+                               end = ~0;
+                       cfe->iorid[i] = i;
+                       DEVPRINTF((bus, "I/O rid %d start %x end %x\n",
+                           i, start, end));
+                       r = cfe->iores[i] = bus_alloc_resource(bus,
+                           SYS_RES_IOPORT, &cfe->iorid[i], start, end,
+                           cfe->iospace[i].length,
+                           rman_make_alignment_flags(cfe->iospace[i].length));
+                       if (cfe->iores[i] == NULL)
+                               goto not_this_one;
+                       resource_list_add(rl, SYS_RES_IOPORT, cfe->iorid[i],
+                           rman_get_start(r), rman_get_end(r),
+                           cfe->iospace[i].length);
+                       rle = resource_list_find(rl, SYS_RES_IOPORT,
+                           cfe->iorid[i]);
+                       rle->res = r;
+                       spaces++;
+               }
+               if (cfe->num_memspace > 0) {
+                       /*
+                        * Not implement yet, Fix me.
+                        */
+                       DEVPRINTF((bus, "Memory space not yet implemented.\n"));
+               }
+               if (spaces == 0) {
+                       DEVPRINTF((bus, "Neither memory nor I/O mampped\n"));
+                       goto not_this_one;
+               }
+               if (cfe->irqmask) {
+                       cfe->irqrid = 0;
+                       r = cfe->irqres = bus_alloc_resource(bus, SYS_RES_IRQ,
+                           &cfe->irqrid, 0, ~0, 1, 0);
+                       if (cfe->irqres == NULL)
+                               goto not_this_one;
+                       resource_list_add(rl, SYS_RES_IRQ, cfe->irqrid,
+                           rman_get_start(r), rman_get_end(r), 1);
+                       rle = resource_list_find(rl, SYS_RES_IRQ,
+                           cfe->irqrid);
+                       rle->res = r;
+               }
+               /* If we get to here, we've allocated all we need */
+               pf->cfe = cfe;
+               break;
+           not_this_one:;
+               DEVPRVERBOSE((bus, "Allocation failed for cfe %d\n",
+                   cfe->number));
+               /*
+                * Release resources that we partially allocated
+                * from this config entry.
+                */
+               for (i = 0; i < cfe->num_iospace; i++) {
+                       if (cfe->iores[i] != NULL) {
+                               bus_release_resource(bus, SYS_RES_IOPORT,
+                                   cfe->iorid[i], cfe->iores[i]);
+                               rle = resource_list_find(rl, SYS_RES_IOPORT,
+                                   cfe->iorid[i]);
+                               rle->res = NULL;
+                               resource_list_delete(rl, SYS_RES_IOPORT,
+                                   cfe->iorid[i]);
+                       }
+                       cfe->iores[i] = NULL;
+               }
+               if (cfe->irqmask && cfe->irqres != NULL) {
+                       bus_release_resource(bus, SYS_RES_IRQ,
+                           cfe->irqrid, cfe->irqres);
+                       rle = resource_list_find(rl, SYS_RES_IRQ,
+                           cfe->irqrid);
+                       rle->res = NULL;
+                       resource_list_delete(rl, SYS_RES_IRQ, cfe->irqrid);
+                       cfe->irqres = NULL;
+               }
+       }
 }
 
 /*
- *     allocate_driver - Create a new device entry for this
- *     slot, and attach a driver to it.
+ * Free resources allocated by pccard_function_init(), May be called as long
+ * as the function is disabled.
+ *
+ * NOTE: This function should be unnecessary.  pccard_function_init should
+ * never keep resources initialized.
  */
+static void
+pccard_function_free(struct pccard_function *pf)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
+       struct resource_list_entry *rle;
+
+       if (pf->pf_flags & PFF_ENABLED) {
+               printf("pccard_function_init: function is enabled");
+               return;
+       }
+
+       SLIST_FOREACH(rle, &devi->resources, link) {
+               if (rle->res) {
+                       if (rle->res->r_dev != pf->sc->dev)
+                               device_printf(pf->sc->dev,
+                                   "function_free: Resource still owned by "
+                                   "child, oops. "
+                                   "(type=%d, rid=%d, addr=%lx)\n",
+                                   rle->type, rle->rid,
+                                   rman_get_start(rle->res));
+                       BUS_RELEASE_RESOURCE(device_get_parent(pf->sc->dev),
+                           rle->res->r_dev, rle->type, rle->rid, rle->res);
+                       rle->res = NULL;
+               }
+       }
+       resource_list_free(&devi->resources);
+}
+
+/* Enable a PCCARD function */
 static int
-allocate_driver(struct slot *slt, struct dev_desc *desc)
+pccard_function_enable(struct pccard_function *pf)
 {
-       struct pccard_devinfo *devi;
-       device_t pccarddev;
-       int err, irq = 0;
-       device_t child;
-       device_t *devs;
-       int count;
+       struct pccard_function *tmp;
+       int reg;
+       device_t dev = pf->sc->dev;
+
+       if (pf->cfe == NULL) {
+               DEVPRVERBOSE((dev, "No config entry could be allocated.\n"));
+               return (ENOMEM);
+       }
 
-       pccarddev = slt->dev;
-       err = device_get_children(pccarddev, &devs, &count);
-       if (err != 0)
-               return (err);
-       free(devs, M_TEMP);
-       if (count) {
-               device_printf(pccarddev,
-                   "Can not attach more than one child.\n");
-               return (EIO);
-       }
-       irq = ffs(desc->irqmask) - 1;
-       MALLOC(devi, struct pccard_devinfo *, sizeof(*devi), M_DEVBUF,
-           M_WAITOK | M_ZERO);
-       strcpy(devi->name, desc->name);
        /*
-        *      Create an entry for the device under this slot.
+        * Increase the reference count on the socket, enabling power, if
+        * necessary.
         */
-       devi->running = 1;
-       devi->slt = slt;
-       bcopy(desc->misc, devi->misc, sizeof(desc->misc));
-       strcpy(devi->manufstr, desc->manufstr);
-       strcpy(devi->versstr, desc->versstr);
-       devi->manufacturer = desc->manufacturer;
-       devi->product = desc->product;
-       devi->prodext = desc->prodext;
-       resource_list_init(&devi->resources);
-       child = device_add_child(pccarddev, devi->name, desc->unit);
-       if (child == NULL) {
-               if (desc->unit != -1)
-                       device_printf(pccarddev,
-                           "Unit %d failed for %s, try a different unit\n",
-                           desc->unit, devi->name);
-               else
-                       device_printf(pccarddev,
-                           "No units available for %s.  Impossible?\n",
-                           devi->name);
-               return (EIO);
-       }
-       device_set_flags(child, desc->flags);
-       device_set_ivars(child, devi);
-       if (bootverbose) {
-               device_printf(pccarddev, "Assigning %s:",
-                   device_get_nameunit(child));
-               if (desc->iobase)
-                       printf(" io 0x%x-0x%x",
-                           desc->iobase, desc->iobase + desc->iosize - 1);
-               if (irq)
-                       printf(" irq %d", irq);
-               if (desc->mem)
-                       printf(" mem 0x%lx-0x%lx", desc->mem,
-                           desc->mem + desc->memsize - 1);
-               printf(" flags 0x%x\n", desc->flags);
-       }
-       err = bus_set_resource(child, SYS_RES_IOPORT, 0, desc->iobase,
-           desc->iosize);
-       if (err)
-               goto err;
-       if (irq)
-               err = bus_set_resource(child, SYS_RES_IRQ, 0, irq, 1);
-       if (err)
-               goto err;
-       if (desc->memsize) {
-               err = bus_set_resource(child, SYS_RES_MEMORY, 0, desc->mem,
-                   desc->memsize);
-               if (err)
-                       goto err;
-       }
-       err = device_probe_and_attach(child);
+       pf->sc->sc_enabled_count++;
+
+       if (pf->pf_flags & PFF_ENABLED) {
+               /*
+                * Don't do anything if we're already enabled.
+                */
+               return (0);
+       }
+
        /*
-        * XXX We unwisely assume that the detach code won't run while the
-        * XXX the attach code is attaching.  Someone should put some
-        * XXX interlock code.  This can happen if probe/attach takes a while
-        * XXX and the user ejects the card, which causes the detach
-        * XXX function to be called.
+        * it's possible for different functions' CCRs to be in the same
+        * underlying page.  Check for that.
         */
-       strncpy(desc->name, device_get_nameunit(child), sizeof(desc->name));
-       desc->name[sizeof(desc->name) - 1] = '\0';
-err:
-       if (err)
-               device_delete_child(pccarddev, child);
-       return (err);
+       STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
+               if ((tmp->pf_flags & PFF_ENABLED) &&
+                   (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
+                   ((pf->ccr_base + PCCARD_CCR_SIZE) <=
+                   (tmp->ccr_base - tmp->pf_ccr_offset +
+                   tmp->pf_ccr_realsize))) {
+                       pf->pf_ccrt = tmp->pf_ccrt;
+                       pf->pf_ccrh = tmp->pf_ccrh;
+                       pf->pf_ccr_realsize = tmp->pf_ccr_realsize;
+
+                       /*
+                        * pf->pf_ccr_offset = (tmp->pf_ccr_offset -
+                        * tmp->ccr_base) + pf->ccr_base;
+                        */
+                       /* pf->pf_ccr_offset =
+                           (tmp->pf_ccr_offset + pf->ccr_base) -
+                           tmp->ccr_base; */
+                       pf->pf_ccr_window = tmp->pf_ccr_window;
+                       break;
+               }
+       }
+       if (tmp == NULL) {
+               pf->ccr_rid = 0;
+               pf->ccr_res = bus_alloc_resource(dev, SYS_RES_MEMORY,
+                   &pf->ccr_rid, 0, ~0, 1 << 10, RF_ACTIVE);
+               if (!pf->ccr_res)
+                       goto bad;
+               DEVPRINTF((dev, "ccr_res == %lx-%lx, base=%x\n",
+                   rman_get_start(pf->ccr_res), rman_get_end(pf->ccr_res),
+                   pf->ccr_base));
+               CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY,
+                   pf->ccr_rid, PCCARD_A_MEM_ATTR);
+               CARD_SET_MEMORY_OFFSET(device_get_parent(dev), dev,
+                   pf->ccr_rid, pf->ccr_base, &pf->pf_ccr_offset);
+               pf->pf_ccrt = rman_get_bustag(pf->ccr_res);
+               pf->pf_ccrh = rman_get_bushandle(pf->ccr_res);
+               pf->pf_ccr_realsize = 1;
+       }
+
+       reg = (pf->cfe->number & PCCARD_CCR_OPTION_CFINDEX);
+       reg |= PCCARD_CCR_OPTION_LEVIREQ;
+       if (pccard_mfc(pf->sc)) {
+               reg |= (PCCARD_CCR_OPTION_FUNC_ENABLE |
+                       PCCARD_CCR_OPTION_ADDR_DECODE);
+               /* PCCARD_CCR_OPTION_IRQ_ENABLE set elsewhere as needed */
+       }
+       pccard_ccr_write(pf, PCCARD_CCR_OPTION, reg);
+
+       reg = 0;
+       if ((pf->cfe->flags & PCCARD_CFE_IO16) == 0)
+               reg |= PCCARD_CCR_STATUS_IOIS8;
+       if (pf->cfe->flags & PCCARD_CFE_AUDIO)
+               reg |= PCCARD_CCR_STATUS_AUDIO;
+       pccard_ccr_write(pf, PCCARD_CCR_STATUS, reg);
+
+       pccard_ccr_write(pf, PCCARD_CCR_SOCKETCOPY, 0);
+
+       if (pccard_mfc(pf->sc)) {
+               long tmp, iosize;
+
+               tmp = pf->pf_mfc_iomax - pf->pf_mfc_iobase;
+               /* round up to nearest (2^n)-1 */
+               for (iosize = 1; iosize < tmp; iosize <<= 1)
+                       ;
+               iosize--;
+
+               pccard_ccr_write(pf, PCCARD_CCR_IOBASE0,
+                                pf->pf_mfc_iobase & 0xff);
+               pccard_ccr_write(pf, PCCARD_CCR_IOBASE1,
+                                (pf->pf_mfc_iobase >> 8) & 0xff);
+               pccard_ccr_write(pf, PCCARD_CCR_IOBASE2, 0);
+               pccard_ccr_write(pf, PCCARD_CCR_IOBASE3, 0);
+
+               pccard_ccr_write(pf, PCCARD_CCR_IOSIZE, iosize);
+       }
+
+#ifdef PCCARDDEBUG
+       if (pccard_debug) {
+               STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
+                       device_printf(tmp->sc->dev,
+                           "function %d CCR at %d offset %x: "
+                           "%x %x %x %x, %x %x %x %x, %x\n",
+                           tmp->number, tmp->pf_ccr_window,
+                           tmp->pf_ccr_offset,
+                           pccard_ccr_read(tmp, 0x00),
+                           pccard_ccr_read(tmp, 0x02),
+                           pccard_ccr_read(tmp, 0x04),
+                           pccard_ccr_read(tmp, 0x06),
+                           pccard_ccr_read(tmp, 0x0A),
+                           pccard_ccr_read(tmp, 0x0C),
+                           pccard_ccr_read(tmp, 0x0E),
+                           pccard_ccr_read(tmp, 0x10),
+                           pccard_ccr_read(tmp, 0x12));
+               }
+       }
+#endif
+       pf->pf_flags |= PFF_ENABLED;
+       return (0);
+
+ bad:
+       /*
+        * Decrement the reference count, and power down the socket, if
+        * necessary.
+        */
+       pf->sc->sc_enabled_count--;
+       DEVPRINTF((dev, "bad --enabled_count = %d\n", pf->sc->sc_enabled_count));
+
+       return (1);
 }
 
-/*
- *     card insert routine - Called from a timeout to debounce
- *     insertion events.
- */
+/* Disable PCCARD function. */
 static void
-inserted(void *arg)
+pccard_function_disable(struct pccard_function *pf)
 {
-       struct slot *slt = arg;
+       struct pccard_function *tmp;
+       device_t dev = pf->sc->dev;
+
+       if (pf->cfe == NULL)
+               panic("pccard_function_disable: function not initialized");
+
+       if ((pf->pf_flags & PFF_ENABLED) == 0) {
+               /*
+                * Don't do anything if we're already disabled.
+                */
+               return;
+       }
+
+       if (pf->intr_handler != NULL) {
+               struct pccard_ivar *devi = PCCARD_IVAR(pf->dev);
+               struct resource_list_entry *rle =
+                   resource_list_find(&devi->resources, SYS_RES_IRQ, 0);
+               BUS_TEARDOWN_INTR(dev, pf->dev, rle->res,
+                   pf->intr_handler_cookie);
+       }
 
-       slt->state = filled;
        /*
-        * Disable any pending timeouts for this slot, and explicitly
-        * power it off right now.  Then, re-enable the power using
-        * the (possibly new) power settings.
+        * it's possible for different functions' CCRs to be in the same
+        * underlying page.  Check for that.  Note we mark us as disabled
+        * first to avoid matching ourself.
         */
-       untimeout(power_off_slot, (caddr_t)slt, slt->poff_ch);
-       power_off_slot(slt);
+
+       pf->pf_flags &= ~PFF_ENABLED;
+       STAILQ_FOREACH(tmp, &pf->sc->card.pf_head, pf_list) {
+               if ((tmp->pf_flags & PFF_ENABLED) &&
+                   (pf->ccr_base >= (tmp->ccr_base - tmp->pf_ccr_offset)) &&
+                   ((pf->ccr_base + PCCARD_CCR_SIZE) <=
+                   (tmp->ccr_base - tmp->pf_ccr_offset +
+                   tmp->pf_ccr_realsize)))
+                       break;
+       }
+
+       /* Not used by anyone else; unmap the CCR. */
+       if (tmp == NULL) {
+               bus_release_resource(dev, SYS_RES_MEMORY, pf->ccr_rid,
+                   pf->ccr_res);
+               pf->ccr_res = NULL;
+       }
 
        /*
-        *      Enable 5V to the card so that the CIS can be read.  Well,
-        * enable the most natural voltage so that the CIS can be read.
+        * Decrement the reference count, and power down the socket, if
+        * necessary.
         */
-       slt->pwr.vcc = -1;
-       slt->pwr.vpp = -1;
-       slt->ctrl->power(slt);
-
-       printf("pccard: card inserted, slot %d\n", slt->slotnum);
-       pccard_insert_beep();
-       slt->ctrl->reset(slt);
+       pf->sc->sc_enabled_count--;
 }
 
 /*
- *     Card event callback. Called at splhigh to prevent
- *     device interrupts from interceding.
+ * simulate the old "probe" routine.  In the new world order, the driver
+ * needs to grab devices while in the old they were assigned to the device by
+ * the pccardd process.  These symbols are exported to the upper layers.
  */
-void
-pccard_event(struct slot *slt, enum card_event event)
+static int
+pccard_compat_do_probe(device_t bus, device_t dev)
 {
-       if (slt->insert_seq) {
-               slt->insert_seq = 0;
-               untimeout(inserted, (void *)slt, slt->insert_ch);
-       }
+       return (CARD_COMPAT_MATCH(dev));
+}
 
-       switch(event) {
-       case card_removed:
-       case card_deactivated:
-               if (slt->state == filled || slt->state == inactive) {
-                       if (event == card_removed)
-                               slt->state = empty;
-                       else
-                               slt->state = inactive;
-                       disable_slot_to(slt);
-               }
-               break;
-       case card_inserted:
-               slt->insert_seq = 1;
-               slt->insert_ch = timeout(inserted, (void *)slt, hz/4);
-               break;
-       }
+static int
+pccard_compat_do_attach(device_t bus, device_t dev)
+{
+       int err;
+
+       err = CARD_COMPAT_PROBE(dev);
+       if (err == 0)
+               err = CARD_COMPAT_ATTACH(dev);
+       return (err);
 }
 
-/*
- *     Device driver interface.
- */
-static int
-crdopen(dev_t dev, int oflags, int devtype, d_thread_t *td)
+#define PCCARD_NPORT   2
+#define PCCARD_NMEM    5
+#define PCCARD_NIRQ    1
+#define PCCARD_NDRQ    0
+
+static int
+pccard_add_children(device_t dev, int busno)
 {
-       struct slot *slt = PCCARD_DEV2SOFTC(dev);
+       /* Call parent to scan for any current children */
+       return (0);
+}
 
-       if (slt == NULL)
-               return (ENXIO);
-       if (slt->rwmem == 0)
-               slt->rwmem = MDF_ATTR;
+static int
+pccard_probe(device_t dev)
+{
+       device_set_desc(dev, "16-bit PCCard bus");
+       return (pccard_add_children(dev, device_get_unit(dev)));
+}
+
+static int
+pccard_attach(device_t dev)
+{
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+
+       sc->dev = dev;
+       sc->sc_enabled_count = 0;
+       return (bus_generic_attach(dev));
+}
+
+static int
+pccard_detach(device_t dev)
+{
+       pccard_detach_card(dev);
+       return 0;
+}
+
+static int
+pccard_suspend(device_t self)
+{
+       pccard_detach_card(self);
        return (0);
 }
 
-/*
- *     Close doesn't de-allocate any resources, since
- *     slots may be assigned to drivers already.
- */
-static int
-crdclose(dev_t dev, int fflag, int devtype, d_thread_t *td)
+static int
+pccard_resume(device_t self)
 {
        return (0);
 }
 
-/*
- *     read interface. Map memory at lseek offset,
- *     then transfer to user space.
- */
-static int
-crdread(dev_t dev, struct uio *uio, int ioflag)
-{
-       struct slot *slt = PCCARD_DEV2SOFTC(dev);
-       struct mem_desc *mp, oldmap;
-       unsigned char *p;
-       unsigned int offs;
-       int error = 0, win, count;
-
-       if (slt == 0 || slt->state != filled)
-               return (ENXIO);
-       if (pccard_mem == 0)
-               return (ENOMEM);
-       for (win = slt->ctrl->maxmem - 1; win >= 0; win--)
-               if ((slt->mem[win].flags & MDF_ACTIVE) == 0)
-                       break;
-       if (win < 0)
-               return (EBUSY);
-       mp = &slt->mem[win];
-       oldmap = *mp;
-       mp->flags = slt->rwmem | MDF_ACTIVE;
-       while (uio->uio_resid && error == 0) {
-               mp->card = uio->uio_offset;
-               mp->size = PCCARD_MEMSIZE;
-               mp->start = (caddr_t)(void *)(uintptr_t)pccard_mem;
-               if ((error = slt->ctrl->mapmem(slt, win)) != 0)
+static void
+pccard_print_resources(struct resource_list *rl, const char *name, int type,
+    int count, const char *format)
+{
+       struct resource_list_entry *rle;
+       int printed;
+       int i;
+
+       printed = 0;
+       for (i = 0; i < count; i++) {
+               rle = resource_list_find(rl, type, i);
+               if (rle != NULL) {
+                       if (printed == 0)
+                               printf(" %s ", name);
+                       else if (printed > 0)
+                               printf(",");
+                       printed++;
+                       printf(format, rle->start);
+                       if (rle->count > 1) {
+                               printf("-");
+                               printf(format, rle->start + rle->count - 1);
+                       }
+               } else if (i > 3) {
+                       /* check the first few regardless */
                        break;
-               offs = (unsigned int)uio->uio_offset & (PCCARD_MEMSIZE - 1);
-               p = pccard_kmem + offs;
-               count = MIN(PCCARD_MEMSIZE - offs, uio->uio_resid);
-               error = uiomove(p, count, uio);
+               }
        }
-       /*
-        *      Restore original map.
-        */
-       *mp = oldmap;
-       slt->ctrl->mapmem(slt, win);
-
-       return (error);
 }
 
-/*
- *     crdwrite - Write data to card memory.
- *     Handles wrap around so that only one memory
- *     window is used.
- */
-static int
-crdwrite(dev_t dev, struct uio *uio, int ioflag)
-{
-       struct slot *slt = PCCARD_DEV2SOFTC(dev);
-       struct mem_desc *mp, oldmap;
-       unsigned char *p;
-       unsigned int offs;
-       int error = 0, win, count;
-
-       if (slt == 0 || slt->state != filled)
-               return (ENXIO);
-       if (pccard_mem == 0)
-               return (ENOMEM);
-       for (win = slt->ctrl->maxmem - 1; win >= 0; win--)
-               if ((slt->mem[win].flags & MDF_ACTIVE) == 0)
-                       break;
-       if (win < 0)
-               return (EBUSY);
-       mp = &slt->mem[win];
-       oldmap = *mp;
-       mp->flags = slt->rwmem | MDF_ACTIVE;
-       while (uio->uio_resid && error == 0) {
-               mp->card = uio->uio_offset;
-               mp->size = PCCARD_MEMSIZE;
-               mp->start = (caddr_t)(void *)(uintptr_t)pccard_mem;
-               if ((error = slt->ctrl->mapmem(slt, win)) != 0)
-                       break;
-               offs = (unsigned int)uio->uio_offset & (PCCARD_MEMSIZE - 1);
-               p = pccard_kmem + offs;
-               count = MIN(PCCARD_MEMSIZE - offs, uio->uio_resid);
-               error = uiomove(p, count, uio);
+static int
+pccard_print_child(device_t dev, device_t child)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct resource_list *rl = &devi->resources;
+       int retval = 0;
+
+       retval += bus_print_child_header(dev, child);
+       retval += printf(" at");
+
+       if (devi != NULL) {
+               pccard_print_resources(rl, "port", SYS_RES_IOPORT,
+                   PCCARD_NPORT, "%#lx");
+               pccard_print_resources(rl, "iomem", SYS_RES_MEMORY,
+                   PCCARD_NMEM, "%#lx");
+               pccard_print_resources(rl, "irq", SYS_RES_IRQ, PCCARD_NIRQ,
+                   "%ld");
+               pccard_print_resources(rl, "drq", SYS_RES_DRQ, PCCARD_NDRQ,
+                   "%ld");
+               retval += printf(" function %d config %d", devi->fcn->number,
+                   devi->fcn->cfe->number);
        }
-       /*
-        *      Restore original map.
-        */
-       *mp = oldmap;
-       slt->ctrl->mapmem(slt, win);
 
-       return (error);
+       retval += bus_print_child_footer(dev, child);
+
+       return (retval);
 }
 
-/*
- *     ioctl calls - allows setting/getting of memory and I/O
- *     descriptors, and assignment of drivers.
- */
-static int
-crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td)
+static int
+pccard_set_resource(device_t dev, device_t child, int type, int rid,
+                u_long start, u_long count)
 {
-       u_int32_t       addr;
-       int             err;
-       struct io_desc  *ip;
-       struct mem_desc *mp;
-       device_t        pccarddev;
-       int             pwval;
-       int             s;
-       struct slot     *slt = PCCARD_DEV2SOFTC(dev);
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct resource_list *rl = &devi->resources;
 
-       if (slt == 0 && cmd != PIOCRWMEM)
-               return (ENXIO);
+       if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY
+           && type != SYS_RES_IRQ && type != SYS_RES_DRQ)
+               return (EINVAL);
+       if (rid < 0)
+               return (EINVAL);
+       if (type == SYS_RES_IOPORT && rid >= PCCARD_NPORT)
+               return (EINVAL);
+       if (type == SYS_RES_MEMORY && rid >= PCCARD_NMEM)
+               return (EINVAL);
+       if (type == SYS_RES_IRQ && rid >= PCCARD_NIRQ)
+               return (EINVAL);
+       if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ)
+               return (EINVAL);
 
-       KKASSERT(td->td_proc != NULL);
+       resource_list_add(rl, type, rid, start, start + count - 1, count);
+       if (NULL != resource_list_alloc(rl, device_get_parent(dev), dev,
+           type, &rid, start, start + count - 1, count, 0))
+               return 0;
+       else
+               return ENOMEM;
+}
 
-       switch(cmd) {
+static int
+pccard_get_resource(device_t dev, device_t child, int type, int rid,
+    u_long *startp, u_long *countp)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct resource_list *rl = &devi->resources;
+       struct resource_list_entry *rle;
+
+       rle = resource_list_find(rl, type, rid);
+       if (rle == NULL)
+               return (ENOENT);
+
+       if (startp != NULL)
+               *startp = rle->start;
+       if (countp != NULL)
+               *countp = rle->count;
+
+       return (0);
+}
+
+static void
+pccard_delete_resource(device_t dev, device_t child, int type, int rid)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct resource_list *rl = &devi->resources;
+       resource_list_delete(rl, type, rid);
+}
+
+static int
+pccard_set_res_flags(device_t dev, device_t child, int type, int rid,
+    u_int32_t flags)
+{
+       return (CARD_SET_RES_FLAGS(device_get_parent(dev), child, type,
+           rid, flags));
+}
+
+static int
+pccard_set_memory_offset(device_t dev, device_t child, int rid,
+    u_int32_t offset, u_int32_t *deltap)
+
+{
+       return (CARD_SET_MEMORY_OFFSET(device_get_parent(dev), child, rid,
+           offset, deltap));
+}
+
+static void
+pccard_probe_nomatch(device_t bus, device_t child)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct pccard_function *func = devi->fcn;
+       struct pccard_softc *sc = PCCARD_SOFTC(bus);
+
+       device_printf(bus, "<unknown card>");
+       printf(" (manufacturer=0x%04x, product=0x%04x) at function %d\n",
+         sc->card.manufacturer, sc->card.product, func->number);
+       device_printf(bus, "   CIS info: %s, %s, %s\n", sc->card.cis1_info[0],
+         sc->card.cis1_info[1], sc->card.cis1_info[2]);
+       return;
+}
+
+static int
+pccard_child_location_str(device_t bus, device_t child, char *buf,
+    size_t buflen)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct pccard_function *func = devi->fcn;
+
+       snprintf(buf, buflen, "function=%d", func->number);
+       return (0);
+}
+
+static int
+pccard_child_pnpinfo_str(device_t bus, device_t child, char *buf,
+    size_t buflen)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct pccard_function *func = devi->fcn;
+       struct pccard_softc *sc = PCCARD_SOFTC(bus);
+
+       snprintf(buf, buflen, "manufacturer=0x%04x product=0x%04x "
+           "cisvendor=\"%s\" cisproduct=\"%s\" function_type=%d",
+           sc->card.manufacturer, sc->card.product, sc->card.cis1_info[0],
+           sc->card.cis1_info[1], func->function);
+       return (0);
+}
+
+static int
+pccard_read_ivar(device_t bus, device_t child, int which, u_char *result)
+{
+       struct pccard_ivar *devi = PCCARD_IVAR(child);
+       struct pccard_function *func = devi->fcn;
+       struct pccard_softc *sc = PCCARD_SOFTC(bus);
+
+       switch (which) {
        default:
-               if (slt->ctrl->ioctl)
-                       return (slt->ctrl->ioctl(slt, cmd, data));
-               return (ENOTTY);
-       /*
-        * Get slot state.
-        */
-       case PIOCGSTATE:
-               s = splhigh();
-               ((struct slotstate *)data)->state = slt->state;
-               ((struct slotstate *)data)->laststate = slt->laststate;
-               slt->laststate = slt->state;
-               splx(s);
-               ((struct slotstate *)data)->maxmem = slt->ctrl->maxmem;
-               ((struct slotstate *)data)->maxio = slt->ctrl->maxio;
-               ((struct slotstate *)data)->irqs = 0;
+       case PCCARD_IVAR_ETHADDR:
+               bcopy(func->pf_funce_lan_nid, result, ETHER_ADDR_LEN);
                break;
-       /*
-        * Get memory context.
-        */
-       case PIOCGMEM:
-               s = ((struct mem_desc *)data)->window;
-               if (s < 0 || s >= slt->ctrl->maxmem)
-                       return (EINVAL);
-               mp = &slt->mem[s];
-               ((struct mem_desc *)data)->flags = mp->flags;
-               ((struct mem_desc *)data)->start = mp->start;
-               ((struct mem_desc *)data)->size = mp->size;
-               ((struct mem_desc *)data)->card = mp->card;
+       case PCCARD_IVAR_VENDOR:
+               *(u_int32_t *) result = sc->card.manufacturer;
                break;
-       /*
-        * Set memory context. If context already active, then unmap it.
-        * It is hard to see how the parameters can be checked.
-        * At the very least, we only allow root to set the context.
-        */
-       case PIOCSMEM:
-               if (suser(td))
-                       return (EPERM);
-               if (slt->state != filled)
-                       return (ENXIO);
-               s = ((struct mem_desc *)data)->window;
-               if (s < 0 || s >= slt->ctrl->maxmem)
-                       return (EINVAL);
-               slt->mem[s] = *((struct mem_desc *)data);
-               return (slt->ctrl->mapmem(slt, s));
-       /*
-        * Get I/O port context.
-        */
-       case PIOCGIO:
-               s = ((struct io_desc *)data)->window;
-               if (s < 0 || s >= slt->ctrl->maxio)
-                       return (EINVAL);
-               ip = &slt->io[s];
-               ((struct io_desc *)data)->flags = ip->flags;
-               ((struct io_desc *)data)->start = ip->start;
-               ((struct io_desc *)data)->size = ip->size;
+       case PCCARD_IVAR_PRODUCT:
+               *(u_int32_t *) result = sc->card.product;
                break;
-       /*
-        * Set I/O port context.
-        */
-       case PIOCSIO:
-               if (suser(td))
-                       return (EPERM);
-               if (slt->state != filled)
-                       return (ENXIO);
-               s = ((struct io_desc *)data)->window;
-               if (s < 0 || s >= slt->ctrl->maxio)
-                       return (EINVAL);
-               slt->io[s] = *((struct io_desc *)data);
-               /* XXX Don't actually map */
-               return (0);
+       case PCCARD_IVAR_PRODEXT:
+               *(u_int16_t *) result = sc->card.prodext;
                break;
-       /*
-        * Set memory window flags for read/write interface.
-        */
-       case PIOCRWFLAG:
-               slt->rwmem = *(int *)data;
+       case PCCARD_IVAR_FUNCTION:
+               *(u_int32_t *) result = func->function;
                break;
-       /*
-        * Set the memory window to be used for the read/write interface.
-        */
-       case PIOCRWMEM:
-               if (*(unsigned long *)data == 0) {
-                       *(unsigned long *)data = pccard_mem;
-                       break;
+       case PCCARD_IVAR_FUNCTION_NUMBER:
+               if (!func) {
+                       device_printf(bus, "No function number, bug!\n");
+                       return (ENOENT);
                }
-               if (suser(td))
-                       return (EPERM);
-               /*
-                * Validate the memory by checking it against the I/O
-                * memory range. It must also start on an aligned block size.
-                */
-               if (*(unsigned long *)data & (PCCARD_MEMSIZE-1))
-                       return (EINVAL);
-               pccarddev = PCCARD_DEV2SOFTC(dev)->dev;
-               pccard_mem_rid = 0;
-               addr = *(unsigned long *)data;
-               if (pccard_mem_res)
-                       bus_release_resource(pccarddev, SYS_RES_MEMORY,
-                           pccard_mem_rid, pccard_mem_res);
-               pccard_mem_res = bus_alloc_resource(pccarddev, SYS_RES_MEMORY,
-                   &pccard_mem_rid, addr, addr, PCCARD_MEMSIZE,
-                   RF_ACTIVE | rman_make_alignment_flags(PCCARD_MEMSIZE));
-               if (pccard_mem_res == NULL)
-                       return (EINVAL);
-               pccard_mem = rman_get_start(pccard_mem_res);
-               pccard_kmem = rman_get_virtual(pccard_mem_res);
+               *(u_int32_t *) result = func->number;
                break;
-       /*
-        * Set power values.
-        */
-       case PIOCSPOW:
-               slt->pwr = *(struct power *)data;
-               return (slt->ctrl->power(slt));
-       /*
-        * Allocate a driver to this slot.
-        */
-       case PIOCSDRV:
-               if (suser(td))
-                       return (EPERM);
-               err = allocate_driver(slt, (struct dev_desc *)data);
-               if (!err)
-                       pccard_success_beep();
-               else
-                       pccard_failure_beep();
-               return (err);
-       /*
-        * Virtual removal/insertion
-        */
-       case PIOCSVIR:
-               pwval = *(int *)data;
-               if (!pwval) {
-                       if (slt->state != filled)
-                               return (EINVAL);
-                       pccard_event(slt, card_deactivated);
-               } else {
-                       if (slt->state != empty && slt->state != inactive)
-                               return (EINVAL);
-                       pccard_event(slt, card_inserted);
-               }
+       case PCCARD_IVAR_VENDOR_STR:
+               *(char **) result = sc->card.cis1_info[0];
                break;
-       case PIOCSBEEP:
-               if (pccard_beep_select(*(int *)data)) {
-                       return (EINVAL);
-               }
+       case PCCARD_IVAR_PRODUCT_STR:
+               *(char **) result = sc->card.cis1_info[1];
+               break;
+       case PCCARD_IVAR_CIS3_STR:
+               *(char **) result = sc->card.cis1_info[2];
+               break;
+       case PCCARD_IVAR_CIS4_STR:
+               *(char **) result = sc->card.cis1_info[3];
                break;
        }
        return (0);
 }
 
-/*
- *     poll - Poll on exceptions will return true
- *     when a change in card status occurs.
- */
-static int
-crdpoll(dev_t dev, int events, d_thread_t *td)
+static void
+pccard_driver_added(device_t dev, driver_t *driver)
 {
-       int     revents = 0;
-       int     s;
-       struct slot *slt = PCCARD_DEV2SOFTC(dev);
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_function *pf;
+       device_t child;
 
-       if (events & (POLLIN | POLLRDNORM))
-               revents |= events & (POLLIN | POLLRDNORM);
+       STAILQ_FOREACH(pf, &sc->card.pf_head, pf_list) {
+               if (STAILQ_EMPTY(&pf->cfe_head))
+                       continue;
+               child = pf->dev;
+               if (device_get_state(child) != DS_NOTPRESENT)
+                       continue;
+               if (pccard_function_enable(pf) == 0 &&
+                   device_probe_and_attach(child) == 0) {
+                       DEVPRINTF((sc->dev, "function %d CCR at %d "
+                           "offset %x: %x %x %x %x, %x %x %x %x, %x\n",
+                           pf->number, pf->pf_ccr_window, pf->pf_ccr_offset,
+                           pccard_ccr_read(pf, 0x00),
+                       pccard_ccr_read(pf, 0x02), pccard_ccr_read(pf, 0x04),
+                       pccard_ccr_read(pf, 0x06), pccard_ccr_read(pf, 0x0A),
+                       pccard_ccr_read(pf, 0x0C), pccard_ccr_read(pf, 0x0E),
+                       pccard_ccr_read(pf, 0x10), pccard_ccr_read(pf, 0x12)));
+               } else {
+                       if (pf->cfe != NULL)
+                               pccard_function_disable(pf);
+               }
+       }
+       return;
+}
 
-       if (events & (POLLOUT | POLLWRNORM))
-               revents |= events & (POLLIN | POLLRDNORM);
+static struct resource *
+pccard_alloc_resource(device_t dev, device_t child, int type, int *rid,
+    u_long start, u_long end, u_long count, u_int flags)
+{
+       struct pccard_ivar *dinfo;
+       struct resource_list_entry *rle = 0;
+       int passthrough = (device_get_parent(child) != dev);
+       struct resource *r = NULL;
 
-       s = splhigh();
-       /*
-        *      select for exception - card event.
-        */
-       if (events & POLLRDBAND)
-               if (slt == 0 || slt->laststate != slt->state)
-                       revents |= POLLRDBAND;
+       if (passthrough) {
+               return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child,
+                   type, rid, start, end, count, flags));
+       }
 
-       if (revents == 0)
-               selrecord(td, &slt->selp);
+       dinfo = device_get_ivars(child);
+       rle = resource_list_find(&dinfo->resources, type, *rid);
 
-       splx(s);
-       return (revents);
+       if (rle == NULL)
+               return (NULL);          /* no resource of that type/rid */
+
+       if (rle->res == NULL) {
+               switch(type) {
+               case SYS_RES_IOPORT:
+                       r = bus_alloc_resource(dev, type, rid, start, end,
+                           count, rman_make_alignment_flags(count));
+                       if (r == NULL)
+                               goto bad;
+                       resource_list_add(&dinfo->resources, type, *rid,
+                           rman_get_start(r), rman_get_end(r), count);
+                       rle = resource_list_find(&dinfo->resources, type, *rid);
+                       if (!rle)
+                               goto bad;
+                       rle->res = r;
+                       break;
+               case SYS_RES_MEMORY:
+                       break;
+               case SYS_RES_IRQ:
+                       break;
+               }
+               return (rle->res);
+       }
+       if (rle->res->r_dev != dev)
+               return (NULL);
+       bus_release_resource(dev, type, *rid, rle->res);
+       rle->res = NULL;
+       switch(type) {
+       case SYS_RES_IOPORT:
+       case SYS_RES_MEMORY:
+               if (!(flags & RF_ALIGNMENT_MASK))
+                       flags |= rman_make_alignment_flags(rle->count);
+               break;
+       case SYS_RES_IRQ:
+               flags |= RF_SHAREABLE;
+               break;
+       }
+       rle->res = resource_list_alloc(&dinfo->resources, dev, child,
+           type, rid, rle->start, rle->end, rle->count, flags);
+       return (rle->res);
+bad:;
+       device_printf(dev, "WARNING: Resource not reserved by pccard\n");
+       return (NULL);
 }
 
-/*
- *     APM hooks for suspending and resuming.
- */
-int
-pccard_suspend(device_t dev)
+static int
+pccard_release_resource(device_t dev, device_t child, int type, int rid,
+    struct resource *r)
 {
-       struct slot *slt = PCCARD_DEVICE2SOFTC(dev);
+       struct pccard_ivar *dinfo;
+       int passthrough = (device_get_parent(child) != dev);
+       struct resource_list_entry *rle = 0;
+       int ret;
+       int flags;
 
-       /* This code stolen from pccard_event:card_removed */
-       if (slt->state == filled) {
-               int s = splhigh();              /* nop on current */
-               disable_slot(slt);
-               slt->laststate = suspend;       /* for pccardd */
-               slt->state = empty;
-               splx(s);
-               printf("pccard: card disabled, slot %d\n", slt->slotnum);
+       if (passthrough)
+               return BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
+                   type, rid, r);
+
+       dinfo = device_get_ivars(child);
+
+       rle = resource_list_find(&dinfo->resources, type, rid);
+
+       if (!rle) {
+               device_printf(dev, "Allocated resource not found, "
+                   "%d %x %lx %lx\n",
+                   type, rid, rman_get_start(r), rman_get_size(r));
+               return ENOENT;
+       }
+       if (!rle->res) {
+               device_printf(dev, "Allocated resource not recorded\n");
+               return ENOENT;
+       }
+
+       ret = BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
+           type, rid, r);
+       switch(type) {
+       case SYS_RES_IOPORT:
+       case SYS_RES_MEMORY:
+               flags = rman_make_alignment_flags(rle->count);
+               break;
+       case SYS_RES_IRQ:
+               flags = RF_SHAREABLE;
+               break;
+       default:
+               flags = 0;
        }
+       rle->res = bus_alloc_resource(dev, type, &rid,
+           rle->start, rle->end, rle->count, flags);
+       if (rle->res == NULL)
+               device_printf(dev, "release_resource: "
+                   "unable to reaquire resource\n");
+       return ret;
+}
+
+static void
+pccard_child_detached(device_t parent, device_t dev)
+{
+       struct pccard_ivar *ivar = PCCARD_IVAR(dev);
+       struct pccard_function *pf = ivar->fcn;
+
+       pccard_function_disable(pf);
+}
+
+static void
+pccard_intr(void *arg)
+{
+       struct pccard_function *pf = (struct pccard_function*) arg;
+       int reg;
+       int doisr = 1;
+
        /*
-        * Disable any pending timeouts for this slot since we're
-        * powering it down/disabling now.
+        * MFC cards know if they interrupted, so we have to ack the
+        * interrupt and call the ISR.  Non-MFC cards don't have these
+        * bits, so they always get called.  Many non-MFC cards have
+        * this bit set always upon read, but some do not.
+        *
+        * We always ack the interrupt, even if there's no ISR
+        * for the card.  This is done on the theory that acking
+        * the interrupt will pacify the card enough to keep an
+        * interrupt storm from happening.  Of course this won't
+        * help in the non-MFC case.
         */
-       untimeout(power_off_slot, (caddr_t)slt, slt->poff_ch);
-       slt->ctrl->disable(slt);
-       return (0);
+       if (pccard_mfc(pf->sc)) {
+               reg = pccard_ccr_read(pf, PCCARD_CCR_STATUS);
+               if (reg & PCCARD_CCR_STATUS_INTR)
+                       pccard_ccr_write(pf, PCCARD_CCR_STATUS,
+                           reg & ~PCCARD_CCR_STATUS_INTR);
+               else
+                       doisr = 0;
+       }
+       if (pf->intr_handler != NULL && doisr)
+               pf->intr_handler(pf->intr_handler_arg);
 }
 
-int
-pccard_resume(device_t dev)
+static int
+pccard_setup_intr(device_t dev, device_t child, struct resource *irq,
+    int flags, driver_intr_t *intr, void *arg, void **cookiep)
 {
-       struct slot *slt = PCCARD_DEVICE2SOFTC(dev);
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_ivar *ivar = PCCARD_IVAR(child);
+       struct pccard_function *func = ivar->fcn;
+       int err;
 
-       slt->ctrl->resume(slt);
+       if (func->intr_handler != NULL)
+               panic("Only one interrupt handler per function allowed");
+       err = bus_generic_setup_intr(dev, child, irq, flags, pccard_intr,
+           func, cookiep);
+       if (err != 0)
+               return (err);
+       func->intr_handler = intr;
+       func->intr_handler_arg = arg;
+       func->intr_handler_cookie = *cookiep;
+       if (pccard_mfc(sc)) {
+               pccard_ccr_write(func, PCCARD_CCR_OPTION,
+                   pccard_ccr_read(func, PCCARD_CCR_OPTION) |
+                   PCCARD_CCR_OPTION_IREQ_ENABLE);
+       }
        return (0);
 }
+
+static int
+pccard_teardown_intr(device_t dev, device_t child, struct resource *r,
+    void *cookie)
+{
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
+       struct pccard_ivar *ivar = PCCARD_IVAR(child);
+       struct pccard_function *func = ivar->fcn;
+       int ret;
+
+       if (pccard_mfc(sc)) {
+               pccard_ccr_write(func, PCCARD_CCR_OPTION,
+                   pccard_ccr_read(func, PCCARD_CCR_OPTION) &
+                   ~PCCARD_CCR_OPTION_IREQ_ENABLE);
+       }
+       ret = bus_generic_teardown_intr(dev, child, r, cookie);
+       if (ret == 0) {
+               func->intr_handler = NULL;
+               func->intr_handler_arg = NULL;
+               func->intr_handler_cookie = NULL;
+       }
+
+       return (ret);
+}
+
+static device_method_t pccard_methods[] = {
+       /* Device interface */
+       DEVMETHOD(device_probe,         pccard_probe),
+       DEVMETHOD(device_attach,        pccard_attach),
+       DEVMETHOD(device_detach,        pccard_detach),
+       DEVMETHOD(device_shutdown,      bus_generic_shutdown),
+       DEVMETHOD(device_suspend,       pccard_suspend),
+       DEVMETHOD(device_resume,        pccard_resume),
+
+       /* Bus interface */
+       DEVMETHOD(bus_print_child,      pccard_print_child),
+       DEVMETHOD(bus_driver_added,     pccard_driver_added),
+       DEVMETHOD(bus_child_detached,   pccard_child_detached),
+       DEVMETHOD(bus_alloc_resource,   pccard_alloc_resource),
+       DEVMETHOD(bus_release_resource, pccard_release_resource),
+       DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
+       DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
+       DEVMETHOD(bus_setup_intr,       pccard_setup_intr),
+       DEVMETHOD(bus_teardown_intr,    pccard_teardown_intr),
+       DEVMETHOD(bus_set_resource,     pccard_set_resource),
+       DEVMETHOD(bus_get_resource,     pccard_get_resource),
+       DEVMETHOD(bus_delete_resource,  pccard_delete_resource),
+       DEVMETHOD(bus_probe_nomatch,    pccard_probe_nomatch),
+       DEVMETHOD(bus_read_ivar,        pccard_read_ivar),
+       DEVMETHOD(bus_child_pnpinfo_str, pccard_child_pnpinfo_str),
+       DEVMETHOD(bus_child_location_str, pccard_child_location_str),
+
+       /* Card Interface */
+       DEVMETHOD(card_set_res_flags,   pccard_set_res_flags),
+       DEVMETHOD(card_set_memory_offset, pccard_set_memory_offset),
+       DEVMETHOD(card_get_type,        pccard_card_gettype),
+       DEVMETHOD(card_attach_card,     pccard_attach_card),
+       DEVMETHOD(card_detach_card,     pccard_detach_card),
+       DEVMETHOD(card_compat_do_probe, pccard_compat_do_probe),
+       DEVMETHOD(card_compat_do_attach, pccard_compat_do_attach),
+       DEVMETHOD(card_do_product_lookup, pccard_do_product_lookup),
+
+       { 0, 0 }
+};
+
+static driver_t pccard_driver = {
+       "pccard",
+       pccard_methods,
+       sizeof(struct pccard_softc)
+};
+
+devclass_t     pccard_devclass;
+
+/* Maybe we need to have a slot device? */
+DRIVER_MODULE(pccard, pcic, pccard_driver, pccard_devclass, 0, 0);
+DRIVER_MODULE(pccard, pc98pcic, pccard_driver, pccard_devclass, 0, 0);
+DRIVER_MODULE(pccard, cbb, pccard_driver, pccard_devclass, 0, 0);
+DRIVER_MODULE(pccard, tcic, pccard_driver, pccard_devclass, 0, 0);
+MODULE_VERSION(pccard, 1);
+/*MODULE_DEPEND(pccard, pcic, 1, 1, 1);*/
similarity index 87%
rename from sys/dev/misc/pccard/pccard_cis.c
rename to sys/bus/pccard/pccard_cis.c
index 089bc22..e4773db 100644 (file)
@@ -1,3 +1,7 @@
+/* $NetBSD: pcmcia_cis.c,v 1.17 2000/02/10 09:01:52 chopps Exp $ */
+/* $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.23 2002/11/14 14:02:32 mux Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccard_cis.c,v 1.1 2004/02/10 07:55:45 joerg Exp $ */
+
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
  *
  * 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.
- *
- * $NetBSD: pcmcia_cis.c,v 1.10 1998/12/29 09:03:15 marc Exp $
- * $FreeBSD: src/sys/dev/pccard/pccard_cis.c,v 1.5.2.1 2000/05/23 03:56:59 imp Exp $
- * $DragonFly: src/sys/dev/misc/pccard/Attic/pccard_cis.c,v 1.3 2003/08/15 08:32:29 dillon Exp $
  */
 
 #include <sys/param.h>
 
 #include "card_if.h"
 
+extern int     pccard_cis_debug;
+
 #define PCCARDCISDEBUG
 #ifdef PCCARDCISDEBUG
-int    pccardcis_debug = 1;
-#define        DPRINTF(arg) if (pccardcis_debug) printf arg
-#define        DEVPRINTF(arg) if (pccardcis_debug) device_printf arg
+#define        DPRINTF(arg) if (pccard_cis_debug) printf arg
+#define        DEVPRINTF(arg) if (pccard_cis_debug) device_printf arg
 #else
 #define        DPRINTF(arg)
 #define        DEVPRINTF(arg)
@@ -71,14 +72,14 @@ struct cis_state {
 };
 
 int    pccard_parse_cis_tuple(struct pccard_tuple *, void *);
+static int decode_funce(struct pccard_tuple *, struct pccard_function *);
 
 void
 pccard_read_cis(struct pccard_softc *sc)
 {
        struct cis_state state;
 
-       state.count = 0;
-       state.gotmfc = 0;
+       bzero(&state, sizeof state);
 
        state.card = &sc->card;
 
@@ -89,14 +90,12 @@ pccard_read_cis(struct pccard_softc *sc)
        state.card->cis1_info[1] = NULL;
        state.card->cis1_info[2] = NULL;
        state.card->cis1_info[3] = NULL;
-       state.card->manufacturer = PCCARD_VENDOR_INVALID;
-       state.card->product = PCCARD_PRODUCT_INVALID;
+       state.card->manufacturer = PCMCIA_VENDOR_INVALID;
+       state.card->product = PCMCIA_PRODUCT_INVALID;
        STAILQ_INIT(&state.card->pf_head);
 
        state.pf = NULL;
 
-printf("Calling scan_cis\n");
-
        if (pccard_scan_cis(sc->dev, pccard_parse_cis_tuple,
            &state) == -1)
                state.card->error++;
@@ -170,7 +169,6 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                        ret = 1;
                                        goto done;
                                }
-                               ret = 1; goto done; /* XXX IMP XXX */
                                tuple.ptr++;
                                break;
                        }
@@ -210,7 +208,7 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                        u_int cksum, sum;
                                        int i;
 
-                                       *((u_int16_t *) & offset) =
+                                       offset = (uint16_t)
                                            pccard_tuple_read_2(&tuple, 0);
                                        length = pccard_tuple_read_2(&tuple, 2);
                                        cksum = pccard_tuple_read_1(&tuple, 4);
@@ -226,9 +224,8 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                         * distant regions
                                         */
                                        if ((addr >= PCCARD_CIS_SIZE) ||
-                                           ((addr + length) < 0) ||
                                            ((addr + length) >=
-                                             PCCARD_CIS_SIZE)) {
+                                           PCCARD_CIS_SIZE)) {
                                                DPRINTF((" skipped, "
                                                    "too distant\n"));
                                                break;
@@ -262,17 +259,50 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                            "short %d\n", tuple.length));
                                        break;
                                }
+                               if (((tuple.length - 1) % 5) != 0) {
+                                       DPRINTF(("CISTPL_LONGLINK_MFC bogus "
+                                           "length %d\n", tuple.length));
+                                       break;
+                               }
                                /*
                                 * this is kind of ad hoc, as I don't have
                                 * any real documentation
                                 */
                                {
-                                       int i;
+                                       int i, tmp_count;
 
-                                       mfc_count =
+                                       /*
+                                        * put count into tmp var so that
+                                        * if we have to bail (because it's
+                                        * a bogus count) it won't be
+                                        * remembered for later use.
+                                        */
+                                       tmp_count =
                                            pccard_tuple_read_1(&tuple, 0);
+
                                        DPRINTF(("CISTPL_LONGLINK_MFC %d",
-                                           mfc_count));
+                                           tmp_count));
+
+                                       /*
+                                        * make _sure_ it's the right size;
+                                        * if too short, it may be a weird
+                                        * (unknown/undefined) format
+                                        */
+                                       if (tuple.length != (tmp_count*5 + 1)) {
+                                               DPRINTF((" bogus length %d\n",
+                                                   tuple.length));
+                                               break;
+                                       }
+                                       /*
+                                        * sanity check for a programming
+                                        * error which is difficult to find
+                                        * when debugging.
+                                        */
+                                       if (tmp_count >
+                                           howmany(sizeof mfc, sizeof mfc[0]))
+                                               panic("CISTPL_LONGLINK_MFC mfc "
+                                                   "count would blow stack");
+                                        mfc_count = tmp_count;
                                        for (i = 0; i < mfc_count; i++) {
                                                mfc[i].common =
                                                    (pccard_tuple_read_1(&tuple,
@@ -316,6 +346,7 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                        if ((i % 16) == 13)
                                                DPRINTF(("\n"));
                                }
+
                                if ((i % 16) != 14)
                                        DPRINTF(("\n"));
                        }
@@ -324,10 +355,6 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                        tuple.ptr += 2 + tuple.length;
                }
 
-#ifdef XXX     /* I'm not up to this tonight, need to implement new API */
-               /* to deal with moving windows and such.  At least that's */
-               /* what it appears at this instant */
-
                /*
                 * the chain is done.  Clean up and move onto the next one,
                 * if any.  The loop is here in the case that there is an MFC
@@ -337,53 +364,26 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                 */
 
                while (1) {
-                       pccard_chip_mem_unmap(pct, pch, window);
-
                        if (longlink_present) {
-                               /*
-                                * if the longlink is to attribute memory,
-                                * then it is unindexed.  That is, if the
-                                * link value is 0x100, then the actual
-                                * memory address is 0x200.  This means that
-                                * we need to multiply by 2 before calling
-                                * mem_map, and then divide the resulting ptr
-                                * by 2 after.
-                                */
-
-                               if (!longlink_common)
-                                       longlink_addr *= 2;
-
-                               pccard_chip_mem_map(pct, pch, longlink_common ?
-                                   PCCARD_MEM_COMMON : PCCARD_MEM_ATTR,
-                                   longlink_addr, PCCARD_CIS_SIZE,
-                                   &pcmh, &tuple.ptr, &window);
-
-                               if (!longlink_common)
-                                       tuple.ptr /= 2;
+                               CARD_SET_RES_FLAGS(device_get_parent(dev), dev,
+                                   SYS_RES_MEMORY, rid, longlink_common ?
+                                   PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR);
                                DPRINTF(("cis mem map %x\n",
                                    (unsigned int) tuple.memh));
                                tuple.mult = longlink_common ? 1 : 2;
+                               tuple.ptr = longlink_addr;
                                longlink_present = 0;
                                longlink_common = 1;
                                longlink_addr = 0;
                        } else if (mfc_count && (mfc_index < mfc_count)) {
-                               if (!mfc[mfc_index].common)
-                                       mfc[mfc_index].addr *= 2;
-
-                               pccard_chip_mem_map(pct, pch,
-                                   mfc[mfc_index].common ?
-                                   PCCARD_MEM_COMMON : PCCARD_MEM_ATTR,
-                                   mfc[mfc_index].addr, PCCARD_CIS_SIZE,
-                                   &pcmh, &tuple.ptr, &window);
-
-                               if (!mfc[mfc_index].common)
-                                       tuple.ptr /= 2;
+                               CARD_SET_RES_FLAGS(device_get_parent(dev), dev,
+                                   SYS_RES_MEMORY, rid, mfc[mfc_index].common
+                                   ? PCCARD_A_MEM_COM : PCCARD_A_MEM_ATTR);
                                DPRINTF(("cis mem map %x\n",
                                    (unsigned int) tuple.memh));
                                /* set parse state, and point at the next one */
-
                                tuple.mult = mfc[mfc_index].common ? 1 : 2;
-
+                               tuple.ptr = mfc[mfc_index].addr;
                                mfc_index++;
                        } else {
                                goto done;
@@ -413,10 +413,8 @@ pccard_scan_cis(device_t dev, int (*fct)(struct pccard_tuple *, void *),
                                continue;
                        }
                        tuple.ptr += 2 + tuple.length;
-
                        break;
                }
-#endif /* XXX */
        }
 
 done:
@@ -430,7 +428,7 @@ done:
 void
 pccard_print_cis(device_t dev)
 {
-       struct pccard_softc *sc = (struct pccard_softc *) device_get_softc(dev);
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
        struct pccard_card *card = &sc->card;
        struct pccard_function *pf;
        struct pccard_config_entry *cfe;
@@ -506,7 +504,7 @@ pccard_print_cis(device_t dev)
                        break;
                }
 
-               printf(", ccr addr %lx mask %lx\n", pf->ccr_base, pf->ccr_mask);
+               printf(", ccr addr %x mask %x\n", pf->ccr_base, pf->ccr_mask);
 
                STAILQ_FOREACH(cfe, &pf->cfe_head, cfe_list) {
                        device_printf(dev, "function %d, config table entry "
@@ -749,6 +747,18 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
                }
                state->card->manufacturer = pccard_tuple_read_2(tuple, 0);
                state->card->product = pccard_tuple_read_2(tuple, 2);
+               /*
+                * This is for xe driver. But not limited to that driver.
+                * In PC Card Standard,
+                * Manufacturer ID: 2byte.
+                * Product ID: typically 2bytes, but there's no limit on its
+                * size.  prodext is a two byte field, so maybe we should
+                * also handle the '6' case.  So far no cards have surfaced
+                * with a length of '6'.
+                */
+               if (tuple->length == 5 ) {
+                       state->card->prodext = pccard_tuple_read_1(tuple, 4);
+               }
                DPRINTF(("CISTPL_MANFID\n"));
                break;
        case PCCARD_CISTPL_FUNCID:
@@ -759,8 +769,7 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
                }
                if ((state->pf == NULL) || (state->gotmfc == 2)) {
                        state->pf = malloc(sizeof(*state->pf), M_DEVBUF,
-                           M_NOWAIT);
-                       bzero(state->pf, sizeof(*state->pf));
+                           M_NOWAIT | M_ZERO);
                        state->pf->number = state->count++;
                        state->pf->last_config_index = -1;
                        STAILQ_INIT(&state->pf->cfe_head);
@@ -772,6 +781,17 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
 
                DPRINTF(("CISTPL_FUNCID\n"));
                break;
+        case PCCARD_CISTPL_FUNCE:
+                if (state->pf == NULL || state->pf->function <= 0) {
+                        DPRINTF(("CISTPL_FUNCE is not followed by "
+                                "valid CISTPL_FUNCID\n"));
+                        break;
+                }
+                if (tuple->length >= 2) {
+                        decode_funce(tuple, state->pf);
+                }
+                DPRINTF(("CISTPL_FUNCE\n"));
+                break;
        case PCCARD_CISTPL_CONFIG:
                if (tuple->length < 3) {
                        DPRINTF(("CISTPL_CONFIG too short %d\n",
@@ -797,8 +817,7 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
                        }
                        if (state->pf == NULL) {
                                state->pf = malloc(sizeof(*state->pf),
-                                   M_DEVBUF, M_NOWAIT);
-                               bzero(state->pf, sizeof(*state->pf));
+                                   M_DEVBUF, M_NOWAIT | M_ZERO);
                                state->pf->number = state->count++;
                                state->pf->last_config_index = -1;
                                STAILQ_INIT(&state->pf->cfe_head);
@@ -917,6 +936,10 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
                        if (intface) {
                                reg = pccard_tuple_read_1(tuple, idx);
                                idx++;
+                               cfe->flags &= ~(PCCARD_CFE_MWAIT_REQUIRED
+                                   | PCCARD_CFE_RDYBSY_ACTIVE
+                                   | PCCARD_CFE_WP_ACTIVE
+                                   | PCCARD_CFE_BVD_ACTIVE);
                                if (reg & PCCARD_TPCE_IF_MWAIT)
                                        cfe->flags |= PCCARD_CFE_MWAIT_REQUIRED;
                                if (reg & PCCARD_TPCE_IF_RDYBSY)
@@ -984,7 +1007,8 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
 
                                reg = pccard_tuple_read_1(tuple, idx);
                                idx++;
-
+                               cfe->flags &=
+                                   ~(PCCARD_CFE_IO8 | PCCARD_CFE_IO16);
                                if (reg & PCCARD_TPCE_IO_BUSWIDTH_8BIT)
                                        cfe->flags |= PCCARD_CFE_IO8;
                                if (reg & PCCARD_TPCE_IO_BUSWIDTH_16BIT)
@@ -1061,7 +1085,9 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
 
                                reg = pccard_tuple_read_1(tuple, idx);
                                idx++;
-
+                               cfe->flags &= ~(PCCARD_CFE_IRQSHARE
+                                   | PCCARD_CFE_IRQPULSE
+                                   | PCCARD_CFE_IRQLEVEL);
                                if (reg & PCCARD_TPCE_IR_SHARE)
                                        cfe->flags |= PCCARD_CFE_IRQSHARE;
                                if (reg & PCCARD_TPCE_IR_PULSE)
@@ -1183,13 +1209,15 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
 
                                reg = pccard_tuple_read_1(tuple, idx);
                                idx++;
-
+                               cfe->flags &= ~(PCCARD_CFE_POWERDOWN
+                                   | PCCARD_CFE_READONLY
+                                   | PCCARD_CFE_AUDIO);
                                if (reg & PCCARD_TPCE_MI_PWRDOWN)
-                                       cfe->flags = PCCARD_CFE_POWERDOWN;
+                                       cfe->flags |= PCCARD_CFE_POWERDOWN;
                                if (reg & PCCARD_TPCE_MI_READONLY)
-                                       cfe->flags = PCCARD_CFE_READONLY;
+                                       cfe->flags |= PCCARD_CFE_READONLY;
                                if (reg & PCCARD_TPCE_MI_AUDIO)
-                                       cfe->flags = PCCARD_CFE_AUDIO;
+                                       cfe->flags |= PCCARD_CFE_AUDIO;
                                cfe->maxtwins = reg & PCCARD_TPCE_MI_MAXTWINS;
 
                                while (reg & PCCARD_TPCE_MI_EXT) {
@@ -1210,3 +1238,36 @@ pccard_parse_cis_tuple(struct pccard_tuple *tuple, void *arg)
 
        return (0);
 }
+
+static int
+decode_funce(struct pccard_tuple *tuple, struct pccard_function *pf)
+{
+       int type = pccard_tuple_read_1(tuple, 0);
+
+       switch (pf->function) {
+       case PCCARD_FUNCTION_DISK:
+               if (type == PCCARD_TPLFE_TYPE_DISK_DEVICE_INTERFACE) {
+                       pf->pf_funce_disk_interface
+                               = pccard_tuple_read_1(tuple, 1);
+               }
+               break;
+       case PCCARD_FUNCTION_NETWORK:
+               if (type == PCCARD_TPLFE_TYPE_LAN_NID) {
+                       int i;
+                       int len = pccard_tuple_read_1(tuple, 1);
+                       if (tuple->length < 2 + len || len > 8) {
+                               /* tuple length not enough or nid too long */
+                               break;
+                        }
+                       for (i = 0; i < len; i++) {
+                               pf->pf_funce_lan_nid[i]
+                                       = pccard_tuple_read_1(tuple, i + 2);
+                       }
+                       pf->pf_funce_lan_nidlen = len;
+               }
+               break;
+       default:
+               break;
+       }
+       return 0;
+}
similarity index 80%
rename from sys/dev/misc/pccard/pccard_cis_quirks.c
rename to sys/bus/pccard/pccard_cis_quirks.c
index d56203c..d21e71e 100644 (file)
@@ -1,3 +1,9 @@
+/*     $NetBSD: pcmcia_cis_quirks.c,v 1.6 2000/04/12 21:07:55 scw Exp $ */
+/* $FreeBSD: src/sys/dev/pccard/pccard_cis_quirks.c,v 1.7 2002/02/09 21:34:06 imp Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccard_cis_quirks.c,v 1.1 2004/02/10 07:55:45 joerg Exp $ */
+
+#define        PCCARDDEBUG
+
 /*
  * Copyright (c) 1998 Marc Horowitz.  All rights reserved.
  *
  * 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.
- *
- * $NetBSD: pcmcia_cis_quirks.c,v 1.5 1999/10/11 17:50:21 thorpej Exp $
- * $FreeBSD: src/sys/dev/pccard/pccard_cis_quirks.c,v 1.2.2.1 2000/05/23 03:57:00 imp Exp $
- * $DragonFly: src/sys/dev/misc/pccard/Attic/pccard_cis_quirks.c,v 1.3 2003/08/15 08:32:29 dillon Exp $
  */
 
-#define        PCCARDDEBUG
-
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/malloc.h>
@@ -46,7 +46,7 @@
 #include <sys/rman.h>
 #include <machine/resource.h>
 
-#include "pccarddevs.h"
+#include <bus/pccard/pccarddevs.h>
 #include <bus/pccard/pccardreg.h>
 #include <bus/pccard/pccardvar.h>
 
@@ -162,23 +162,46 @@ static struct pccard_config_entry pccard_sveclancard_func0_cfe0 = {
        0,                      /* maxtwins */
 };
 
+static struct pccard_function pccard_ndc_nd5100_func0 = {
+       0,                      /* function number */
+       PCCARD_FUNCTION_NETWORK,
+       0x23,                   /* last cfe number */
+       0x3f8,                  /* ccr_base */
+       0x3,                    /* ccr_mask */
+};
+
+static struct pccard_config_entry pccard_ndc_nd5100_func0_cfe0 = {
+       0x20,                   /* cfe number */
+       PCCARD_CFE_MWAIT_REQUIRED | PCCARD_CFE_IO16 | PCCARD_CFE_IRQLEVEL,
+       PCCARD_IFTYPE_IO,
+       1,                      /* num_iospace */
+       5,                      /* iomask */
+       { { 0x20, 0x300 } },    /* iospace */
+       0xdeb8,                 /* irqmask */
+       0,                      /* num_memspace */
+       { },                    /* memspace */
+       0,                      /* maxtwins */
+};
+
 static struct pccard_cis_quirk pccard_cis_quirks[] = {
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CXEM556, PCCARD_CIS_INVALID, 
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID, 
          &pccard_3cxem556_func0, &pccard_3cxem556_func0_cfe0 },
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CXEM556, PCCARD_CIS_INVALID,
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556, PCMCIA_CIS_INVALID,
          &pccard_3cxem556_func1, &pccard_3cxem556_func1_cfe0 },
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CXEM556INT, PCCARD_CIS_INVALID, 
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT, PCMCIA_CIS_INVALID, 
          &pccard_3cxem556_func0, &pccard_3cxem556_func0_cfe0 },
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CXEM556INT, PCCARD_CIS_INVALID,
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CXEM556INT, PCMCIA_CIS_INVALID,
          &pccard_3cxem556_func1, &pccard_3cxem556_func1_cfe0 },
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CCFEM556BI,
-         PCCARD_CIS_INVALID,
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI,
+         PCMCIA_CIS_INVALID,
          &pccard_3ccfem556bi_func0, &pccard_3ccfem556bi_func0_cfe0 },
-       { PCCARD_VENDOR_3COM, PCCARD_PRODUCT_3COM_3CCFEM556BI,
-         PCCARD_CIS_INVALID,
+       { PCMCIA_VENDOR_3COM, PCMCIA_PRODUCT_3COM_3CCFEM556BI,
+         PCMCIA_CIS_INVALID,
          &pccard_3ccfem556bi_func1, &pccard_3ccfem556bi_func1_cfe0 },
-       { PCCARD_VENDOR_INVALID, PCCARD_PRODUCT_INVALID, PCCARD_CIS_SVEC_LANCARD,
+       { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID, PCMCIA_CIS_SVEC_LANCARD,
          &pccard_sveclancard_func0, &pccard_sveclancard_func0_cfe0 },
+       { PCMCIA_VENDOR_INVALID, PCMCIA_PRODUCT_INVALID, PCMCIA_CIS_NDC_ND5100_E,
+         &pccard_ndc_nd5100_func0, &pccard_ndc_nd5100_func0_cfe0 },
 };
        
 static int n_pccard_cis_quirks =
@@ -186,8 +209,7 @@ static int n_pccard_cis_quirks =
 
 void pccard_check_cis_quirks(device_t dev)
 {
-       struct pccard_softc *sc = (struct pccard_softc *)
-           device_get_softc(dev);
+       struct pccard_softc *sc = PCCARD_SOFTC(dev);
        int wiped = 0;
        int i, j;
        struct pccard_function *pf, *pf_next, *pf_last;
@@ -199,10 +221,10 @@ void pccard_check_cis_quirks(device_t dev)
        for (i=0; i<n_pccard_cis_quirks; i++) {
                if ((sc->card.manufacturer == pccard_cis_quirks[i].manufacturer) &&
                        (sc->card.product == pccard_cis_quirks[i].product) &&
-                       (((sc->card.manufacturer != PCCARD_VENDOR_INVALID) &&
-                         (sc->card.product != PCCARD_PRODUCT_INVALID)) ||
-                        ((sc->card.manufacturer == PCCARD_VENDOR_INVALID) &&
-                         (sc->card.product == PCCARD_PRODUCT_INVALID) &&
+                       (((sc->card.manufacturer != PCMCIA_VENDOR_INVALID) &&
+                         (sc->card.product != PCMCIA_PRODUCT_INVALID)) ||
+                        ((sc->card.manufacturer == PCMCIA_VENDOR_INVALID) &&
+                         (sc->card.product == PCMCIA_PRODUCT_INVALID) &&
                          sc->card.cis1_info[0] &&
                          (strcmp(sc->card.cis1_info[0],
                                          pccard_cis_quirks[i].cis1_info[0]) == 0) &&
@@ -210,7 +232,7 @@ void pccard_check_cis_quirks(device_t dev)
                          (strcmp(sc->card.cis1_info[1],
                                          pccard_cis_quirks[i].cis1_info[1]) == 0)))) {
                        if (!wiped) {
-                               if (pccard_verbose) {
+                               if (bootverbose) {
                                        device_printf(dev, "using CIS quirks for ");
                                        for (j = 0; j < 4; j++) {
                                                if (sc->card.cis1_info[j] == NULL)
diff --git a/sys/bus/pccard/pccard_nbk.c b/sys/bus/pccard/pccard_nbk.c
deleted file mode 100644 (file)
index 71aeab4..0000000
+++ /dev/null
@@ -1,439 +0,0 @@
-/*
- * Copyright (c) 1999, 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/pccard/pccard_nbk.c,v 1.15.2.11 2002/09/22 20:26:58 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/pccard_nbk.c,v 1.4 2004/01/08 10:06:29 joerg Exp $
- */
-
-/*
- * This file contains various kludges to allow the legacy pccard system to
- * work in the newbus system until the pccard system can be converted
- * wholesale to newbus.  As that is a while off, I'm providing this glue to
- * allow newbus drivers to have pccard attachments.
- *
- * We do *NOT* implement ISA ivars at all.  We are not an isa bus, and drivers
- * that abuse isa_{set,get}_* must be fixed in order to work with pccard.
- * We use ivars for something else anyway, so it becomes fairly awkward
- * to do so.
- *
- * Here's a summary of the glue that we do to make things work.
- *
- * First, we have pccard node in the device and driver trees.  The pccard
- * device lives in the instance tree attached to the nexus.  The pccard
- * attachments will be attached to that node.  This allows one to pass things
- * up the tree that terminates at the nexus, like other buses.  The pccard
- * code will create a device instance for each of the drivers that are to
- * be attached.
- *
- * These compatibility nodes are called pccnbk.  PCCard New Bus Kludge.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/module.h>
-#include <sys/kernel.h>
-#include <sys/sysctl.h>
-#include <sys/queue.h>
-#include <sys/types.h>
-
-#include <sys/bus.h>
-#include <machine/bus.h>
-#include <machine/resource.h>
-
-/* XXX Shouldn't reach into the MD code here */
-#ifdef PC98
-#include <pc98/pc98/pc98.h>
-#else
-#include <bus/isa/i386/isa.h>
-#endif
-
-#include "cardinfo.h"
-#include "slot.h"
-
-#include <bus/pccard/pccardvar.h>
-#include <net/ethernet.h>
-
-#include "card_if.h"
-
-devclass_t     pccard_devclass;
-
-#define PCCARD_NPORT   2
-#define PCCARD_NMEM    5
-#define PCCARD_NIRQ    1
-#define PCCARD_NDRQ    0
-
-#define PCCARD_DEVINFO(d) (struct pccard_devinfo *) device_get_ivars(d)
-
-SYSCTL_NODE(_machdep, OID_AUTO, pccard, CTLFLAG_RW, 0, "pccard");
-
-#ifdef UNSAFE
-static u_long mem_start = IOM_BEGIN;
-static u_long mem_end = IOM_END;
-#else
-static u_long mem_start = 0xd0000;
-static u_long mem_end = 0xeffff;
-#endif
-
-SYSCTL_ULONG(_machdep_pccard, OID_AUTO, mem_start, CTLFLAG_RW,
-    &mem_start, 0, "");
-SYSCTL_ULONG(_machdep_pccard, OID_AUTO, mem_end, CTLFLAG_RW,
-    &mem_end, 0, "");
-
-#if __FreeBSD_version >= 500000
-/*
- * glue for NEWCARD/OLDCARD compat layer
- */
-static int
-pccard_compat_do_probe(device_t bus, device_t dev)
-{
-       return (CARD_COMPAT_PROBE(dev));
-}
-
-static int
-pccard_compat_do_attach(device_t bus, device_t dev)
-{
-       return (CARD_COMPAT_ATTACH(dev));
-}
-#endif
-
-static int
-pccard_probe(device_t dev)
-{
-       device_set_desc(dev, "PC Card 16-bit bus (classic)");
-       return (0);
-}
-
-static int
-pccard_attach(device_t dev)
-{
-       return (0);
-}
-
-static void
-pccard_print_resources(struct resource_list *rl, const char *name, int type,
-    int count, const char *format)
-{
-       struct resource_list_entry *rle;
-       int printed;
-       int i;
-
-       printed = 0;
-       for (i = 0; i < count; i++) {
-               rle = resource_list_find(rl, type, i);
-               if (rle) {
-                       if (printed == 0)
-                               printf(" %s ", name);
-                       else if (printed > 0)
-                               printf(",");
-                       printed++;
-                       printf(format, rle->start);
-                       if (rle->count > 1) {
-                               printf("-");
-                               printf(format, rle->start + rle->count - 1);
-                       }
-               } else if (i > 3) {
-                       /* check the first few regardless */
-                       break;
-               }
-       }
-}
-
-static int
-pccard_print_child(device_t dev, device_t child)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       struct resource_list *rl = &devi->resources;
-       int     retval = 0;
-       int     flags = device_get_flags(child);
-
-       retval += bus_print_child_header(dev, child);
-       retval += printf(" at");
-
-       if (devi) {
-               pccard_print_resources(rl, "port", SYS_RES_IOPORT,
-                   PCCARD_NPORT, "%#lx");
-               pccard_print_resources(rl, "iomem", SYS_RES_MEMORY,
-                   PCCARD_NMEM, "%#lx");
-               pccard_print_resources(rl, "irq", SYS_RES_IRQ, PCCARD_NIRQ,
-                   "%ld");
-               pccard_print_resources(rl, "drq", SYS_RES_DRQ, PCCARD_NDRQ,
-                   "%ld");
-               if (flags != 0)
-                       retval += printf(" flags 0x%x", flags);
-               retval += printf(" slot %d", devi->slt->slotnum);
-       }
-
-       retval += bus_print_child_footer(dev, child);
-
-       return (retval);
-}
-
-static int
-pccard_set_resource(device_t dev, device_t child, int type, int rid,
-    u_long start, u_long count)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       struct resource_list *rl = &devi->resources;
-
-       if (type != SYS_RES_IOPORT && type != SYS_RES_MEMORY
-           && type != SYS_RES_IRQ && type != SYS_RES_DRQ)
-               return (EINVAL);
-       if (rid < 0)
-               return (EINVAL);
-       if (type == SYS_RES_IOPORT && rid >= PCCARD_NPORT)
-               return (EINVAL);
-       if (type == SYS_RES_MEMORY && rid >= PCCARD_NMEM)
-               return (EINVAL);
-       if (type == SYS_RES_IRQ && rid >= PCCARD_NIRQ)
-               return (EINVAL);
-       if (type == SYS_RES_DRQ && rid >= PCCARD_NDRQ)
-               return (EINVAL);
-
-       resource_list_add(rl, type, rid, start, start + count - 1, count);
-
-       return (0);
-}
-
-static int
-pccard_get_resource(device_t dev, device_t child, int type, int rid,
-    u_long *startp, u_long *countp)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       struct resource_list *rl = &devi->resources;
-       struct resource_list_entry *rle;
-
-       rle = resource_list_find(rl, type, rid);
-       if (!rle)
-               return (ENOENT);
-       
-       if (startp)
-               *startp = rle->start;
-       if (countp)
-               *countp = rle->count;
-
-       return (0);
-}
-
-static void
-pccard_delete_resource(device_t dev, device_t child, int type, int rid)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       struct resource_list *rl = &devi->resources;
-       resource_list_delete(rl, type, rid);
-}
-
-static struct resource *
-pccard_alloc_resource(device_t bus, device_t child, int type, int *rid,
-    u_long start, u_long end, u_long count, u_int flags)
-{
-       /*
-        * Consider adding a resource definition. We allow rid 0 for
-        * irq, 0-4 for memory and 0-1 for ports
-        */
-       int passthrough = (device_get_parent(child) != bus);
-       int isdefault;
-       struct pccard_devinfo *devi = device_get_ivars(child);
-       struct resource_list *rl = &devi->resources;
-       struct resource_list_entry *rle;
-       struct resource *res;
-
-       if (start == 0 && end == ~0 && type == SYS_RES_MEMORY && count != 1) {
-               start = mem_start;
-               end = mem_end;
-       }
-       isdefault = (start == 0UL && end == ~0UL);
-       if (!passthrough && !isdefault) {
-               rle = resource_list_find(rl, type, *rid);
-               if (!rle) {
-                       if (*rid < 0)
-                               return (NULL);
-                       switch (type) {
-                       case SYS_RES_IRQ:
-                               if (*rid >= PCCARD_NIRQ)
-                                       return (NULL);
-                               break;
-                       case SYS_RES_DRQ:
-                               if (*rid >= PCCARD_NDRQ)
-                                       return (NULL);
-                               break;
-                       case SYS_RES_MEMORY:
-                               if (*rid >= PCCARD_NMEM)
-                                       return (NULL);
-                               break;
-                       case SYS_RES_IOPORT:
-                               if (*rid >= PCCARD_NPORT)
-                                       return (NULL);
-                               break;
-                       default:
-                               return (NULL);
-                       }
-                       resource_list_add(rl, type, *rid, start, end, count);
-               }
-       }
-       res = resource_list_alloc(rl, bus, child, type, rid, start, end,
-           count, flags);
-       return (res);
-}
-
-static int
-pccard_release_resource(device_t bus, device_t child, int type, int rid,
-                    struct resource *r)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       struct resource_list *rl = &devi->resources;
-       return (resource_list_release(rl, bus, child, type, rid, r));
-}
-
-static int
-pccard_read_ivar(device_t bus, device_t child, int which, uintptr_t *result)
-{
-       struct pccard_devinfo *devi = PCCARD_DEVINFO(child);
-       
-       switch (which) {
-       case PCCARD_IVAR_ETHADDR:
-               bcopy(devi->misc, result, ETHER_ADDR_LEN);
-               return (0);
-       case PCCARD_IVAR_VENDOR:
-               *(u_int32_t *) result = devi->manufacturer;
-               return (0);
-       case PCCARD_IVAR_PRODUCT:
-               *(u_int32_t *) result = devi->product;
-               return (0);
-       case PCCARD_IVAR_PRODEXT:
-               *(u_int16_t *) result = devi->prodext;
-               return (0);
-       }
-       return (ENOENT);
-}
-
-static int
-pccard_set_res_flags(device_t bus, device_t child, int restype, int rid,
-    u_long value)
-{
-       return (CARD_SET_RES_FLAGS(device_get_parent(bus), child, restype,
-           rid, value));
-}
-
-static int
-pccard_get_res_flags(device_t bus, device_t child, int restype, int rid,
-    u_long *value)
-{
-       return (CARD_GET_RES_FLAGS(device_get_parent(bus), child, restype,
-           rid, value));
-}
-
-static int
-pccard_set_memory_offset(device_t bus, device_t child, int rid, 
-    u_int32_t offset, u_int32_t *deltap)
-{
-       return (CARD_SET_MEMORY_OFFSET(device_get_parent(bus), child, rid,
-           offset, deltap));
-}
-
-static int
-pccard_get_memory_offset(device_t bus, device_t child, int rid, 
-    u_int32_t *offset)
-{
-       return (CARD_GET_MEMORY_OFFSET(device_get_parent(bus), child, rid,
-           offset));
-}
-
-#if __FreeBSD_version >= 500000
-static int
-pccard_get_function_num(device_t bus, device_t child, int *function)
-{
-       *function = 0;
-       return (0);
-}
-
-static int
-pccard_activate_function(device_t bus, device_t child)
-{
-       /* pccardd has alrady activated the function */
-       return (0);
-}
-
-static int
-pccard_deactivate_function(device_t bus, device_t child)
-{
-       /* pccardd will deactivate the function */
-       return (0);
-}
-
-static const struct pccard_product *
-pccard_do_product_lookup(device_t bus, device_t dev,
-                     const struct pccard_product *tab,
-                     size_t ent_size, pccard_product_match_fn matchfn)
-{
-       return (NULL);
-}
-#endif
-
-static device_method_t pccard_methods[] = {
-       /* Device interface */
-       DEVMETHOD(device_probe,         pccard_probe),
-       DEVMETHOD(device_attach,        pccard_attach),
-       DEVMETHOD(device_shutdown,      bus_generic_shutdown),
-       DEVMETHOD(device_suspend,       pccard_suspend),
-       DEVMETHOD(device_resume,        pccard_resume),
-
-       /* Bus interface */
-       DEVMETHOD(bus_print_child,      pccard_print_child),
-       DEVMETHOD(bus_driver_added,     bus_generic_driver_added),
-       DEVMETHOD(bus_alloc_resource,   pccard_alloc_resource),
-       DEVMETHOD(bus_release_resource, pccard_release_resource),
-       DEVMETHOD(bus_activate_resource, bus_generic_activate_resource),
-       DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource),
-       DEVMETHOD(bus_setup_intr,       bus_generic_setup_intr),
-       DEVMETHOD(bus_teardown_intr,    bus_generic_teardown_intr),
-       DEVMETHOD(bus_set_resource,     pccard_set_resource),
-       DEVMETHOD(bus_get_resource,     pccard_get_resource),
-       DEVMETHOD(bus_delete_resource,  pccard_delete_resource),
-       DEVMETHOD(bus_read_ivar,        pccard_read_ivar),
-
-       /* Card interface */
-       DEVMETHOD(card_set_res_flags,   pccard_set_res_flags),
-       DEVMETHOD(card_get_res_flags,   pccard_get_res_flags),
-       DEVMETHOD(card_set_memory_offset, pccard_set_memory_offset),
-       DEVMETHOD(card_get_memory_offset, pccard_get_memory_offset),
-#if __FreeBSD_version >= 500000
-       DEVMETHOD(card_get_function,    pccard_get_function_num),
-       DEVMETHOD(card_activate_function, pccard_activate_function),
-       DEVMETHOD(card_deactivate_function, pccard_deactivate_function),
-       DEVMETHOD(card_compat_do_probe, pccard_compat_do_probe),
-       DEVMETHOD(card_compat_do_attach, pccard_compat_do_attach),
-       DEVMETHOD(card_do_product_lookup, pccard_do_product_lookup),
-#endif
-       { 0, 0 }
-};
-
-static driver_t pccard_driver = {
-       "pccard",
-       pccard_methods,
-       sizeof(struct slot)
-};
-
-DRIVER_MODULE(pccard, pcic, pccard_driver, pccard_devclass, 0, 0);
-DRIVER_MODULE(pccard, mecia, pccard_driver, pccard_devclass, 0, 0);
-MODULE_VERSION(pccard, 1);
diff --git a/sys/bus/pccard/pccard_nbk.h b/sys/bus/pccard/pccard_nbk.h
deleted file mode 100644 (file)
index 7efdcff..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 1999, 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 AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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: src/sys/pccard/pccard_nbk.h,v 1.4.2.2 2002/09/22 20:26:58 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/pccard_nbk.h,v 1.2 2003/06/17 04:28:55 dillon Exp $
- */
-
-#ifndef PCCARD_PCCARD_NBK_H
-#define PCCARD_PCCARD_NBK_H
-
-SYSCTL_DECL(_machdep_pccard);
-
-struct pccard_device;
-extern devclass_t pccard_devclass;
-
-#endif /* ! PCCARD_PCCARD_NBK_H */
diff --git a/sys/bus/pccard/pccarddevs b/sys/bus/pccard/pccarddevs
new file mode 100644 (file)
index 0000000..ba8afa7
--- /dev/null
@@ -0,0 +1,611 @@
+$DragonFly: src/sys/bus/pccard/pccarddevs,v 1.1 2004/02/10 07:55:45 joerg Exp $
+/* $NetBSD: pcmciadevs,v 1.186 2003/09/16 08:26:37 onoe Exp $ */
+/* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */
+/* $FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.79 2003/11/03 16:09:17 imp Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+/*
+ * List of known PCMCIA vendors, sorted by numeric ID.
+ */
+
+vendor FUJITSU                 0x0004  Fujitsu Corporation
+vendor INTERSIL                        0x000b  Intersil
+vendor PANASONIC               0x0032  Matsushita Electric Industrial Co.
+vendor SANDISK                 0x0045  Sandisk Corporation
+vendor NEWMEDIA                        0x0057  New Media Corporation
+vendor INTEL                   0x0089  Intel
+vendor IBM                     0x00a4  IBM Corporation
+vendor SHARP                   0x00b0  Sharp Corporation
+vendor 3COM                    0x0101  3Com Corporation
+vendor MEGAHERTZ               0x0102  Megahertz Corporation
+vendor SOCKET                  0x0104  Socket Communications
+vendor TDK                     0x0105  TDK Corporation
+vendor XIRCOM                  0x0105  Xircom
+vendor SMC                     0x0108  Standard Microsystems Corporation
+vendor MOTOROLA                        0x0109  Motorola Corporation
+vendor NI                      0x010b  National Instruments
+vendor QLOGIC                  0x0114  QLogic
+vendor USROBOTICS              0x0115  US Robotics Corporation
+vendor OLICOM                  0x0121  Olicom
+vendor PROXIM                  0x0126  Proxim
+vendor DSPSI                   0x0128  DSP Solutions, Inc
+vendor ADAPTEC                 0x012f  Adaptec Corporation
+vendor QUATECH                 0x0137  Quatech
+vendor COMPAQ                  0x0138  Compaq
+vendor OSITECH                 0x0140  Ositech
+vendor DLINK_2                 0x0143  D-Link
+vendor DLINK_3                 0x0149  D-Link
+vendor LINKSYS                 0x0149  Linksys Corporation
+vendor NETGEAR                 0x0149  Netgear
+vendor SIMPLETECH              0x014d  Simple Technology
+vendor SYMBOL2                 0x014d  Symbol
+vendor LUCENT                  0x0156  Lucent Technologies
+vendor GEMPLUS                 0x0157  Gemplus
+vendor AIRONET                 0x015f  Aironet Wireless Communications
+vendor ERICSSON                        0x016b  Ericsson
+vendor PSION                   0x016c  Psion
+vendor COMPAQ2                 0x0183  Compaq
+vendor PARALON                 0x0183  Paralon Technologies Inc
+vendor KINGSTON                        0x0186  Kingston
+vendor MELCO                   0x018a  Melco Corporation
+vendor DAYNA                   0x0194  Dayna Corporation
+vendor RAYTHEON                        0x01a6  Raytheon
+vendor IODATA                  0x01bf  I-O DATA
+vendor BAY                     0x01eb  Bay Networks
+vendor FARALLON                        0x0200  Farallon Communications
+vendor TELECOMDEVICE           0x021b  Telecom Device
+vendor NOKIA                   0x023d  Nokia Communications
+vendor SAMSUNG                 0x0250  Samsung
+vendor HWN                     0x0261  Home Wireless Networks
+vendor ARTEM                   0x0268  ARtem
+vendor SYMBOL                  0x026c  Symbol
+vendor BUFFALO                 0x026f  BUFFALO (Melco Corporation)
+vendor BROMAX                  0x0274  Bromax communications, Inc
+vendor IODATA2                 0x028a  I-O DATA
+vendor ASUS                    0x02aa  ASUS
+vendor SIEMENS                 0x02ac  Siemens
+vendor MICROSOFT               0x02d2  Microsoft Corporation
+
+/*
+ * The following vendor IDs are byte-swapped from what the company is assigned.
+ */
+vendor NWN                     0x0602  No Wires Needed
+vendor BREEZECOM               0x0a02  BreezeCOM
+vendor LASAT                   0x3401  Lasat Communications A/S
+vendor BONDWELL                        0x3b01  Bondwell
+vendor LEXARMEDIA              0x4e01  Lexar Media
+vendor COMPEX                  0x8a01  Compex Corporation
+vendor ZONET                   0x8a01  Zonet Technology Inc.
+vendor ELSA                    0xd601  Elsa 
+
+/*
+ * The following vendor IDs are not, as far as I can tell, actually
+ * assigned to these people.  However, all the ones starting with '0xc'
+ * look coherent enough that maybe somebody other than PCMCIA is
+ * assigning numbers in that range.
+ */
+vendor NEWMEDIA2               0x10cd  NewMedia
+vendor PLANEX_2                        0x14ea  PLANEX
+vendor ACTIONTEC               0x1668  ACTIONTEC
+vendor AIRVAST                  0x50c2  AirVast Technology
+vendor ARCHOS                  0x5241  Archos
+vendor DUAL                    0x890f  Dual
+vendor EDIMAX                  0x890f  Edimax Technology Inc.
+vendor CONTEC                  0xc001  Contec
+vendor MACNICA                 0xc00b  MACNICA
+vendor ROLAND                  0xc00c  Roland
+vendor COREGA2                 0xc00f  Corega K.K.
+vendor ALLIEDTELESIS           0xc00f  Allied Telesis K.K.
+vendor HAGIWARASYSCOM          0xc012  Hagiwara SYS-COM
+vendor RATOC                   0xc015  RATOC System Inc.
+vendor WORKBIT                 0xc024  WORKBIT
+vendor EMTAC                   0xc250  EMTAC Technology Corporation
+
+/*
+ * List of known products.  Grouped by vendor, sorted by number within the
+ * group.
+ */
+
+/* 3COM Products */
+product 3COM 3CRWE737A         0x0001 3Com AirConnect Wireless LAN
+product 3COM 3CXM056BNW                0x002f 3Com/NoteWorthy 3CXM056-BNW 56K Modem
+product 3COM 3CXEM556          0x0035 3Com/Megahertz 3CXEM556 Ethernet/Modem
+product 3COM 3CXEM556INT       0x003d 3Com/Megahertz 3CXEM556-INT Ethernet/Modem
+product 3COM 3CCFEM556BI       0x0556 3Com/Megahertz 3CCFEM556BI Ethernet/Modem
+product 3COM 3C562             0x0562 3Com 3c562 33.6 Modem/10Mbps Ethernet
+product 3COM 3C589             0x0589 3Com 3c589 10Mbps Ethernet
+product 3COM 3C574             0x0574 3Com 3c574-TX 10/100Mbps Ethernet
+product        3COM 3CRWE777A          0x0777 3Com 3CRWE777A Airconnect
+product 3COM 3C1               0x0cf1 3Com Megahertz 3C1 10Mbps LAN CF+ Card
+product 3COM 3CRWE62092A       0x2092 3Com 3CRWE62092A Wireless LAN
+
+/* ACTIONTEC Products */
+product        ACTIONTEC PRISM         0x0101 PRISM Wireless LAN PC Card
+
+/* Adaptec Products */
+product ADAPTEC APA1460                0x0001 Adaptec APA-1460 SlimSCSI
+product ADAPTEC APA1460A       0x0002 Adaptec APA-1460A SlimSCSI
+
+/* Aironet */
+product AIRONET PC4500         0x0005 Aironet PC4500 Wireless LAN Adapter
+product AIRONET PC4800         0x0007 Aironet PC4800 Wireless LAN Adapter
+product AIRONET 350            0x000a Aironet 350 Wireless LAN Adapter
+
+/* AirVast */
+product AIRVAST WN_100          0x7300 AirVast WN-100 
+
+/* Allied Telesis K.K. */
+product ALLIEDTELESIS LA_PCM   0x0002 Allied Telesis LA-PCM
+
+/* Archos */
+product        ARCHOS ARC_ATAPI        0x0043 MiniCD
+
+/* ARtem */
+product ARTEM ONAIR            0x0001 ARtem OnAir
+
+/* ASUS WL-100 */
+product        ASUS WL100              0x0002 ASUS SpaceLink WL-100 Wireless LAN
+
+/* Bay Networks */
+product BAY STACK_650          0x0804 BayStack 650 Wireless LAN
+product BAY SURFER_PRO         0x0806 AirSurfer Pro Wireless LAN
+product BAY STACK_660          0x0807 BayStack 660 Wireless LAN
+product        BAY EMOBILITY_11B       0x080a e-Mobility 11Mb Wireless LAN
+
+/* Bondwell */
+product        BONDWELL B236           0x0000 Game Card Joystick
+
+/* BreezeCOM */
+product BREEZECOM BREEZENET    0x0102 BreezeCOM BreezeNET
+
+/* Bromax Communications, Inc (Linksys OEM) */
+product BROMAX IWN             0x1612 Instant Wireless Network PC Card
+product BROMAX IWN3            0x1613 Instant Wireless Network PC Card, Versin 3
+product BROMAX WCF11           0x3301 Instant Wireless Network CF Card
+
+/* BUFFALO */
+product        BUFFALO LPC3_CLX        0x0301  BUFFALO LPC3-CLX Ethernet Adapter
+product BUFFALO WLI_PCM_S11    0x0305  BUFFALO AirStation 11Mbps WLAN
+product BUFFALO LPC_CF_CLT     0x0307  BUFFALO LPC-CF-CLT
+product        BUFFALO LPC3_CLT        0x030a  BUFFALO LPC3-CLT Ethernet Adapter
+product BUFFALO WLI_CF_S11G    0x030b  BUFFALO AirStation 11Mbps CF WLAN
+
+/* Compaq Products */
+product COMPAQ NC5004          0x0002 Compaq Agency NC5004 Wireless Card
+product COMPAQ2 CPQ_10_100     0x010a Compaq Netelligent 10/100 Ethernet
+
+/* Compex Products */
+product COMPEX AMP_WIRELESS    0x0066 AMP
+product COMPEX LINKPORT_ENET_B 0x0100 Compex Linkport ENET-B Ethernet
+
+/* Contec C-NET(PC) */
+product CONTEC CNETPC          0x0000 Contec C-NET(PC)C
+product        CONTEC FX_DS110_PCC     0x0008 Contec FLEXLAN/FX-DS110-PCC
+
+/* Dayna Products */
+product DAYNA COMMUNICARD_E_1  0x002d Dayna CommuniCard E
+product DAYNA COMMUNICARD_E_2  0x002f Dayna CommuniCard E
+
+/* DIGITAL Products */
+product DIGITAL MOBILE_MEDIA_CDROM 0x0d00 Digital Mobile Media CD-ROM
+
+/* D-Link Products */
+product DLINK_2 DMF560TX       0xc0ab D-Link DMF-650TX
+
+/* DSP Solutions, Inc. (Megahertz OEM) */
+product DSPSI XJEM1144         0x0101 Megahertz X-JACK
+product DSPSI XJACK            0x0103 Megahertz X-JACK Ethernet
+
+/* Dual */
+product DUAL NE2000            0x0100 Dual NE2000
+
+/* Edimax Products */
+product EDIMAX EP4000A         0x0100 Edimax EP4000A
+
+/* ELSA Products */
+product ELSA MC2_IEEE          0x0001 AirLancer MC-2 IEEE
+product ELSA XI300_IEEE                0x0002 XI300 Wireless LAN
+product ELSA XI800_IEEE                0x0004 XI800 CF Wireless LAN
+product ELSA XI325_IEEE                0x0005 XI325 Wireless LAN
+
+/* EMTAC */
+product EMTAC WLAN             0x0002  EMTAC A2424i 11Mbps WLAN Card
+
+/* Ericsson */
+product ERICSSON WIRELESSLAN   0x0001  DSSS Wireless LAN PC Card
+
+/* Farallon */
+product FARALLON SKYLINE       0x0a01 SkyLINE Wireless
+
+/* Fujutsu Products */
+product FUJITSU SCSI600                0x0401 Fujitsu SCSI 600 Interface
+product FUJITSU LA10S          0x1003 Fujitsu Compact Flash Ethernet
+product FUJITSU LA501          0x2000 Fujitsu Towa LA501 Ethernet
+product FUJITSU WL110          0x2003 PEGA-WL110 Wireless LAN
+
+/* Gemplus */
+product GEMPLUS GPR400         0x3004 GPR400 Smartcard Reader
+
+/* Home Wireless Networks */
+product HWN AIRWAY80211                0x0002 HWN Airway Wireless PCMCIA Card
+
+/* IBM Products */
+product IBM MICRODRIVE         0x0000 IBM Microdrive
+product IBM 3270               0x0001 IBM 3270 Emulation
+product IBM INFOMOVER          0x0002 IBM InfoMover
+product IBM 5250               0x000b IBM 5250 Emulation
+product IBM TROPIC             0x001e IBM Token Ring 4/16
+product IBM SCSI               0x0026 IBM SCSI PCMCIA
+product IBM PORTABLE_CDROM     0x002d IBM PCMCIA Portable CD-ROM Drive
+product IBM HOME_AND_AWAY      0x002e IBM Home and Away Modem
+product IBM WIRELESS_LAN_ENTRY 0x0032 IBM Wireless LAN Entry 
+product IBM SMART_CAPTURE_II   0x003c IBM Smart Capture Card II
+product IBM ETHERJET           0x003f IBM EtherJet Ethernet
+
+/* Intel Products */
+product INTEL PRO_WLAN_2011    0x0001 Intel PRO/Wireless 2011 LAN PC Card
+product INTEL EEPRO100         0x010a Intel EtherExpress PRO/100
+product INTEL ETHEREXPPRO      0x0301 Intel EtherExpress Pro PCMCIA Card
+
+/* Intersil */
+/* Note: The following likely is an OEM card under a different Intersil name */
+product INTERSIL MA401RA       0x7300 Netgear MA401RA
+
+/* I-O DATA */
+product IODATA PCLATE          0x2216 I-O DATA PCLA/TE
+product IODATA2 WNB11PCM       0x0002 I-O DATA WN-B11/PCM
+product IODATA2 WCF12          0x0673 Wireless CF Card
+
+/* Kingston Products */
+product KINGSTON KNE2          0x0100 Kingston KNE-PC2 Ethernet
+
+/* Lasat Products */
+product LASAT CREDIT_288       0x2811 Lasat Credit 288 Modem
+
+/* Lexar Media */
+product LEXARMEDIA COMPACTFLASH        0x0100 Lexar Media CompactFlash
+
+/* Linksys corporation */
+product LINKSYS TRUST_COMBO_ECARD 0x021b Trust (Linksys) Combo EthernetCard
+product LINKSYS ETHERFAST      0x0230 Linksys Etherfast 10/100 Ethernet
+product LINKSYS ECARD_1                0x0265 Linksys EthernetCard or D-Link DE-650
+product LINKSYS COMBO_ECARD    0xc1ab Linksys Combo EthernetCard
+
+/* Lucent WaveLAN/IEEE */
+product LUCENT WAVELAN_IEEE    0x0002 WaveLAN/IEEE
+
+/* MACNICA */
+product MACNICA ME1_JEIDA      0x3300  MACNICA ME1 for JEIDA
+product MACNICA MPS110         0xa041  MACNICA Miracle SCSI-II mPS110
+
+/* Megahertz Products */
+product MEGAHERTZ XJEM3336     0x0006 Megahertz X-JACK Ethernet Modem
+product MEGAHERTZ XJ4288       0x0023 Megahertz XJ4288 Modem
+product MEGAHERTZ XJ4336       0x0027 Megahertz XJ4336 Modem
+product MEGAHERTZ XJ5560       0x0034 Megahertz X-JACK 56kbps Modem
+
+/* Melco Products */
+product MELCO LPC3_TX          0xc1ab Melco LPC3-TX
+product MELCO LPC3_CLX         0x0301 Melco LPC3-CLX Ethernet Adapter
+
+/* Microsoft Products */
+product MICROSOFT MN_520       0x0001 Microsoft MN-520 WLAN Card
+
+/* Motorola Products */
+product MOTOROLA POWER144      0x0105 Motorola Power 14.4 Modem
+product MOTOROLA PM100C                0x0302 Motorola Personal Messenger 100C CDPD Modem
+product MOTOROLA MONTANA_336   0x0505 Motorola Montana 33.6
+
+/* New Media Products */
+product NEWMEDIA BASICS                0x0019 New Media BASICS Ethernet
+product NEWMEDIA LANSURFER     0x0021 NewMedia LANSurfer
+product NEWMEDIA LIVEWIRE      0x1004 NewMedia LiveWire Ethernet LAN Adapter
+product NEWMEDIA MULTIMEDIA    0x100b NewMedia Multimedia
+product NEWMEDIA BUSTOASTER2   0xa002 New Media SCSI Bus Toaster
+product NEWMEDIA BUSTOASTER    0xc102 New Media SCSI Bus Toaster
+product NEWMEDIA BUSTOASTER3   0xd302 New Media SCSI Bus Toaster
+product NEWMEDIA WAVJAMMER     0xe005 NewMedia .WAVjammer
+product NEWMEDIA2 BUSTOASTER   0x0001 NewMedia BusToaster
+
+/* Netgear */
+product NETGEAR FA410TX                0x0230 Netgear FA410TX
+product NETGEAR FA410TXC       0x4530 Netgear FA410TXC
+product NETGEAR FA411          0x0411 Netgear FA411
+
+/* National Instruments */
+product NI PCMCIA_GPIB         0x4882 National Instruments PCMCIA-GPIB
+
+/* Nokia Products */
+product NOKIA C110_WLAN                0x1110 Nokia C110/C111
+product NOKIA C020_WLAN                0x20c0 Nokia C020 WLAN Card
+
+/* No Wires Needed */
+product NWN WLAN_550           0x0002 NWN 550 WLAN
+product NWN WLAN_1148          0x0003 NWN 1148 WLAN
+
+/* Olicom Products */
+product OLICOM TR              0x2132 GoCard Token Ring 16/4
+product OLICOM OC2220          0x2022 GoCard Ethernet
+product OLICOM OC2231          0x3122 GoCard Combo Eth/Modem 288
+product OLICOM OC2232          0x3222 GoCard Combo Eth/Modem 336
+
+/* Ositech Products */
+product OSITECH TRUMPCARD_SOD  0x0008 Ositech Seven of Diamonds Ethernet Card
+
+/* Panasonic Products */
+product PANASONIC KXLC002      0x0304 Panasonic 4X CD-ROM Interface Card
+product PANASONIC KXLC003      0x0504 Panasonic 8X CD-ROM Interface Card
+product PANASONIC KXLC004      0x0604 Panasonic KXL-810AN Interface Card
+product PANASONIC KXLC005      0x2704 Panasonic 16X CD-ROM Interface Card
+product PANASONIC KME          0x2604 Panasonic CD-R/RW Interface
+
+/* Planex */
+product PLANEX_2 GWNS11H       0xb001 Planex GW-NS11H
+
+/* Proxim */
+product PROXIM HARMONY         0x0002 Proxim HARMONY 80211B
+product PROXIM ROAMABOUT_2400FH        0x1058 Digital RoamAbout 2400FH
+product PROXIM RANGELAN2_7401  0x1158 Proxim RangeLAN2 7401
+product PROXIM RANGELANDS_8430 0x8000 Proxim RangeLAN-DS 8430
+
+/* Psion */
+product PSION GOLDCARD         0x0020 Psion Gold Card
+
+/* QLogic */
+product QLOGIC PC05            0x0104 Qlogic Fast SCSI
+
+/* Quatech */
+product QUATECH SPP_100                0x0003 Quatech Enhanced Parallel Port
+product QUATECH DSP_225                0x0008 Quatech Dual Serial Port
+
+/* RATOC System Inc. Products */
+/* Don't use because both cards have same product id */
+product RATOC REX_R280_9530    0x0001  RATOC REX-R280/REX-9530
+
+/* Raylink/WebGear */
+product RAYTHEON WLAN          0x0000 WLAN Adapter
+
+/* Roland */
+product ROLAND SCP55           0x0001 Roland SCP-55
+
+/* Samsung */
+product        SAMSUNG SWL_2000N       0x0002  Samsung MagicLAN SWL-2000N
+
+/* Sandisk Products */
+product SANDISK SDCFB          0x0401 Sandisk CompactFlash Card
+
+/* Sharp Products */
+product SHARP PALDIO611S       0x0000  PALDIO 611S PC CARD
+
+/* Siemens */
+product SIEMENS SS1021         0x0002 Siemens SpeedStream 1021
+
+/* Simple Technology Products */
+product SIMPLETECH COMMUNICATOR288 0x0100 Simple Technology 28.8 Communicator
+/* Simpletech ID also used by Symbol */
+product SIMPLETECH SPECTRUM24 0x801 Symbol Spectrum24 WLAN Adapter
+
+/* Standard Microsystems Corporation Products */
+product SMC 8016               0x0105 SMC 8016 EtherCard
+product SMC EZCARD             0x8022 SMC EZCard 10 PCMCIA
+
+/* Socket Communications Products */
+product SOCKET EA_ETHER                0x0000 Socket Communications EA
+product SOCKET LP_WLAN_CF      0x0001 Socket Communications Low Power WLAN Card
+product SOCKET PAGECARD                0x0003 Socket Communications PageCard
+product SOCKET DUAL_RS232      0x0006 Socket Communications Dual RS232
+product SOCKET LP_ETHER                0x000d Socket Communications LP-E
+product SOCKET LP_ETHER_CF     0x0075 Socket Communications LP-E CF
+product SOCKET LP_ETH_10_100_CF 0x0145 Socket Communications 10/100 Ethernet
+
+/* Symbol */
+product        SYMBOL LA4100           0x0001  Symbol Spectrum24 LA4100 Series WLAN
+
+/* TDK Products */
+product TDK LAK_CD011WL                0x0000 TDK LAK-CD011WL
+product TDK LAK_CD021BX                0x0200 TDK LAK-CD021BX Ethernet
+product TDK LAK_CF010          0x0900 TDK LAC-CF010
+product TDK DFL9610            0x0d0a TDK DFL9610 Ethernet & Digital Cellular
+product        TDK C6500012            0x410a TDK ELSA MicroLink MC all
+
+/* Telecom Device */
+product TELECOMDEVICE TCD_HPC100       0x0202 Telecom Device TCD-HPC100
+
+/* US Robotics Products */
+product USROBOTICS WORLDPORT144        0x3330 US Robotics WorldPort 14.4 Modem
+
+/* WORKBIT Products */
+product WORKBIT ULTRA_NINJA_16 0x8006 WORKBIT Ultra Ninja-16 (16bit mode)
+
+/* Xircom Products */
+product XIRCOM CWE1130         0x0007 Xircom Wireless Ethernet Adapter 
+product XIRCOM CE              0x0108 Xircom CreditCard Ethernet
+product XIRCOM CE3             0x010a Xircom CreditCard 10/100 Ethernet
+product XIRCOM CE2             0x010b Xircom CreditCard Ethernet II
+product XIRCOM XE2000          0x0153 Xircom XE2000 10/100 Ethernet
+product XIRCOM CNW_801         0x0801 Xircom CreditCard Netwave (Canada)
+product XIRCOM CNW_802         0x0802 Xircom CreditCard Netwave (US)
+product XIRCOM CT2             0x1101 Xircom CreditCard Token Ring II
+product XIRCOM CEM             0x110a Xircom CreditCard Ethernet + Modem
+product XIRCOM REM56           0x110a Xircom RealPort Ethernet 10/100 + Modem 56
+product XIRCOM CEM28           0x110b Xircom CreditCard Ethernet + Modem 28
+product XIRCOM CEM56           0x110b Xircom CreditCard Ethernet + Modem 56
+product XIRCOM CEM33           0x110d Xircom CreditCard Ethernet + Modem 33
+
+/* ZONET */
+product ZONET ZEN              0x0100  Zonet Zen 10/10
+
+/*
+ * Cards we know only by their cis, sorted by name.
+ */
+vendor AMBICOM                 -1      AmbiCom Inc
+vendor ACCTON                  -1      ACCTON
+vendor ADDTRON                 -1      Addtron
+vendor ARGOSY                  -1      ARGOSY
+vendor AMD                     -1      AMD
+vendor BILLIONTON              -1      Billionton Systems Inc.
+vendor CNET                    -1      CNet
+vendor COREGA                  -1      Corega K.K.
+vendor DIGITAL                 -1      Digital Equipment Corporation
+vendor DLINK                   -1      D-Link
+vendor DYNALINK                        -1      DynaLink
+vendor EIGERLABS               -1      Eiger labs,Inc.
+vendor EPSON                   -1      Seiko Epson Corporation
+vendor EXP                     -1      EXP Computer Inc
+vendor FUJITSU2                        -1      Fujitsu
+vendor FUTUREDOMAIN            -1      FutureDomain
+vendor FREECOM                 -1      Freecom
+vendor GEMTEK                  -1      Gem Tek
+vendor ICOM                    -1      ICOM Inc
+vendor INTERSIL2               -1      Intersil
+vendor IODATA3                 -1      I-O DATA
+vendor LANTECH                 -1      Lantech Computer Company
+vendor MELCO2                  -1      Melco Corporation
+vendor NAKAGAWAMETAL           -1      NAKAGAWA METAL
+vendor NDC                     -1      NDC
+vendor NEC                     -1      NEC
+vendor OEM2                    -1      Generic OEM
+vendor PLANET                  -1      Planet
+vendor PLANEX                  -1      Planex Communications Inc
+vendor PREMAX                  -1      Premax
+vendor RPTI                    -1      RPTI
+vendor SVEC                    -1      SVEC/Hawking Technology
+vendor SYNERGY21               -1      Synergy 21
+vendor TEAC                    -1      TEAC
+vendor TOSHIBA                 -1      TOSHIBA
+vendor WORKBIT2                        -1      WORKBIT
+vendor YEDATA                  -1      Y-E DATA
+vendor YIS                     -1      YIS Corporation
+vendor ZOOM                    -1      ZOOM
+
+product ACCTON EN2212          { "ACCTON", "EN2212", NULL, NULL } Accton EN2212
+product ACCTON EN2216          { "ACCTON", "EN2216-PCMCIA-ETHERNET", "EN2216R01", NULL } Accton EN2216
+product ACCTON EN2226          { "Accton", "Fast&spEtherCard-16", "EN2226", "1.00" } Accton EN2226
+product ADDTRON AWP100         { "Addtron", "AWP-100&spWireless&spPCMCIA", "Version&sp01.02", NULL }
+product ALLIEDTELESIS WR211PCM { "Allied&spTelesis&spK.K.", "WR211PCM", NULL, NULL } Allied Telesis WR211PCM
+product AMBICOM AMB8002T       { "AmbiCom&spInc", "AMB8002T", NULL, NULL } AmbiCom AMB8002T
+product AMD AM79C930           { "AMD", "Am79C930", NULL, NULL } AMD Am79C930
+product ARGOSY SP320           { "PCMCIA", "RS-COM 2P", NULL, NULL } ARGOSY SP320 Dual port serial PCMCIA
+product BILLIONTON CFLT10N     { "CF", "10Base-Ethernet", "1.0", NULL } Billionton Systems Inc. CFLT10N Ethernet
+product BILLIONTON LNT10TN     { "PCMCIA", "LNT-10TN", NULL, NULL } Billionton Systems Inc. LNT-10TN NE2000 Compatible Card
+product CNET NE2000            { "CNet", "CN40BC&spEthernet", "D", "NE2000" } CNet CN40BC NE2000 Compatible
+product COREGA ETHER_PCC_T     { "corega&spK.K.", "corega&spEther&spPCC-T", NULL, NULL } Corega Ether PCC-T
+product COREGA ETHER_PCC_TD    { "corega&spK.K.", "corega&spEther&spPCC-TD", NULL, NULL } Corega Ether PCC-TD
+product COREGA ETHER_II_PCC_T  { "corega&spK.K.", "corega&spEtherII&spPCC-T", NULL, NULL } Corega EtherII PCC-T
+product COREGA ETHER_II_PCC_TD { "corega&spK.K.", "corega&spEtherII&spPCC-TD", NULL, NULL } Corega EtherII PCC-TD
+product COREGA FAST_ETHER_PCC_TX       { "corega&spK.K.", "corega&spFastEther&spPCC-TX", NULL, NULL } Corega FastEther PCC-TX
+product COREGA FETHER_PCC_TXD  { "corega&spK.K.", "corega&spFEther&spPCC-TXD", NULL, NULL } Corega FEther PCC-TXD
+product COREGA FETHER_PCC_TXF  { "corega", "FEther&spPCC-TXF", NULL, NULL } Corega FEther PCC-TXF
+product COREGA WIRELESS_LAN_PCC_11     { "corega&spK.K.", "Wireless&spLAN&spPCC-11", NULL, NULL } Corega Wireless LAN PCC-11
+product COREGA WIRELESS_LAN_PCCA_11    { "corega&spK.K.", "Wireless&spLAN&spPCCA-11", NULL, NULL } Corega Wireless LAN PCCA-11
+product COREGA WIRELESS_LAN_PCCB_11    { "corega_K.K.", "Wireless_LAN_PCCB-11", NULL, NULL } Corega Wireless LAN PCCB-11
+product COREGA WIRELESS_LAN_PCCL_11    { "corega", "WL&spPCCL-11", NULL, NULL } Corega Wireless LAN PCCL-11
+
+product DIGITAL DEPCMXX                { "DIGITAL", "DEPCM-XX", NULL, NULL } DEC DEPCM-BA
+product DLINK DE650            { "D-Link", "DE-650", NULL, NULL } D-Link DE-650
+product DLINK DE660            { "D-Link", "DE-660", NULL, NULL } D-Link DE-660
+product DLINK DE660PLUS                { "D-Link", "DE-660+", NULL, NULL } D-Link DE-660+
+product DLINK DFE670TXD                { "D-Link", "DFE-670TXD", NULL, NULL } D-Link DFE-670TXD
+product DLINK DWL650H          { "D-Link&spCorporation", "D-Link&spDWL-650H&sp11Mbps&spWLAN&spAdapter", NULL, NULL } D-Link DWL-650H
+product        DYNALINK L10C           { "DYNALINK", "L10C", NULL, NULL } Dynalink L10C
+/*
+ * vendor ID of EPX_AA2000 is Fujitsu (0x0004) and product ID is 0x2000, but
+ * it conflicts with Fujitsu Towa LA501 Ethernet.
+ */
+product EIGERLABS EPX_AA2000   { "Eiger&splabs,Inc.", "EPX-AA2000&spPC&spSound&spCard", NULL, NULL } EPX-AA2000 PC Sound Card
+product EPSON EEN10B           { "Seiko&spEpson&spCorp.", "Ethernet", "P/N:&spEEN10B&spRev.&sp00", NULL } Epson EEN10B
+product EPSON SC200            { "EPSON", "SCSI-2&spPC&spCard&spSC200", NULL, NULL } Media Intelligent SCSI-2 PC Card MSC-200
+product EXP EXPMULTIMEDIA      { "EXP&sp&sp&sp", "PnPIDE", "F1", NULL } EXP IDE/ATAPI DVD Card
+product EXP THINLANCOMBO       { "PCMCIA&spLAN", "Ethernet", NULL, NULL } EXP ThinLan Combo
+product FREECOM PCCARDIDE      { "FREECOM", "PCCARD-IDE", NULL, NULL } FREECOM PCCARD-IDE
+product FUJITSU2 FMV_J181      { "PCMCIA&spMBH10302", "01", NULL, NULL } FUJITSU FMV-J181 PCMCIA Card
+product FUJITSU2 FMV_J182      { "FUJITSU", "LAN&spCard(FMV-J182)", "Ver.01", NULL } FUJITSU FMV-J182 PCMCIA Card
+product FUJITSU2 FMV_J182A     { "FUJITSU", "LAN&spCard(FMV-J182)", "Ver.02", NULL } FUJITSU FMV-J182A PCMCIA Card
+product FUJITSU2 ITCFJ182A     { "FUJITSU", "LAN&spCard(ITCFJ182)", "Ver.01", NULL } FUJITSU ITCFJ182A CompactCard
+product FUTUREDOMAIN SCSI2GO   { "Future&spDomain&spCorporation" "SCSI&spPCMCIA&spCredit&spCard&spController", NULL, NULL } Future Domain SCSI2GO
+product GEMTEK WLAN            { "Intersil", "PRISM&sp2_5&spPCMCIA&spADAPTER", "ISL37300P", "Eval-RevA" } GEMTEK Prism2_5 WaveLAN Card
+product IBM SCSICARD           { "IBM&spCorp.", "SCSI&spPCMCIA&spCard", NULL, NULL } IBM SCSI PCMCIA Card
+product ICOM SL200             { "Icom", "SL-200", NULL, NULL } Icom SL-200
+product INTERSIL2 PRISM2       { "INTERSIL", "HFA384x/IEEE", "Version&sp01.02", NULL } Intersil Prism II
+product IODATA CBIDE2          { "IO&spDATA", "CBIDE2&sp&sp&sp&sp&sp&sp", NULL, NULL } IO-DATA CBIDE2/16-bit mode
+product IODATA3 CBSC16         { "IO&spDATA", "CBSC16&sp&sp&sp&sp&sp&sp&sp", NULL, NULL } IO-DATA CBSC16
+product IODATA PCLAT           { "I-O&spDATA", "PCLA", "ETHERNET", NULL } IO-DATA PCLA/T
+product LANTECH FASTNETTX      { "ASIX", "AX88190", NULL, NULL } Lantech Fastnet/TX
+product LINKSYS ECARD_2                { "LINKSYS", "E-CARD", NULL, NULL } Linksys E-Card
+product LINKSYS PCM100         { "Linksys", "EtherFast&sp10/100&spIntegrated&spPC&spCard&sp(PCM100)", "Ver&sp1.0", NULL }
+product MACNICA MPS100         { "MACNICA", "MIRACLE&spSCSI", "mPS100", "D.0" } Macnica Miracle SCSI mPS100
+product MEGAHERTZ XJ2288       { "MEGAHERTZ", "MODEM&spXJ2288", NULL, NULL } Megahertz XJ2288 Modem
+product MELCO2 LPC2_TX         { "MELCO", "LPC2-TX", NULL, NULL } Melco LPC2-TX
+product NAKAGAWAMETAL LNT10TN  { "PCMCIA", "LNT-10TN", NULL, NULL } NAKAGAWA METAL LNT-10TN NE2000 Compatible Card 
+product NANOSPEED PRISM2       { "NANOSPEED", "HFA384x/IEEE", "Version&sp01.02", NULL } NANOSPEED ROOT-RZ2000 WLAN Card
+product NDC ND5100_E           { "NDC", "Ethernet", "A", NULL } Sohoware ND5100E NE2000 Compatible Card
+product NEC CMZ_RT_WP          { "NEC", "Wireless&spCard&spCMZ-RT-WP", "Version&sp01.01", NULL } NEC Wireless Card CMZ-RT-WP
+product NEC PC9801N_J03R       { "NEC", "PC-9801N-J03R", NULL, NULL } NEC PC-9801N-J03R
+product NEWMEDIA BASICS_SCSI   { "BASICS&spby&spNew&spMedia&spCorporation" "SCSI&spSym53C500", NULL, NULL } New Media Corporation BASICS SCSI
+product NTT_ME WLAN            { "NTT-ME", "11Mbps&spWireless&spLAN&spPC&spCard", NULL, NULL } NTT-ME 11Mbps Wireless LAN PC Card
+product OEM2 CDROM1    { "PCMCIA", "CD-ROM", NULL, NULL } Generic PCMCIA CD-ROM
+product OEM2 IDE       { "PCMCIA", "IDE&spCARD", NULL, NULL } Generic PCMCIA IDE CARD
+product PLANET SMARTCOM2000    { "PCMCIA", "UE2212", NULL, NULL } Planet SmartCOM 2000
+/*
+ * vendor ID of both FNW-3600-T and FNW-3700-T is LINKSYS (0x0149) and
+ * product ID is 0xc1ab, but it conflicts with LINKSYS Combo EthernetCard.
+ */
+product PLANEX FNW3600T                -1 Planex FNW-3600-T
+product PLANEX FNW3700T                -1 Planex FNW-3700-T
+product RPTI EP400             { "RPTI&spLTD.", "EP400", "CISV100", NULL } RPTI EP400
+product RPTI EP401             { "RPTI", "EP401&spEthernet&spNE2000&spCompatible", NULL, NULL } RPTI EP401
+product PREMAX PE200           { "PMX&sp&sp&sp", "PE-200", NULL, NULL } PreMax PE-200
+product RATOC REX_R280         { "RATOC&spSystem&spInc.", "10BASE_T&spCARD&spR280", NULL, NULL } RATOC REX-R280
+product RATOC REX5536          { "1195&spRATOC&spSystem&spInc.", "REX5536&spSCSI2&spCARD", NULL, NULL } RATOC REX-5536
+product RATOC REX5536AM                { "PCMCIA&spSCSI&spMBH10404", "01", NULL, NULL } RATOC REX-5536AM
+product RATOC REX5536M         { "PCMCIA&spSCSI2&spCARD", "01", NULL, NULL } RATOC REX-5536M
+product RATOC REX5572          { "RATOC&spSystem&spInc.", "SOUND/SCSI2&spCARD", NULL, NULL } RATOC REX-5572
+product RATOC REX9530          { "RATOC&spSystem&spInc.", "SCSI2&spCARD&sp37", NULL, NULL } RATOC REX-9530
+product SIMPLETECH SPECTRUM24_ALT      { "Symbol&spTechnologies", "LA4111&spSpectrum24&spWireless&spLAN&spPC&spCard", NULL, NULL } LA4111 Spectrum24 Wireless LAN PC Card
+product SMC 2632W              { "SMC", "SMC2632W", "Version&sp01.02", NULL } SMC 2632 EZ Connect Wireless PC Card
+product SMC 8041               { "SMC", "8041TX-10/100-PC-Card-V2", NULL, NULL } SMC 8041TX 10/100 PC Card
+product SVEC COMBOCARD         { "Ethernet", "Adapter", NULL, NULL } SVEC/Hawking Tech. Combo Card
+product SVEC LANCARD           { "SVEC", "FD605&spPCMCIA&spEtherNet&spCard", "V1-1", NULL } SVEC PCMCIA Lan Card
+product SYNERGY21 S21810       { "PCMCIA", "Ethernet", "A", "004743118001" } Synergy 21 S21810+ NE2000 Compatible Card
+product TEAC IDECARDII         { NULL, "NinjaATA-", NULL, NULL } TEAC IDE Card/II
+product TOSHIBA CBIDE2         { "LOOKMEET", "CBIDE2&sp&sp&sp&sp&sp&sp", NULL, NULL } TOSHIBA PA2673U CBIDE2/16-bit mode (IO-DATA OEM)
+product WORKBIT2 NINJA_SCSI3   { "WBT", "NinjaSCSI-3", NULL, NULL } WORKBIT Ninja SCSI series
+product XIRCOM CFE_10          { "Xircom", "CompactCard&spEthernet", "CFE-10", "1.00" } Xircom CompactCard CFE-10
+product YEDATA EXTERNAL_FDD    { "Y-E&spDATA", "External&spFDD", NULL, NULL } Y-E DATA External FDD
+product YIS YWL11B     { "YIS&spCorp.", "YWL-11b", NULL, NULL } YIS Corp. YWL-11b
+product ZOOM AIR_4000          { "Zoom", "Air-4000", NULL, NULL } Zoom Air-4000
diff --git a/sys/bus/pccard/pccarddevs.h b/sys/bus/pccard/pccarddevs.h
new file mode 100644 (file)
index 0000000..5fd34e2
--- /dev/null
@@ -0,0 +1,1148 @@
+/*     $DragonFly: src/sys/bus/pccard/pccarddevs.h,v 1.1 2004/02/10 07:55:45 joerg Exp $       */
+
+/*
+ * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
+ *
+ * generated from:
+ *     FreeBSD: src/sys/dev/pccard/pccarddevs,v 1.79 2003/11/03 16:09:17 imp Exp 
+ */
+/* $NetBSD: pcmciadevs,v 1.186 2003/09/16 08:26:37 onoe Exp $ */
+/* $OpenBSD: pcmciadevs,v 1.93 2002/06/21 08:31:10 henning Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccarddevs.h,v 1.1 2004/02/10 07:55:45 joerg Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *        This product includes software developed by the NetBSD
+ *        Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ *    contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``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 FOUNDATION OR CONTRIBUTORS
+ * 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.
+ */
+
+/*
+ * List of known PCMCIA vendors, sorted by numeric ID.
+ */
+
+#define        PCMCIA_VENDOR_FUJITSU   0x0004  /* Fujitsu Corporation */
+#define        PCMCIA_VENDOR_INTERSIL  0x000b  /* Intersil */
+#define        PCMCIA_VENDOR_PANASONIC 0x0032  /* Matsushita Electric Industrial Co. */
+#define        PCMCIA_VENDOR_SANDISK   0x0045  /* Sandisk Corporation */
+#define        PCMCIA_VENDOR_NEWMEDIA  0x0057  /* New Media Corporation */
+#define        PCMCIA_VENDOR_INTEL     0x0089  /* Intel */
+#define        PCMCIA_VENDOR_IBM       0x00a4  /* IBM Corporation */
+#define        PCMCIA_VENDOR_SHARP     0x00b0  /* Sharp Corporation */
+#define        PCMCIA_VENDOR_3COM      0x0101  /* 3Com Corporation */
+#define        PCMCIA_VENDOR_MEGAHERTZ 0x0102  /* Megahertz Corporation */
+#define        PCMCIA_VENDOR_SOCKET    0x0104  /* Socket Communications */
+#define        PCMCIA_VENDOR_TDK       0x0105  /* TDK Corporation */
+#define        PCMCIA_VENDOR_XIRCOM    0x0105  /* Xircom */
+#define        PCMCIA_VENDOR_SMC       0x0108  /* Standard Microsystems Corporation */
+#define        PCMCIA_VENDOR_MOTOROLA  0x0109  /* Motorola Corporation */
+#define        PCMCIA_VENDOR_NI        0x010b  /* National Instruments */
+#define        PCMCIA_VENDOR_QLOGIC    0x0114  /* QLogic */
+#define        PCMCIA_VENDOR_USROBOTICS        0x0115  /* US Robotics Corporation */
+#define        PCMCIA_VENDOR_OLICOM    0x0121  /* Olicom */
+#define        PCMCIA_VENDOR_PROXIM    0x0126  /* Proxim */
+#define        PCMCIA_VENDOR_DSPSI     0x0128  /* DSP Solutions, Inc */
+#define        PCMCIA_VENDOR_ADAPTEC   0x012f  /* Adaptec Corporation */
+#define        PCMCIA_VENDOR_QUATECH   0x0137  /* Quatech */
+#define        PCMCIA_VENDOR_COMPAQ    0x0138  /* Compaq */
+#define        PCMCIA_VENDOR_OSITECH   0x0140  /* Ositech */
+#define        PCMCIA_VENDOR_DLINK_2   0x0143  /* D-Link */
+#define        PCMCIA_VENDOR_DLINK_3   0x0149  /* D-Link */
+#define        PCMCIA_VENDOR_LINKSYS   0x0149  /* Linksys Corporation */
+#define        PCMCIA_VENDOR_NETGEAR   0x0149  /* Netgear */
+#define        PCMCIA_VENDOR_SIMPLETECH        0x014d  /* Simple Technology */
+#define        PCMCIA_VENDOR_SYMBOL2   0x014d  /* Symbol */
+#define        PCMCIA_VENDOR_LUCENT    0x0156  /* Lucent Technologies */
+#define        PCMCIA_VENDOR_GEMPLUS   0x0157  /* Gemplus */
+#define        PCMCIA_VENDOR_AIRONET   0x015f  /* Aironet Wireless Communications */
+#define        PCMCIA_VENDOR_ERICSSON  0x016b  /* Ericsson */
+#define        PCMCIA_VENDOR_PSION     0x016c  /* Psion */
+#define        PCMCIA_VENDOR_COMPAQ2   0x0183  /* Compaq */
+#define        PCMCIA_VENDOR_PARALON   0x0183  /* Paralon Technologies Inc */
+#define        PCMCIA_VENDOR_KINGSTON  0x0186  /* Kingston */
+#define        PCMCIA_VENDOR_MELCO     0x018a  /* Melco Corporation */
+#define        PCMCIA_VENDOR_DAYNA     0x0194  /* Dayna Corporation */
+#define        PCMCIA_VENDOR_RAYTHEON  0x01a6  /* Raytheon */
+#define        PCMCIA_VENDOR_IODATA    0x01bf  /* I-O DATA */
+#define        PCMCIA_VENDOR_BAY       0x01eb  /* Bay Networks */
+#define        PCMCIA_VENDOR_FARALLON  0x0200  /* Farallon Communications */
+#define        PCMCIA_VENDOR_TELECOMDEVICE     0x021b  /* Telecom Device */
+#define        PCMCIA_VENDOR_NOKIA     0x023d  /* Nokia Communications */
+#define        PCMCIA_VENDOR_SAMSUNG   0x0250  /* Samsung */
+#define        PCMCIA_VENDOR_HWN       0x0261  /* Home Wireless Networks */
+#define        PCMCIA_VENDOR_ARTEM     0x0268  /* ARtem */
+#define        PCMCIA_VENDOR_SYMBOL    0x026c  /* Symbol */
+#define        PCMCIA_VENDOR_BUFFALO   0x026f  /* BUFFALO (Melco Corporation) */
+#define        PCMCIA_VENDOR_BROMAX    0x0274  /* Bromax communications, Inc */
+#define        PCMCIA_VENDOR_IODATA2   0x028a  /* I-O DATA */
+#define        PCMCIA_VENDOR_ASUS      0x02aa  /* ASUS */
+#define        PCMCIA_VENDOR_SIEMENS   0x02ac  /* Siemens */
+#define        PCMCIA_VENDOR_MICROSOFT 0x02d2  /* Microsoft Corporation */
+
+/*
+ * The following vendor IDs are byte-swapped from what the company is assigned.
+ */
+#define        PCMCIA_VENDOR_NWN       0x0602  /* No Wires Needed */
+#define        PCMCIA_VENDOR_BREEZECOM 0x0a02  /* BreezeCOM */
+#define        PCMCIA_VENDOR_LASAT     0x3401  /* Lasat Communications A/S */
+#define        PCMCIA_VENDOR_BONDWELL  0x3b01  /* Bondwell */
+#define        PCMCIA_VENDOR_LEXARMEDIA        0x4e01  /* Lexar Media */
+#define        PCMCIA_VENDOR_COMPEX    0x8a01  /* Compex Corporation */
+#define        PCMCIA_VENDOR_ZONET     0x8a01  /* Zonet Technology Inc. */
+#define        PCMCIA_VENDOR_ELSA      0xd601  /* Elsa */
+
+/*
+ * The following vendor IDs are not, as far as I can tell, actually
+ * assigned to these people.  However, all the ones starting with '0xc'
+ * look coherent enough that maybe somebody other than PCMCIA is
+ * assigning numbers in that range.
+ */
+#define        PCMCIA_VENDOR_NEWMEDIA2 0x10cd  /* NewMedia */
+#define        PCMCIA_VENDOR_PLANEX_2  0x14ea  /* PLANEX */
+#define        PCMCIA_VENDOR_ACTIONTEC 0x1668  /* ACTIONTEC */
+#define        PCMCIA_VENDOR_AIRVAST   0x50c2  /* AirVast Technology */
+#define        PCMCIA_VENDOR_ARCHOS    0x5241  /* Archos */
+#define        PCMCIA_VENDOR_DUAL      0x890f  /* Dual */
+#define        PCMCIA_VENDOR_EDIMAX    0x890f  /* Edimax Technology Inc. */
+#define        PCMCIA_VENDOR_CONTEC    0xc001  /* Contec */
+#define        PCMCIA_VENDOR_MACNICA   0xc00b  /* MACNICA */
+#define        PCMCIA_VENDOR_ROLAND    0xc00c  /* Roland */
+#define        PCMCIA_VENDOR_COREGA2   0xc00f  /* Corega K.K. */
+#define        PCMCIA_VENDOR_ALLIEDTELESIS     0xc00f  /* Allied Telesis K.K. */
+#define        PCMCIA_VENDOR_HAGIWARASYSCOM    0xc012  /* Hagiwara SYS-COM */
+#define        PCMCIA_VENDOR_RATOC     0xc015  /* RATOC System Inc. */
+#define        PCMCIA_VENDOR_WORKBIT   0xc024  /* WORKBIT */
+#define        PCMCIA_VENDOR_EMTAC     0xc250  /* EMTAC Technology Corporation */
+
+/*
+ * List of known products.  Grouped by vendor, sorted by number within the
+ * group.
+ */
+
+/* 3COM Products */
+#define        PCMCIA_CIS_3COM_3CRWE737A       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CRWE737A   0x0001
+#define        PCMCIA_STR_3COM_3CRWE737A       "3Com AirConnect Wireless LAN"
+#define        PCMCIA_CIS_3COM_3CXM056BNW      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CXM056BNW  0x002f
+#define        PCMCIA_STR_3COM_3CXM056BNW      "3Com/NoteWorthy 3CXM056-BNW 56K Modem"
+#define        PCMCIA_CIS_3COM_3CXEM556        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CXEM556    0x0035
+#define        PCMCIA_STR_3COM_3CXEM556        "3Com/Megahertz 3CXEM556 Ethernet/Modem"
+#define        PCMCIA_CIS_3COM_3CXEM556INT     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CXEM556INT 0x003d
+#define        PCMCIA_STR_3COM_3CXEM556INT     "3Com/Megahertz 3CXEM556-INT Ethernet/Modem"
+#define        PCMCIA_CIS_3COM_3CCFEM556BI     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CCFEM556BI 0x0556
+#define        PCMCIA_STR_3COM_3CCFEM556BI     "3Com/Megahertz 3CCFEM556BI Ethernet/Modem"
+#define        PCMCIA_CIS_3COM_3C562   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3C562       0x0562
+#define        PCMCIA_STR_3COM_3C562   "3Com 3c562 33.6 Modem/10Mbps Ethernet"
+#define        PCMCIA_CIS_3COM_3C589   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3C589       0x0589
+#define        PCMCIA_STR_3COM_3C589   "3Com 3c589 10Mbps Ethernet"
+#define        PCMCIA_CIS_3COM_3C574   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3C574       0x0574
+#define        PCMCIA_STR_3COM_3C574   "3Com 3c574-TX 10/100Mbps Ethernet"
+#define        PCMCIA_CIS_3COM_3CRWE777A       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CRWE777A   0x0777
+#define        PCMCIA_STR_3COM_3CRWE777A       "3Com 3CRWE777A Airconnect"
+#define        PCMCIA_CIS_3COM_3C1     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3C1 0x0cf1
+#define        PCMCIA_STR_3COM_3C1     "3Com Megahertz 3C1 10Mbps LAN CF+ Card"
+#define        PCMCIA_CIS_3COM_3CRWE62092A     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_3COM_3CRWE62092A 0x2092
+#define        PCMCIA_STR_3COM_3CRWE62092A     "3Com 3CRWE62092A Wireless LAN"
+
+/* ACTIONTEC Products */
+#define        PCMCIA_CIS_ACTIONTEC_PRISM      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ACTIONTEC_PRISM  0x0101
+#define        PCMCIA_STR_ACTIONTEC_PRISM      "PRISM Wireless LAN PC Card"
+
+/* Adaptec Products */
+#define        PCMCIA_CIS_ADAPTEC_APA1460      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ADAPTEC_APA1460  0x0001
+#define        PCMCIA_STR_ADAPTEC_APA1460      "Adaptec APA-1460 SlimSCSI"
+#define        PCMCIA_CIS_ADAPTEC_APA1460A     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ADAPTEC_APA1460A 0x0002
+#define        PCMCIA_STR_ADAPTEC_APA1460A     "Adaptec APA-1460A SlimSCSI"
+
+/* Aironet */
+#define        PCMCIA_CIS_AIRONET_PC4500       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_AIRONET_PC4500   0x0005
+#define        PCMCIA_STR_AIRONET_PC4500       "Aironet PC4500 Wireless LAN Adapter"
+#define        PCMCIA_CIS_AIRONET_PC4800       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_AIRONET_PC4800   0x0007
+#define        PCMCIA_STR_AIRONET_PC4800       "Aironet PC4800 Wireless LAN Adapter"
+#define        PCMCIA_CIS_AIRONET_350  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_AIRONET_350      0x000a
+#define        PCMCIA_STR_AIRONET_350  "Aironet 350 Wireless LAN Adapter"
+
+/* AirVast */
+#define        PCMCIA_CIS_AIRVAST_WN_100       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_AIRVAST_WN_100   0x7300
+#define        PCMCIA_STR_AIRVAST_WN_100       "AirVast WN-100"
+
+/* Allied Telesis K.K. */
+#define        PCMCIA_CIS_ALLIEDTELESIS_LA_PCM { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ALLIEDTELESIS_LA_PCM     0x0002
+#define        PCMCIA_STR_ALLIEDTELESIS_LA_PCM "Allied Telesis LA-PCM"
+
+/* Archos */
+#define        PCMCIA_CIS_ARCHOS_ARC_ATAPI     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ARCHOS_ARC_ATAPI 0x0043
+#define        PCMCIA_STR_ARCHOS_ARC_ATAPI     "MiniCD"
+
+/* ARtem */
+#define        PCMCIA_CIS_ARTEM_ONAIR  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ARTEM_ONAIR      0x0001
+#define        PCMCIA_STR_ARTEM_ONAIR  "ARtem OnAir"
+
+/* ASUS WL-100 */
+#define        PCMCIA_CIS_ASUS_WL100   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ASUS_WL100       0x0002
+#define        PCMCIA_STR_ASUS_WL100   "ASUS SpaceLink WL-100 Wireless LAN"
+
+/* Bay Networks */
+#define        PCMCIA_CIS_BAY_STACK_650        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BAY_STACK_650    0x0804
+#define        PCMCIA_STR_BAY_STACK_650        "BayStack 650 Wireless LAN"
+#define        PCMCIA_CIS_BAY_SURFER_PRO       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BAY_SURFER_PRO   0x0806
+#define        PCMCIA_STR_BAY_SURFER_PRO       "AirSurfer Pro Wireless LAN"
+#define        PCMCIA_CIS_BAY_STACK_660        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BAY_STACK_660    0x0807
+#define        PCMCIA_STR_BAY_STACK_660        "BayStack 660 Wireless LAN"
+#define        PCMCIA_CIS_BAY_EMOBILITY_11B    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BAY_EMOBILITY_11B        0x080a
+#define        PCMCIA_STR_BAY_EMOBILITY_11B    "e-Mobility 11Mb Wireless LAN"
+
+/* Bondwell */
+#define        PCMCIA_CIS_BONDWELL_B236        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BONDWELL_B236    0x0000
+#define        PCMCIA_STR_BONDWELL_B236        "Game Card Joystick"
+
+/* BreezeCOM */
+#define        PCMCIA_CIS_BREEZECOM_BREEZENET  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BREEZECOM_BREEZENET      0x0102
+#define        PCMCIA_STR_BREEZECOM_BREEZENET  "BreezeCOM BreezeNET"
+
+/* Bromax Communications, Inc (Linksys OEM) */
+#define        PCMCIA_CIS_BROMAX_IWN   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BROMAX_IWN       0x1612
+#define        PCMCIA_STR_BROMAX_IWN   "Instant Wireless Network PC Card"
+#define        PCMCIA_CIS_BROMAX_IWN3  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BROMAX_IWN3      0x1613
+#define        PCMCIA_STR_BROMAX_IWN3  "Instant Wireless Network PC Card, Versin 3"
+#define        PCMCIA_CIS_BROMAX_WCF11 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BROMAX_WCF11     0x3301
+#define        PCMCIA_STR_BROMAX_WCF11 "Instant Wireless Network CF Card"
+
+/* BUFFALO */
+#define        PCMCIA_CIS_BUFFALO_LPC3_CLX     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BUFFALO_LPC3_CLX 0x0301
+#define        PCMCIA_STR_BUFFALO_LPC3_CLX     "BUFFALO LPC3-CLX Ethernet Adapter"
+#define        PCMCIA_CIS_BUFFALO_WLI_PCM_S11  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BUFFALO_WLI_PCM_S11      0x0305
+#define        PCMCIA_STR_BUFFALO_WLI_PCM_S11  "BUFFALO AirStation 11Mbps WLAN"
+#define        PCMCIA_CIS_BUFFALO_LPC_CF_CLT   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BUFFALO_LPC_CF_CLT       0x0307
+#define        PCMCIA_STR_BUFFALO_LPC_CF_CLT   "BUFFALO LPC-CF-CLT"
+#define        PCMCIA_CIS_BUFFALO_LPC3_CLT     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BUFFALO_LPC3_CLT 0x030a
+#define        PCMCIA_STR_BUFFALO_LPC3_CLT     "BUFFALO LPC3-CLT Ethernet Adapter"
+#define        PCMCIA_CIS_BUFFALO_WLI_CF_S11G  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_BUFFALO_WLI_CF_S11G      0x030b
+#define        PCMCIA_STR_BUFFALO_WLI_CF_S11G  "BUFFALO AirStation 11Mbps CF WLAN"
+
+/* Compaq Products */
+#define        PCMCIA_CIS_COMPAQ_NC5004        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_COMPAQ_NC5004    0x0002
+#define        PCMCIA_STR_COMPAQ_NC5004        "Compaq Agency NC5004 Wireless Card"
+#define        PCMCIA_CIS_COMPAQ2_CPQ_10_100   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_COMPAQ2_CPQ_10_100       0x010a
+#define        PCMCIA_STR_COMPAQ2_CPQ_10_100   "Compaq Netelligent 10/100 Ethernet"
+
+/* Compex Products */
+#define        PCMCIA_CIS_COMPEX_AMP_WIRELESS  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_COMPEX_AMP_WIRELESS      0x0066
+#define        PCMCIA_STR_COMPEX_AMP_WIRELESS  "AMP"
+#define        PCMCIA_CIS_COMPEX_LINKPORT_ENET_B       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_COMPEX_LINKPORT_ENET_B   0x0100
+#define        PCMCIA_STR_COMPEX_LINKPORT_ENET_B       "Compex Linkport ENET-B Ethernet"
+
+/* Contec C-NET(PC) */
+#define        PCMCIA_CIS_CONTEC_CNETPC        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_CONTEC_CNETPC    0x0000
+#define        PCMCIA_STR_CONTEC_CNETPC        "Contec C-NET(PC)C"
+#define        PCMCIA_CIS_CONTEC_FX_DS110_PCC  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_CONTEC_FX_DS110_PCC      0x0008
+#define        PCMCIA_STR_CONTEC_FX_DS110_PCC  "Contec FLEXLAN/FX-DS110-PCC"
+
+/* Dayna Products */
+#define        PCMCIA_CIS_DAYNA_COMMUNICARD_E_1        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DAYNA_COMMUNICARD_E_1    0x002d
+#define        PCMCIA_STR_DAYNA_COMMUNICARD_E_1        "Dayna CommuniCard E"
+#define        PCMCIA_CIS_DAYNA_COMMUNICARD_E_2        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DAYNA_COMMUNICARD_E_2    0x002f
+#define        PCMCIA_STR_DAYNA_COMMUNICARD_E_2        "Dayna CommuniCard E"
+
+/* DIGITAL Products */
+#define        PCMCIA_CIS_DIGITAL_MOBILE_MEDIA_CDROM   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DIGITAL_MOBILE_MEDIA_CDROM       0x0d00
+#define        PCMCIA_STR_DIGITAL_MOBILE_MEDIA_CDROM   "Digital Mobile Media CD-ROM"
+
+/* D-Link Products */
+#define        PCMCIA_CIS_DLINK_2_DMF560TX     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_2_DMF560TX 0xc0ab
+#define        PCMCIA_STR_DLINK_2_DMF560TX     "D-Link DMF-650TX"
+
+/* DSP Solutions, Inc. (Megahertz OEM) */
+#define        PCMCIA_CIS_DSPSI_XJEM1144       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DSPSI_XJEM1144   0x0101
+#define        PCMCIA_STR_DSPSI_XJEM1144       "Megahertz X-JACK"
+#define        PCMCIA_CIS_DSPSI_XJACK  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DSPSI_XJACK      0x0103
+#define        PCMCIA_STR_DSPSI_XJACK  "Megahertz X-JACK Ethernet"
+
+/* Dual */
+#define        PCMCIA_CIS_DUAL_NE2000  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_DUAL_NE2000      0x0100
+#define        PCMCIA_STR_DUAL_NE2000  "Dual NE2000"
+
+/* Edimax Products */
+#define        PCMCIA_CIS_EDIMAX_EP4000A       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_EDIMAX_EP4000A   0x0100
+#define        PCMCIA_STR_EDIMAX_EP4000A       "Edimax EP4000A"
+
+/* ELSA Products */
+#define        PCMCIA_CIS_ELSA_MC2_IEEE        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ELSA_MC2_IEEE    0x0001
+#define        PCMCIA_STR_ELSA_MC2_IEEE        "AirLancer MC-2 IEEE"
+#define        PCMCIA_CIS_ELSA_XI300_IEEE      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ELSA_XI300_IEEE  0x0002
+#define        PCMCIA_STR_ELSA_XI300_IEEE      "XI300 Wireless LAN"
+#define        PCMCIA_CIS_ELSA_XI800_IEEE      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ELSA_XI800_IEEE  0x0004
+#define        PCMCIA_STR_ELSA_XI800_IEEE      "XI800 CF Wireless LAN"
+#define        PCMCIA_CIS_ELSA_XI325_IEEE      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ELSA_XI325_IEEE  0x0005
+#define        PCMCIA_STR_ELSA_XI325_IEEE      "XI325 Wireless LAN"
+
+/* EMTAC */
+#define        PCMCIA_CIS_EMTAC_WLAN   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_EMTAC_WLAN       0x0002
+#define        PCMCIA_STR_EMTAC_WLAN   "EMTAC A2424i 11Mbps WLAN Card"
+
+/* Ericsson */
+#define        PCMCIA_CIS_ERICSSON_WIRELESSLAN { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ERICSSON_WIRELESSLAN     0x0001
+#define        PCMCIA_STR_ERICSSON_WIRELESSLAN "DSSS Wireless LAN PC Card"
+
+/* Farallon */
+#define        PCMCIA_CIS_FARALLON_SKYLINE     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_FARALLON_SKYLINE 0x0a01
+#define        PCMCIA_STR_FARALLON_SKYLINE     "SkyLINE Wireless"
+
+/* Fujutsu Products */
+#define        PCMCIA_CIS_FUJITSU_SCSI600      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_FUJITSU_SCSI600  0x0401
+#define        PCMCIA_STR_FUJITSU_SCSI600      "Fujitsu SCSI 600 Interface"
+#define        PCMCIA_CIS_FUJITSU_LA10S        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_FUJITSU_LA10S    0x1003
+#define        PCMCIA_STR_FUJITSU_LA10S        "Fujitsu Compact Flash Ethernet"
+#define        PCMCIA_CIS_FUJITSU_LA501        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_FUJITSU_LA501    0x2000
+#define        PCMCIA_STR_FUJITSU_LA501        "Fujitsu Towa LA501 Ethernet"
+#define        PCMCIA_CIS_FUJITSU_WL110        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_FUJITSU_WL110    0x2003
+#define        PCMCIA_STR_FUJITSU_WL110        "PEGA-WL110 Wireless LAN"
+
+/* Gemplus */
+#define        PCMCIA_CIS_GEMPLUS_GPR400       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_GEMPLUS_GPR400   0x3004
+#define        PCMCIA_STR_GEMPLUS_GPR400       "GPR400 Smartcard Reader"
+
+/* Home Wireless Networks */
+#define        PCMCIA_CIS_HWN_AIRWAY80211      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_HWN_AIRWAY80211  0x0002
+#define        PCMCIA_STR_HWN_AIRWAY80211      "HWN Airway Wireless PCMCIA Card"
+
+/* IBM Products */
+#define        PCMCIA_CIS_IBM_MICRODRIVE       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_MICRODRIVE   0x0000
+#define        PCMCIA_STR_IBM_MICRODRIVE       "IBM Microdrive"
+#define        PCMCIA_CIS_IBM_3270     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_3270 0x0001
+#define        PCMCIA_STR_IBM_3270     "IBM 3270 Emulation"
+#define        PCMCIA_CIS_IBM_INFOMOVER        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_INFOMOVER    0x0002
+#define        PCMCIA_STR_IBM_INFOMOVER        "IBM InfoMover"
+#define        PCMCIA_CIS_IBM_5250     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_5250 0x000b
+#define        PCMCIA_STR_IBM_5250     "IBM 5250 Emulation"
+#define        PCMCIA_CIS_IBM_TROPIC   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_TROPIC       0x001e
+#define        PCMCIA_STR_IBM_TROPIC   "IBM Token Ring 4/16"
+#define        PCMCIA_CIS_IBM_SCSI     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_SCSI 0x0026
+#define        PCMCIA_STR_IBM_SCSI     "IBM SCSI PCMCIA"
+#define        PCMCIA_CIS_IBM_PORTABLE_CDROM   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_PORTABLE_CDROM       0x002d
+#define        PCMCIA_STR_IBM_PORTABLE_CDROM   "IBM PCMCIA Portable CD-ROM Drive"
+#define        PCMCIA_CIS_IBM_HOME_AND_AWAY    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_HOME_AND_AWAY        0x002e
+#define        PCMCIA_STR_IBM_HOME_AND_AWAY    "IBM Home and Away Modem"
+#define        PCMCIA_CIS_IBM_WIRELESS_LAN_ENTRY       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_WIRELESS_LAN_ENTRY   0x0032
+#define        PCMCIA_STR_IBM_WIRELESS_LAN_ENTRY       "IBM Wireless LAN Entry"
+#define        PCMCIA_CIS_IBM_SMART_CAPTURE_II { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_SMART_CAPTURE_II     0x003c
+#define        PCMCIA_STR_IBM_SMART_CAPTURE_II "IBM Smart Capture Card II"
+#define        PCMCIA_CIS_IBM_ETHERJET { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_ETHERJET     0x003f
+#define        PCMCIA_STR_IBM_ETHERJET "IBM EtherJet Ethernet"
+
+/* Intel Products */
+#define        PCMCIA_CIS_INTEL_PRO_WLAN_2011  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_INTEL_PRO_WLAN_2011      0x0001
+#define        PCMCIA_STR_INTEL_PRO_WLAN_2011  "Intel PRO/Wireless 2011 LAN PC Card"
+#define        PCMCIA_CIS_INTEL_EEPRO100       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_INTEL_EEPRO100   0x010a
+#define        PCMCIA_STR_INTEL_EEPRO100       "Intel EtherExpress PRO/100"
+#define        PCMCIA_CIS_INTEL_ETHEREXPPRO    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_INTEL_ETHEREXPPRO        0x0301
+#define        PCMCIA_STR_INTEL_ETHEREXPPRO    "Intel EtherExpress Pro PCMCIA Card"
+
+/* Intersil */
+/* Note: The following likely is an OEM card under a different Intersil name */
+#define        PCMCIA_CIS_INTERSIL_MA401RA     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_INTERSIL_MA401RA 0x7300
+#define        PCMCIA_STR_INTERSIL_MA401RA     "Netgear MA401RA"
+
+/* I-O DATA */
+#define        PCMCIA_CIS_IODATA_PCLATE        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IODATA_PCLATE    0x2216
+#define        PCMCIA_STR_IODATA_PCLATE        "I-O DATA PCLA/TE"
+#define        PCMCIA_CIS_IODATA2_WNB11PCM     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IODATA2_WNB11PCM 0x0002
+#define        PCMCIA_STR_IODATA2_WNB11PCM     "I-O DATA WN-B11/PCM"
+#define        PCMCIA_CIS_IODATA2_WCF12        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_IODATA2_WCF12    0x0673
+#define        PCMCIA_STR_IODATA2_WCF12        "Wireless CF Card"
+
+/* Kingston Products */
+#define        PCMCIA_CIS_KINGSTON_KNE2        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_KINGSTON_KNE2    0x0100
+#define        PCMCIA_STR_KINGSTON_KNE2        "Kingston KNE-PC2 Ethernet"
+
+/* Lasat Products */
+#define        PCMCIA_CIS_LASAT_CREDIT_288     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LASAT_CREDIT_288 0x2811
+#define        PCMCIA_STR_LASAT_CREDIT_288     "Lasat Credit 288 Modem"
+
+/* Lexar Media */
+#define        PCMCIA_CIS_LEXARMEDIA_COMPACTFLASH      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LEXARMEDIA_COMPACTFLASH  0x0100
+#define        PCMCIA_STR_LEXARMEDIA_COMPACTFLASH      "Lexar Media CompactFlash"
+
+/* Linksys corporation */
+#define        PCMCIA_CIS_LINKSYS_TRUST_COMBO_ECARD    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_TRUST_COMBO_ECARD        0x021b
+#define        PCMCIA_STR_LINKSYS_TRUST_COMBO_ECARD    "Trust (Linksys) Combo EthernetCard"
+#define        PCMCIA_CIS_LINKSYS_ETHERFAST    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_ETHERFAST        0x0230
+#define        PCMCIA_STR_LINKSYS_ETHERFAST    "Linksys Etherfast 10/100 Ethernet"
+#define        PCMCIA_CIS_LINKSYS_ECARD_1      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_ECARD_1  0x0265
+#define        PCMCIA_STR_LINKSYS_ECARD_1      "Linksys EthernetCard or D-Link DE-650"
+#define        PCMCIA_CIS_LINKSYS_COMBO_ECARD  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_COMBO_ECARD      0xc1ab
+#define        PCMCIA_STR_LINKSYS_COMBO_ECARD  "Linksys Combo EthernetCard"
+
+/* Lucent WaveLAN/IEEE */
+#define        PCMCIA_CIS_LUCENT_WAVELAN_IEEE  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_LUCENT_WAVELAN_IEEE      0x0002
+#define        PCMCIA_STR_LUCENT_WAVELAN_IEEE  "WaveLAN/IEEE"
+
+/* MACNICA */
+#define        PCMCIA_CIS_MACNICA_ME1_JEIDA    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MACNICA_ME1_JEIDA        0x3300
+#define        PCMCIA_STR_MACNICA_ME1_JEIDA    "MACNICA ME1 for JEIDA"
+#define        PCMCIA_CIS_MACNICA_MPS110       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MACNICA_MPS110   0xa041
+#define        PCMCIA_STR_MACNICA_MPS110       "MACNICA Miracle SCSI-II mPS110"
+
+/* Megahertz Products */
+#define        PCMCIA_CIS_MEGAHERTZ_XJEM3336   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MEGAHERTZ_XJEM3336       0x0006
+#define        PCMCIA_STR_MEGAHERTZ_XJEM3336   "Megahertz X-JACK Ethernet Modem"
+#define        PCMCIA_CIS_MEGAHERTZ_XJ4288     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MEGAHERTZ_XJ4288 0x0023
+#define        PCMCIA_STR_MEGAHERTZ_XJ4288     "Megahertz XJ4288 Modem"
+#define        PCMCIA_CIS_MEGAHERTZ_XJ4336     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MEGAHERTZ_XJ4336 0x0027
+#define        PCMCIA_STR_MEGAHERTZ_XJ4336     "Megahertz XJ4336 Modem"
+#define        PCMCIA_CIS_MEGAHERTZ_XJ5560     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MEGAHERTZ_XJ5560 0x0034
+#define        PCMCIA_STR_MEGAHERTZ_XJ5560     "Megahertz X-JACK 56kbps Modem"
+
+/* Melco Products */
+#define        PCMCIA_CIS_MELCO_LPC3_TX        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MELCO_LPC3_TX    0xc1ab
+#define        PCMCIA_STR_MELCO_LPC3_TX        "Melco LPC3-TX"
+#define        PCMCIA_CIS_MELCO_LPC3_CLX       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MELCO_LPC3_CLX   0x0301
+#define        PCMCIA_STR_MELCO_LPC3_CLX       "Melco LPC3-CLX Ethernet Adapter"
+
+/* Microsoft Products */
+#define        PCMCIA_CIS_MICROSOFT_MN_520     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MICROSOFT_MN_520 0x0001
+#define        PCMCIA_STR_MICROSOFT_MN_520     "Microsoft MN-520 WLAN Card"
+
+/* Motorola Products */
+#define        PCMCIA_CIS_MOTOROLA_POWER144    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MOTOROLA_POWER144        0x0105
+#define        PCMCIA_STR_MOTOROLA_POWER144    "Motorola Power 14.4 Modem"
+#define        PCMCIA_CIS_MOTOROLA_PM100C      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MOTOROLA_PM100C  0x0302
+#define        PCMCIA_STR_MOTOROLA_PM100C      "Motorola Personal Messenger 100C CDPD Modem"
+#define        PCMCIA_CIS_MOTOROLA_MONTANA_336 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_MOTOROLA_MONTANA_336     0x0505
+#define        PCMCIA_STR_MOTOROLA_MONTANA_336 "Motorola Montana 33.6"
+
+/* New Media Products */
+#define        PCMCIA_CIS_NEWMEDIA_BASICS      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_BASICS  0x0019
+#define        PCMCIA_STR_NEWMEDIA_BASICS      "New Media BASICS Ethernet"
+#define        PCMCIA_CIS_NEWMEDIA_LANSURFER   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_LANSURFER       0x0021
+#define        PCMCIA_STR_NEWMEDIA_LANSURFER   "NewMedia LANSurfer"
+#define        PCMCIA_CIS_NEWMEDIA_LIVEWIRE    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_LIVEWIRE        0x1004
+#define        PCMCIA_STR_NEWMEDIA_LIVEWIRE    "NewMedia LiveWire Ethernet LAN Adapter"
+#define        PCMCIA_CIS_NEWMEDIA_MULTIMEDIA  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_MULTIMEDIA      0x100b
+#define        PCMCIA_STR_NEWMEDIA_MULTIMEDIA  "NewMedia Multimedia"
+#define        PCMCIA_CIS_NEWMEDIA_BUSTOASTER2 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_BUSTOASTER2     0xa002
+#define        PCMCIA_STR_NEWMEDIA_BUSTOASTER2 "New Media SCSI Bus Toaster"
+#define        PCMCIA_CIS_NEWMEDIA_BUSTOASTER  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_BUSTOASTER      0xc102
+#define        PCMCIA_STR_NEWMEDIA_BUSTOASTER  "New Media SCSI Bus Toaster"
+#define        PCMCIA_CIS_NEWMEDIA_BUSTOASTER3 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_BUSTOASTER3     0xd302
+#define        PCMCIA_STR_NEWMEDIA_BUSTOASTER3 "New Media SCSI Bus Toaster"
+#define        PCMCIA_CIS_NEWMEDIA_WAVJAMMER   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_WAVJAMMER       0xe005
+#define        PCMCIA_STR_NEWMEDIA_WAVJAMMER   "NewMedia .WAVjammer"
+#define        PCMCIA_CIS_NEWMEDIA2_BUSTOASTER { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA2_BUSTOASTER     0x0001
+#define        PCMCIA_STR_NEWMEDIA2_BUSTOASTER "NewMedia BusToaster"
+
+/* Netgear */
+#define        PCMCIA_CIS_NETGEAR_FA410TX      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NETGEAR_FA410TX  0x0230
+#define        PCMCIA_STR_NETGEAR_FA410TX      "Netgear FA410TX"
+#define        PCMCIA_CIS_NETGEAR_FA410TXC     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NETGEAR_FA410TXC 0x4530
+#define        PCMCIA_STR_NETGEAR_FA410TXC     "Netgear FA410TXC"
+#define        PCMCIA_CIS_NETGEAR_FA411        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NETGEAR_FA411    0x0411
+#define        PCMCIA_STR_NETGEAR_FA411        "Netgear FA411"
+
+/* National Instruments */
+#define        PCMCIA_CIS_NI_PCMCIA_GPIB       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NI_PCMCIA_GPIB   0x4882
+#define        PCMCIA_STR_NI_PCMCIA_GPIB       "National Instruments PCMCIA-GPIB"
+
+/* Nokia Products */
+#define        PCMCIA_CIS_NOKIA_C110_WLAN      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NOKIA_C110_WLAN  0x1110
+#define        PCMCIA_STR_NOKIA_C110_WLAN      "Nokia C110/C111"
+#define        PCMCIA_CIS_NOKIA_C020_WLAN      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NOKIA_C020_WLAN  0x20c0
+#define        PCMCIA_STR_NOKIA_C020_WLAN      "Nokia C020 WLAN Card"
+
+/* No Wires Needed */
+#define        PCMCIA_CIS_NWN_WLAN_550 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NWN_WLAN_550     0x0002
+#define        PCMCIA_STR_NWN_WLAN_550 "NWN 550 WLAN"
+#define        PCMCIA_CIS_NWN_WLAN_1148        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_NWN_WLAN_1148    0x0003
+#define        PCMCIA_STR_NWN_WLAN_1148        "NWN 1148 WLAN"
+
+/* Olicom Products */
+#define        PCMCIA_CIS_OLICOM_TR    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_OLICOM_TR        0x2132
+#define        PCMCIA_STR_OLICOM_TR    "GoCard Token Ring 16/4"
+#define        PCMCIA_CIS_OLICOM_OC2220        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_OLICOM_OC2220    0x2022
+#define        PCMCIA_STR_OLICOM_OC2220        "GoCard Ethernet"
+#define        PCMCIA_CIS_OLICOM_OC2231        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_OLICOM_OC2231    0x3122
+#define        PCMCIA_STR_OLICOM_OC2231        "GoCard Combo Eth/Modem 288"
+#define        PCMCIA_CIS_OLICOM_OC2232        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_OLICOM_OC2232    0x3222
+#define        PCMCIA_STR_OLICOM_OC2232        "GoCard Combo Eth/Modem 336"
+
+/* Ositech Products */
+#define        PCMCIA_CIS_OSITECH_TRUMPCARD_SOD        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_OSITECH_TRUMPCARD_SOD    0x0008
+#define        PCMCIA_STR_OSITECH_TRUMPCARD_SOD        "Ositech Seven of Diamonds Ethernet Card"
+
+/* Panasonic Products */
+#define        PCMCIA_CIS_PANASONIC_KXLC002    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PANASONIC_KXLC002        0x0304
+#define        PCMCIA_STR_PANASONIC_KXLC002    "Panasonic 4X CD-ROM Interface Card"
+#define        PCMCIA_CIS_PANASONIC_KXLC003    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PANASONIC_KXLC003        0x0504
+#define        PCMCIA_STR_PANASONIC_KXLC003    "Panasonic 8X CD-ROM Interface Card"
+#define        PCMCIA_CIS_PANASONIC_KXLC004    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PANASONIC_KXLC004        0x0604
+#define        PCMCIA_STR_PANASONIC_KXLC004    "Panasonic KXL-810AN Interface Card"
+#define        PCMCIA_CIS_PANASONIC_KXLC005    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PANASONIC_KXLC005        0x2704
+#define        PCMCIA_STR_PANASONIC_KXLC005    "Panasonic 16X CD-ROM Interface Card"
+#define        PCMCIA_CIS_PANASONIC_KME        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PANASONIC_KME    0x2604
+#define        PCMCIA_STR_PANASONIC_KME        "Panasonic CD-R/RW Interface"
+
+/* Planex */
+#define        PCMCIA_CIS_PLANEX_2_GWNS11H     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PLANEX_2_GWNS11H 0xb001
+#define        PCMCIA_STR_PLANEX_2_GWNS11H     "Planex GW-NS11H"
+
+/* Proxim */
+#define        PCMCIA_CIS_PROXIM_HARMONY       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PROXIM_HARMONY   0x0002
+#define        PCMCIA_STR_PROXIM_HARMONY       "Proxim HARMONY 80211B"
+#define        PCMCIA_CIS_PROXIM_ROAMABOUT_2400FH      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PROXIM_ROAMABOUT_2400FH  0x1058
+#define        PCMCIA_STR_PROXIM_ROAMABOUT_2400FH      "Digital RoamAbout 2400FH"
+#define        PCMCIA_CIS_PROXIM_RANGELAN2_7401        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PROXIM_RANGELAN2_7401    0x1158
+#define        PCMCIA_STR_PROXIM_RANGELAN2_7401        "Proxim RangeLAN2 7401"
+#define        PCMCIA_CIS_PROXIM_RANGELANDS_8430       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PROXIM_RANGELANDS_8430   0x8000
+#define        PCMCIA_STR_PROXIM_RANGELANDS_8430       "Proxim RangeLAN-DS 8430"
+
+/* Psion */
+#define        PCMCIA_CIS_PSION_GOLDCARD       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PSION_GOLDCARD   0x0020
+#define        PCMCIA_STR_PSION_GOLDCARD       "Psion Gold Card"
+
+/* QLogic */
+#define        PCMCIA_CIS_QLOGIC_PC05  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_QLOGIC_PC05      0x0104
+#define        PCMCIA_STR_QLOGIC_PC05  "Qlogic Fast SCSI"
+
+/* Quatech */
+#define        PCMCIA_CIS_QUATECH_SPP_100      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_QUATECH_SPP_100  0x0003
+#define        PCMCIA_STR_QUATECH_SPP_100      "Quatech Enhanced Parallel Port"
+#define        PCMCIA_CIS_QUATECH_DSP_225      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_QUATECH_DSP_225  0x0008
+#define        PCMCIA_STR_QUATECH_DSP_225      "Quatech Dual Serial Port"
+
+/* RATOC System Inc. Products */
+/* Don't use because both cards have same product id */
+#define        PCMCIA_CIS_RATOC_REX_R280_9530  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX_R280_9530      0x0001
+#define        PCMCIA_STR_RATOC_REX_R280_9530  "RATOC REX-R280/REX-9530"
+
+/* Raylink/WebGear */
+#define        PCMCIA_CIS_RAYTHEON_WLAN        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_RAYTHEON_WLAN    0x0000
+#define        PCMCIA_STR_RAYTHEON_WLAN        "WLAN Adapter"
+
+/* Roland */
+#define        PCMCIA_CIS_ROLAND_SCP55 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ROLAND_SCP55     0x0001
+#define        PCMCIA_STR_ROLAND_SCP55 "Roland SCP-55"
+
+/* Samsung */
+#define        PCMCIA_CIS_SAMSUNG_SWL_2000N    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SAMSUNG_SWL_2000N        0x0002
+#define        PCMCIA_STR_SAMSUNG_SWL_2000N    "Samsung MagicLAN SWL-2000N"
+
+/* Sandisk Products */
+#define        PCMCIA_CIS_SANDISK_SDCFB        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SANDISK_SDCFB    0x0401
+#define        PCMCIA_STR_SANDISK_SDCFB        "Sandisk CompactFlash Card"
+
+/* Sharp Products */
+#define        PCMCIA_CIS_SHARP_PALDIO611S     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SHARP_PALDIO611S 0x0000
+#define        PCMCIA_STR_SHARP_PALDIO611S     "PALDIO 611S PC CARD"
+
+/* Siemens */
+#define        PCMCIA_CIS_SIEMENS_SS1021       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SIEMENS_SS1021   0x0002
+#define        PCMCIA_STR_SIEMENS_SS1021       "Siemens SpeedStream 1021"
+
+/* Simple Technology Products */
+#define        PCMCIA_CIS_SIMPLETECH_COMMUNICATOR288   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SIMPLETECH_COMMUNICATOR288       0x0100
+#define        PCMCIA_STR_SIMPLETECH_COMMUNICATOR288   "Simple Technology 28.8 Communicator"
+/* Simpletech ID also used by Symbol */
+#define        PCMCIA_CIS_SIMPLETECH_SPECTRUM24        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SIMPLETECH_SPECTRUM24    0x801
+#define        PCMCIA_STR_SIMPLETECH_SPECTRUM24        "Symbol Spectrum24 WLAN Adapter"
+
+/* Standard Microsystems Corporation Products */
+#define        PCMCIA_CIS_SMC_8016     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SMC_8016 0x0105
+#define        PCMCIA_STR_SMC_8016     "SMC 8016 EtherCard"
+#define        PCMCIA_CIS_SMC_EZCARD   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SMC_EZCARD       0x8022
+#define        PCMCIA_STR_SMC_EZCARD   "SMC EZCard 10 PCMCIA"
+
+/* Socket Communications Products */
+#define        PCMCIA_CIS_SOCKET_EA_ETHER      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_EA_ETHER  0x0000
+#define        PCMCIA_STR_SOCKET_EA_ETHER      "Socket Communications EA"
+#define        PCMCIA_CIS_SOCKET_LP_WLAN_CF    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_LP_WLAN_CF        0x0001
+#define        PCMCIA_STR_SOCKET_LP_WLAN_CF    "Socket Communications Low Power WLAN Card"
+#define        PCMCIA_CIS_SOCKET_PAGECARD      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_PAGECARD  0x0003
+#define        PCMCIA_STR_SOCKET_PAGECARD      "Socket Communications PageCard"
+#define        PCMCIA_CIS_SOCKET_DUAL_RS232    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_DUAL_RS232        0x0006
+#define        PCMCIA_STR_SOCKET_DUAL_RS232    "Socket Communications Dual RS232"
+#define        PCMCIA_CIS_SOCKET_LP_ETHER      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_LP_ETHER  0x000d
+#define        PCMCIA_STR_SOCKET_LP_ETHER      "Socket Communications LP-E"
+#define        PCMCIA_CIS_SOCKET_LP_ETHER_CF   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_LP_ETHER_CF       0x0075
+#define        PCMCIA_STR_SOCKET_LP_ETHER_CF   "Socket Communications LP-E CF"
+#define        PCMCIA_CIS_SOCKET_LP_ETH_10_100_CF      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SOCKET_LP_ETH_10_100_CF  0x0145
+#define        PCMCIA_STR_SOCKET_LP_ETH_10_100_CF      "Socket Communications 10/100 Ethernet"
+
+/* Symbol */
+#define        PCMCIA_CIS_SYMBOL_LA4100        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_SYMBOL_LA4100    0x0001
+#define        PCMCIA_STR_SYMBOL_LA4100        "Symbol Spectrum24 LA4100 Series WLAN"
+
+/* TDK Products */
+#define        PCMCIA_CIS_TDK_LAK_CD011WL      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TDK_LAK_CD011WL  0x0000
+#define        PCMCIA_STR_TDK_LAK_CD011WL      "TDK LAK-CD011WL"
+#define        PCMCIA_CIS_TDK_LAK_CD021BX      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TDK_LAK_CD021BX  0x0200
+#define        PCMCIA_STR_TDK_LAK_CD021BX      "TDK LAK-CD021BX Ethernet"
+#define        PCMCIA_CIS_TDK_LAK_CF010        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TDK_LAK_CF010    0x0900
+#define        PCMCIA_STR_TDK_LAK_CF010        "TDK LAC-CF010"
+#define        PCMCIA_CIS_TDK_DFL9610  { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TDK_DFL9610      0x0d0a
+#define        PCMCIA_STR_TDK_DFL9610  "TDK DFL9610 Ethernet & Digital Cellular"
+#define        PCMCIA_CIS_TDK_C6500012 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TDK_C6500012     0x410a
+#define        PCMCIA_STR_TDK_C6500012 "TDK ELSA MicroLink MC all"
+
+/* Telecom Device */
+#define        PCMCIA_CIS_TELECOMDEVICE_TCD_HPC100     { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_TELECOMDEVICE_TCD_HPC100 0x0202
+#define        PCMCIA_STR_TELECOMDEVICE_TCD_HPC100     "Telecom Device TCD-HPC100"
+
+/* US Robotics Products */
+#define        PCMCIA_CIS_USROBOTICS_WORLDPORT144      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_USROBOTICS_WORLDPORT144  0x3330
+#define        PCMCIA_STR_USROBOTICS_WORLDPORT144      "US Robotics WorldPort 14.4 Modem"
+
+/* WORKBIT Products */
+#define        PCMCIA_CIS_WORKBIT_ULTRA_NINJA_16       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_WORKBIT_ULTRA_NINJA_16   0x8006
+#define        PCMCIA_STR_WORKBIT_ULTRA_NINJA_16       "WORKBIT Ultra Ninja-16 (16bit mode)"
+
+/* Xircom Products */
+#define        PCMCIA_CIS_XIRCOM_CWE1130       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CWE1130   0x0007
+#define        PCMCIA_STR_XIRCOM_CWE1130       "Xircom Wireless Ethernet Adapter"
+#define        PCMCIA_CIS_XIRCOM_CE    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CE        0x0108
+#define        PCMCIA_STR_XIRCOM_CE    "Xircom CreditCard Ethernet"
+#define        PCMCIA_CIS_XIRCOM_CE3   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CE3       0x010a
+#define        PCMCIA_STR_XIRCOM_CE3   "Xircom CreditCard 10/100 Ethernet"
+#define        PCMCIA_CIS_XIRCOM_CE2   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CE2       0x010b
+#define        PCMCIA_STR_XIRCOM_CE2   "Xircom CreditCard Ethernet II"
+#define        PCMCIA_CIS_XIRCOM_XE2000        { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_XE2000    0x0153
+#define        PCMCIA_STR_XIRCOM_XE2000        "Xircom XE2000 10/100 Ethernet"
+#define        PCMCIA_CIS_XIRCOM_CNW_801       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CNW_801   0x0801
+#define        PCMCIA_STR_XIRCOM_CNW_801       "Xircom CreditCard Netwave (Canada)"
+#define        PCMCIA_CIS_XIRCOM_CNW_802       { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CNW_802   0x0802
+#define        PCMCIA_STR_XIRCOM_CNW_802       "Xircom CreditCard Netwave (US)"
+#define        PCMCIA_CIS_XIRCOM_CT2   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CT2       0x1101
+#define        PCMCIA_STR_XIRCOM_CT2   "Xircom CreditCard Token Ring II"
+#define        PCMCIA_CIS_XIRCOM_CEM   { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CEM       0x110a
+#define        PCMCIA_STR_XIRCOM_CEM   "Xircom CreditCard Ethernet + Modem"
+#define        PCMCIA_CIS_XIRCOM_REM56 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_REM56     0x110a
+#define        PCMCIA_STR_XIRCOM_REM56 "Xircom RealPort Ethernet 10/100 + Modem 56"
+#define        PCMCIA_CIS_XIRCOM_CEM28 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CEM28     0x110b
+#define        PCMCIA_STR_XIRCOM_CEM28 "Xircom CreditCard Ethernet + Modem 28"
+#define        PCMCIA_CIS_XIRCOM_CEM56 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CEM56     0x110b
+#define        PCMCIA_STR_XIRCOM_CEM56 "Xircom CreditCard Ethernet + Modem 56"
+#define        PCMCIA_CIS_XIRCOM_CEM33 { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_XIRCOM_CEM33     0x110d
+#define        PCMCIA_STR_XIRCOM_CEM33 "Xircom CreditCard Ethernet + Modem 33"
+
+/* ZONET */
+#define        PCMCIA_CIS_ZONET_ZEN    { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_ZONET_ZEN        0x0100
+#define        PCMCIA_STR_ZONET_ZEN    "Zonet Zen 10/10"
+
+/*
+ * Cards we know only by their cis, sorted by name.
+ */
+#define        PCMCIA_VENDOR_AMBICOM   0xffffffff      /* AmbiCom Inc */
+#define        PCMCIA_VENDOR_ACCTON    0xffffffff      /* ACCTON */
+#define        PCMCIA_VENDOR_ADDTRON   0xffffffff      /* Addtron */
+#define        PCMCIA_VENDOR_ARGOSY    0xffffffff      /* ARGOSY */
+#define        PCMCIA_VENDOR_AMD       0xffffffff      /* AMD */
+#define        PCMCIA_VENDOR_BILLIONTON        0xffffffff      /* Billionton Systems Inc. */
+#define        PCMCIA_VENDOR_CNET      0xffffffff      /* CNet */
+#define        PCMCIA_VENDOR_COREGA    0xffffffff      /* Corega K.K. */
+#define        PCMCIA_VENDOR_DIGITAL   0xffffffff      /* Digital Equipment Corporation */
+#define        PCMCIA_VENDOR_DLINK     0xffffffff      /* D-Link */
+#define        PCMCIA_VENDOR_DYNALINK  0xffffffff      /* DynaLink */
+#define        PCMCIA_VENDOR_EIGERLABS 0xffffffff      /* Eiger labs,Inc. */
+#define        PCMCIA_VENDOR_EPSON     0xffffffff      /* Seiko Epson Corporation */
+#define        PCMCIA_VENDOR_EXP       0xffffffff      /* EXP Computer Inc */
+#define        PCMCIA_VENDOR_FUJITSU2  0xffffffff      /* Fujitsu */
+#define        PCMCIA_VENDOR_FUTUREDOMAIN      0xffffffff      /* FutureDomain */
+#define        PCMCIA_VENDOR_FREECOM   0xffffffff      /* Freecom */
+#define        PCMCIA_VENDOR_GEMTEK    0xffffffff      /* Gem Tek */
+#define        PCMCIA_VENDOR_ICOM      0xffffffff      /* ICOM Inc */
+#define        PCMCIA_VENDOR_INTERSIL2 0xffffffff      /* Intersil */
+#define        PCMCIA_VENDOR_IODATA3   0xffffffff      /* I-O DATA */
+#define        PCMCIA_VENDOR_LANTECH   0xffffffff      /* Lantech Computer Company */
+#define        PCMCIA_VENDOR_MELCO2    0xffffffff      /* Melco Corporation */
+#define        PCMCIA_VENDOR_NAKAGAWAMETAL     0xffffffff      /* NAKAGAWA METAL */
+#define        PCMCIA_VENDOR_NDC       0xffffffff      /* NDC */
+#define        PCMCIA_VENDOR_NEC       0xffffffff      /* NEC */
+#define        PCMCIA_VENDOR_OEM2      0xffffffff      /* Generic OEM */
+#define        PCMCIA_VENDOR_PLANET    0xffffffff      /* Planet */
+#define        PCMCIA_VENDOR_PLANEX    0xffffffff      /* Planex Communications Inc */
+#define        PCMCIA_VENDOR_PREMAX    0xffffffff      /* Premax */
+#define        PCMCIA_VENDOR_RPTI      0xffffffff      /* RPTI */
+#define        PCMCIA_VENDOR_SVEC      0xffffffff      /* SVEC/Hawking Technology */
+#define        PCMCIA_VENDOR_SYNERGY21 0xffffffff      /* Synergy 21 */
+#define        PCMCIA_VENDOR_TEAC      0xffffffff      /* TEAC */
+#define        PCMCIA_VENDOR_TOSHIBA   0xffffffff      /* TOSHIBA */
+#define        PCMCIA_VENDOR_WORKBIT2  0xffffffff      /* WORKBIT */
+#define        PCMCIA_VENDOR_YEDATA    0xffffffff      /* Y-E DATA */
+#define        PCMCIA_VENDOR_YIS       0xffffffff      /* YIS Corporation */
+#define        PCMCIA_VENDOR_ZOOM      0xffffffff      /* ZOOM */
+
+#define        PCMCIA_CIS_ACCTON_EN2212        { "ACCTON", "EN2212", NULL, NULL }
+#define        PCMCIA_PRODUCT_ACCTON_EN2212    0xffffffff
+#define        PCMCIA_STR_ACCTON_EN2212        "Accton EN2212"
+#define        PCMCIA_CIS_ACCTON_EN2216        { "ACCTON", "EN2216-PCMCIA-ETHERNET", "EN2216R01", NULL }
+#define        PCMCIA_PRODUCT_ACCTON_EN2216    0xffffffff
+#define        PCMCIA_STR_ACCTON_EN2216        "Accton EN2216"
+#define        PCMCIA_CIS_ACCTON_EN2226        { "Accton", "Fast EtherCard-16", "EN2226", "1.00" }
+#define        PCMCIA_PRODUCT_ACCTON_EN2226    0xffffffff
+#define        PCMCIA_STR_ACCTON_EN2226        "Accton EN2226"
+#define        PCMCIA_CIS_ADDTRON_AWP100       { "Addtron", "AWP-100 Wireless PCMCIA", "Version 01.02", NULL }
+#define        PCMCIA_PRODUCT_ADDTRON_AWP100   0xffffffff
+#define        PCMCIA_STR_ADDTRON_AWP100       ""
+#define        PCMCIA_CIS_ALLIEDTELESIS_WR211PCM       { "Allied Telesis K.K.", "WR211PCM", NULL, NULL }
+#define        PCMCIA_PRODUCT_ALLIEDTELESIS_WR211PCM   0xffffffff
+#define        PCMCIA_STR_ALLIEDTELESIS_WR211PCM       "Allied Telesis WR211PCM"
+#define        PCMCIA_CIS_AMBICOM_AMB8002T     { "AmbiCom Inc", "AMB8002T", NULL, NULL }
+#define        PCMCIA_PRODUCT_AMBICOM_AMB8002T 0xffffffff
+#define        PCMCIA_STR_AMBICOM_AMB8002T     "AmbiCom AMB8002T"
+#define        PCMCIA_CIS_AMD_AM79C930 { "AMD", "Am79C930", NULL, NULL }
+#define        PCMCIA_PRODUCT_AMD_AM79C930     0xffffffff
+#define        PCMCIA_STR_AMD_AM79C930 "AMD Am79C930"
+#define        PCMCIA_CIS_ARGOSY_SP320 { "PCMCIA", "RS-COM 2P", NULL, NULL
+#define        PCMCIA_PRODUCT_ARGOSY_SP320     0xffffffff
+#define        PCMCIA_STR_ARGOSY_SP320 "} ARGOSY SP320 Dual port serial PCMCIA"
+#define        PCMCIA_CIS_BILLIONTON_CFLT10N   { "CF", "10Base-Ethernet", "1.0", NULL }
+#define        PCMCIA_PRODUCT_BILLIONTON_CFLT10N       0xffffffff
+#define        PCMCIA_STR_BILLIONTON_CFLT10N   "Billionton Systems Inc. CFLT10N Ethernet"
+#define        PCMCIA_CIS_BILLIONTON_LNT10TN   { "PCMCIA", "LNT-10TN", NULL, NULL }
+#define        PCMCIA_PRODUCT_BILLIONTON_LNT10TN       0xffffffff
+#define        PCMCIA_STR_BILLIONTON_LNT10TN   "Billionton Systems Inc. LNT-10TN NE2000 Compatible Card"
+#define        PCMCIA_CIS_CNET_NE2000  { "CNet", "CN40BC Ethernet", "D", "NE2000" }
+#define        PCMCIA_PRODUCT_CNET_NE2000      0xffffffff
+#define        PCMCIA_STR_CNET_NE2000  "CNet CN40BC NE2000 Compatible"
+#define        PCMCIA_CIS_COREGA_ETHER_PCC_T   { "corega K.K.", "corega Ether PCC-T", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_ETHER_PCC_T       0xffffffff
+#define        PCMCIA_STR_COREGA_ETHER_PCC_T   "Corega Ether PCC-T"
+#define        PCMCIA_CIS_COREGA_ETHER_PCC_TD  { "corega K.K.", "corega Ether PCC-TD", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_ETHER_PCC_TD      0xffffffff
+#define        PCMCIA_STR_COREGA_ETHER_PCC_TD  "Corega Ether PCC-TD"
+#define        PCMCIA_CIS_COREGA_ETHER_II_PCC_T        { "corega K.K.", "corega EtherII PCC-T", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_ETHER_II_PCC_T    0xffffffff
+#define        PCMCIA_STR_COREGA_ETHER_II_PCC_T        "Corega EtherII PCC-T"
+#define        PCMCIA_CIS_COREGA_ETHER_II_PCC_TD       { "corega K.K.", "corega EtherII PCC-TD", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_ETHER_II_PCC_TD   0xffffffff
+#define        PCMCIA_STR_COREGA_ETHER_II_PCC_TD       "Corega EtherII PCC-TD"
+#define        PCMCIA_CIS_COREGA_FAST_ETHER_PCC_TX     { "corega K.K.", "corega FastEther PCC-TX", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_FAST_ETHER_PCC_TX 0xffffffff
+#define        PCMCIA_STR_COREGA_FAST_ETHER_PCC_TX     "Corega FastEther PCC-TX"
+#define        PCMCIA_CIS_COREGA_FETHER_PCC_TXD        { "corega K.K.", "corega FEther PCC-TXD", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_FETHER_PCC_TXD    0xffffffff
+#define        PCMCIA_STR_COREGA_FETHER_PCC_TXD        "Corega FEther PCC-TXD"
+#define        PCMCIA_CIS_COREGA_FETHER_PCC_TXF        { "corega", "FEther PCC-TXF", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_FETHER_PCC_TXF    0xffffffff
+#define        PCMCIA_STR_COREGA_FETHER_PCC_TXF        "Corega FEther PCC-TXF"
+#define        PCMCIA_CIS_COREGA_WIRELESS_LAN_PCC_11   { "corega K.K.", "Wireless LAN PCC-11", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_WIRELESS_LAN_PCC_11       0xffffffff
+#define        PCMCIA_STR_COREGA_WIRELESS_LAN_PCC_11   "Corega Wireless LAN PCC-11"
+#define        PCMCIA_CIS_COREGA_WIRELESS_LAN_PCCA_11  { "corega K.K.", "Wireless LAN PCCA-11", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_WIRELESS_LAN_PCCA_11      0xffffffff
+#define        PCMCIA_STR_COREGA_WIRELESS_LAN_PCCA_11  "Corega Wireless LAN PCCA-11"
+#define        PCMCIA_CIS_COREGA_WIRELESS_LAN_PCCB_11  { "corega_K.K.", "Wireless_LAN_PCCB-11", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_WIRELESS_LAN_PCCB_11      0xffffffff
+#define        PCMCIA_STR_COREGA_WIRELESS_LAN_PCCB_11  "Corega Wireless LAN PCCB-11"
+#define        PCMCIA_CIS_COREGA_WIRELESS_LAN_PCCL_11  { "corega", "WL PCCL-11", NULL, NULL }
+#define        PCMCIA_PRODUCT_COREGA_WIRELESS_LAN_PCCL_11      0xffffffff
+#define        PCMCIA_STR_COREGA_WIRELESS_LAN_PCCL_11  "Corega Wireless LAN PCCL-11"
+
+#define        PCMCIA_CIS_DIGITAL_DEPCMXX      { "DIGITAL", "DEPCM-XX", NULL, NULL }
+#define        PCMCIA_PRODUCT_DIGITAL_DEPCMXX  0xffffffff
+#define        PCMCIA_STR_DIGITAL_DEPCMXX      "DEC DEPCM-BA"
+#define        PCMCIA_CIS_DLINK_DE650  { "D-Link", "DE-650", NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_DE650      0xffffffff
+#define        PCMCIA_STR_DLINK_DE650  "D-Link DE-650"
+#define        PCMCIA_CIS_DLINK_DE660  { "D-Link", "DE-660", NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_DE660      0xffffffff
+#define        PCMCIA_STR_DLINK_DE660  "D-Link DE-660"
+#define        PCMCIA_CIS_DLINK_DE660PLUS      { "D-Link", "DE-660+", NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_DE660PLUS  0xffffffff
+#define        PCMCIA_STR_DLINK_DE660PLUS      "D-Link DE-660+"
+#define        PCMCIA_CIS_DLINK_DFE670TXD      { "D-Link", "DFE-670TXD", NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_DFE670TXD  0xffffffff
+#define        PCMCIA_STR_DLINK_DFE670TXD      "D-Link DFE-670TXD"
+#define        PCMCIA_CIS_DLINK_DWL650H        { "D-Link Corporation", "D-Link DWL-650H 11Mbps WLAN Adapter", NULL, NULL }
+#define        PCMCIA_PRODUCT_DLINK_DWL650H    0xffffffff
+#define        PCMCIA_STR_DLINK_DWL650H        "D-Link DWL-650H"
+#define        PCMCIA_CIS_DYNALINK_L10C        { "DYNALINK", "L10C", NULL, NULL }
+#define        PCMCIA_PRODUCT_DYNALINK_L10C    0xffffffff
+#define        PCMCIA_STR_DYNALINK_L10C        "Dynalink L10C"
+/*
+ * vendor ID of EPX_AA2000 is Fujitsu (0x0004) and product ID is 0x2000, but
+ * it conflicts with Fujitsu Towa LA501 Ethernet.
+ */
+#define        PCMCIA_CIS_EIGERLABS_EPX_AA2000 { "Eiger labs,Inc.", "EPX-AA2000 PC Sound Card", NULL, NULL }
+#define        PCMCIA_PRODUCT_EIGERLABS_EPX_AA2000     0xffffffff
+#define        PCMCIA_STR_EIGERLABS_EPX_AA2000 "EPX-AA2000 PC Sound Card"
+#define        PCMCIA_CIS_EPSON_EEN10B { "Seiko Epson Corp.", "Ethernet", "P/N: EEN10B Rev. 00", NULL }
+#define        PCMCIA_PRODUCT_EPSON_EEN10B     0xffffffff
+#define        PCMCIA_STR_EPSON_EEN10B "Epson EEN10B"
+#define        PCMCIA_CIS_EPSON_SC200  { "EPSON", "SCSI-2 PC Card SC200", NULL, NULL }
+#define        PCMCIA_PRODUCT_EPSON_SC200      0xffffffff
+#define        PCMCIA_STR_EPSON_SC200  "Media Intelligent SCSI-2 PC Card MSC-200"
+#define        PCMCIA_CIS_EXP_EXPMULTIMEDIA    { "EXP   ", "PnPIDE", "F1", NULL }
+#define        PCMCIA_PRODUCT_EXP_EXPMULTIMEDIA        0xffffffff
+#define        PCMCIA_STR_EXP_EXPMULTIMEDIA    "EXP IDE/ATAPI DVD Card"
+#define        PCMCIA_CIS_EXP_THINLANCOMBO     { "PCMCIA LAN", "Ethernet", NULL, NULL }
+#define        PCMCIA_PRODUCT_EXP_THINLANCOMBO 0xffffffff
+#define        PCMCIA_STR_EXP_THINLANCOMBO     "EXP ThinLan Combo"
+#define        PCMCIA_CIS_FREECOM_PCCARDIDE    { "FREECOM", "PCCARD-IDE", NULL, NULL }
+#define        PCMCIA_PRODUCT_FREECOM_PCCARDIDE        0xffffffff
+#define        PCMCIA_STR_FREECOM_PCCARDIDE    "FREECOM PCCARD-IDE"
+#define        PCMCIA_CIS_FUJITSU2_FMV_J181    { "PCMCIA MBH10302", "01", NULL, NULL }
+#define        PCMCIA_PRODUCT_FUJITSU2_FMV_J181        0xffffffff
+#define        PCMCIA_STR_FUJITSU2_FMV_J181    "FUJITSU FMV-J181 PCMCIA Card"
+#define        PCMCIA_CIS_FUJITSU2_FMV_J182    { "FUJITSU", "LAN Card(FMV-J182)", "Ver.01", NULL }
+#define        PCMCIA_PRODUCT_FUJITSU2_FMV_J182        0xffffffff
+#define        PCMCIA_STR_FUJITSU2_FMV_J182    "FUJITSU FMV-J182 PCMCIA Card"
+#define        PCMCIA_CIS_FUJITSU2_FMV_J182A   { "FUJITSU", "LAN Card(FMV-J182)", "Ver.02", NULL }
+#define        PCMCIA_PRODUCT_FUJITSU2_FMV_J182A       0xffffffff
+#define        PCMCIA_STR_FUJITSU2_FMV_J182A   "FUJITSU FMV-J182A PCMCIA Card"
+#define        PCMCIA_CIS_FUJITSU2_ITCFJ182A   { "FUJITSU", "LAN Card(ITCFJ182)", "Ver.01", NULL }
+#define        PCMCIA_PRODUCT_FUJITSU2_ITCFJ182A       0xffffffff
+#define        PCMCIA_STR_FUJITSU2_ITCFJ182A   "FUJITSU ITCFJ182A CompactCard"
+#define        PCMCIA_CIS_FUTUREDOMAIN_SCSI2GO { "Future Domain Corporation" "SCSI PCMCIA Credit Card Controller", NULL, NULL }
+#define        PCMCIA_PRODUCT_FUTUREDOMAIN_SCSI2GO     0xffffffff
+#define        PCMCIA_STR_FUTUREDOMAIN_SCSI2GO "Future Domain SCSI2GO"
+#define        PCMCIA_CIS_GEMTEK_WLAN  { "Intersil", "PRISM 2_5 PCMCIA ADAPTER", "ISL37300P", "Eval-RevA" }
+#define        PCMCIA_PRODUCT_GEMTEK_WLAN      0xffffffff
+#define        PCMCIA_STR_GEMTEK_WLAN  "GEMTEK Prism2_5 WaveLAN Card"
+#define        PCMCIA_CIS_IBM_SCSICARD { "IBM Corp.", "SCSI PCMCIA Card", NULL, NULL }
+#define        PCMCIA_PRODUCT_IBM_SCSICARD     0xffffffff
+#define        PCMCIA_STR_IBM_SCSICARD "IBM SCSI PCMCIA Card"
+#define        PCMCIA_CIS_ICOM_SL200   { "Icom", "SL-200", NULL, NULL }
+#define        PCMCIA_PRODUCT_ICOM_SL200       0xffffffff
+#define        PCMCIA_STR_ICOM_SL200   "Icom SL-200"
+#define        PCMCIA_CIS_INTERSIL2_PRISM2     { "INTERSIL", "HFA384x/IEEE", "Version 01.02", NULL }
+#define        PCMCIA_PRODUCT_INTERSIL2_PRISM2 0xffffffff
+#define        PCMCIA_STR_INTERSIL2_PRISM2     "Intersil Prism II"
+#define        PCMCIA_CIS_IODATA_CBIDE2        { "IO DATA", "CBIDE2      ", NULL, NULL }
+#define        PCMCIA_PRODUCT_IODATA_CBIDE2    0xffffffff
+#define        PCMCIA_STR_IODATA_CBIDE2        "IO-DATA CBIDE2/16-bit mode"
+#define        PCMCIA_CIS_IODATA3_CBSC16       { "IO DATA", "CBSC16       ", NULL, NULL }
+#define        PCMCIA_PRODUCT_IODATA3_CBSC16   0xffffffff
+#define        PCMCIA_STR_IODATA3_CBSC16       "IO-DATA CBSC16"
+#define        PCMCIA_CIS_IODATA_PCLAT { "I-O DATA", "PCLA", "ETHERNET", NULL }
+#define        PCMCIA_PRODUCT_IODATA_PCLAT     0xffffffff
+#define        PCMCIA_STR_IODATA_PCLAT "IO-DATA PCLA/T"
+#define        PCMCIA_CIS_LANTECH_FASTNETTX    { "ASIX", "AX88190", NULL, NULL }
+#define        PCMCIA_PRODUCT_LANTECH_FASTNETTX        0xffffffff
+#define        PCMCIA_STR_LANTECH_FASTNETTX    "Lantech Fastnet/TX"
+#define        PCMCIA_CIS_LINKSYS_ECARD_2      { "LINKSYS", "E-CARD", NULL, NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_ECARD_2  0xffffffff
+#define        PCMCIA_STR_LINKSYS_ECARD_2      "Linksys E-Card"
+#define        PCMCIA_CIS_LINKSYS_PCM100       { "Linksys", "EtherFast 10/100 Integrated PC Card (PCM100)", "Ver 1.0", NULL }
+#define        PCMCIA_PRODUCT_LINKSYS_PCM100   0xffffffff
+#define        PCMCIA_STR_LINKSYS_PCM100       ""
+#define        PCMCIA_CIS_MACNICA_MPS100       { "MACNICA", "MIRACLE SCSI", "mPS100", "D.0" }
+#define        PCMCIA_PRODUCT_MACNICA_MPS100   0xffffffff
+#define        PCMCIA_STR_MACNICA_MPS100       "Macnica Miracle SCSI mPS100"
+#define        PCMCIA_CIS_MEGAHERTZ_XJ2288     { "MEGAHERTZ", "MODEM XJ2288", NULL, NULL }
+#define        PCMCIA_PRODUCT_MEGAHERTZ_XJ2288 0xffffffff
+#define        PCMCIA_STR_MEGAHERTZ_XJ2288     "Megahertz XJ2288 Modem"
+#define        PCMCIA_CIS_MELCO2_LPC2_TX       { "MELCO", "LPC2-TX", NULL, NULL }
+#define        PCMCIA_PRODUCT_MELCO2_LPC2_TX   0xffffffff
+#define        PCMCIA_STR_MELCO2_LPC2_TX       "Melco LPC2-TX"
+#define        PCMCIA_CIS_NAKAGAWAMETAL_LNT10TN        { "PCMCIA", "LNT-10TN", NULL, NULL }
+#define        PCMCIA_PRODUCT_NAKAGAWAMETAL_LNT10TN    0xffffffff
+#define        PCMCIA_STR_NAKAGAWAMETAL_LNT10TN        "NAKAGAWA METAL LNT-10TN NE2000 Compatible Card"
+#define        PCMCIA_CIS_NANOSPEED_PRISM2     { "NANOSPEED", "HFA384x/IEEE", "Version 01.02", NULL }
+#define        PCMCIA_PRODUCT_NANOSPEED_PRISM2 0xffffffff
+#define        PCMCIA_STR_NANOSPEED_PRISM2     "NANOSPEED ROOT-RZ2000 WLAN Card"
+#define        PCMCIA_CIS_NDC_ND5100_E { "NDC", "Ethernet", "A", NULL }
+#define        PCMCIA_PRODUCT_NDC_ND5100_E     0xffffffff
+#define        PCMCIA_STR_NDC_ND5100_E "Sohoware ND5100E NE2000 Compatible Card"
+#define        PCMCIA_CIS_NEC_CMZ_RT_WP        { "NEC", "Wireless Card CMZ-RT-WP", "Version 01.01", NULL }
+#define        PCMCIA_PRODUCT_NEC_CMZ_RT_WP    0xffffffff
+#define        PCMCIA_STR_NEC_CMZ_RT_WP        "NEC Wireless Card CMZ-RT-WP"
+#define        PCMCIA_CIS_NEC_PC9801N_J03R     { "NEC", "PC-9801N-J03R", NULL, NULL }
+#define        PCMCIA_PRODUCT_NEC_PC9801N_J03R 0xffffffff
+#define        PCMCIA_STR_NEC_PC9801N_J03R     "NEC PC-9801N-J03R"
+#define        PCMCIA_CIS_NEWMEDIA_BASICS_SCSI { "BASICS by New Media Corporation" "SCSI Sym53C500", NULL, NULL }
+#define        PCMCIA_PRODUCT_NEWMEDIA_BASICS_SCSI     0xffffffff
+#define        PCMCIA_STR_NEWMEDIA_BASICS_SCSI "New Media Corporation BASICS SCSI"
+#define        PCMCIA_CIS_NTT_ME_WLAN  { "NTT-ME", "11Mbps Wireless LAN PC Card", NULL, NULL }
+#define        PCMCIA_PRODUCT_NTT_ME_WLAN      0xffffffff
+#define        PCMCIA_STR_NTT_ME_WLAN  "NTT-ME 11Mbps Wireless LAN PC Card"
+#define        PCMCIA_CIS_OEM2_CDROM1  { "PCMCIA", "CD-ROM", NULL, NULL }
+#define        PCMCIA_PRODUCT_OEM2_CDROM1      0xffffffff
+#define        PCMCIA_STR_OEM2_CDROM1  "Generic PCMCIA CD-ROM"
+#define        PCMCIA_CIS_OEM2_IDE     { "PCMCIA", "IDE CARD", NULL, NULL }
+#define        PCMCIA_PRODUCT_OEM2_IDE 0xffffffff
+#define        PCMCIA_STR_OEM2_IDE     "Generic PCMCIA IDE CARD"
+#define        PCMCIA_CIS_PLANET_SMARTCOM2000  { "PCMCIA", "UE2212", NULL, NULL }
+#define        PCMCIA_PRODUCT_PLANET_SMARTCOM2000      0xffffffff
+#define        PCMCIA_STR_PLANET_SMARTCOM2000  "Planet SmartCOM 2000"
+/*
+ * vendor ID of both FNW-3600-T and FNW-3700-T is LINKSYS (0x0149) and
+ * product ID is 0xc1ab, but it conflicts with LINKSYS Combo EthernetCard.
+ */
+#define        PCMCIA_CIS_PLANEX_FNW3600T      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PLANEX_FNW3600T  -1
+#define        PCMCIA_STR_PLANEX_FNW3600T      "Planex FNW-3600-T"
+#define        PCMCIA_CIS_PLANEX_FNW3700T      { NULL, NULL, NULL, NULL }
+#define        PCMCIA_PRODUCT_PLANEX_FNW3700T  -1
+#define        PCMCIA_STR_PLANEX_FNW3700T      "Planex FNW-3700-T"
+#define        PCMCIA_CIS_RPTI_EP400   { "RPTI LTD.", "EP400", "CISV100", NULL }
+#define        PCMCIA_PRODUCT_RPTI_EP400       0xffffffff
+#define        PCMCIA_STR_RPTI_EP400   "RPTI EP400"
+#define        PCMCIA_CIS_RPTI_EP401   { "RPTI", "EP401 Ethernet NE2000 Compatible", NULL, NULL }
+#define        PCMCIA_PRODUCT_RPTI_EP401       0xffffffff
+#define        PCMCIA_STR_RPTI_EP401   "RPTI EP401"
+#define        PCMCIA_CIS_PREMAX_PE200 { "PMX   ", "PE-200", NULL, NULL }
+#define        PCMCIA_PRODUCT_PREMAX_PE200     0xffffffff
+#define        PCMCIA_STR_PREMAX_PE200 "PreMax PE-200"
+#define        PCMCIA_CIS_RATOC_REX_R280       { "RATOC System Inc.", "10BASE_T CARD R280", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX_R280   0xffffffff
+#define        PCMCIA_STR_RATOC_REX_R280       "RATOC REX-R280"
+#define        PCMCIA_CIS_RATOC_REX5536        { "1195 RATOC System Inc.", "REX5536 SCSI2 CARD", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX5536    0xffffffff
+#define        PCMCIA_STR_RATOC_REX5536        "RATOC REX-5536"
+#define        PCMCIA_CIS_RATOC_REX5536AM      { "PCMCIA SCSI MBH10404", "01", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX5536AM  0xffffffff
+#define        PCMCIA_STR_RATOC_REX5536AM      "RATOC REX-5536AM"
+#define        PCMCIA_CIS_RATOC_REX5536M       { "PCMCIA SCSI2 CARD", "01", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX5536M   0xffffffff
+#define        PCMCIA_STR_RATOC_REX5536M       "RATOC REX-5536M"
+#define        PCMCIA_CIS_RATOC_REX5572        { "RATOC System Inc.", "SOUND/SCSI2 CARD", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX5572    0xffffffff
+#define        PCMCIA_STR_RATOC_REX5572        "RATOC REX-5572"
+#define        PCMCIA_CIS_RATOC_REX9530        { "RATOC System Inc.", "SCSI2 CARD 37", NULL, NULL }
+#define        PCMCIA_PRODUCT_RATOC_REX9530    0xffffffff
+#define        PCMCIA_STR_RATOC_REX9530        "RATOC REX-9530"
+#define        PCMCIA_CIS_SIMPLETECH_SPECTRUM24_ALT    { "Symbol Technologies", "LA4111 Spectrum24 Wireless LAN PC Card", NULL, NULL }
+#define        PCMCIA_PRODUCT_SIMPLETECH_SPECTRUM24_ALT        0xffffffff
+#define        PCMCIA_STR_SIMPLETECH_SPECTRUM24_ALT    "LA4111 Spectrum24 Wireless LAN PC Card"
+#define        PCMCIA_CIS_SMC_2632W    { "SMC", "SMC2632W", "Version 01.02", NULL }
+#define        PCMCIA_PRODUCT_SMC_2632W        0xffffffff
+#define        PCMCIA_STR_SMC_2632W    "SMC 2632 EZ Connect Wireless PC Card"
+#define        PCMCIA_CIS_SMC_8041     { "SMC", "8041TX-10/100-PC-Card-V2", NULL, NULL }
+#define        PCMCIA_PRODUCT_SMC_8041 0xffffffff
+#define        PCMCIA_STR_SMC_8041     "SMC 8041TX 10/100 PC Card"
+#define        PCMCIA_CIS_SVEC_COMBOCARD       { "Ethernet", "Adapter", NULL, NULL }
+#define        PCMCIA_PRODUCT_SVEC_COMBOCARD   0xffffffff
+#define        PCMCIA_STR_SVEC_COMBOCARD       "SVEC/Hawking Tech. Combo Card"
+#define        PCMCIA_CIS_SVEC_LANCARD { "SVEC", "FD605 PCMCIA EtherNet Card", "V1-1", NULL }
+#define        PCMCIA_PRODUCT_SVEC_LANCARD     0xffffffff
+#define        PCMCIA_STR_SVEC_LANCARD "SVEC PCMCIA Lan Card"
+#define        PCMCIA_CIS_SYNERGY21_S21810     { "PCMCIA", "Ethernet", "A", "004743118001" }
+#define        PCMCIA_PRODUCT_SYNERGY21_S21810 0xffffffff
+#define        PCMCIA_STR_SYNERGY21_S21810     "Synergy 21 S21810+ NE2000 Compatible Card"
+#define        PCMCIA_CIS_TEAC_IDECARDII       { NULL, "NinjaATA-", NULL, NULL }
+#define        PCMCIA_PRODUCT_TEAC_IDECARDII   0xffffffff
+#define        PCMCIA_STR_TEAC_IDECARDII       "TEAC IDE Card/II"
+#define        PCMCIA_CIS_TOSHIBA_CBIDE2       { "LOOKMEET", "CBIDE2      ", NULL, NULL }
+#define        PCMCIA_PRODUCT_TOSHIBA_CBIDE2   0xffffffff
+#define        PCMCIA_STR_TOSHIBA_CBIDE2       "TOSHIBA PA2673U CBIDE2/16-bit mode (IO-DATA OEM)"
+#define        PCMCIA_CIS_WORKBIT2_NINJA_SCSI3 { "WBT", "NinjaSCSI-3", NULL, NULL }
+#define        PCMCIA_PRODUCT_WORKBIT2_NINJA_SCSI3     0xffffffff
+#define        PCMCIA_STR_WORKBIT2_NINJA_SCSI3 "WORKBIT Ninja SCSI series"
+#define        PCMCIA_CIS_XIRCOM_CFE_10        { "Xircom", "CompactCard Ethernet", "CFE-10", "1.00" }
+#define        PCMCIA_PRODUCT_XIRCOM_CFE_10    0xffffffff
+#define        PCMCIA_STR_XIRCOM_CFE_10        "Xircom CompactCard CFE-10"
+#define        PCMCIA_CIS_YEDATA_EXTERNAL_FDD  { "Y-E DATA", "External FDD", NULL, NULL }
+#define        PCMCIA_PRODUCT_YEDATA_EXTERNAL_FDD      0xffffffff
+#define        PCMCIA_STR_YEDATA_EXTERNAL_FDD  "Y-E DATA External FDD"
+#define        PCMCIA_CIS_YIS_YWL11B   { "YIS Corp.", "YWL-11b", NULL, NULL }
+#define        PCMCIA_PRODUCT_YIS_YWL11B       0xffffffff
+#define        PCMCIA_STR_YIS_YWL11B   "YIS Corp. YWL-11b"
+#define        PCMCIA_CIS_ZOOM_AIR_4000        { "Zoom", "Air-4000", NULL, NULL }
+#define        PCMCIA_PRODUCT_ZOOM_AIR_4000    0xffffffff
+#define        PCMCIA_STR_ZOOM_AIR_4000        "Zoom Air-4000"
index a767699..f50352e 100644 (file)
@@ -1,6 +1,6 @@
 /*     $NetBSD: pcmciareg.h,v 1.7 1998/10/29 09:45:52 enami Exp $      */
 /* $FreeBSD: src/sys/dev/pccard/pccardreg.h,v 1.1 1999/10/26 06:52:31 imp Exp $ */
-/* $DragonFly: src/sys/bus/pccard/pccardreg.h,v 1.2 2003/06/17 04:28:29 dillon Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccardreg.h,v 1.3 2004/02/10 07:55:45 joerg Exp $ */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
index 849467e..bc99721 100644 (file)
@@ -1,6 +1,6 @@
-/*     $NetBSD: pcmciavar.h,v 1.9 1998/12/29 09:00:28 marc Exp $       */
-/* $FreeBSD: src/sys/dev/pccard/pccardvar.h,v 1.6.2.3 2002/09/01 05:45:51 imp Exp $ */
-/* $DragonFly: src/sys/bus/pccard/pccardvar.h,v 1.2 2003/06/17 04:28:29 dillon Exp $ */
+/*     $NetBSD: pcmciavar.h,v 1.12 2000/02/08 12:51:31 enami Exp $     */
+/* $FreeBSD: src/sys/dev/pccard/pccardvar.h,v 1.34 2002/11/14 05:15:50 imp Exp $ */
+/* $DragonFly: src/sys/bus/pccard/pccardvar.h,v 1.3 2004/02/10 07:55:45 joerg Exp $ */
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -61,7 +61,8 @@ struct pccard_mem_handle {
        bus_addr_t      addr;           /* resulting address in bus space */
        bus_size_t      size;           /* size of mem space */
        bus_size_t      realsize;       /* how much we really allocated */
-       long            offset;
+       long            offset;         /* mapped Offset on card */
+       bus_addr_t      cardaddr;       /* Absolute address on card */
        int             kind;
 };
 
@@ -104,16 +105,36 @@ struct pccard_config_entry {
                u_long  hostaddr;
        } memspace[2];          /* XXX this could be as high as 8 */
        int             maxtwins;
+       struct resource *iores[4];
+       int             iorid[4];
+       struct resource *irqres;
+       int             irqrid;
+       struct resource *memres[2];
+       int             memrid[2];
        STAILQ_ENTRY(pccard_config_entry) cfe_list;
 };
 
+struct pccard_funce_disk {
+       int pfd_interface;
+};
+
+struct pccard_funce_lan {
+       int pfl_nidlen;
+       u_int8_t pfl_nid[8];
+};
+
+union pccard_funce {
+       struct pccard_funce_disk pfv_disk;
+       struct pccard_funce_lan pfv_lan;
+};
+
 struct pccard_function {
        /* read off the card */
        int             number;
        int             function;
        int             last_config_index;
-       u_long          ccr_base;
-       u_long          ccr_mask;
+       uint32_t        ccr_base;       /* Offset with card's memory */
+       uint32_t        ccr_mask;
        struct resource *ccr_res;
        int             ccr_rid;
        STAILQ_HEAD(, pccard_config_entry) cfe_head;
@@ -122,17 +143,23 @@ struct pccard_function {
        struct pccard_softc *sc;
        struct pccard_config_entry *cfe;
        struct pccard_mem_handle pf_pcmh;
+       device_t        dev;
 #define        pf_ccrt         pf_pcmh.memt
 #define        pf_ccrh         pf_pcmh.memh
 #define        pf_ccr_realsize pf_pcmh.realsize
-       bus_addr_t      pf_ccr_offset;
+       uint32_t        pf_ccr_offset;  /* Offset from ccr_base of CIS */
        int             pf_ccr_window;
-       long            pf_mfc_iobase;
+       long            pf_mfc_iobase;  /* Right type? */
        long            pf_mfc_iomax;
-       int             (*ih_fct)(void *);
-       void            *ih_arg;
-       int             ih_ipl;
        int             pf_flags;
+       driver_intr_t   *intr_handler;
+       void            *intr_handler_arg;
+       void            *intr_handler_cookie;
+
+       union pccard_funce pf_funce; /* CISTPL_FUNCE */
+#define pf_funce_disk_interface pf_funce.pfv_disk.pfd_interface
+#define pf_funce_lan_nid pf_funce.pfv_lan.pfl_nid
+#define pf_funce_lan_nidlen pf_funce.pfv_lan.pfl_nidlen
 };
 
 /* pf_flags */
@@ -150,11 +177,12 @@ struct pccard_card {
         * indicates no id was found.
         */
        int32_t         manufacturer;
-#define        PCCARD_VENDOR_INVALID   -1
+#define        PCMCIA_VENDOR_INVALID   -1
        int32_t         product;
-#define        PCCARD_PRODUCT_INVALID          -1
+#define        PCMCIA_PRODUCT_INVALID          -1
+       int16_t         prodext;
        u_int16_t       error;
-#define        PCCARD_CIS_INVALID              { NULL, NULL, NULL, NULL }
+#define        PCMCIA_CIS_INVALID              { NULL, NULL, NULL, NULL }
        STAILQ_HEAD(, pccard_function) pf_head;
 };
 
@@ -168,7 +196,7 @@ struct pccard_card {
 /* More later? */
 struct pccard_ivar {
        struct resource_list resources;
-       int     slotnum;
+       struct pccard_function *fcn;
 };
 
 struct pccard_softc {
@@ -177,9 +205,7 @@ struct pccard_softc {
 
        /* this stuff is for the card */
        struct pccard_card card;
-       void            *ih;
        int             sc_enabled_count;       /* num functions enabled */
-
 };
 
 void
@@ -202,6 +228,33 @@ struct pccard_tuple {
        bus_space_handle_t memh;
 };
 
+struct pccard_product {
+       const char      *pp_name;               /* NULL if end of table */
+#define PCCARD_VENDOR_ANY ((u_int32_t) -1)
+       u_int32_t       pp_vendor;
+#define PCCARD_PRODUCT_ANY ((u_int32_t) -1)
+       u_int32_t       pp_product;
+       int             pp_expfunc;
+       const char      *pp_cis[4];
+};
+
+typedef int (*pccard_product_match_fn) (device_t dev,
+    const struct pccard_product *ent, int vpfmatch);
+
+#include "card_if.h"
+
+/*
+ * make this inline so that we don't have to worry about dangling references
+ * to it in the modules or the code.
+ */
+static __inline const struct pccard_product *
+pccard_product_lookup(device_t dev, const struct pccard_product *tab,
+    size_t ent_size, pccard_product_match_fn matchfn)
+{
+       return CARD_DO_PRODUCT_LOOKUP(device_get_parent(dev), dev,
+           tab, ent_size, matchfn);
+}
+
 void   pccard_read_cis(struct pccard_softc *);
 void   pccard_check_cis_quirks(device_t);
 void   pccard_print_cis(device_t);
@@ -215,7 +268,7 @@ int pccard_scan_cis(device_t,
        (pccard_cis_read_1((tuple), ((tuple)->ptr+(2+(idx1)))))
 
 #define        pccard_tuple_read_2(tuple, idx2)                                \
-       (pccard_tuple_read_1((tuple), (idx2)) |                         \
+       (pccard_tuple_read_1((tuple), (idx2)) |                         \
         (pccard_tuple_read_1((tuple), (idx2)+1)<<8))
 
 #define        pccard_tuple_read_3(tuple, idx3)                                \
@@ -238,17 +291,9 @@ int        pccard_scan_cis(device_t,
 #define        PCCARD_SPACE_MEMORY     1
 #define        PCCARD_SPACE_IO         2
 
-int    pccard_ccr_read(struct pccard_function *, int);
-void   pccard_ccr_write(struct pccard_function *, int, int);
-
 #define        pccard_mfc(sc)  (STAILQ_FIRST(&(sc)->card.pf_head) &&           \
                 STAILQ_NEXT(STAILQ_FIRST(&(sc)->card.pf_head),pf_list))
 
-void   pccard_function_init(struct pccard_function *,
-           struct pccard_config_entry *);
-int    pccard_function_enable(struct pccard_function *);
-void   pccard_function_disable(struct pccard_function *);
-
 #define        pccard_io_alloc(pf, start, size, align, pciop)                  \
        (pccard_chip_io_alloc((pf)->sc->pct, pf->sc->pch, (start),      \
         (size), (align), (pciop)))
@@ -262,17 +307,27 @@ void      pccard_io_unmap(struct pccard_function *, int);
 
 #define pccard_mem_alloc(pf, size, pcmhp)                              \
        (pccard_chip_mem_alloc((pf)->sc->pct, (pf)->sc->pch, (size), (pcmhp)))
-
 #define pccard_mem_free(pf, pcmhp)                                     \
        (pccard_chip_mem_free((pf)->sc->pct, (pf)->sc->pch, (pcmhp)))
-
 #define pccard_mem_map(pf, kind, card_addr, size, pcmhp, offsetp, windowp) \
        (pccard_chip_mem_map((pf)->sc->pct, (pf)->sc->pch, (kind),      \
         (card_addr), (size), (pcmhp), (offsetp), (windowp)))
-
 #define        pccard_mem_unmap(pf, window)                                    \
        (pccard_chip_mem_unmap((pf)->sc->pct, (pf)->sc->pch, (window)))
 
+/* compat layer */
+static __inline int
+pccard_compat_probe(device_t dev)
+{
+       return (CARD_COMPAT_DO_PROBE(device_get_parent(dev), dev));
+}
+
+static __inline int
+pccard_compat_attach(device_t dev)
+{
+       return (CARD_COMPAT_DO_ATTACH(device_get_parent(dev), dev));
+}
+
 /* ivar interface */
 enum {
        PCCARD_IVAR_ETHADDR,    /* read ethernet address from CIS tupple */
@@ -287,18 +342,41 @@ enum {
        PCCARD_IVAR_FUNCTION
 };
 
-/* read ethernet address from CIS tupple */
-__inline static int
-pccard_get_ether(device_t dev, u_char *enaddr)
-{
-       return BUS_READ_IVAR(device_get_parent(dev), dev, 
-           PCCARD_IVAR_ETHADDR, (uintptr_t *)enaddr);
+#define PCCARD_ACCESSOR(A, B, T)                                       \
+__inline static int                                                    \
+pccard_get_ ## A(device_t dev, T *t)                                   \
+{                                                                      \
+       return BUS_READ_IVAR(device_get_parent(dev), dev,               \
+           PCCARD_IVAR_ ## B, (uintptr_t *) t);                        \
 }
 
+PCCARD_ACCESSOR(ether,         ETHADDR,                u_int8_t)
+PCCARD_ACCESSOR(vendor,                VENDOR,                 u_int32_t)
+PCCARD_ACCESSOR(product,       PRODUCT,                u_int32_t)
+PCCARD_ACCESSOR(prodext,       PRODEXT,                u_int16_t)
+PCCARD_ACCESSOR(function_number,FUNCTION_NUMBER,       u_int32_t)
+PCCARD_ACCESSOR(function,      FUNCTION,               u_int32_t)
+PCCARD_ACCESSOR(vendor_str,    VENDOR_STR,             char *)
+PCCARD_ACCESSOR(product_str,   PRODUCT_STR,            char *)
+PCCARD_ACCESSOR(cis3_str,      CIS3_STR,               char *)
+
 /* shared memory flags */
 enum {
-       PCCARD_A_MEM_ATTR=1,    /* attribute */
        PCCARD_A_MEM_COM,       /* common */
+       PCCARD_A_MEM_ATTR,      /* attribute */
        PCCARD_A_MEM_8BIT,      /* 8 bit */
        PCCARD_A_MEM_16BIT      /* 16 bit */
 };
+
+#define PCCARD_SOFTC(d) (struct pccard_softc *) device_get_softc(d)
+#define PCCARD_IVAR(d) (struct pccard_ivar *) device_get_ivars(d)
+
+#define PCCARD_S(a, b) PCMCIA_STR_ ## a ## _ ## b
+#define PCCARD_P(a, b) PCMCIA_PRODUCT_ ## a ## _ ## b
+#define PCCARD_C(a, b) PCMCIA_CIS_ ## a ## _ ## b
+#define PCMCIA_CARD(v, p, f) { PCCARD_S(v, p), PCMCIA_VENDOR_ ## v, \
+               PCCARD_P(v, p), f, PCCARD_C(v, p) }
+#define PCMCIA_CARD2(v1, p1, p2, f) \
+               { PCMCIA_STR_ ## p2, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \
+                 f, PCMCIA_CIS_ ## p2}
+
diff --git a/sys/bus/pccard/pccbb/Makefile b/sys/bus/pccard/pccbb/Makefile
deleted file mode 100644 (file)
index 58a2d09..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-# $FreeBSD: src/sys/modules/cbb/Makefile,v 1.2 1999/11/28 18:52:41 bde Exp $
-# $DragonFly: src/sys/bus/pccard/pccbb/Attic/Makefile,v 1.3 2003/08/15 01:19:54 dillon Exp $
-#
-# XXX disabled, no pccbb.c to be found.
-
-KMOD=   cbb
-SRCS=   pccbb.c \
-       device_if.h bus_if.h
-NOMAN=
-
-.include <bsd.kmod.mk>
diff --git a/sys/bus/pccard/pcic.c b/sys/bus/pccard/pcic.c
deleted file mode 100644 (file)
index 4c1f4c7..0000000
+++ /dev/null
@@ -1,1330 +0,0 @@
-/*
- *  Intel PCIC or compatible Controller driver
- *-------------------------------------------------------------------------
- *
- * Copyright (c) 2001 M. Warner Losh.  All rights reserved.
- * Copyright (c) 1995 Andrew McRae.  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.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * 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: src/sys/pccard/pcic.c,v 1.89.2.28 2003/02/26 18:42:00 imp Exp $
- * $DragonFly: src/sys/bus/pccard/Attic/pcic.c,v 1.4 2004/01/08 10:06:29 joerg Exp $
- */
-
-#include <sys/param.h>
-#include <sys/bus.h>
-#include <sys/kernel.h>
-#include <sys/module.h>
-#include <sys/sysctl.h>
-#include <sys/systm.h>
-
-#include <machine/clock.h>
-#include "i82365.h"
-#include "pcic_pci.h"
-#include "cardinfo.h"
-#include "slot.h"
-#include "pcicvar.h"
-
-/* Get pnp IDs */
-#include <bus/isa/isavar.h>
-#include <dev/misc/pcic/i82365reg.h>
-#include "pccardvar.h"
-#include "card_if.h"
-
-/*
- *     Prototypes for interrupt handler.
- */
-static int             pcic_ioctl(struct slot *, int, caddr_t);
-static int             pcic_power(struct slot *);
-static void            pcic_mapirq(struct slot *, int);
-static timeout_t       pcic_reset;
-static void            pcic_resume(struct slot *);
-static void            pcic_disable(struct slot *);
-static int             pcic_memory(struct slot *, int);
-static int             pcic_io(struct slot *, int);
-
-devclass_t     pcic_devclass;
-
-static struct slot_ctrl pcic_cinfo = {
-       pcic_mapirq,
-       pcic_memory,
-       pcic_io,
-       pcic_reset,
-       pcic_disable,
-       pcic_power,
-       pcic_ioctl,
-       pcic_resume,
-       PCIC_MEM_WIN,
-       PCIC_IO_WIN
-};
-
-/* sysctl vars */
-SYSCTL_NODE(_hw, OID_AUTO, pcic, CTLFLAG_RD, 0, "PCIC parameters");
-
-int pcic_override_irq = 0;
-TUNABLE_INT("machdep.pccard.pcic_irq", &pcic_override_irq);
-TUNABLE_INT("hw.pcic.irq", &pcic_override_irq);
-SYSCTL_INT(_hw_pcic, OID_AUTO, irq, CTLFLAG_RD,
-    &pcic_override_irq, 0,
-    "Override the IRQ configured by the config system for all pcic devices");
-
-int pcic_boot_deactivated = 0;
-TUNABLE_INT("hw.pcic.boot_deactivated", &pcic_boot_deactivated);
-SYSCTL_INT(_hw_pcic, OID_AUTO, boot_deactivated, CTLFLAG_RD,
-    &pcic_boot_deactivated, 0,
-    "Override the automatic powering up of pccards at boot.  This works\n\
-around what turns out to be an old bug in the code that has since been\n\
-corrected.  It is now deprecated and will be removed completely before\n\
-FreeBSD 4.8.");
-
-/*
- * CL-PD6722's VSENSE method
- *     0: NO VSENSE (assume a 5.0V card)
- *     1: 6710's method (default)
- *     2: 6729's method
- */
-int pcic_pd6722_vsense = 1;
-TUNABLE_INT("hw.pcic.pd6722_vsense", &pcic_pd6722_vsense);
-SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_RD,
-    &pcic_pd6722_vsense, 1,
-    "Select CL-PD6722's VSENSE method.  VSENSE is used to determine the\n\
-volatage of inserted cards.  The CL-PD6722 has two methods to determine the\n\
-voltage of the card.  0 means assume a 5.0V card and do not check.  1 means\n\
-use the same method that the CL-PD6710 uses (default).  2 means use the\n\
-same method as the CL-PD6729.  2 is documented in the datasheet as being\n\
-the correct way, but 1 seems to give better results on more laptops.");
-
-/*
- * Read a register from the PCIC.
- */
-unsigned char
-pcic_getb_io(struct pcic_slot *sp, int reg)
-{
-       bus_space_write_1(sp->bst, sp->bsh, PCIC_INDEX, sp->offset + reg);
-       return (bus_space_read_1(sp->bst, sp->bsh, PCIC_DATA));
-}
-
-/*
- * Write a register on the PCIC
- */
-void
-pcic_putb_io(struct pcic_slot *sp, int reg, unsigned char val)
-{
-       /*
-        * Many datasheets recommend using outw rather than outb to save 
-        * a microsecond.  Maybe we should do this, but we'd likely only
-        * save 20-30us on card activation.
-        */
-       bus_space_write_1(sp->bst, sp->bsh, PCIC_INDEX, sp->offset + reg);
-       bus_space_write_1(sp->bst, sp->bsh, PCIC_DATA, val);
-}
-
-/*
- * Clear bit(s) of a register.
- */
-__inline void
-pcic_clrb(struct pcic_slot *sp, int reg, unsigned char mask)
-{
-       sp->putb(sp, reg, sp->getb(sp, reg) & ~mask);
-}
-
-/*
- * Set bit(s) of a register
- */
-__inline void
-pcic_setb(struct pcic_slot *sp, int reg, unsigned char mask)
-{
-       sp->putb(sp, reg, sp->getb(sp, reg) | mask);
-}
-
-/*
- * Write a 16 bit value to 2 adjacent PCIC registers
- */
-static __inline void
-pcic_putw(struct pcic_slot *sp, int reg, unsigned short word)
-{
-       sp->putb(sp, reg, word & 0xFF);
-       sp->putb(sp, reg + 1, (word >> 8) & 0xff);
-}
-
-/*
- * pc98 cbus cards introduce a slight wrinkle here.  They route the irq7 pin
- * from the pcic chip to INT 2 on the cbus.  INT 2 is normally mapped to
- * irq 6 on the pc98 architecture, so if we get a request for irq 6
- * lie to the hardware and say it is 7.  All the other usual mappings for
- * cbus INT into irq space are the same as the rest of the system.
- */
-static __inline int
-host_irq_to_pcic(int irq)
-{
-#ifdef PC98
-       if (irq == 6)
-               irq = 7;
-#endif
-       return (irq);
-}
-
-/*
- * Free up resources allocated so far.
- */
-void
-pcic_dealloc(device_t dev)
-{
-       struct pcic_softc *sc;
-
-       sc = (struct pcic_softc *) device_get_softc(dev);
-       if (sc->slot_poll)
-               untimeout(sc->slot_poll, sc, sc->timeout_ch);
-       if (sc->iores)
-               bus_release_resource(dev, SYS_RES_IOPORT, sc->iorid,
-                   sc->iores);
-       if (sc->memres)
-               bus_release_resource(dev, SYS_RES_MEMORY, sc->memrid,
-                   sc->memres);
-       if (sc->ih)
-               bus_teardown_intr(dev, sc->irqres, sc->ih);
-       if (sc->irqres)
-               bus_release_resource(dev, SYS_RES_IRQ, sc->irqrid, sc->irqres);
-}
-
-/*
- *     entry point from main code to map/unmap memory context.
- */
-static int
-pcic_memory(struct slot *slt, int win)
-{
-       struct pcic_slot *sp = slt->cdata;
-       struct mem_desc *mp = &slt->mem[win];
-       int reg = win * PCIC_MEMSIZE + PCIC_MEMBASE;
-
-       if (win < 0 || win >= slt->ctrl->maxmem) {
-               printf("Illegal PCIC MEMORY window request %d\n", win);
-               return (ENXIO);
-       }
-       if (mp->flags & MDF_ACTIVE) {
-               unsigned long sys_addr = (uintptr_t)(void *)mp->start >> 12;
-               if ((sys_addr >> 12) != 0 && 
-                   (sp->sc->flags & PCIC_YENTA_HIGH_MEMORY) == 0) {
-                       printf("This pcic does not support mapping > 24M\n");
-                       return (ENXIO);
-               }
-               /*
-                * Write the addresses, card offsets and length.
-                * The values are all stored as the upper 12 bits of the
-                * 24 bit address i.e everything is allocated as 4 Kb chunks.
-                * Memory mapped cardbus bridges extend this slightly to allow
-                * one to set the upper 8 bits of the 32bit address as well.
-                * If the chip supports it, then go ahead and write those
-                * upper 8 bits.
-                */
-               pcic_putw(sp, reg, sys_addr & 0xFFF);
-               pcic_putw(sp, reg+2, (sys_addr + (mp->size >> 12) - 1) & 0xFFF);
-               pcic_putw(sp, reg+4, ((mp->card >> 12) - sys_addr) & 0x3FFF);
-               if (sp->sc->flags & PCIC_YENTA_HIGH_MEMORY)
-                   sp->putb(sp, PCIC_MEMORY_HIGH0 + win, sys_addr >> 12);
-               /*
-                *      Each 16 bit register has some flags in the upper bits.
-                */
-               if (mp->flags & MDF_16BITS)
-                       pcic_setb(sp, reg+1, PCIC_DATA16);
-               if (mp->flags & MDF_ZEROWS)
-                       pcic_setb(sp, reg+1, PCIC_ZEROWS);
-               if (mp->flags & MDF_WS0)
-                       pcic_setb(sp, reg+3, PCIC_MW0);
-               if (mp->flags & MDF_WS1)
-                       pcic_setb(sp, reg+3, PCIC_MW1);
-               if (mp->flags & MDF_ATTR)
-                       pcic_setb(sp, reg+5, PCIC_REG);
-               if (mp->flags & MDF_WP)
-                       pcic_setb(sp, reg+5, PCIC_WP);
-               /*
-                * Enable the memory window. By experiment, we need a delay.
-                */
-               pcic_setb(sp, PCIC_ADDRWINE, (1<<win) | PCIC_MEMCS16);
-               DELAY(50);
-       } else {
-               pcic_clrb(sp, PCIC_ADDRWINE, 1<<win);
-               pcic_putw(sp, reg, 0);
-               pcic_putw(sp, reg+2, 0);
-               pcic_putw(sp, reg+4, 0);
-       }
-       return (0);
-}
-
-/*
- *     pcic_io - map or unmap I/O context
- */
-static int
-pcic_io(struct slot *slt, int win)
-{
-       int     mask, reg;
-       struct pcic_slot *sp = slt->cdata;
-       struct io_desc *ip = &slt->io[win];
-       if (bootverbose) {
-               printf("pcic: I/O win %d flags %x %x-%x\n", win, ip->flags,
-                   ip->start, ip->start + ip->size - 1);
-       }
-
-       switch (win) {
-       case 0:
-               mask = PCIC_IO0_EN;
-               reg = PCIC_IO0;
-               break;
-       case 1:
-               mask = PCIC_IO1_EN;
-               reg = PCIC_IO1;
-               break;
-       default:
-               printf("Illegal PCIC I/O window request %d\n", win);
-               return (ENXIO);
-       }
-       if (ip->flags & IODF_ACTIVE) {
-               unsigned char x, ioctlv;
-
-               pcic_putw(sp, reg, ip->start);
-               pcic_putw(sp, reg+2, ip->start + ip->size - 1);
-               x = 0;
-               if (ip->flags & IODF_ZEROWS)
-                       x |= PCIC_IO_0WS;
-               if (ip->flags & IODF_WS)
-                       x |= PCIC_IO_WS;
-               if (ip->flags & IODF_CS16)
-                       x |= PCIC_IO_CS16;
-               if (ip->flags & IODF_16BIT)
-                       x |= PCIC_IO_16BIT;
-               /*
-                * Extract the current flags and merge with new flags.
-                * Flags for window 0 in lower nybble, and in upper nybble
-                * for window 1.
-                */
-               ioctlv = sp->getb(sp, PCIC_IOCTL);
-               DELAY(100);
-               switch (win) {
-               case 0:
-                       sp->putb(sp, PCIC_IOCTL, x | (ioctlv & 0xf0));
-                       break;
-               case 1:
-                       sp->putb(sp, PCIC_IOCTL, (x << 4) | (ioctlv & 0xf));
-                       break;
-               }
-               DELAY(100);
-               pcic_setb(sp, PCIC_ADDRWINE, mask);
-               DELAY(100);
-       } else {
-               pcic_clrb(sp, PCIC_ADDRWINE, mask);
-               DELAY(100);
-               pcic_putw(sp, reg, 0);
-               pcic_putw(sp, reg + 2, 0);
-       }
-       return (0);
-}
-
-static void
-pcic_do_mgt_irq(struct pcic_slot *sp, int irq)
-{
-       u_int32_t       reg;
-
-       if (sp->sc->csc_route == pcic_iw_pci) {
-               /* Do the PCI side of things: Enable the Card Change int */
-               reg = CB_SM_CD;
-               bus_space_write_4(sp->bst, sp->bsh, CB_SOCKET_MASK, reg);
-               /*
-                * TI Chips need us to set the following.  We tell the
-                * controller to route things via PCI interrupts.  Also
-                * we clear the interrupt number in the STAT_INT register
-                * as well.  The TI-12xx and newer chips require one or the
-                * other of these to happen, depending on what is set in the
-                * diagnostic register.  I do both on the theory that other
-                * chips might need one or the other and that no harm will
-                * come from it.  If there is harm, then I'll make it a bit
-                * in the tables.
-                */
-               pcic_setb(sp, PCIC_INT_GEN, PCIC_INTR_ENA);
-               pcic_clrb(sp, PCIC_STAT_INT, PCIC_CSCSELECT);
-       } else {
-               /* Management IRQ changes */
-               /*
-                * The PCIC_INTR_ENA bit means either "tie the function
-                * and csc interrupts together" or "Route csc interrupts
-                * via PCI" or "Reserved".  In any case, we want to clear
-                * it since we're using ISA interrupts.
-                */
-               pcic_clrb(sp, PCIC_INT_GEN, PCIC_INTR_ENA);
-               irq = host_irq_to_pcic(irq);
-               sp->putb(sp, PCIC_STAT_INT, (irq << PCIC_SI_IRQ_SHIFT) | 
-                   PCIC_CDEN);
-       }
-}
-
-int
-pcic_attach(device_t dev)
-{
-       int             i;
-       device_t        kid;
-       struct pcic_softc *sc;
-       struct slot     *slt;
-       struct pcic_slot *sp;
-       
-       sc = (struct pcic_softc *) device_get_softc(dev);
-       callout_handle_init(&sc->timeout_ch);
-       sp = &sc->slots[0];
-       for (i = 0; i < PCIC_CARD_SLOTS; i++, sp++) {
-               if (!sp->slt)
-                       continue;
-               sp->slt = 0;
-               kid = device_add_child(dev, NULL, -1);
-               if (kid == NULL) {
-                       device_printf(dev, "Can't add pccard bus slot %d", i);
-                       return (ENXIO);
-               }
-               device_probe_and_attach(kid);
-               slt = pccard_init_slot(kid, &pcic_cinfo);
-               if (slt == 0) {
-                       device_printf(dev, "Can't get pccard info slot %d", i);
-                       return (ENXIO);
-               }
-               sc->slotmask |= (1 << i);
-               slt->cdata = sp;
-               sp->slt = slt;
-               sp->sc = sc;
-       }
-
-       sp = &sc->slots[0];
-       for (i = 0; i < PCIC_CARD_SLOTS; i++, sp++) {
-               if (sp->slt == NULL)
-                       continue;
-
-               pcic_do_mgt_irq(sp, sc->irq);
-               sp->slt->irq = sc->irq;
-
-               /* Check for changes */
-               sp->slt->laststate = sp->slt->state = empty;
-               if (pcic_boot_deactivated) {
-                       sp->putb(sp, PCIC_POWER, 0);
-                       if ((sp->getb(sp, PCIC_STATUS) & PCIC_CD) == PCIC_CD) {
-                               sp->slt->state = inactive;
-                               pccard_event(sp->slt, card_deactivated);
-                       }
-               } else {
-                       pcic_do_stat_delta(sp);
-               }
-       }
-
-       return (bus_generic_attach(dev));
-}
-
-
-static int
-pcic_sresource(struct slot *slt, caddr_t data)
-{
-       struct pccard_resource *pr;
-       struct resource *r;
-       int flags;
-       int rid = 0;
-       device_t bridgedev = slt->dev;
-       struct pcic_slot *sp = slt->cdata;
-
-       pr = (struct pccard_resource *)data;
-       pr->resource_addr = ~0ul;
-
-       /*
-        * If we're using PCI interrupt routing, then force the IRQ to
-        * use and to heck with what the user requested.  If they want
-        * to be able to request IRQs, they must use ISA interrupt
-        * routing.  If we don't give them an irq, and it is the
-        * pccardd 0,0 case, then just return (giving the "bad resource"
-        * return in pr->resource_addr).
-        */
-       if (pr->type == SYS_RES_IRQ) {
-               if (sp->sc->func_route >= pcic_iw_pci) {
-                       pr->resource_addr = sp->sc->irq;
-                       return (0);
-               }
-               if (pr->min == 0 && pr->max == 0)
-                       return (0);
-       }
-
-       /*
-        * Make sure we grok this type.
-        */
-       switch(pr->type) {
-       default:
-               return (EINVAL);
-       case SYS_RES_MEMORY:
-       case SYS_RES_IRQ:
-       case SYS_RES_IOPORT:
-               break;
-       }
-
-       /*
-        * Allocate the resource, and align it to the most natural
-        * size.  If we get it, then tell userland what we actually got
-        * in the range they requested.
-        */
-       flags = rman_make_alignment_flags(pr->size);
-       r = bus_alloc_resource(bridgedev, pr->type, &rid, pr->min, pr->max,
-          pr->size, flags);
-       if (r != NULL) {
-               pr->resource_addr = (u_long)rman_get_start(r);
-               bus_release_resource(bridgedev, pr->type, rid, r);
-       }
-       return (0);
-}
-
-/*
- *     ioctl calls - Controller specific ioctls
- */
-static int
-pcic_ioctl(struct slot *slt, int cmd, caddr_t data)
-{
-       struct pcic_slot *sp = slt->cdata;
-       struct pcic_reg *preg = (struct pcic_reg *) data;
-
-       switch(cmd) {
-       default:
-               return (ENOTTY);
-       case PIOCGREG:                  /* Get pcic register */
-               preg->value = sp->getb(sp, preg->reg);
-               break;                  /* Set pcic register */
-       case PIOCSREG:
-               sp->putb(sp, preg->reg, preg->value);
-               break;
-       case PIOCSRESOURCE:             /* Can I use this resource? */
-               pcic_sresource(slt, data);
-               break;
-       }
-       return (0);
-}
-
-/*
- *     pcic_cardbus_power
- *
- *     Power the card up, as specified, using the cardbus power
- *     registers to control power.  Microsoft recommends that cardbus
- *     vendors support powering the card via cardbus registers because
- *     there is no standard for 3.3V cards.  Since at least a few of the
- *     cardbus bridges have minor issues with power via the ExCA registers,
- *     go ahead and do it all via cardbus registers.
- *
- *     An expamination of the code will show the relative ease that we do
- *     Vpp in comparison to the ExCA case (which may be partially broken).
- */
-static int
-pcic_cardbus_power(struct pcic_slot *sp, struct slot *slt)
-{
-       uint32_t power;
-       uint32_t state;
-
-       /*
-        * If we're doing an auto-detect, and we're in a badvcc state, then
-        * we need to force the socket to rescan the card.  We don't do this
-        * all the time because the socket can take up to 200ms to do the deed,
-        * and that's too long to busy wait.  Since this is a relatively rare
-        * event (some BIOSes, and earlier versions of OLDCARD caused it), we
-        * test for it special.
-        */
-       state =  bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_STATE);
-       if (slt->pwr.vcc == -1 && (state & CB_SS_BADVCC)) {
-               /*
-                * Force the bridge to scan the card for the proper voltages
-                * that it supports.
-                */
-               bus_space_write_4(sp->bst, sp->bsh, CB_SOCKET_FORCE,
-                   CB_SF_INTCVS);
-               state =  bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_STATE);
-               /* This while loop can take 100-150ms */
-               while ((state & CB_SS_CARD_MASK) == 0) {
-                       DELAY(10 * 1000);
-                       state =  bus_space_read_4(sp->bst, sp->bsh,
-                           CB_SOCKET_STATE);
-               }
-       }
-       /*
-        * Preserve the clock stop bit of the socket power register.  Not
-        * sure that we want to do that, but maybe we should set it based
-        * on the power state.
-        */
-       power = bus_space_read_4(sp->bst, sp->bsh, CB_SOCKET_POWER);
-       power = 0;
-
-       /*
-        * vcc == -1 means automatically detect the voltage of the card.
-        * Do so and apply the right amount of power.
-        */
-       if (slt->pwr.vcc == -1) {
-               if (state & CB_SS_5VCARD)
-                       slt->pwr.vcc = 50;
-               else if (state & CB_SS_3VCARD)
-                       slt->pwr.vcc = 33;
-               else if (state & CB_SS_XVCARD)
-                       slt->pwr.vcc = 22;
-               else if (state & CB_SS_YVCARD)
-                       slt->pwr.vcc = 11;
-               if (bootverbose && slt->pwr.vcc != -1)
-                       device_printf(sp->sc->dev,
-                           "Autodetected %d.%dV card\n",
-                           slt->pwr.vcc / 10, slt->pwr.vcc % 10);
-       }
-
-       switch(slt->pwr.vcc) {
-       default:
-               return (EINVAL);
-       case 0:
-               power |= CB_SP_VCC_0V;
-               break;
-       case 11:
-               power |= CB_SP_VCC_YV;
-               break;
-       case 22:
-               power |= CB_SP_VCC_XV;
-               break;
-       case 33:
-               power |= CB_SP_VCC_3V;
-               break;
-       case 50:
-               power |= CB_SP_VCC_5V;
-               break;
-       }
-
-       /*
-        * vpp == -1 means use vcc voltage.
-        */
-       if (slt->pwr.vpp == -1)
-               slt->pwr.vpp = slt->pwr.vcc;
-       switch(slt->pwr.vpp) {
-       default:
-               return (EINVAL);
-       case 0:
-               power |= CB_SP_VPP_0V;
-               break;
-       case 11:
-               power |= CB_SP_VPP_YV;
-               break;
-       case 22:
-               power |= CB_SP_VPP_XV;
-               break;
-       case 33:
-               power |= CB_SP_VPP_3V;
-               break;
-       case 50:
-               power |= CB_SP_VPP_5V;
-               break;
-       case 120:
-               power |= CB_SP_VPP_12V;
-               break;
-       }
-       bus_space_write_4(sp->bst, sp->bsh, CB_SOCKET_POWER, power);
-
-       /*
-        * OK.  We need to bring the card out of reset.  Let the power
-        * stabilize for 300ms (why 300?) and then enable the outputs
-        * and then wait 100ms (why 100?) for it to stabilize.  These numbers
-        * were stolen from the dim, dark past of OLDCARD and I have no clue
-        * how they were derived.  I also use the bit setting routines here
-        * as a measure of conservatism.
-        */
-       if (power) {
-               pcic_setb(sp, PCIC_POWER, PCIC_DISRST);
-               DELAY(300*1000);
-               pcic_setb(sp, PCIC_POWER, PCIC_DISRST | PCIC_OUTENA);
-               DELAY(100*1000);
-       } else {
-               pcic_clrb(sp, PCIC_POWER, PCIC_DISRST | PCIC_OUTENA);
-       }
-       return (0);
-}
-
-/*
- *     pcic_power - Enable the power of the slot according to
- *     the parameters in the power structure(s).
- */
-static int
-pcic_power(struct slot *slt)
-{
-       unsigned char c, c2;
-       unsigned char reg = PCIC_DISRST | PCIC_PCPWRE;
-       struct pcic_slot *sp = slt->cdata;
-       struct pcic_slot *sp2;
-       struct pcic_softc *sc = sp->sc;
-       int dodefault = 0;
-       char controller;
-       
-       /*
-        * Cardbus power registers are completely different.
-        */
-       if (sc->flags & PCIC_CARDBUS_POWER)
-               return (pcic_cardbus_power(sp, slt));
-
-       if (bootverbose)
-               device_printf(sc->dev, "Power: Vcc=%d Vpp=%d\n", slt->pwr.vcc,
-                   slt->pwr.vpp);
-       /*
-        * If we're automatically detecting what voltage to use, then we need
-        * to ask the bridge what type (voltage-wise) the card is.
-        */
-       if (slt->pwr.vcc == -1) {
-               if (sc->flags & PCIC_DF_POWER) {
-                       /* 
-                        * Look at the VS[12]# bits on the card.  If VS1 is
-                        * clear then the card needs 3.3V instead of 5.0V.
-                        */
-                       c = sp->getb(sp, PCIC_CDGC);
-                       if ((c & PCIC_VS1STAT) == 0)
-                               slt->pwr.vcc = 33;
-                       else
-                               slt->pwr.vcc = 50;
-               }
-               if (sc->flags & PCIC_PD_POWER) {
-                       /*
-                        * The 6710 does it one way, and the '22 and '29 do it
-                        * another.  The '22 can also do it the same way as a
-                        * '10 does it, despite what the datasheets say.  Some
-                        * laptops with '22 don't seem to have the signals
-                        * wired right for the '29 method to work.  The
-                        * laptops that don't work hang solid when the pccard
-                        * memory is accessed.
-                        *
-                        * To allow for both types of laptops,
-                        * hw.pcic.pd6722_vsense will select which one to use.
-                        * 0 - none, 1 - the '10 way and 2 - the '29 way.
-                        */
-         &nb