summaryrefslogtreecommitdiffstats
path: root/sys/dev/cardbus/cardbus_cis.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2011-06-06 13:21:11 +0000
committerjhb <jhb@FreeBSD.org>2011-06-06 13:21:11 +0000
commit970967dd97cca8ced16a03113dc1e5d3d193cb8b (patch)
tree091aa9e17267ad5bd79054485341c8956b0d813c /sys/dev/cardbus/cardbus_cis.c
parentb6df97b17b6ea3b8cc5819e7a3117e28327aa54b (diff)
downloadFreeBSD-src-970967dd97cca8ced16a03113dc1e5d3d193cb8b.zip
FreeBSD-src-970967dd97cca8ced16a03113dc1e5d3d193cb8b.tar.gz
More properly handle Cardbus cards that that store their CIS in a BAR after
the recent changes to track BAR state explicitly. The code would now attempt to add the same BAR twice in this case. Instead, change this so that it recognizes this case and only adds it once and do not delete the BAR outright after parsing the CIS. Tested by: bschmidt
Diffstat (limited to 'sys/dev/cardbus/cardbus_cis.c')
-rw-r--r--sys/dev/cardbus/cardbus_cis.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c
index 2cfea19..3352a56 100644
--- a/sys/dev/cardbus/cardbus_cis.c
+++ b/sys/dev/cardbus/cardbus_cis.c
@@ -324,7 +324,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id,
* hint when the cardbus bridge is a child of pci0 (the main
* bus). The PC Card spec seems to indicate that this should
* only be done on x86 based machines, which suggests that on
- * non-x86 machines the adddresses can be anywhere. Since the
+ * non-x86 machines the addresses can be anywhere. Since the
* hardware can do it on non-x86 machines, it should be able
* to do it on x86 machines too. Therefore, we can and should
* ignore this hint. Furthermore, the PC Card spec recommends
@@ -430,7 +430,6 @@ cardbus_read_tuple_finish(device_t cbdev, device_t child, int rid,
{
if (res != CIS_CONFIG_SPACE) {
bus_release_resource(child, SYS_RES_MEMORY, rid, res);
- bus_delete_resource(child, SYS_RES_MEMORY, rid);
}
}
@@ -467,7 +466,7 @@ cardbus_read_tuple_init(device_t cbdev, device_t child, uint32_t *start,
}
/* allocate the memory space to read CIS */
- res = bus_alloc_resource(child, SYS_RES_MEMORY, rid, 0, ~0, 1,
+ res = bus_alloc_resource_any(child, SYS_RES_MEMORY, rid,
rman_make_alignment_flags(4096) | RF_ACTIVE);
if (res == NULL) {
device_printf(cbdev, "Unable to allocate resource "
OpenPOWER on IntegriCloud