ipro100: Check interrupt status in HAIKU_CHECK_DISABLE_INTERRUPTS.
This should make ipro100 behave better on shared IRQ lines. Should fix #17349.
This commit is contained in:
parent
91337da63b
commit
7da3d33132
@ -1734,7 +1734,12 @@ fxp_intr(void *xsc)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#ifndef __HAIKU__
|
||||
while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) {
|
||||
#else
|
||||
statack = (uint8_t)atomic_get((int32 *)&sc->sc_statack);
|
||||
do {
|
||||
#endif
|
||||
/*
|
||||
* It should not be possible to have all bits set; the
|
||||
* FXP_SCB_INTR_SWI bit always returns 0 on a read. If
|
||||
@ -1752,7 +1757,11 @@ fxp_intr(void *xsc)
|
||||
CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack);
|
||||
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0)
|
||||
fxp_intr_body(sc, ifp, statack, -1);
|
||||
#ifndef __HAIKU__
|
||||
}
|
||||
#else
|
||||
} while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0);
|
||||
#endif
|
||||
FXP_UNLOCK(sc);
|
||||
}
|
||||
|
||||
|
@ -222,6 +222,9 @@ struct fxp_softc {
|
||||
int if_flags;
|
||||
uint8_t rfa_size;
|
||||
uint32_t tx_cmd;
|
||||
#ifdef __HAIKU__
|
||||
int32_t sc_statack;
|
||||
#endif
|
||||
uint16_t eeprom[256];
|
||||
};
|
||||
|
||||
|
@ -19,27 +19,29 @@
|
||||
|
||||
|
||||
HAIKU_FBSD_DRIVER_GLUE(ipro100, fxp, pci)
|
||||
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE);
|
||||
HAIKU_FBSD_MII_DRIVER(inphy);
|
||||
|
||||
|
||||
int
|
||||
__haiku_disable_interrupts(device_t dev)
|
||||
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
||||
{
|
||||
struct fxp_softc *sc = device_get_softc(dev);
|
||||
|
||||
// TODO: check interrupt status!
|
||||
uint8_t statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK);
|
||||
if (statack == 0)
|
||||
return 0;
|
||||
|
||||
CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, FXP_SCB_INTR_DISABLE);
|
||||
atomic_set((int32*)&sc->sc_statack, statack);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
__haiku_reenable_interrupts(device_t dev)
|
||||
HAIKU_REENABLE_INTERRUPTS(device_t dev)
|
||||
{
|
||||
struct fxp_softc *sc = device_get_softc(dev);
|
||||
|
||||
CSR_WRITE_1(sc, FXP_CSR_SCB_INTRCNTL, 0);
|
||||
}
|
||||
|
||||
|
||||
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_SWI_TASKQUEUE);
|
||||
HAIKU_FBSD_MII_DRIVER(inphy);
|
||||
|
Loading…
x
Reference in New Issue
Block a user