Eliminate the need for pccard_common.c by moving the function inline
in the .h file. Make it static __inline to make sure that it doesn't wind up defined in any files. Also, fix a typo that said null_do_attach instead of null_do_probe.
This commit is contained in:
parent
cd0195b666
commit
30e16b137a
@ -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;
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
@ -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)))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user