From 73f0e8eb9c82c4c414762d706c0bf5eac3a454af Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Mon, 18 Jan 2010 17:53:44 +0000 Subject: [PATCH] Add a warning if we're inw'ing from an odd address. This could happen due to a bug and might be the real basis for the cardbus workaround hack. --- sys/dev/cs/if_csreg.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/cs/if_csreg.h b/sys/dev/cs/if_csreg.h index 114800e8c062..be41e5c516d2 100644 --- a/sys/dev/cs/if_csreg.h +++ b/sys/dev/cs/if_csreg.h @@ -539,6 +539,8 @@ static __inline uint16_t cs_inw(struct cs_softc *sc, int off) { + if (off & 1) + device_printf(sc->dev, "BUG: inw to an odd address.\n"); return ((inb(sc->nic_addr + off) & 0xff) | (inb(sc->nic_addr + off + 1) << 8)); }