summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2003-02-16 02:02:44 +0000
committerimp <imp@FreeBSD.org>2003-02-16 02:02:44 +0000
commit51131e1cc27a32c455f0bde18c44c80a0ac403f1 (patch)
tree3361ccdef3775e014b098bc4f38e05d5f30aae39 /sys/dev/pci
parent3d5956dc2206dac332987481047a125abc1d40d7 (diff)
downloadFreeBSD-src-51131e1cc27a32c455f0bde18c44c80a0ac403f1.zip
FreeBSD-src-51131e1cc27a32c455f0bde18c44c80a0ac403f1.tar.gz
Use rman_get_device rather than rle->resl->r_dev.
make pci_hdrtypedata and pci_read_extcap accessible (but maybe in the end we'll make them private again).
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/pci.c10
-rw-r--r--sys/dev/pci/pci_private.h4
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index ecdcba0..3ca38c3 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -65,9 +65,6 @@ static int pci_maptype(unsigned mapreg);
static int pci_mapsize(unsigned testval);
static int pci_maprange(unsigned mapreg);
static void pci_fixancient(pcicfgregs *cfg);
-static void pci_hdrtypedata(device_t pcib, int b, int s, int f,
- pcicfgregs *cfg);
-static void pci_read_extcap(device_t pcib, pcicfgregs *cfg);
static int pci_porten(device_t pcib, int b, int s, int f);
static int pci_memen(device_t pcib, int b, int s, int f);
@@ -294,7 +291,7 @@ pci_fixancient(pcicfgregs *cfg)
/* extract header type specific config data */
-static void
+void
pci_hdrtypedata(device_t pcib, int b, int s, int f, pcicfgregs *cfg)
{
#define REG(n, w) PCIB_READ_CONFIG(pcib, b, s, f, n, w)
@@ -392,7 +389,7 @@ pci_read_device(device_t pcib, int b, int s, int f, size_t size)
#undef REG
}
-static void
+void
pci_read_extcap(device_t pcib, pcicfgregs *cfg)
{
#define REG(n, w) PCIB_READ_CONFIG(pcib, cfg->bus, cfg->slot, cfg->func, n, w)
@@ -451,7 +448,6 @@ pci_freecfg(struct pci_devinfo *dinfo)
devlist_head = &pci_devq;
- /* XXX this hasn't been tested */
STAILQ_REMOVE(devlist_head, dinfo, pci_devinfo, pci_links);
free(dinfo, M_DEVBUF);
@@ -1337,7 +1333,7 @@ pci_delete_resource(device_t dev, device_t child, int type, int rid)
rle = resource_list_find(rl, type, rid);
if (rle) {
if (rle->res) {
- if (rle->res->r_dev != dev ||
+ if (rman_get_device(rle->res) != dev ||
rman_get_flags(rle->res) & RF_ACTIVE) {
device_printf(dev, "delete_resource: "
"Resource still owned by child, oops. "
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
index 1b14bc8..3902efb 100644
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -68,5 +68,7 @@ struct pci_devinfo *pci_read_device(device_t pcib, int b, int s, int f,
size_t size);
void pci_print_verbose(struct pci_devinfo *dinfo);
int pci_freecfg(struct pci_devinfo *dinfo);
-
+void pci_hdrtypedata(device_t pcib, int b, int s, int f,
+ pcicfgregs *cfg);
+void pci_read_extcap(device_t pcib, pcicfgregs *cfg);
#endif /* _PCI_PRIVATE_H_ */
OpenPOWER on IntegriCloud