diff options
| author | Warner Losh <imp@FreeBSD.org> | 2002-07-17 05:20:43 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2002-07-17 05:20:43 +0000 |
| commit | c1bb793bbbce6ebe54520632664968c323091d32 (patch) | |
| tree | e8c2eb15037f660bdb8c48dfe3536ff8974d369a /sys/dev | |
| parent | 4a59c3ab552ad09f910322387e7fb7f7cb29eb52 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pccard/card_if.m | 11 | ||||
| -rw-r--r-- | sys/dev/pccard/pccard_common.c | 60 | ||||
| -rw-r--r-- | sys/dev/pccard/pccardvar.h | 18 |
3 files changed, 19 insertions, 70 deletions
diff --git a/sys/dev/pccard/card_if.m b/sys/dev/pccard/card_if.m index 3d97d1d19ba1a..b321d226a04f1 100644 --- a/sys/dev/pccard/card_if.m +++ b/sys/dev/pccard/card_if.m @@ -174,8 +174,6 @@ METHOD int compat_attach { } CODE { - static int null_do_probe(device_t bus, device_t dev) __unused; - static int null_do_probe(device_t bus, device_t dev) { return (CARD_COMPAT_DO_PROBE(device_get_parent(bus), dev)); @@ -190,13 +188,16 @@ CODE { METHOD int compat_do_probe { device_t bus; device_t dev; -} DEFAULT null_do_attach; +} 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; @@ -204,6 +205,7 @@ METHOD struct pccard_product * do_product_lookup { 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 @@ -239,6 +241,7 @@ CODE { *buff = NULL; return ENXIO; } + static void null_cis_free(device_t dev, struct cis_tupleinfo *buff, int *nret) { @@ -246,7 +249,6 @@ CODE { } }; - METHOD int cis_read { device_t dev; device_t child; @@ -261,4 +263,3 @@ METHOD int cis_free { int nret; } DEFAULT null_cis_free; - diff --git a/sys/dev/pccard/pccard_common.c b/sys/dev/pccard/pccard_common.c deleted file mode 100644 index e6838d1125657..0000000000000 --- a/sys/dev/pccard/pccard_common.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 a432856e601b0..0914f813e4bcc 100644 --- a/sys/dev/pccard/pccardvar.h +++ b/sys/dev/pccard/pccardvar.h @@ -240,9 +240,19 @@ struct pccard_product { 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); +#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); @@ -250,8 +260,6 @@ 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))) |
