Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/dev/pci Pull up revision 1.4 (requested by toshii i...



details:   https://anonhg.NetBSD.org/src/rev/0622805ec00c
branches:  netbsd-2-0
changeset: 561499:0622805ec00c
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jun 21 17:20:08 2004 +0000

description:
Pull up revision 1.4 (requested by toshii in ticket #517):
call ether_ifdetach() and if_detach() if attaching fails...

diffstat:

 sys/dev/pci/if_re.c |  8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r 37d03ca8ba2b -r 0622805ec00c sys/dev/pci/if_re.c
--- a/sys/dev/pci/if_re.c       Mon Jun 21 17:18:38 2004 +0000
+++ b/sys/dev/pci/if_re.c       Mon Jun 21 17:20:08 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_re.c,v 1.4.2.4 2004/06/21 17:18:38 tron Exp $       */
+/*     $NetBSD: if_re.c,v 1.4.2.5 2004/06/21 17:20:08 tron Exp $       */
 /*
  * Copyright (c) 1997, 1998-2003
  *     Bill Paul <wpaul%windriver.com@localhost>.  All rights reserved.
@@ -120,6 +120,7 @@
 #include <sys/malloc.h>
 #include <sys/kernel.h>
 #include <sys/socket.h>
+#include <sys/device.h>
 
 #include <net/if.h>
 #include <net/if_arp.h>
@@ -918,6 +919,7 @@
                printf("%s: attach aborted due to hardware diag failure\n",
                    sc->sc_dev.dv_xname);
                ether_ifdetach(ifp);
+               if_detach(ifp);
                goto fail;
        }
 
@@ -926,6 +928,8 @@
        if (pci_intr_map(pa, &ih)) {
                printf("%s: couldn't map interrupt\n", sc->sc_dev.dv_xname);
                error = ENXIO;
+               ether_ifdetach(ifp);
+               if_detach(ifp);
                goto fail;
        }
        intrstr = pci_intr_string(pc, ih);
@@ -936,6 +940,8 @@
                if (intrstr != NULL)
                        printf(" at %s", intrstr);
                printf("\n");
+               ether_ifdetach(ifp);
+               if_detach(ifp);
                return;
        }
        aprint_normal("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);



Home | Main Index | Thread Index | Old Index