| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_ex_pci.c,v 1.49 2008/04/28 20:23:55 martin Exp $ */ | | 1 | /* $NetBSD: if_ex_pci.c,v 1.50 2009/05/05 10:02:52 cegger Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Frank van der Linden; Jason R. Thorpe of the Numerical Aerospace | | 8 | * by Frank van der Linden; Jason R. Thorpe of the Numerical Aerospace |
9 | * Simulation Facility, NASA Ames Research Center. | | 9 | * Simulation Facility, NASA Ames Research Center. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
30 | * POSSIBILITY OF SUCH DAMAGE. | | 30 | * POSSIBILITY OF SUCH DAMAGE. |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.49 2008/04/28 20:23:55 martin Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: if_ex_pci.c,v 1.50 2009/05/05 10:02:52 cegger Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/mbuf.h> | | 38 | #include <sys/mbuf.h> |
39 | #include <sys/socket.h> | | 39 | #include <sys/socket.h> |
40 | #include <sys/ioctl.h> | | 40 | #include <sys/ioctl.h> |
41 | #include <sys/errno.h> | | 41 | #include <sys/errno.h> |
42 | #include <sys/syslog.h> | | 42 | #include <sys/syslog.h> |
43 | #include <sys/select.h> | | 43 | #include <sys/select.h> |
44 | #include <sys/device.h> | | 44 | #include <sys/device.h> |
45 | | | 45 | |
46 | #include <net/if.h> | | 46 | #include <net/if.h> |
47 | #include <net/if_dl.h> | | 47 | #include <net/if_dl.h> |
| @@ -286,28 +286,28 @@ ex_pci_attach(device_t parent, device_t | | | @@ -286,28 +286,28 @@ ex_pci_attach(device_t parent, device_t |
286 | sc->enabled = 1; | | 286 | sc->enabled = 1; |
287 | | | 287 | |
288 | /* Map and establish the interrupt. */ | | 288 | /* Map and establish the interrupt. */ |
289 | if (pci_intr_map(pa, &ih)) { | | 289 | if (pci_intr_map(pa, &ih)) { |
290 | aprint_error_dev(self, "couldn't map interrupt\n"); | | 290 | aprint_error_dev(self, "couldn't map interrupt\n"); |
291 | return; | | 291 | return; |
292 | } | | 292 | } |
293 | | | 293 | |
294 | intrstr = pci_intr_string(pc, ih); | | 294 | intrstr = pci_intr_string(pc, ih); |
295 | sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ex_intr, sc); | | 295 | sc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, ex_intr, sc); |
296 | if (sc->sc_ih == NULL) { | | 296 | if (sc->sc_ih == NULL) { |
297 | aprint_error_dev(self, "couldn't establish interrupt"); | | 297 | aprint_error_dev(self, "couldn't establish interrupt"); |
298 | if (intrstr != NULL) | | 298 | if (intrstr != NULL) |
299 | aprint_normal(" at %s", intrstr); | | 299 | aprint_error(" at %s", intrstr); |
300 | aprint_normal("\n"); | | 300 | aprint_error("\n"); |
301 | return; | | 301 | return; |
302 | } | | 302 | } |
303 | aprint_normal_dev(self, "interrupting at %s\n", intrstr); | | 303 | aprint_normal_dev(self, "interrupting at %s\n", intrstr); |
304 | | | 304 | |
305 | ex_config(sc); | | 305 | ex_config(sc); |
306 | | | 306 | |
307 | if (sc->ex_conf & EX_CONF_PCI_FUNCREG) | | 307 | if (sc->ex_conf & EX_CONF_PCI_FUNCREG) |
308 | bus_space_write_4(psc->sc_funct, psc->sc_funch, PCI_INTR, | | 308 | bus_space_write_4(psc->sc_funct, psc->sc_funch, PCI_INTR, |
309 | PCI_INTRACK); | | 309 | PCI_INTRACK); |
310 | | | 310 | |
311 | if (sc->disable != NULL) | | 311 | if (sc->disable != NULL) |
312 | ex_disable(sc); | | 312 | ex_disable(sc); |
313 | } | | 313 | } |