diff options
author | imp <imp@FreeBSD.org> | 2004-04-12 21:04:54 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2004-04-12 21:04:54 +0000 |
commit | 09643af85a69cb796dbf782ef031c341eb82426e (patch) | |
tree | 0707ff144ba00f0eef72a6be3ff840c3a88299e8 /sys/dev/pccbb | |
parent | 67c5859522541670ab38af4e06edf745ae350759 (diff) | |
download | FreeBSD-src-09643af85a69cb796dbf782ef031c341eb82426e.zip FreeBSD-src-09643af85a69cb796dbf782ef031c341eb82426e.tar.gz |
MFp4:
Alignment for pccards should also be treated in a similar way that
we tread it for cardbus cards.
Remove bogus debugs while I'm here.
# This is also necessary to make the CIS reading work.
Submitted by: Carlos Velasco
Diffstat (limited to 'sys/dev/pccbb')
-rw-r--r-- | sys/dev/pccbb/pccbb.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c index 75044ba..4fd004a 100644 --- a/sys/dev/pccbb/pccbb.c +++ b/sys/dev/pccbb/pccbb.c @@ -1123,7 +1123,6 @@ cbb_intr(void *arg) */ sockevent = cbb_get(sc, CBB_SOCKET_EVENT); if (sockevent != 0) { - DPRINTF(("CBB EVENT 0x%x\n", sockevent)); /* ack the interrupt */ cbb_setb(sc, CBB_SOCKET_EVENT, sockevent); @@ -1145,7 +1144,6 @@ cbb_intr(void *arg) cbb_setb(sc, CBB_SOCKET_MASK, CBB_SOCKET_MASK_CD); sc->flags &= ~CBB_CARD_OK; cbb_disable_func_intr(sc); - DPRINTF(("Waking up thread\n")); cv_signal(&sc->cv); mtx_unlock(&sc->mtx); } @@ -1768,6 +1766,7 @@ cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid, { struct resource *res = NULL; struct cbb_softc *sc = device_get_softc(brdev); + int align; int tmp; switch (type) { @@ -1776,8 +1775,20 @@ cbb_pcic_alloc_resource(device_t brdev, device_t child, int type, int *rid, start = cbb_start_mem; if (end < start) end = start; - flags = (flags & ~RF_ALIGNMENT_MASK) | - rman_make_alignment_flags(CBB_MEMALIGN); + if (count < CBB_MEMALIGN) + align = CBB_MEMALIGN; + else + align = count; + if (align > (1 << RF_ALIGNMENT(flags))) + flags = (flags & ~RF_ALIGNMENT_MASK) | + rman_make_alignment_flags(align); + if (count < CBB_MEMALIGN) + align = CBB_MEMALIGN; + else + align = count; + if (align > (1 << RF_ALIGNMENT(flags))) + flags = (flags & ~RF_ALIGNMENT_MASK) | + rman_make_alignment_flags(align); break; case SYS_RES_IOPORT: if (start < cbb_start_16_io) |