Deleted Added
full compact
if_gem_pci.c (92739) if_gem_pci.c (99726)
1/*
2 * Copyright (C) 2001 Eduardo Horvath.
3 * All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp
28 *
1/*
2 * Copyright (C) 2001 Eduardo Horvath.
3 * All rights reserved.
4 *
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * from: NetBSD: if_gem_pci.c,v 1.7 2001/10/18 15:09:15 thorpej Exp
28 *
29 * $FreeBSD: head/sys/dev/gem/if_gem_pci.c 92739 2002-03-20 02:08:01Z alfred $
29 * $FreeBSD: head/sys/dev/gem/if_gem_pci.c 99726 2002-07-10 10:24:23Z benno $
30 */
31
32/*
33 * PCI bindings for Sun GEM ethernet controllers.
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>

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

102 sizeof(struct gem_pci_softc)
103};
104
105
106DRIVER_MODULE(if_gem, pci, gem_pci_driver, gem_devclass, 0, 0);
107
108struct gem_pci_dev {
109 u_int32_t gpd_devid;
30 */
31
32/*
33 * PCI bindings for Sun GEM ethernet controllers.
34 */
35
36#include <sys/param.h>
37#include <sys/systm.h>

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

102 sizeof(struct gem_pci_softc)
103};
104
105
106DRIVER_MODULE(if_gem, pci, gem_pci_driver, gem_devclass, 0, 0);
107
108struct gem_pci_dev {
109 u_int32_t gpd_devid;
110 int gpd_variant;
110 char *gpd_desc;
111} gem_pci_devlist[] = {
111 char *gpd_desc;
112} gem_pci_devlist[] = {
112 { 0x1101108e, "Sun ERI 10/100 Ethernet Adaptor" },
113 { 0x2bad108e, "Sun GEM Gigabit Ethernet Adaptor" },
114 { 0x0021106b, "Apple GMAC Ethernet Adaptor" },
115 { 0x0024106b, "Apple GMAC2 Ethernet Adaptor" },
113 { 0x1101108e, GEM_SUN_GEM, "Sun ERI 10/100 Ethernet Adaptor" },
114 { 0x2bad108e, GEM_SUN_GEM, "Sun GEM Gigabit Ethernet Adaptor" },
115 { 0x0021106b, GEM_APPLE_GMAC, "Apple GMAC Ethernet Adaptor" },
116 { 0x0024106b, GEM_APPLE_GMAC, "Apple GMAC2 Ethernet Adaptor" },
116 { 0, NULL }
117};
118
119/*
120 * Attach routines need to be split out to different bus-specific files.
121 */
122static int
123gem_pci_probe(dev)
124 device_t dev;
125{
126 int i;
127 u_int32_t devid;
117 { 0, NULL }
118};
119
120/*
121 * Attach routines need to be split out to different bus-specific files.
122 */
123static int
124gem_pci_probe(dev)
125 device_t dev;
126{
127 int i;
128 u_int32_t devid;
129 struct gem_pci_softc *gsc;
128
129 devid = pci_get_devid(dev);
130 for (i = 0; gem_pci_devlist[i].gpd_desc != NULL; i++) {
131 if (devid == gem_pci_devlist[i].gpd_devid) {
132 device_set_desc(dev, gem_pci_devlist[i].gpd_desc);
130
131 devid = pci_get_devid(dev);
132 for (i = 0; gem_pci_devlist[i].gpd_desc != NULL; i++) {
133 if (devid == gem_pci_devlist[i].gpd_devid) {
134 device_set_desc(dev, gem_pci_devlist[i].gpd_desc);
135 gsc = device_get_softc(dev);
136 gsc->gsc_gem.sc_variant =
137 gem_pci_devlist[i].gpd_variant;
133 return (0);
134 }
135 }
136
137 return (ENXIO);
138}
139
140static int

--- 59 unchanged lines hidden ---
138 return (0);
139 }
140 }
141
142 return (ENXIO);
143}
144
145static int

--- 59 unchanged lines hidden ---