Date: Thu, 14 Apr 2011 13:50:15 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 191480 for review Message-ID: <201104141350.p3EDoFdT075077@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@191480?ac=10 Change 191480 by jhb@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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104141350.p3EDoFdT075077>