Author: brooks
Date: Fri Jan 22 19:51:34 2010
New Revision: 202823
URL: http://svn.freebsd.org/changeset/base/202823

Log:
  MFC r201350:
  
    The devices that supported EVFILT_NETDEV kqueue filters were removed in
    r195175.  Remove all definitions, documentation, and usage.
  
  The change of function signature for vlan_link_state() was not merged to
  maintain the ABI.

Modified:
  stable/8/lib/libc/sys/kqueue.2
  stable/8/sys/kern/kern_event.c
  stable/8/sys/net/if.c
  stable/8/sys/sys/event.h
  stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c
  stable/8/usr.bin/truss/syscalls.c
Directory Properties:
  stable/8/lib/libc/   (props changed)
  stable/8/lib/libc/stdtime/   (props changed)
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/tools/regression/fifo/   (props changed)
  stable/8/usr.bin/truss/   (props changed)

Modified: stable/8/lib/libc/sys/kqueue.2
==============================================================================
--- stable/8/lib/libc/sys/kqueue.2      Fri Jan 22 18:46:37 2010        
(r202822)
+++ stable/8/lib/libc/sys/kqueue.2      Fri Jan 22 19:51:34 2010        
(r202823)
@@ -438,19 +438,6 @@ There is a system wide limit on the numb
 which is controlled by the
 .Va kern.kq_calloutmax
 sysctl.
-.It Dv EVFILT_NETDEV
-Takes a descriptor to a network interface as the identifier, and the events to 
watch for in
-.Va fflags .
-It returns, when one or more of the requested events occur on the descriptor.
-The events to monitor are:
-.Bl -tag -width XXNOTE_LINKDOWN
-.It Dv NOTE_LINKUP
-The link is up.
-.It Dv NOTE_LINKDOWN
-The link is down.
-.It Dv NOTE_LINKINV
-The link state is invalid.
-.El
 .Pp
 On return,
 .Va fflags
@@ -595,13 +582,6 @@ system and this manual page were written
 .An Jonathan Lemon Aq jle...@freebsd.org .
 .Sh BUGS
 The
-.Dv EVFILT_NETDEV
-filter is currently only implemented for devices that use the
-.Xr miibus 4
-driver for LINKUP and LINKDOWN operations.
-Therefore, it will not work with many non-ethernet devices.
-.Pp
-The
 .Fa timeout
 value is limited to 24 hours; longer timeouts will be silently
 reinterpreted as 24 hours.

