aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pccbb/pccbb.c
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2004-04-12 21:04:54 +0000
committerWarner Losh <imp@FreeBSD.org>2004-04-12 21:04:54 +0000
commit9b582996a691f9d25b737c98900ccdc8901768e2 (patch)
tree0707ff144ba00f0eef72a6be3ff840c3a88299e8 /sys/dev/pccbb/pccbb.c
parent8f54c15baf92bb5fc35d141065abfee53697de39 (diff)
downloadsrc-9b582996a691f9d25b737c98900ccdc8901768e2.tar.gz
src-9b582996a691f9d25b737c98900ccdc8901768e2.zip
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
Notes
Notes: svn path=/head/; revision=128170
Diffstat (limited to 'sys/dev/pccbb/pccbb.c')
-rw-r--r--sys/dev/pccbb/pccbb.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/pccbb/pccbb.c b/sys/dev/pccbb/pccbb.c
index 75044ba17595..4fd004a02a1c 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)