Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Add support for detaching the interface.



details:   https://anonhg.NetBSD.org/src/rev/3fd05e7e74a6
branches:  trunk
changeset: 481550:3fd05e7e74a6
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Feb 01 22:53:14 2000 +0000

description:
Add support for detaching the interface.

diffstat:

 sys/dev/usb/if_kue.c |  35 +++++++++++++----------------------
 1 files changed, 13 insertions(+), 22 deletions(-)

diffs (72 lines):

diff -r 4fb9c0b6e7c9 -r 3fd05e7e74a6 sys/dev/usb/if_kue.c
--- a/sys/dev/usb/if_kue.c      Tue Feb 01 22:52:04 2000 +0000
+++ b/sys/dev/usb/if_kue.c      Tue Feb 01 22:53:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_kue.c,v 1.4 2000/01/24 08:47:43 augustss Exp $      */
+/*     $NetBSD: if_kue.c,v 1.5 2000/02/01 22:53:14 thorpej Exp $       */
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *     Bill Paul <wpaul%ee.columbia.edu@localhost>.  All rights reserved.
@@ -708,17 +708,25 @@
 USB_DETACH(kue)
 {
        USB_DETACH_START(kue, sc);
-#if defined(__FreeBSD__)
        struct ifnet            *ifp;
        int                     s;
 
        s = splusb();
 
+#if defined(__FreeBSD__)
        sc = device_get_softc(dev);
+#endif
        ifp = GET_IFP(sc);
 
-       if (ifp != NULL)
+       if (ifp != NULL) {
+#if defined(__NetBSD__)
+#if NBPFILTER > 0
+               bpfdetach(ifp);
+#endif
+               ether_ifdetach(ifp);
+#endif /* __NetBSD__ */
                if_detach(ifp);
+       }
 
        if (sc->kue_ep[KUE_ENDPT_TX] != NULL)
                usbd_abort_pipe(sc->kue_ep[KUE_ENDPT_TX]);
@@ -733,21 +741,6 @@
        splx(s);
 
        return (0);
-#elif defined(__NetBSD__) || defined(__OpenBSD__)
-       sc = sc;                /* XXX use sc */
-       /* XXX deallocate */
-
-#ifdef notyet
-       /*
-        * Our softc is about to go away, so drop our refernce
-        * to the ifnet.
-        */
-       if_delref(sc->kue_ec.ec_if);
-#else
-       return (0);
-#endif
-
-#endif /* defined(__NetBSD__) || defined(__OpenBSD__) */
 }
 
 #if defined(__NetBSD__) || defined(__OpenBSD__)
@@ -766,10 +759,8 @@
                break;
 
        case DVACT_DEACTIVATE:
-#ifdef notyet
-               /* First, kill off the interface. */
-               if_detach(sc->kue_ec.ec_if);
-#endif
+               /* Deactivate the interface. */
+               if_deactivate(&sc->kue_ec.ec_if);
                sc->kue_dying = 1;
                break;
        }



Home | Main Index | Thread Index | Old Index