diff options
-rw-r--r-- | sys/conf/files | 8 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 4 | ||||
-rw-r--r-- | sys/dev/cardbus/cardbus_cis.c | 2 | ||||
-rw-r--r-- | sys/dev/exca/exca.c | 9 | ||||
-rw-r--r-- | sys/dev/pccard/card_if.m | 8 | ||||
-rw-r--r-- | sys/dev/pccard/pccard.c | 14 | ||||
-rw-r--r-- | sys/dev/pccard/pccard_common.c | 60 | ||||
-rw-r--r-- | sys/dev/pccard/pccardvar.h | 3 | ||||
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 4 | ||||
-rw-r--r-- | sys/dev/pcic/i82365_isa.c | 1 | ||||
-rw-r--r-- | sys/modules/oldcard/Makefile | 2 |
11 files changed, 103 insertions, 12 deletions
diff --git a/sys/conf/files b/sys/conf/files index f807263..84c61f2 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -449,14 +449,12 @@ dev/musycc/musycc.c optional musycc dev/nge/if_nge.c optional nge dev/null/null.c standard dev/nmdm/nmdm.c optional nmdm -dev/pccard/card_if.m optional card -dev/pccard/card_if.m optional cardbus -dev/pccard/card_if.m optional pccard +dev/pccard/pccard_common.c standard +dev/pccard/card_if.m standard dev/pccard/pccard.c optional pccard dev/pccard/pccard_cis.c optional pccard dev/pccard/pccard_cis_quirks.c optional pccard -dev/pccard/power_if.m optional cardbus -dev/pccard/power_if.m optional pccard +dev/pccard/power_if.m standard dev/pccbb/pccbb.c optional pccbb dev/pci/eisa_pci.c optional pci dev/pci/fixup_pci.c optional pci diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 5e58ecc..98f3438 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -55,9 +55,9 @@ #include <dev/cardbus/cardbusreg.h> #include <dev/cardbus/cardbusvar.h> #include <dev/cardbus/cardbus_cis.h> +#include <dev/pccard/pccardvar.h> #include "power_if.h" -#include "card_if.h" #include "pcib_if.h" /* sysctl vars */ @@ -1236,6 +1236,8 @@ static driver_t cardbus_driver = { static devclass_t cardbus_devclass; DRIVER_MODULE(cardbus, pccbb, cardbus_driver, cardbus_devclass, 0, 0); +MODULE_VERSION(cardbus, 1); +MODULE_DEPEND(cardbus, exca, 1, 1, 1); /* MODULE_DEPEND(cardbus, pccbb, 1, 1, 1); */ diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index ba56430..ceb409e 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -50,7 +50,7 @@ #include <dev/cardbus/cardbusvar.h> #include <dev/cardbus/cardbus_cis.h> -#include "card_if.h" +#include <dev/pccard/pccardvar.h> extern int cardbus_cis_debug; diff --git a/sys/dev/exca/exca.c b/sys/dev/exca/exca.c index d2ed4a7..66b5d6b 100644 --- a/sys/dev/exca/exca.c +++ b/sys/dev/exca/exca.c @@ -60,6 +60,8 @@ #include <sys/kernel.h> #include <sys/malloc.h> #include <sys/queue.h> +#include <sys/module.h> +#include <sys/conf.h> #include <sys/bus.h> #include <machine/bus.h> @@ -614,3 +616,10 @@ exca_is_pcic(struct exca_softc *sc) /* XXX */ return (0); } + +static int exca_modevent(module_t mod, int cmd, void *arg) +{ + return 0; +} +DEV_MODULE(exca, exca_modevent, NULL); +MODULE_VERSION(exca, 1); diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 7cedc82..3d97d1d 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -27,6 +27,7 @@ # #include <sys/bus.h> +#include <dev/pccard/pccardvar.h> INTERFACE card; @@ -196,6 +197,13 @@ METHOD int compat_do_attach { device_t dev; } DEFAULT null_do_attach; +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 diff --git a/sys/dev/pccard/pccard.c b/sys/dev/pccard/pccard.c index d710eb8..4e73e98 100644 --- a/sys/dev/pccard/pccard.c +++ b/sys/dev/pccard/pccard.c @@ -124,6 +124,12 @@ static int pccard_setup_intr(device_t dev, device_t child, 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) { @@ -276,9 +282,10 @@ pccard_detach_card(device_t dev, int flags) return (0); } -const struct pccard_product * -pccard_product_lookup(device_t dev, const struct pccard_product *tab, - size_t ent_size, pccard_product_match_fn matchfn) +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) { const struct pccard_product *ent; int matches; @@ -1255,6 +1262,7 @@ static device_method_t pccard_methods[] = { 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 } }; diff --git a/sys/dev/pccard/pccard_common.c b/sys/dev/pccard/pccard_common.c new file mode 100644 index 0000000..e6838d1 --- /dev/null +++ b/sys/dev/pccard/pccard_common.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002 Takanori Watanabe 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. 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 + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * $FreeBSD$ + */ + + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/malloc.h> +#include <sys/module.h> +#include <sys/kernel.h> +#include <sys/queue.h> +#include <sys/sysctl.h> +#include <sys/types.h> + +#include <sys/bus.h> +#include <machine/bus.h> +#include <sys/rman.h> +#include <machine/resource.h> + +#include <net/ethernet.h> + +#include <dev/pccard/pccardreg.h> +#include <dev/pccard/pccardvar.h> + +#include "card_if.h" + +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); +} diff --git a/sys/dev/pccard/pccardvar.h b/sys/dev/pccard/pccardvar.h index e5e3849..a432856 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -34,7 +34,6 @@ #include <sys/queue.h> #include <machine/bus.h> -#include "card_if.h" extern int pccard_verbose; @@ -251,6 +250,8 @@ void pccard_print_cis(device_t); int pccard_scan_cis(device_t, int (*) (struct pccard_tuple *, void *), void *); +#include "card_if.h" + #define pccard_cis_read_1(tuple, idx0) \ (bus_space_read_1((tuple)->memt, (tuple)->memh, (tuple)->mult*(idx0))) diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 0230a71..3700d06 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1944,3 +1944,7 @@ static driver_t pccbb_driver = { static devclass_t pccbb_devclass; DRIVER_MODULE(pccbb, pci, pccbb_driver, pccbb_devclass, 0, 0); +MODULE_VERSION(pccbb, 1); +MODULE_DEPEND(pccbb, exca, 1, 1, 1); +MODULE_DEPEND(pccbb, pccard, 1, 1, 1); +MODULE_DEPEND(pccbb, cardbus, 1, 1, 1); diff --git a/sys/dev/pcic/i82365_isa.c b/sys/dev/pcic/i82365_isa.c index fc065bb..5651825 100644 --- a/sys/dev/pcic/i82365_isa.c +++ b/sys/dev/pcic/i82365_isa.c @@ -401,3 +401,4 @@ static driver_t pcic_driver = { static devclass_t pcic_devclass; DRIVER_MODULE(pcic, isa, pcic_driver, pcic_devclass, 0, 0); +MODULE_DEPEND(pcic, pccard, 1, 1, 1); diff --git a/sys/modules/oldcard/Makefile b/sys/modules/oldcard/Makefile index 990eb77..04cf35f 100644 --- a/sys/modules/oldcard/Makefile +++ b/sys/modules/oldcard/Makefile @@ -5,7 +5,7 @@ KMOD= oldcard SRCS= pccard.c pcic.c pccard_beep.c pccard_nbk.c pcic_pci.c pcic_isa.c \ opt_pcic.h device_if.h bus_if.h isa_if.h pci_if.h \ - power_if.h card_if.h power_if.c card_if.c + power_if.h card_if.h EXPORT_SYMS= YES # XXX evaluate |