PERFORCE change 191480 for review
John Baldwin
jhb at FreeBSD.org
Thu Apr 14 13:50:16 UTC 2011
http://p4web.freebsd.org/@@191480?ac=10
Change 191480 by jhb at jhb_fiver on 2011/04/14 13:49:26
Handle the case where a CardBus card's CIS is stored in a BAR.
Affected files ...
.. //depot/projects/pci/sys/dev/cardbus/cardbus_cis.c#2 edit
.. //depot/projects/pci/sys/dev/pci/pci.c#14 edit
Differences ...
==== //depot/projects/pci/sys/dev/cardbus/cardbus_cis.c#2 (text+ko) ====
@@ -430,7 +430,10 @@
{
if (res != CIS_CONFIG_SPACE) {
bus_release_resource(child, SYS_RES_MEMORY, rid, res);
+#if 0
+ /* XXX: Not anymore. */
bus_delete_resource(child, SYS_RES_MEMORY, rid);
+#endif
}
}
==== //depot/projects/pci/sys/dev/pci/pci.c#14 (text+ko) ====
@@ -2576,6 +2576,17 @@
uint16_t cmd;
struct resource *res;
+ /*
+ * The BAR may already exist if the device is a CardBus card
+ * whose CIS is stored in this BAR.
+ */
+ pm = pci_find_bar(dev, reg);
+ if (pm != NULL) {
+ maprange = pci_maprange(pm->value);
+ barlen = maprange == 64 ? 2 : 1;
+ return (barlen);
+ }
+
pci_read_bar(dev, reg, &map, &testval);
if (PCI_BAR_MEM(map)) {
type = SYS_RES_MEMORY;
More information about the p4-projects
mailing list