Move enable/disable 16bit access routines into if_ed. Slightly

pessmize the error recover path through edintr by calling these
functions, rather than expanding it inline.  This error path already
does a lot in it, so an extra function call will be lost in the noise.
It also happens rarely.
This commit is contained in:
Warner Losh 2005-02-10 23:48:13 +00:00
parent 0cfebadeb9
commit f7167d3e91
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141673
3 changed files with 30 additions and 35 deletions

View File

@ -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);
}
}

View File

@ -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
*/

View File

@ -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;