static int com_isa_detach(device_t self, int flags) { struct com_isa_softc *isc = device_private(self); struct com_softc *sc = &isc->sc_com; const struct com_regs *cr = &sc->sc_regs; int rc; if ((rc = com_detach(self, flags)) != 0) return rc; if (isc->sc_ih != NULL) isa_intr_disestablish(isc->sc_ic, isc->sc_ih); pmf_device_deregister(self); com_cleanup(self, 0); #ifdef COM_HAYESP if (sc->sc_type == COM_TYPE_HAYESP) bus_space_unmap(cr->cr_iot, sc->sc_hayespioh, HAYESP_NPORTS); #endif bus_space_unmap(cr->cr_iot, cr->cr_ioh, COM_NPORTS); return 0; }
static bool com_isa_suspend(device_t self, const pmf_qual_t *qual) { struct com_isa_softc *isc = device_private(self); if (!com_suspend(self, qual)) return false; isa_intr_disestablish(isc->sc_ic, isc->sc_ih); isc->sc_ih = NULL; return true; }
static bool com_isa_suspend(device_t self PMF_FN_ARGS) { struct com_isa_softc *isc = device_private(self); if (!com_suspend(self PMF_FN_CALL)) return false; isa_intr_disestablish(isc->sc_ic, isc->sc_ih); isc->sc_ih = NULL; return true; }
static int fdc_isa_detach(device_t self, int flags) { int rc; struct fdc_isa_softc *isc = device_private(self); struct fdc_softc *fdc = &isc->sc_fdc; if ((rc = fdcdetach(self, flags)) != 0) return rc; isa_intr_disestablish(fdc->sc_ic, fdc->sc_ih); bus_space_unmap(fdc->sc_iot, fdc->sc_fdctlioh, 1); bus_space_unmap(fdc->sc_iot, isc->sc_baseioh, 6 /* FDC_NPORT */); return 0; }
void mca_intr_disestablish(mca_chipset_tag_t mc, void *cookie) { isa_intr_disestablish(NULL, cookie); }
void ahc_isa_attach(device_t parent, device_t self, void *aux) { struct ahc_softc *ahc = device_private(self); struct isa_attach_args *ia = aux; bus_space_tag_t iot = ia->ia_iot; bus_space_handle_t ioh; int irq, intrtype; const char *intrtypestr; char idstring[EISA_IDSTRINGLEN]; u_char intdef; ahc->sc_dev = self; aprint_naive(": SCSI controller\n"); if (bus_space_map(iot, ia->ia_io[0].ir_addr, ia->ia_io[0].ir_size, 0, &ioh)) { aprint_error(": can't map i/o space\n"); return; } if (!ahc_isa_idstring(iot, ioh, idstring)) { aprint_error(": can't read ID string\n"); goto free_io; } if ((irq = ahc_aic77xx_irq(iot, ioh)) < 0) { aprint_error(": ahc_aic77xx_irq failed\n"); goto free_io; } if (strcmp(idstring, "ADP7756") == 0) { aprint_normal(": %s\n", EISA_PRODUCT_ADP7756); } else if (strcmp(idstring, "ADP7757") == 0) { aprint_normal(": %s\n", EISA_PRODUCT_ADP7757); } else { aprint_error(": unknown device type %s\n", idstring); goto free_io; } /* * Tell the bus-DMA interface that we can do 32bit DMA * NOTE: this variable is first referenced in ahc_init(). */ ahc->sc_dmaflags = ISABUS_DMA_32BIT; ahc_set_name(ahc, device_xname(ahc->sc_dev)); ahc->parent_dmat = ia->ia_dmat; ahc->channel = 'A'; ahc->chip = AHC_AIC7770|AHC_VL; ahc->features = AHC_AIC7770_FE; ahc->bugs |= AHC_TMODE_WIDEODD_BUG; ahc->flags |= AHC_PAGESCBS; ahc->tag = iot; ahc->bsh = ioh; if (ahc_softc_init(ahc) != 0) goto free_io; ahc_intr_enable(ahc, false); if (ahc_reset(ahc) != 0) goto free_io; intdef = bus_space_read_1(iot, ioh, INTDEF); if (intdef & EDGE_TRIG) { intrtype = IST_EDGE; intrtypestr = "edge triggered"; } else { intrtype = IST_LEVEL; intrtypestr = "level sensitive"; } ahc->ih = isa_intr_establish(ia->ia_ic, irq, intrtype, IPL_BIO, ahc_intr, ahc); if (ahc->ih == NULL) { aprint_error_dev(ahc->sc_dev, "couldn't establish %s interrupt\n", intrtypestr); goto free_io; } /* * Tell the user what type of interrupts we're using. * useful for debugging irq problems */ if (bootverbose) { aprint_verbose_dev(ahc->sc_dev, "Using %s interrupts\n", intrtypestr); } /* * Now that we know we own the resources we need, do the * card initialization. */ aha2840_load_seeprom(ahc); /* Attach sub-devices */ if (ahc_aic77xx_attach(ahc) == 0) return; /* succeed */ /* failed */ isa_intr_disestablish(ia->ia_ic, ahc->ih); free_io: bus_space_unmap(iot, ioh, ia->ia_io[0].ir_size); }
void pciide_machdep_compat_intr_disestablish(pci_chipset_tag_t pc, void *cookie) { isa_intr_disestablish(NULL, cookie); }
void pci_intr_disestablish(pci_chipset_tag_t pc, void *cookie) { /* XXX oh, unroute the pci int link? */ isa_intr_disestablish(NULL, cookie); }
void eisa_intr_disestablish(eisa_chipset_tag_t ec, void *cookie) { return (isa_intr_disestablish(NULL, cookie)); }