Modified: stable/8/sys/kern/kern_event.c
==============================================================================
--- stable/8/sys/kern/kern_event.c      Fri Jan 22 18:46:37 2010        
(r202822)
+++ stable/8/sys/kern/kern_event.c      Fri Jan 22 19:51:34 2010        
(r202823)
@@ -264,7 +264,7 @@ static struct {
        { &proc_filtops },                      /* EVFILT_PROC */
        { &sig_filtops },                       /* EVFILT_SIGNAL */
        { &timer_filtops },                     /* EVFILT_TIMER */
-       { &file_filtops },                      /* EVFILT_NETDEV */
+       { &null_filtops },                      /* former EVFILT_NETDEV */
        { &fs_filtops },                        /* EVFILT_FS */
        { &null_filtops },                      /* EVFILT_LIO */
        { &user_filtops },                      /* EVFILT_USER */

Modified: stable/8/sys/net/if.c
==============================================================================
--- stable/8/sys/net/if.c       Fri Jan 22 18:46:37 2010        (r202822)
+++ stable/8/sys/net/if.c       Fri Jan 22 19:51:34 2010        (r202823)
@@ -1878,19 +1878,12 @@ do_link_state_change(void *arg, int pend
 {
        struct ifnet *ifp = (struct ifnet *)arg;
        int link_state = ifp->if_link_state;
-       int link;
        CURVNET_SET(ifp->if_vnet);
 
        /* Notify that the link state has changed. */
        rt_ifmsg(ifp);
-       if (link_state == LINK_STATE_UP)
-               link = NOTE_LINKUP;
-       else if (link_state == LINK_STATE_DOWN)
-               link = NOTE_LINKDOWN;
-       else
-               link = NOTE_LINKINV;
        if (ifp->if_vlantrunk != NULL)
-               (*vlan_link_state_p)(ifp, link);
+               (*vlan_link_state_p)(ifp, 0);
 
        if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) &&
            IFP2AC(ifp)->ac_netgraph != NULL)

Modified: stable/8/sys/sys/event.h
==============================================================================
--- stable/8/sys/sys/event.h    Fri Jan 22 18:46:37 2010        (r202822)
+++ stable/8/sys/sys/event.h    Fri Jan 22 19:51:34 2010        (r202823)
@@ -38,7 +38,7 @@
 #define EVFILT_PROC            (-5)    /* attached to struct proc */
 #define EVFILT_SIGNAL          (-6)    /* attached to struct proc */
 #define EVFILT_TIMER           (-7)    /* timers */
-#define EVFILT_NETDEV          (-8)    /* network devices */
+/*     EVFILT_NETDEV           (-8)       no longer supported */
 #define EVFILT_FS              (-9)    /* filesystem events */
 #define EVFILT_LIO             (-10)   /* attached to lio requests */
 #define EVFILT_USER            (-11)   /* User events */
@@ -131,13 +131,6 @@ struct kevent {
 #define        NOTE_TRACKERR   0x00000002              /* could not track 
child */
 #define        NOTE_CHILD      0x00000004              /* am a child process */
 
-/*
- * data/hint flags for EVFILT_NETDEV, shared with userspace
- */
-#define NOTE_LINKUP    0x0001                  /* link is up */
-#define NOTE_LINKDOWN  0x0002                  /* link is down */
-#define NOTE_LINKINV   0x0004                  /* link state is invalid */
-
 struct knote;
 SLIST_HEAD(klist, knote);
 struct kqueue;

Modified: stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c
==============================================================================
--- stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c        Fri Jan 22 
18:46:37 2010        (r202822)
+++ stable/8/tools/regression/fifo/fifo_misc/fifo_misc.c        Fri Jan 22 
19:51:34 2010        (r202823)
@@ -148,114 +148,6 @@ test_truncate(void)
        cleanfifo("testfifo", -1, -1);
 }
 
-struct filter_entry {
-       int              fe_filter;
-       const char      *fe_name;
-       int              fe_error;
-       const char      *fe_errorname;
-};
-
-static const struct filter_entry good_filter_types[] = {
-       { EVFILT_READ, "EVFILT_READ", 0, "0" },
-       { EVFILT_WRITE, "EVFILT_WRITE", 0, "0" },
-#if WORKING_EVFILT_VNODE_ON_FIFOS
-       { EVFILT_VNODE, "EVFILT_VNODE", EINVAL, "EINVAL" },
-#endif
-};
-static const int good_filter_types_len = sizeof(good_filter_types) /
-    sizeof(good_filter_types[0]);
-
-static const struct filter_entry bad_filter_types[] = {
-       { EVFILT_NETDEV, "EVFILT_NETDEV", EINVAL, "EINVAL" },
-};
-static const int bad_filter_types_len = sizeof(bad_filter_types) /
-    sizeof(bad_filter_types[0]);
-
-/*
- * kqueue event-related tests are in fifo_io.c; however, that tests only
- * valid invocations of kqueue.  Check to make sure that some invalid filters
- * that are generally allowed on file descriptors are not allowed to be
- * registered with kqueue, and that if attempts are made, we get the right
- * error.
- */
-static void
-test_kqueue(void)
-{
-       int kqueue_fd, reader_fd, writer_fd;
-       struct kevent kev_set;
-       struct timespec timeout;
-       int i, ret;
-
-       makefifo("testfifo", __func__);
-
-       if (openfifo("testfifo", __func__, &reader_fd, &writer_fd) < 0) {
-               warn("%s: openfifo", __func__);
-               cleanfifo("testfifo", -1, -1);
-               exit(-1);
-       }
-
-       kqueue_fd = kqueue();
-       if (kqueue_fd < 0) {
-               warn("%s: kqueue", __func__);
-               cleanfifo("testfifo", reader_fd, writer_fd);
-               exit(-1);
-       }
-
-       timeout.tv_sec = 0;
-       timeout.tv_nsec = 0;
-
-       for (i = 0; i < good_filter_types_len; i++) {
-               bzero(&kev_set, sizeof(kev_set));
-               EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter,
-                   EV_ADD, 0, 0, 0);
-               ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
-               if (ret < 0) {
-                       warn("%s: kevent: adding good filter %s", __func__,
-                           good_filter_types[i].fe_name);
-                       close(kqueue_fd);
-                       cleanfifo("testfifo", reader_fd, writer_fd);
-                       exit(-1);
-               }
-               bzero(&kev_set, sizeof(kev_set));
-               EV_SET(&kev_set, reader_fd, good_filter_types[i].fe_filter,
-                   EV_DELETE, 0, 0, 0);
-               ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
-               if (ret < 0) {
-                       warn("%s: kevent: deleting good filter %s", __func__,
-                           good_filter_types[i].fe_name);
-                       close(kqueue_fd);
-                       cleanfifo("testfifo", reader_fd, writer_fd);
-                       exit(-1);
-               }
-       }
-
-       for (i = 0; i < bad_filter_types_len; i++) {
-               bzero(&kev_set, sizeof(kev_set));
-               EV_SET(&kev_set, reader_fd, bad_filter_types[i].fe_filter,
-                   EV_ADD, 0, 0, 0);
-               ret = kevent(kqueue_fd, &kev_set, 1, NULL, 0, &timeout);
-               if (ret >= 0) {
-                       warnx("%s: kevent: bad filter %s succeeded, expected "
-                           "EINVAL", __func__, bad_filter_types[i].fe_name);
-                       close(kqueue_fd);
-                       cleanfifo("testfifo", reader_fd, writer_fd);
-                       exit(-1);
-               }
-               if (errno != bad_filter_types[i].fe_error) {
-                       warn("%s: kevent: bad filter %s failed with error "
-                           "not %s", __func__,
-                           bad_filter_types[i].fe_name,
-                           bad_filter_types[i].fe_errorname);
-                       close(kqueue_fd);
-                       cleanfifo("testfifo", reader_fd, writer_fd);
-                       exit(-1);
-               }
-       }
-
-       close(kqueue_fd);
-       cleanfifo("testfifo", reader_fd, writer_fd);
-}
-
 static int
 test_ioctl_setclearflag(int fd, int flag, const char *testname,
     const char *fdname, const char *flagname)
@@ -345,7 +237,6 @@ main(int argc, char *argv[])
 
        test_lseek();
        test_truncate();
-       test_kqueue();
        test_ioctl();
 
        return (0);

Modified: stable/8/usr.bin/truss/syscalls.c
==============================================================================
--- stable/8/usr.bin/truss/syscalls.c   Fri Jan 22 18:46:37 2010        
(r202822)
+++ stable/8/usr.bin/truss/syscalls.c   Fri Jan 22 19:51:34 2010        
(r202823)
@@ -259,7 +259,7 @@ struct xlat {
 static struct xlat kevent_filters[] = {
        X(EVFILT_READ) X(EVFILT_WRITE) X(EVFILT_AIO) X(EVFILT_VNODE)
        X(EVFILT_PROC) X(EVFILT_SIGNAL) X(EVFILT_TIMER)
-       X(EVFILT_NETDEV) X(EVFILT_FS) X(EVFILT_READ) XEND
+       X(EVFILT_FS) X(EVFILT_READ) XEND
 };
 
 static struct xlat kevent_flags[] = {
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to