Deleted Added
full compact
if_vx_pci.c (48528) if_vx_pci.c (50107)
1/*
2 * Copyright (C) 1996 Naoki Hamada <nao@tom-yam.or.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Copyright (C) 1996 Naoki Hamada <nao@tom-yam.or.jp>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 12 unchanged lines hidden (view full) ---

21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/vx/if_vx_pci.c 48528 1999-07-03 20:17:08Z peter $
29 * $FreeBSD: head/sys/dev/vx/if_vx_pci.c 50107 1999-08-21 06:24:40Z msmith $
30 */
31
32#include "vx.h"
33#if NVX > 0
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/kernel.h>
38#include <sys/socket.h>
39
40#include <net/if.h>
41#include <net/if_arp.h>
42
43#include <pci/pcivar.h>
44
45#include <dev/vx/if_vxreg.h>
46
30 */
31
32#include "vx.h"
33#if NVX > 0
34
35#include <sys/param.h>
36#include <sys/systm.h>
37#include <sys/kernel.h>
38#include <sys/socket.h>
39
40#include <net/if.h>
41#include <net/if_arp.h>
42
43#include <pci/pcivar.h>
44
45#include <dev/vx/if_vxreg.h>
46
47static void vx_pci_shutdown(int, void *);
47static void vx_pci_shutdown(void *, int);
48static const char *vx_pci_probe(pcici_t, pcidi_t);
49static void vx_pci_attach(pcici_t, int unit);
50
51static void
52vx_pci_shutdown(
48static const char *vx_pci_probe(pcici_t, pcidi_t);
49static void vx_pci_attach(pcici_t, int unit);
50
51static void
52vx_pci_shutdown(
53 int howto,
54 void *sc)
53 void *sc,
54 int howto)
55{
56 vxstop(sc);
57 vxfree(sc);
58}
59
60static const char*
61vx_pci_probe(
62 pcici_t config_id,

--- 54 unchanged lines hidden (view full) ---

117 }
118 }
119
120 /*
121 * Add shutdown hook so that DMA is disabled prior to reboot. Not
122 * doing do could allow DMA to corrupt kernel memory during the
123 * reboot before the driver initializes.
124 */
55{
56 vxstop(sc);
57 vxfree(sc);
58}
59
60static const char*
61vx_pci_probe(
62 pcici_t config_id,

--- 54 unchanged lines hidden (view full) ---

117 }
118 }
119
120 /*
121 * Add shutdown hook so that DMA is disabled prior to reboot. Not
122 * doing do could allow DMA to corrupt kernel memory during the
123 * reboot before the driver initializes.
124 */
125 at_shutdown(vx_pci_shutdown, sc, SHUTDOWN_POST_SYNC);
125 EVENTHANDLER_REGISTER(shutdown_post_sync, vx_pci_shutdown, sc,
126 SHUTDOWN_PRI_DEFAULT);
126
127 pci_map_int(config_id, vxintr, (void *) sc, &net_imask);
128}
129
130static struct pci_device vxdevice = {
131 "vx",
132 vx_pci_probe,
133 vx_pci_attach,
134 &vx_count,
135 NULL
136};
137
138COMPAT_PCI_DRIVER (vx, vxdevice);
139
140#endif /* NVX */
127
128 pci_map_int(config_id, vxintr, (void *) sc, &net_imask);
129}
130
131static struct pci_device vxdevice = {
132 "vx",
133 vx_pci_probe,
134 vx_pci_attach,
135 &vx_count,
136 NULL
137};
138
139COMPAT_PCI_DRIVER (vx, vxdevice);
140
141#endif /* NVX */