diff options
| author | Jonathan Chen <jon@FreeBSD.org> | 2000-11-29 19:38:25 +0000 |
|---|---|---|
| committer | Jonathan Chen <jon@FreeBSD.org> | 2000-11-29 19:38:25 +0000 |
| commit | d58b9dbc97d4aa3bdd5add5a4e869f07fcbd9bda (patch) | |
| tree | dc3e5d777885d40651059669a759e1de86cc1c04 /sys/dev | |
| parent | 9766e32c01845546839d4884f3b825a1e167bddf (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/cardbus/cardbus_cis.c | 9 | ||||
| -rw-r--r-- | sys/dev/cardbus/cardbus_cis.h | 2 |
2 files changed, 4 insertions, 7 deletions
diff --git a/sys/dev/cardbus/cardbus_cis.c b/sys/dev/cardbus/cardbus_cis.c index a676e950e24c..deef8cd1f477 100644 --- a/sys/dev/cardbus/cardbus_cis.c +++ b/sys/dev/cardbus/cardbus_cis.c @@ -274,7 +274,7 @@ DECODE_PROTOTYPE(bar) type = SYS_RES_MEMORY; } bar = (reg & TPL_BAR_REG_ASI_MASK) - 1; - if (bar < 0 || bar > 6) { + if (bar < 0 || bar > 5 || (type == SYS_RES_IOPORT && bar == 5)) { device_printf(dev, "Invalid BAR number: %02x(%02x)\n", reg, bar); return EINVAL; @@ -282,13 +282,10 @@ DECODE_PROTOTYPE(bar) bar = CARDBUS_BASE0_REG + bar * 4; DEVPRINTF((dev, "Opening BAR: type=%s, bar=%02x, len=%04x\n", (type==SYS_RES_MEMORY)?"MEM":"IO", bar, len)); - res = bus_generic_alloc_resource(child, child, type, ®, 0, + res = bus_generic_alloc_resource(child, child, type, &bar, 0, ~0, len, rman_make_alignment_flags(len) | RF_ACTIVE); if (res == NULL) { - device_printf(dev, "Cannot allocate BAR %02x\n", reg); - } else { - start = rman_get_start(res); - pci_write_config(child, reg, start, 4); + device_printf(dev, "Cannot allocate BAR %02x\n", bar); } } return 0; diff --git a/sys/dev/cardbus/cardbus_cis.h b/sys/dev/cardbus/cardbus_cis.h index 3fdc5f2ec713..926858299d41 100644 --- a/sys/dev/cardbus/cardbus_cis.h +++ b/sys/dev/cardbus/cardbus_cis.h @@ -80,7 +80,7 @@ int cardbus_do_cis(device_t dev, device_t child); /* BAR */ #define TPL_BAR_REG_ASI_MASK 0x07 -#define TPL_BAR_REG_AS 0x08 +#define TPL_BAR_REG_AS 0x10 /* CISTPL_FUNC */ #define TPL_FUNC_MF 0 /* multi function tuple */ |
