aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2005-02-10 23:48:13 +0000
committerWarner Losh <imp@FreeBSD.org>2005-02-10 23:48:13 +0000
commitf7167d3e9131616e801e9cd45b373c78d9699aa4 (patch)
tree422db64d96e0211618b7fc251c86bb29440dce8a /sys/dev/ed
parent0cfebadeb95c6dcb517f8a885cc094c80b811573 (diff)
Notes
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed.c48
-rw-r--r--sys/dev/ed/if_ed_wd80x3.c14
-rw-r--r--sys/dev/ed/if_edvar.h3
3 files changed, 30 insertions, 35 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index c206586c78b2..f72a19fd9274 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -129,6 +129,31 @@ ed_probe_generic8390(struct ed_softc *sc)
return (1);
}
+void
+ed_disable_16bit_access(struct ed_softc *sc)
+{
+ /*
+ * Disable 16 bit access to shared memory
+ */
+ if (sc->isa16bit && sc->vendor == ED_VENDOR_WD_SMC) {
+ if (sc->chip_type == ED_CHIP_TYPE_WD790)
+ ed_asic_outb(sc, ED_WD_MSR, 0x00);
+ ed_asic_outb(sc, ED_WD_LAAR,
+ sc->wd_laar_proto & ~ED_WD_LAAR_M16EN);
+ }
+}
+
+void
+ed_enable_16bit_access(struct ed_softc *sc)
+{
+ if (sc->isa16bit && sc->vendor == ED_VENDOR_WD_SMC) {
+ ed_asic_outb(sc, ED_WD_LAAR,
+ sc->wd_laar_proto | ED_WD_LAAR_M16EN);
+ if (sc->chip_type == ED_CHIP_TYPE_WD790)
+ ed_asic_outb(sc, ED_WD_MSR, ED_WD_MSR_MENB);
+ }
+}
+
/*
* Allocate a port resource with the given resource id.
*/
@@ -1128,28 +1153,9 @@ edintr(void *arg)
* Enable 16bit access to shared memory first
* on WD/SMC boards.
*/
- if (sc->isa16bit &&
- (sc->vendor == ED_VENDOR_WD_SMC)) {
-
- ed_asic_outb(sc, ED_WD_LAAR,
- sc->wd_laar_proto | ED_WD_LAAR_M16EN);
- if (sc->chip_type == ED_CHIP_TYPE_WD790) {
- ed_asic_outb(sc, ED_WD_MSR,
- ED_WD_MSR_MENB);
- }
- }
+ ed_enable_16bit_access(sc);
ed_rint(sc);
-
- /* disable 16bit access */
- if (sc->isa16bit &&
- (sc->vendor == ED_VENDOR_WD_SMC)) {
-
- if (sc->chip_type == ED_CHIP_TYPE_WD790) {
- ed_asic_outb(sc, ED_WD_MSR, 0x00);
- }
- ed_asic_outb(sc, ED_WD_LAAR,
- sc->wd_laar_proto & ~ED_WD_LAAR_M16EN);
- }
+ ed_disable_16bit_access(sc);
}
}
diff --git a/sys/dev/ed/if_ed_wd80x3.c b/sys/dev/ed/if_ed_wd80x3.c
index 2ecbbb08bbe8..04943587bc42 100644
--- a/sys/dev/ed/if_ed_wd80x3.c
+++ b/sys/dev/ed/if_ed_wd80x3.c
@@ -86,20 +86,6 @@ static uint16_t ed_790_intr_val[] = {
15
};
-static void
-ed_disable_16bit_access(struct ed_softc *sc)
-{
- /*
- * Disable 16 bit access to shared memory
- */
- if (sc->isa16bit) {
- if (sc->chip_type == ED_CHIP_TYPE_WD790)
- ed_asic_outb(sc, ED_WD_MSR, 0x00);
- ed_asic_outb(sc, ED_WD_LAAR, sc->wd_laar_proto &
- ~ED_WD_LAAR_M16EN);
- }
-}
-
/*
* Probe and vendor-specific initialization routine for SMC/WD80x3 boards
*/
diff --git a/sys/dev/ed/if_edvar.h b/sys/dev/ed/if_edvar.h
index 4707f35dafdd..b0489f08a08c 100644
--- a/sys/dev/ed/if_edvar.h
+++ b/sys/dev/ed/if_edvar.h
@@ -224,6 +224,9 @@ void ed_hpp_set_physical_link(struct ed_softc *);
void ed_hpp_readmem(struct ed_softc *, long, uint8_t *, uint16_t);
u_short ed_hpp_write_mbufs(struct ed_softc *, struct mbuf *, int);
+void ed_disable_16bit_access(struct ed_softc *);
+void ed_enable_16bit_access(struct ed_softc *);
+
driver_intr_t edintr;
extern devclass_t ed_devclass;