| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $ */ | | 1 | /* $NetBSD: if_gem_pci.c,v 1.45 2012/09/23 01:11:14 chs Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * | | 4 | * |
5 | * Copyright (C) 2001 Eduardo Horvath. | | 5 | * Copyright (C) 2001 Eduardo Horvath. |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -24,27 +24,27 @@ | | | @@ -24,27 +24,27 @@ |
24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 24 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 25 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 26 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 27 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
28 | * SUCH DAMAGE. | | 28 | * SUCH DAMAGE. |
29 | * | | 29 | * |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * PCI bindings for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers | | 33 | * PCI bindings for Apple GMAC, Sun ERI and Sun GEM Ethernet controllers |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | #include <sys/cdefs.h> | | 36 | #include <sys/cdefs.h> |
37 | __KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.44 2012/01/30 19:41:20 drochner Exp $"); | | 37 | __KERNEL_RCSID(0, "$NetBSD: if_gem_pci.c,v 1.45 2012/09/23 01:11:14 chs Exp $"); |
38 | | | 38 | |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/systm.h> | | 40 | #include <sys/systm.h> |
41 | #include <sys/malloc.h> | | 41 | #include <sys/malloc.h> |
42 | #include <sys/kernel.h> | | 42 | #include <sys/kernel.h> |
43 | #include <sys/socket.h> | | 43 | #include <sys/socket.h> |
44 | #include <sys/errno.h> | | 44 | #include <sys/errno.h> |
45 | #include <sys/device.h> | | 45 | #include <sys/device.h> |
46 | | | 46 | |
47 | #include <machine/endian.h> | | 47 | #include <machine/endian.h> |
48 | | | 48 | |
49 | #include <net/if.h> | | 49 | #include <net/if.h> |
50 | #include <net/if_dl.h> | | 50 | #include <net/if_dl.h> |
| @@ -266,27 +266,27 @@ gem_pci_attach(device_t parent, device_t | | | @@ -266,27 +266,27 @@ gem_pci_attach(device_t parent, device_t |
266 | serdes = 1; | | 266 | serdes = 1; |
267 | } else { | | 267 | } else { |
268 | if (isshared_pins(&buf[i])) | | 268 | if (isshared_pins(&buf[i])) |
269 | serdes = 2; | | 269 | serdes = 2; |
270 | } | | 270 | } |
271 | if (serdes == 2) { | | 271 | if (serdes == 2) { |
272 | sc->sc_flags |= GEM_SERDES; | | 272 | sc->sc_flags |= GEM_SERDES; |
273 | break; | | 273 | break; |
274 | } | | 274 | } |
275 | i++; | | 275 | i++; |
276 | } | | 276 | } |
277 | #ifdef GEM_DEBUG | | 277 | #ifdef GEM_DEBUG |
278 | /* PROM dump */ | | 278 | /* PROM dump */ |
279 | printf("%s: PROM dump (0x0000 to %04lx)\n", device_xname(sc->sc_dev), | | 279 | printf("%s: PROM dump (0x0000 to %04zx)\n", device_xname(sc->sc_dev), |
280 | (sizeof buf) - 1); | | 280 | (sizeof buf) - 1); |
281 | i = 0; | | 281 | i = 0; |
282 | j = 0; | | 282 | j = 0; |
283 | printf(" %04x ", i); | | 283 | printf(" %04x ", i); |
284 | while (i < sizeof buf) { | | 284 | while (i < sizeof buf) { |
285 | printf("%02x ", buf[i]); | | 285 | printf("%02x ", buf[i]); |
286 | if (i && !(i % 8)) | | 286 | if (i && !(i % 8)) |
287 | printf(" "); | | 287 | printf(" "); |
288 | if (i && !(i % 16)) { | | 288 | if (i && !(i % 16)) { |
289 | printf(" "); | | 289 | printf(" "); |
290 | while (j < i) { | | 290 | while (j < i) { |
291 | if (buf[j] > 31 && buf[j] < 128) | | 291 | if (buf[j] > 31 && buf[j] < 128) |
292 | printf("%c", buf[j]); | | 292 | printf("%c", buf[j]); |