summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus/cardbus_cis.c
diff options
context:
space:
mode:
authorjon <jon@FreeBSD.org>2000-11-28 00:52:40 +0000
committerjon <jon@FreeBSD.org>2000-11-28 00:52:40 +0000
commit51f405ec6ea3c70e9e867604bf429307817cb25c (patch)
tree57c8c77e8f5c87fb6e5b5230d756340726855112 /sys/dev/cardbus/cardbus_cis.c
parent49bd2bf0607af99945e5e2b456be122bc22f2247 (diff)
downloadFreeBSD-src-51f405ec6ea3c70e9e867604bf429307817cb25c.zip
FreeBSD-src-51f405ec6ea3c70e9e867604bf429307817cb25c.tar.gz
1) When mucking with mapping registers, it is best to *not* have
io or memory space access enabled. This patch defers the setting of these bits until after all of the mapping registers are probed. It might be even better to defer this until a particular mapping is activated and to disable that type of access when a new register is activated. 2) The PCI spec is very explicit about how mapping registers and the expansion ROM mapping register should be probed. This patch makes cardbus_add_map() follow the spec. 3) The PCI spec allows a device to use the same address decoder for expansion ROM access as is used for memory mapped register access. This patch carefully enables and disables ROM access along with resource (de)activiation. This doesn't include the prefetching detection stuff (maybe later when code is written to actually turn on prefetching). It also does not use the PCI definitions (yet, I'll try to put this in all at once later) Submitted by: Justin T. Gibbs
Diffstat (limited to 'sys/dev/cardbus/cardbus_cis.c')
-rw-r--r--sys/dev/cardbus/cardbus_cis.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c
index af1719e..46c6862 100644
--- a/sys/dev/cardbus/cardbus_cis.c
+++ b/sys/dev/cardbus/cardbus_cis.c
@@ -300,7 +300,7 @@ cardbus_read_tuple_conf(device_t dev, device_t child, u_int32_t *space,
{
int i, j;
u_int32_t e;
-
+
e = pci_read_config(child, *off - *off%4, 4);
for (j = *off%4; j>0; j--)
e >>= 8;
@@ -361,7 +361,7 @@ cardbus_read_tuple_exrom(device_t dev, struct resource *mem, u_int32_t *space,
*tupleid = image[0];
*len = image[1];
memcpy(tupledata, image+2, *len);
- *off += *len+2;
+ *off += *len+2;
return 0;
}
@@ -434,7 +434,7 @@ cardbus_read_tuple(device_t dev, device_t child, u_int32_t *space,
return EINVAL;
}
}
-
+
static int
decode_tuple(device_t dev, device_t child, int tupleid, int len,
u_int8_t *tupledata, u_int32_t *space, u_int32_t *off)
@@ -460,7 +460,7 @@ cardbus_do_cis(device_t dev, device_t child)
int len;
int expect_linktarget;
u_int32_t space, off;
-
+
bzero(tupledata, MAXTUPLESIZE);
expect_linktarget = TRUE;
off = pci_read_config(child, CARDBUS_CIS_REG, 4);
@@ -470,7 +470,7 @@ cardbus_do_cis(device_t dev, device_t child)
do {
cardbus_read_tuple(dev, child, &space, &off, &tupleid, &len,
tupledata);
-
+
if (expect_linktarget && tupleid != CISTPL_LINKTARGET) {
device_printf(dev, "Expecting link target, got 0x%x\n",
tupleid);
@@ -481,6 +481,6 @@ cardbus_do_cis(device_t dev, device_t child)
if (expect_linktarget != 0)
return expect_linktarget;
} while (tupleid != CISTPL_END);
- return 0;
+ return 0;
}
OpenPOWER on IntegriCloud