void * landisk_pci_intr_establish(void *v, pci_intr_handle_t ih, int level, int (*ih_fun)(void *), void *ih_arg, const char *ih_name) { if (ih == 0) panic("pci_intr_establish: bogus handle 0x%x", ih); return extintr_establish(ih, level, ih_fun, ih_arg, ih_name); }
void power_attach(struct device *parent, struct device *self, void *aux) { struct power_softc *sc = (void *)self; power_softc = sc; sc->sc_ih = extintr_establish(LANDISK_INTR_PWRSW, IPL_TTY, power_intr, sc, sc->sc_dev.dv_xname); if (sc->sc_ih == NULL) { printf(": couldn't map interrupt\n"); return; } printf("\n"); }
static void btn_obio_attach(device_t parent, device_t self, void *aux) { struct btn_obio_softc *sc; int i; aprint_naive("\n"); aprint_normal(": USL-5P buttons\n"); sc = device_private(self); sc->sc_dev = self; btn_softc = sc; callout_init(&sc->sc_guard_ch, 0); callout_setfunc(&sc->sc_guard_ch, btn_guard_timeout, sc); sc->sc_ih = extintr_establish(LANDISK_INTR_BTN, IPL_TTY, btn_intr, sc); if (sc->sc_ih == NULL) { aprint_error_dev(self, "unable to establish interrupt"); panic("extintr_establish"); } sc->sc_smpsw.smpsw_name = device_xname(self); sc->sc_smpsw.smpsw_type = PSWITCH_TYPE_RESET; if (sysmon_pswitch_register(&sc->sc_smpsw) != 0) { aprint_error_dev(self, "unable to register with sysmon\n"); return; } sc->sc_mask |= BTN_RESET_BIT; for (i = 0; i < NBUTTON; i++) { int idx = btnlist[i].idx; sc->sc_bev[idx].bev_name = btnlist[i].name; if (btn_event_register(&sc->sc_bev[idx]) != 0) { aprint_error_dev(self, "unable to register '%s' button\n", btnlist[i].name); } else { sc->sc_mask |= btnlist[i].mask; } } }
/* * Set up an interrupt handler to start being called. */ void * obio_intr_establish(int irq, int level, int (*ih_fun)(void *), void *ih_arg, const char *ih_name) { return extintr_establish(irq, level, ih_fun, ih_arg, ih_name); }