[BACK]Return to if_tap.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / net

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/net/if_tap.c between version 1.41 and 1.42

version 1.41, 2008/03/21 21:55:00 version 1.42, 2008/04/24 15:35:30
Line 58  __KERNEL_RCSID(0, "$NetBSD$");
Line 58  __KERNEL_RCSID(0, "$NetBSD$");
 #include <sys/kauth.h>  #include <sys/kauth.h>
 #include <sys/mutex.h>  #include <sys/mutex.h>
 #include <sys/simplelock.h>  #include <sys/simplelock.h>
   #include <sys/intr.h>
   
 #include <net/if.h>  #include <net/if.h>
 #include <net/if_dl.h>  #include <net/if_dl.h>
Line 109  struct tap_softc {
Line 110  struct tap_softc {
         pid_t           sc_pgid; /* For async. IO */          pid_t           sc_pgid; /* For async. IO */
         kmutex_t        sc_rdlock;          kmutex_t        sc_rdlock;
         struct simplelock       sc_kqlock;          struct simplelock       sc_kqlock;
           void            *sc_sih;
 };  };
   
 /* autoconf(9) glue */  /* autoconf(9) glue */
Line 197  static void tap_stop(struct ifnet *, int
Line 199  static void tap_stop(struct ifnet *, int
 static int      tap_init(struct ifnet *);  static int      tap_init(struct ifnet *);
 static int      tap_ioctl(struct ifnet *, u_long, void *);  static int      tap_ioctl(struct ifnet *, u_long, void *);
   
 /* This is an internal function to keep tap_ioctl readable */  /* Internal functions */
 static int      tap_lifaddr(struct ifnet *, u_long, struct ifaliasreq *);  static int      tap_lifaddr(struct ifnet *, u_long, struct ifaliasreq *);
   static void     tap_softintr(void *);
   
 /*  /*
  * tap is a clonable interface, although it is highly unrealistic for   * tap is a clonable interface, although it is highly unrealistic for
Line 255  tap_attach(device_t parent, device_t sel
Line 258  tap_attach(device_t parent, device_t sel
         int error;          int error;
   
         sc->sc_dev = self;          sc->sc_dev = self;
           sc->sc_sih = softint_establish(SOFTINT_CLOCK, tap_softintr, sc);
   
         /*          /*
          * In order to obtain unique initial Ethernet address on a host,           * In order to obtain unique initial Ethernet address on a host,
Line 367  tap_detach(device_t self, int flags)
Line 371  tap_detach(device_t self, int flags)
         if_down(ifp);          if_down(ifp);
         splx(s);          splx(s);
   
           softint_disestablish(sc->sc_sih);
   
         /*          /*
          * Destroying a single leaf is a very straightforward operation using           * Destroying a single leaf is a very straightforward operation using
          * sysctl_destroyv.  One should be sure to always end the path with           * sysctl_destroyv.  One should be sure to always end the path with
Line 458  tap_start(struct ifnet *ifp)
Line 464  tap_start(struct ifnet *ifp)
                 wakeup(sc);                  wakeup(sc);
                 selnotify(&sc->sc_rsel, 0, 1);                  selnotify(&sc->sc_rsel, 0, 1);
                 if (sc->sc_flags & TAP_ASYNCIO)                  if (sc->sc_flags & TAP_ASYNCIO)
                         fownsignal(sc->sc_pgid, SIGIO, POLL_IN,                          softint_schedule(sc->sc_sih);
                             POLLIN|POLLRDNORM, NULL);          }
   }
   
   static void
   tap_softintr(void *cookie)
   {
           struct tap_softc *sc;
           struct ifnet *ifp;
           int a, b;
   
           sc = cookie;
   
           if (sc->sc_flags & TAP_ASYNCIO) {
                   ifp = &sc->sc_ec.ec_if;
                   if (ifp->if_flags & IFF_RUNNING) {
                           a = POLL_IN;
                           b = POLLIN|POLLRDNORM;
                   } else {
                           a = POLL_HUP;
                           b = 0;
                   }
                   fownsignal(sc->sc_pgid, SIGIO, a, b, NULL);
         }          }
 }  }
   
Line 553  tap_stop(struct ifnet *ifp, int disable)
Line 580  tap_stop(struct ifnet *ifp, int disable)
         wakeup(sc);          wakeup(sc);
         selnotify(&sc->sc_rsel, 0, 1);          selnotify(&sc->sc_rsel, 0, 1);
         if (sc->sc_flags & TAP_ASYNCIO)          if (sc->sc_flags & TAP_ASYNCIO)
                 fownsignal(sc->sc_pgid, SIGIO, POLL_HUP, 0, NULL);                  softint_schedule(sc->sc_sih);
 }  }
   
 /*  /*

Legend:
Removed from v.1.41  
changed lines
  Added in v.1.42

CVSweb <webmaster@jp.NetBSD.org>