static int
btn_intr(void *arg)
{
	struct btn_obio_softc *sc = (void *)arg;
	int status;
	int rv;

	status = (int8_t)bus_space_read_1(sc->sc_iot, sc->sc_ioh, 0);
	if (status == -1) {
		return 0;
	}

	rv = 0;
	status = ~status;
	if (status & BTNSTAT_POWER) {
		if (sc->sc_mask & BTNSTAT_POWER) {
			hdlg_disable_pldintr(INTEN_PWRSW|INTEN_BUTTON);
			i80321_intr_disestablish(sc->sc_ih);
			sc->sc_ih = NULL;
			sysmon_task_queue_sched(0, btn_sysmon_pressed_event,
			    &sc->sc_smpsw[0]);
		} else {
			aprint_error("%s: power button pressed\n",
			    device_xname(sc->sc_dev));
		}
		rv = 1;
	} else if (status & BTNSTAT_RESET) {
		if (sc->sc_mask & BTNSTAT_RESET) {
			hdlg_disable_pldintr(INTEN_PWRSW|INTEN_BUTTON);
			i80321_intr_disestablish(sc->sc_ih);
			sc->sc_ih = NULL;
			sysmon_task_queue_sched(0, btn_sysmon_pressed_event,
			    &sc->sc_smpsw[1]);
		} else {
			aprint_error("%s: reset button pressed\n",
			    device_xname(sc->sc_dev));
		}
		rv = 1;
	}

	return rv;
}
void
iyonix_pci_intr_disestablish(void *v, void *cookie)
{

	i80321_intr_disestablish(cookie);
}
Beispiel #3
0
void
hdlg_pci_intr_disestablish(void *v, void *cookie)
{

	i80321_intr_disestablish(cookie);
}