if_en_pci.c (48528) | if_en_pci.c (50107) |
---|---|
1/* $NetBSD: if_en_pci.c,v 1.1 1996/06/22 02:00:31 chuck Exp $ */ 2 3/* 4 * 5 * Copyright (c) 1996 Charles D. Cranor and Washington University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * | 1/* $NetBSD: if_en_pci.c,v 1.1 1996/06/22 02:00:31 chuck Exp $ */ 2 3/* 4 * 5 * Copyright (c) 1996 Charles D. Cranor and Washington University. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 17 unchanged lines hidden (view full) --- 26 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 27 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 28 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 * |
34 * $FreeBSD: head/sys/dev/en/if_en_pci.c 48528 1999-07-03 20:17:08Z peter $ | 34 * $FreeBSD: head/sys/dev/en/if_en_pci.c 50107 1999-08-21 06:24:40Z msmith $ |
35 */ 36 37/* 38 * 39 * i f _ e n _ p c i . c 40 * 41 * author: Chuck Cranor <chuck@ccrc.wustl.edu> 42 * started: spring, 1996. --- 22 unchanged lines hidden (view full) --- 65 66 67/* 68 * prototypes 69 */ 70 71static void en_pci_attach __P((pcici_t, int)); 72static const char *en_pci_probe __P((pcici_t, pcidi_t)); | 35 */ 36 37/* 38 * 39 * i f _ e n _ p c i . c 40 * 41 * author: Chuck Cranor <chuck@ccrc.wustl.edu> 42 * started: spring, 1996. --- 22 unchanged lines hidden (view full) --- 65 66 67/* 68 * prototypes 69 */ 70 71static void en_pci_attach __P((pcici_t, int)); 72static const char *en_pci_probe __P((pcici_t, pcidi_t)); |
73static void en_pci_shutdown __P((int, void *)); | 73static void en_pci_shutdown __P((void *, int)); |
74 75/* 76 * local structures 77 */ 78 79struct en_pci_softc { 80 /* bus independent stuff */ 81 struct en_softc esc; /* includes "device" structure */ --- 179 unchanged lines hidden (view full) --- 261 device_id = pci_conf_read(config_id, PCI_ID_REG); 262 sc->is_adaptec = (PCI_VENDOR(device_id) == PCI_VENDOR_ADP) ? 1 : 0; 263 264 /* 265 * Add shutdown hook so that DMA is disabled prior to reboot. Not 266 * doing so could allow DMA to corrupt kernel memory during the 267 * reboot before the driver initializes. 268 */ | 74 75/* 76 * local structures 77 */ 78 79struct en_pci_softc { 80 /* bus independent stuff */ 81 struct en_softc esc; /* includes "device" structure */ --- 179 unchanged lines hidden (view full) --- 261 device_id = pci_conf_read(config_id, PCI_ID_REG); 262 sc->is_adaptec = (PCI_VENDOR(device_id) == PCI_VENDOR_ADP) ? 1 : 0; 263 264 /* 265 * Add shutdown hook so that DMA is disabled prior to reboot. Not 266 * doing so could allow DMA to corrupt kernel memory during the 267 * reboot before the driver initializes. 268 */ |
269 at_shutdown(en_pci_shutdown, scp, SHUTDOWN_POST_SYNC); | 269 EVENTHANDLER_REGISTER(shutdown_post_sync, en_pci_shutdown, scp, 270 SHUTDOWN_PRI_DEFAULT); |
270 271 if (!pci_map_int(config_id, en_intr, (void *) sc, &net_imask)) { 272 printf("%s: couldn't establish interrupt\n", sc->sc_dev.dv_xname); 273 return; 274 } 275 sc->ipl = 1; /* XXX */ 276 277 /* --- 21 unchanged lines hidden (view full) --- 299 */ 300 301 en_attach(sc); 302 303} 304 305static void 306en_pci_shutdown( | 271 272 if (!pci_map_int(config_id, en_intr, (void *) sc, &net_imask)) { 273 printf("%s: couldn't establish interrupt\n", sc->sc_dev.dv_xname); 274 return; 275 } 276 sc->ipl = 1; /* XXX */ 277 278 /* --- 21 unchanged lines hidden (view full) --- 300 */ 301 302 en_attach(sc); 303 304} 305 306static void 307en_pci_shutdown( |
307 int howto, 308 void *sc) | 308 void *sc, 309 int howto) |
309{ 310 struct en_pci_softc *psc = (struct en_pci_softc *)sc; 311 312 en_reset(&psc->esc); 313 DELAY(10); 314} 315 316#if !defined(MIDWAY_ENIONLY) --- 119 unchanged lines hidden --- | 310{ 311 struct en_pci_softc *psc = (struct en_pci_softc *)sc; 312 313 en_reset(&psc->esc); 314 DELAY(10); 315} 316 317#if !defined(MIDWAY_ENIONLY) --- 119 unchanged lines hidden --- |