Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci #include <sys/device.h>



details:   https://anonhg.NetBSD.org/src/rev/e6882ef08e62
branches:  trunk
changeset: 567123:e6882ef08e62
user:      mrg <mrg%NetBSD.org@localhost>
date:      Tue Jun 01 15:17:49 2004 +0000

description:
#include <sys/device.h>
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 58f3d9124455 -r e6882ef08e62 sys/dev/pci/if_re.c
--- a/sys/dev/pci/if_re.c       Tue Jun 01 13:35:59 2004 +0000
+++ b/sys/dev/pci/if_re.c       Tue Jun 01 15:17:49 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_re.c,v 1.3 2004/05/30 03:51:48 toshii Exp $ */
+/*     $NetBSD: if_re.c,v 1.4 2004/06/01 15:17:49 mrg 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