summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-12-20 17:48:26 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-12-20 17:48:26 +0000
commitc96a924651d828720924b81b19eeb6067b04e8df (patch)
tree8511df1c78da645e68b867a7d5bfa9a60e3146f9 /sys
parentb269489afb77ac5b3a70f643fd6c6aef160491db (diff)
for mimi-pci cards registers are word in a dword, missed that in bringing over support from netbsd; partially successfully tested by ellidz@eridu.uchicago.edu
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/if_wireg.h28
-rw-r--r--sys/dev/ic/if_wivar.h3
-rw-r--r--sys/dev/pci/if_wi_pci.c3
3 files changed, 21 insertions, 13 deletions
diff --git a/sys/dev/ic/if_wireg.h b/sys/dev/ic/if_wireg.h
index 6e88eeabb90..c4ad1e283b3 100644
--- a/sys/dev/ic/if_wireg.h
+++ b/sys/dev/ic/if_wireg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wireg.h,v 1.7 2001/10/25 19:40:06 mickey Exp $ */
+/* $OpenBSD: if_wireg.h,v 1.8 2001/12/20 17:48:25 mickey Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -78,25 +78,31 @@
* register space access macros
*/
#define CSR_WRITE_4(sc, reg, val) \
- bus_space_write_4(sc->wi_btag, sc->wi_bhandle, reg, val)
+ bus_space_write_4(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg) , val)
#define CSR_WRITE_2(sc, reg, val) \
- bus_space_write_2(sc->wi_btag, sc->wi_bhandle, reg, val)
+ bus_space_write_2(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg) , val)
#define CSR_WRITE_1(sc, reg, val) \
- bus_space_write_1(sc->wi_btag, sc->wi_bhandle, reg, val)
+ bus_space_write_1(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg) , val)
#define CSR_READ_4(sc, reg) \
- bus_space_read_4(sc->wi_btag, sc->wi_bhandle, reg)
+ bus_space_read_4(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg))
#define CSR_READ_2(sc, reg) \
- bus_space_read_2(sc->wi_btag, sc->wi_bhandle, reg)
+ bus_space_read_2(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg))
#define CSR_READ_1(sc, reg) \
- bus_space_read_1(sc->wi_btag, sc->wi_bhandle, reg)
+ bus_space_read_1(sc->wi_btag, sc->wi_bhandle, \
+ (sc->sc_pci? reg * 2: reg))
#define CSR_READ_RAW_2(sc, ba, dst, sz) \
- bus_space_read_raw_multi_2((sc)->wi_btag, (sc)->wi_bhandle, (ba), \
- (dst), (sz))
+ bus_space_read_raw_multi_2((sc)->wi_btag, (sc)->wi_bhandle, \
+ (sc->sc_pci? ba * 2: ba), (dst), (sz))
#define CSR_WRITE_RAW_2(sc, ba, dst, sz) \
- bus_space_write_raw_multi_2((sc)->wi_btag, (sc)->wi_bhandle, (ba), \
- (dst), (sz))
+ bus_space_write_raw_multi_2((sc)->wi_btag, (sc)->wi_bhandle, \
+ (sc->sc_pci? ba * 2: ba), (dst), (sz))
/*
* The WaveLAN/IEEE cards contain an 802.11 MAC controller which Lucent
diff --git a/sys/dev/ic/if_wivar.h b/sys/dev/ic/if_wivar.h
index 47a2b80eb6d..75415452fed 100644
--- a/sys/dev/ic/if_wivar.h
+++ b/sys/dev/ic/if_wivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wivar.h,v 1.3 2001/06/09 20:17:21 millert Exp $ */
+/* $OpenBSD: if_wivar.h,v 1.4 2001/12/20 17:48:25 mickey Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -74,6 +74,7 @@ struct wi_softc {
struct timeout sc_timo;
int sc_prism2;
int sc_prism2_ver;
+ int sc_pci;
};
#define WI_PRT_FMT "%s"
diff --git a/sys/dev/pci/if_wi_pci.c b/sys/dev/pci/if_wi_pci.c
index 75b0df266e3..ac6280f0ec8 100644
--- a/sys/dev/pci/if_wi_pci.c
+++ b/sys/dev/pci/if_wi_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_pci.c,v 1.11 2001/12/20 17:41:48 mickey Exp $ */
+/* $OpenBSD: if_wi_pci.c,v 1.12 2001/12/20 17:48:25 mickey Exp $ */
/*
* Copyright (c) 2001 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -201,6 +201,7 @@ wi_pci_attach(parent, self, aux)
memt = iot;
memh = ioh;
+ sc->sc_pci = 1;
}
sc->wi_btag = iot;