marvell_yukon: implement HAIKU_CHECK_DISABLE_INTERRUPTS()

* hrev43729 switched the interrupt handler to a threaded handler, thus requiring
  to implement HAIKU_CHECK_DISABLE_INTERRUPTS()
* should help fixing #8327
This commit is contained in:
Jérôme Duval 2012-02-16 21:00:26 +01:00
parent 6e434fd80e
commit a57a200337

View File

@ -6,6 +6,15 @@
#include <sys/bus.h>
#include <sys/rman.h>
#include <sys/systm.h>
#include <machine/bus.h>
#include <net/if.h>
#include <net/if_media.h>
#include <dev/msk/if_mskreg.h>
HAIKU_FBSD_DRIVER_GLUE(marvell_yukon, mskc, pci)
@ -26,7 +35,26 @@ __haiku_select_miibus_driver(device_t dev)
return __haiku_probe_miibus(dev, drivers);
}
NO_HAIKU_CHECK_DISABLE_INTERRUPTS();
int
HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
{
struct msk_softc *sc = device_get_softc(dev);
u_int16_t status;
/* Reading B0_Y2_SP_ISRC2 masks further interrupts. */
status = CSR_READ_4(sc, B0_Y2_SP_ISRC2);
if (status == 0 || status == 0xffffffff ||
(sc->msk_pflags & MSK_FLAG_SUSPEND) != 0 ||
(status & sc->msk_intrmask) == 0) {
CSR_WRITE_4(sc, B0_Y2_SP_ICR, 2);
return 0;
}
return 1;
}
NO_HAIKU_REENABLE_INTERRUPTS();
HAIKU_DRIVER_REQUIREMENTS(FBSD_TASKQUEUES | FBSD_FAST_TASKQUEUE | FBSD_SWI_TASKQUEUE);