Retire BARBIT in favor of new PCI_RID2BAR.

This commit is contained in:
Warner Losh 2005-12-29 23:41:29 +00:00
parent b60c6f4683
commit 3cd242d123
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153862
2 changed files with 4 additions and 5 deletions

View File

@ -316,7 +316,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id,
if (type == SYS_RES_MEMORY) { if (type == SYS_RES_MEMORY) {
if (reg & TPL_BAR_REG_PREFETCHABLE) if (reg & TPL_BAR_REG_PREFETCHABLE)
dinfo->mprefetchable |= BARBIT(bar); dinfo->mprefetchable |= PCI_RID2BAR(bar);
#if 0 #if 0
/* /*
* XXX: It appears from a careful reading of the spec * XXX: It appears from a careful reading of the spec
@ -338,7 +338,7 @@ decode_tuple_bar(device_t cbdev, device_t child, int id,
* correctness. * correctness.
*/ */
if (reg & TPL_BAR_REG_BELOW1MB) if (reg & TPL_BAR_REG_BELOW1MB)
dinfo->mbelow1mb |= BARBIT(bar); dinfo->mbelow1mb |= PCI_RID2BAR(bar);
#endif #endif
} }
@ -360,9 +360,9 @@ decode_tuple_bar(device_t cbdev, device_t child, int id,
DEVPRINTF((cbdev, "Opening BAR: type=%s, bar=%02x, len=%04x%s%s\n", DEVPRINTF((cbdev, "Opening BAR: type=%s, bar=%02x, len=%04x%s%s\n",
(type == SYS_RES_MEMORY) ? "MEM" : "IO", bar, len, (type == SYS_RES_MEMORY) ? "MEM" : "IO", bar, len,
(type == SYS_RES_MEMORY && dinfo->mprefetchable & BARBIT(bar)) ? (type == SYS_RES_MEMORY && dinfo->mprefetchable & PCI_RID2BAR(bar)) ?
" (Prefetchable)" : "", type == SYS_RES_MEMORY ? " (Prefetchable)" : "", type == SYS_RES_MEMORY ?
((dinfo->mbelow1mb & BARBIT(bar)) ? " (Below 1Mb)" : "") : "")); ((dinfo->mbelow1mb & PCI_RID2BAR(bar)) ? " (Below 1Mb)" : "") : ""));
resource_list_add(&dinfo->pci.resources, type, bar, 0UL, ~0UL, len); resource_list_add(&dinfo->pci.resources, type, bar, 0UL, ~0UL, len);

View File

@ -35,7 +35,6 @@ struct cardbus_devinfo
uint8_t mprefetchable; /* bit mask of prefetchable BARs */ uint8_t mprefetchable; /* bit mask of prefetchable BARs */
uint8_t mbelow1mb; /* bit mask of BARs which require below 1Mb */ uint8_t mbelow1mb; /* bit mask of BARs which require below 1Mb */
uint8_t ibelow1mb; /* bit mask of BARs which require below 1Mb */ uint8_t ibelow1mb; /* bit mask of BARs which require below 1Mb */
#define BARBIT(RID) (1<<(((RID)-PCIR_BARS)/4))
uint16_t mfrid; /* manufacturer id */ uint16_t mfrid; /* manufacturer id */
uint16_t prodid; /* product id */ uint16_t prodid; /* product id */
u_int funcid; /* function id */ u_int funcid; /* function id */