ips_pci.c (119997) | ips_pci.c (126364) |
---|---|
1/*- 2 * Copyright (c) 2002 Adaptec Inc. 3 * All rights reserved. 4 * 5 * Written by: David Jeffery 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Adaptec Inc. 3 * All rights reserved. 4 * 5 * Written by: David Jeffery 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/ips/ips_pci.c 119997 2003-09-11 23:30:28Z ps $"); | 30__FBSDID("$FreeBSD: head/sys/dev/ips/ips_pci.c 126364 2004-02-28 19:14:41Z scottl $"); |
31 32#include <dev/ips/ips.h> 33 34static int ips_pci_free(ips_softc_t *sc); 35static void ips_intrhook(void *arg); 36 37static int ips_pci_probe(device_t dev) 38{ --- 91 unchanged lines hidden (view full) --- 130 /* lockfunc */ busdma_lock_mutex, 131 /* lockarg */ &Giant, 132 &sc->adapter_dmatag) != 0) { 133 printf("IPS can't alloc dma tag\n"); 134 goto error; 135 } 136 sc->ips_ich.ich_func = ips_intrhook; 137 sc->ips_ich.ich_arg = sc; | 31 32#include <dev/ips/ips.h> 33 34static int ips_pci_free(ips_softc_t *sc); 35static void ips_intrhook(void *arg); 36 37static int ips_pci_probe(device_t dev) 38{ --- 91 unchanged lines hidden (view full) --- 130 /* lockfunc */ busdma_lock_mutex, 131 /* lockarg */ &Giant, 132 &sc->adapter_dmatag) != 0) { 133 printf("IPS can't alloc dma tag\n"); 134 goto error; 135 } 136 sc->ips_ich.ich_func = ips_intrhook; 137 sc->ips_ich.ich_arg = sc; |
138 mtx_init(&sc->queue_mtx, "IPS bioqueue lock", MTX_DEF, 0); 139 bioq_init(&sc->queue); |
|
138 if (config_intrhook_establish(&sc->ips_ich) != 0) { 139 printf("IPS can't establish configuration hook\n"); 140 goto error; 141 } 142 return 0; 143error: 144 ips_pci_free(sc); 145 return (ENXIO); --- 31 unchanged lines hidden (view full) --- 177 DEVICE_PRINTF(1, dev, "detaching ServeRaid\n"); 178 sc = (ips_softc_t *) device_get_softc(dev); 179 if (sc->configured) { 180 sc->configured = 0; 181 ips_flush_cache(sc); 182 if(ips_adapter_free(sc)) 183 return EBUSY; 184 ips_pci_free(sc); | 140 if (config_intrhook_establish(&sc->ips_ich) != 0) { 141 printf("IPS can't establish configuration hook\n"); 142 goto error; 143 } 144 return 0; 145error: 146 ips_pci_free(sc); 147 return (ENXIO); --- 31 unchanged lines hidden (view full) --- 179 DEVICE_PRINTF(1, dev, "detaching ServeRaid\n"); 180 sc = (ips_softc_t *) device_get_softc(dev); 181 if (sc->configured) { 182 sc->configured = 0; 183 ips_flush_cache(sc); 184 if(ips_adapter_free(sc)) 185 return EBUSY; 186 ips_pci_free(sc); |
185 mtx_destroy(&sc->cmd_mtx); | 187 bioq_flush(&sc->queue, NULL, ENXIO); |
186 } 187 return 0; 188} 189 190static int ips_pci_shutdown(device_t dev) 191{ 192 ips_softc_t *sc = (ips_softc_t *) device_get_softc(dev); 193 if (sc->configured) { --- 21 unchanged lines hidden --- | 188 } 189 return 0; 190} 191 192static int ips_pci_shutdown(device_t dev) 193{ 194 ips_softc_t *sc = (ips_softc_t *) device_get_softc(dev); 195 if (sc->configured) { --- 21 unchanged lines hidden --- |