diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-04 22:26:56 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2007-12-04 22:26:56 +0000 |
commit | 5cbc5dc1bbfc5e16afd43ddaaaa3f5799ba0dda8 (patch) | |
tree | 832000cc585532d7bff1ddba3d45d7fe4637567d /sys | |
parent | a0a521cc6fec5a389d3004997e1a5b83fbe34712 (diff) |
expresscard ral(4) rt2860 now can attach and detach correctly
ok kettenis
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/rt2860.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/if_ral_pci.c | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/sys/dev/ic/rt2860.c b/sys/dev/ic/rt2860.c index 24e8496b0c3..f0b452d9ae6 100644 --- a/sys/dev/ic/rt2860.c +++ b/sys/dev/ic/rt2860.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2860.c,v 1.6 2007/11/19 21:26:19 damien Exp $ */ +/* $OpenBSD: rt2860.c,v 1.7 2007/12/04 22:26:55 deraadt Exp $ */ /*- * Copyright (c) 2007 @@ -1140,6 +1140,8 @@ rt2860_intr(void *arg) uint32_t r; r = RAL_READ(sc, RT2860_INT_STATUS); + if (r == 0xffffffff) + return 0; /* device likely went away */ if (r == 0) return 0; /* not for us */ diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c index 0a398bc5eea..370f05763e7 100644 --- a/sys/dev/pci/if_ral_pci.c +++ b/sys/dev/pci/if_ral_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral_pci.c,v 1.10 2007/11/15 21:40:47 deraadt Exp $ */ +/* $OpenBSD: if_ral_pci.c,v 1.11 2007/12/04 22:26:54 deraadt Exp $ */ /*- * Copyright (c) 2005-2007 @@ -186,9 +186,19 @@ ral_pci_detach(struct device *self, int flags) { struct ral_pci_softc *psc = (struct ral_pci_softc *)self; struct rt2560_softc *sc = &psc->sc_sc; + int error; + + error = (*psc->sc_opns->detach)(sc); + if (error != 0) + return error; + + if (psc->sc_ih != NULL) { + pci_intr_disestablish(psc->sc_pc, psc->sc_ih); + psc->sc_ih = NULL; + } - (*psc->sc_opns->detach)(sc); - pci_intr_disestablish(psc->sc_pc, psc->sc_ih); + if (psc->sc_mapsize > 0) + bus_space_unmap(sc->sc_st, sc->sc_sh, psc->sc_mapsize); return 0; } |