Index: conf/files =================================================================== RCS file: /home/cvs/sys/sys/conf/files,v retrieving revision 1.1.1.5 retrieving revision 1.3 diff -u -r1.1.1.5 -r1.3 --- conf/files 28 May 2002 15:22:17 -0000 1.1.1.5 +++ conf/files 30 May 2002 12:47:22 -0000 1.3 @@ -449,14 +449,12 @@ 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 Index: dev/cardbus/cardbus.c =================================================================== RCS file: /home/cvs/sys/sys/dev/cardbus/cardbus.c,v retrieving revision 1.1.1.1 retrieving revision 1.4 diff -u -r1.1.1.1 -r1.4 --- dev/cardbus/cardbus.c 16 May 2002 22:53:56 -0000 1.1.1.1 +++ dev/cardbus/cardbus.c 30 May 2002 12:47:24 -0000 1.4 @@ -55,9 +55,9 @@ #include #include #include +#include #include "power_if.h" -#include "card_if.h" #include "pcib_if.h" /* sysctl vars */ @@ -1236,6 +1236,8 @@ 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); */ Index: dev/cardbus/cardbus_cis.c =================================================================== RCS file: /home/cvs/sys/sys/dev/cardbus/cardbus_cis.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- dev/cardbus/cardbus_cis.c 16 May 2002 22:53:56 -0000 1.1.1.1 +++ dev/cardbus/cardbus_cis.c 29 May 2002 12:23:07 -0000 1.2 @@ -50,7 +50,7 @@ #include #include -#include "card_if.h" +#include extern int cardbus_cis_debug; Index: dev/exca/exca.c =================================================================== RCS file: /home/cvs/sys/sys/dev/exca/exca.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- dev/exca/exca.c 16 May 2002 22:53:59 -0000 1.1.1.1 +++ dev/exca/exca.c 29 May 2002 15:16:37 -0000 1.2 @@ -60,6 +60,8 @@ #include #include #include +#include +#include #include #include @@ -614,3 +616,10 @@ /* 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); Index: dev/pccard/card_if.m =================================================================== RCS file: /home/cvs/sys/sys/dev/pccard/card_if.m,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- dev/pccard/card_if.m 16 May 2002 22:54:01 -0000 1.1.1.1 +++ dev/pccard/card_if.m 29 May 2002 12:23:09 -0000 1.3 @@ -27,6 +27,7 @@ # #include +#include INTERFACE card; @@ -196,6 +197,13 @@ 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 Index: dev/pccard/pccard.c =================================================================== RCS file: /home/cvs/sys/sys/dev/pccard/pccard.c,v retrieving revision 1.1.1.1 retrieving revision 1.5 diff -u -r1.1.1.1 -r1.5 --- dev/pccard/pccard.c 16 May 2002 22:54:01 -0000 1.1.1.1 +++ dev/pccard/pccard.c 30 May 2002 12:47:25 -0000 1.5 @@ -124,6 +124,12 @@ 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 @@ 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,7 +1262,7 @@ 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 } }; Index: dev/pccard/pccard_common.c =================================================================== RCS file: dev/pccard/pccard_common.c diff -N dev/pccard/pccard_common.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ dev/pccard/pccard_common.c 28 May 2002 18:36:59 -0000 1.1 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 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. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include + +#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); +} Index: dev/pccard/pccardvar.h =================================================================== RCS file: /home/cvs/sys/sys/dev/pccard/pccardvar.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- dev/pccard/pccardvar.h 16 May 2002 22:54:01 -0000 1.1.1.1 +++ dev/pccard/pccardvar.h 28 May 2002 18:36:59 -0000 1.2 @@ -34,7 +34,6 @@ #include #include -#include "card_if.h" extern int pccard_verbose; @@ -240,16 +239,16 @@ typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); - const struct pccard_product *pccard_product_lookup(device_t dev, const struct pccard_product *tab, size_t ent_size, pccard_product_match_fn matchfn); - void pccard_read_cis(struct pccard_softc *); void pccard_check_cis_quirks(device_t); 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))) Index: dev/pccbb/pccbb.c =================================================================== RCS file: /home/cvs/sys/sys/dev/pccbb/pccbb.c,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- dev/pccbb/pccbb.c 16 May 2002 22:54:01 -0000 1.1.1.1 +++ dev/pccbb/pccbb.c 30 May 2002 12:47:26 -0000 1.3 @@ -1944,3 +1944,7 @@ 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); Index: dev/pcic/i82365_isa.c =================================================================== RCS file: /home/cvs/sys/sys/dev/pcic/i82365_isa.c,v retrieving revision 1.1.1.1 retrieving revision 1.3 diff -u -r1.1.1.1 -r1.3 --- dev/pcic/i82365_isa.c 16 May 2002 22:54:02 -0000 1.1.1.1 +++ dev/pcic/i82365_isa.c 30 May 2002 12:47:27 -0000 1.3 @@ -401,3 +401,4 @@ static devclass_t pcic_devclass; DRIVER_MODULE(pcic, isa, pcic_driver, pcic_devclass, 0, 0); +MODULE_DEPEND(pcic, pccard, 1, 1, 1); Index: modules/oldcard/Makefile =================================================================== RCS file: /home/cvs/sys/sys/modules/oldcard/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- modules/oldcard/Makefile 16 May 2002 22:54:13 -0000 1.1.1.1 +++ modules/oldcard/Makefile 30 May 2002 12:47:29 -0000 1.2 @@ -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