예제 #1
0
static int
fxp_cardbus_detach(device_t self, int flags)
{
    struct fxp_cardbus_softc *csc = device_private(self);
    struct fxp_softc *sc = &csc->sc;
    struct cardbus_devfunc *ct = csc->ct;
    int rv, reg;

#ifdef DIAGNOSTIC
    if (ct == NULL)
        panic("%s: data structure lacks", device_xname(self));
#endif

    rv = fxp_detach(sc);
    if (rv == 0) {
        /*
         * Unhook the interrupt handler.
         */
        cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, sc->sc_ih);

        /*
         * release bus space and close window
         */
        if (csc->base0_reg)
            reg = CARDBUS_BASE0_REG;
        else
            reg = CARDBUS_BASE1_REG;
        Cardbus_mapreg_unmap(ct, reg, sc->sc_st, sc->sc_sh, csc->size);
    }
    return (rv);
}
예제 #2
0
int
fxp_pci_detach(struct device *self, int flags)
{
	struct fxp_pci_softc *psc = (void *)self;
	struct fxp_softc *sc = &psc->psc_softc;

	if (sc->sc_ih != NULL)
		pci_intr_disestablish(psc->psc_pc, sc->sc_ih);
	fxp_detach(sc);
	bus_space_unmap(sc->sc_st, sc->sc_sh, psc->psc_mapsize);

	return (0);
}