Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 Add support for SIOCGIFGENERIC and SIOCS...



details:   https://anonhg.NetBSD.org/src/rev/d9c1bb55de8e
branches:  trunk
changeset: 828074:d9c1bb55de8e
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Nov 26 17:46:13 2017 +0000

description:
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  25 +++++++++++++++++++++----
 sys/compat/netbsd32/netbsd32_ioctl.h |   5 ++++-
 2 files changed, 25 insertions(+), 5 deletions(-)

diffs (81 lines):

diff -r 603f8ffb6987 -r d9c1bb55de8e sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Sun Nov 26 16:32:10 2017 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Sun Nov 26 17:46:13 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $ */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.90 2017/11/26 17:46:13 jmcneill Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.89 2017/01/14 16:34:44 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.90 2017/11/26 17:46:13 jmcneill Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -116,8 +116,14 @@
         * union member needs to be converted to 64 bits... this
         * is very driver specific and so we ignore it for now..
         */
-       if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
+       switch (cmd) {
+       case SIOCGIFDATA:
+       case SIOCZIFDATA:
+       case SIOCGIFGENERIC:
+       case SIOCSIFGENERIC:
                p->ifr_data = (void *)NETBSD32PTR64(s32p->ifr_data);
+               break;
+       }
 }
 
 static inline void
@@ -534,8 +540,14 @@
         * is very driver specific and so we ignore it for now..
         */
        memcpy(s32p, p, sizeof *s32p);
-       if (cmd == SIOCGIFDATA || cmd == SIOCZIFDATA)
+       switch (cmd) {
+       case SIOCGIFDATA:
+       case SIOCZIFDATA:
+       case SIOCGIFGENERIC:
+       case SIOCSIFGENERIC:
                NETBSD32PTR32(s32p->ifr_data, p->ifr_data);
+               break;
+       }
 }
 
 static inline void
@@ -1233,6 +1245,11 @@
        case SIOCGIFMEDIA32:
                IOCTL_STRUCT_CONV_TO(SIOCGIFMEDIA, ifmediareq);
 
+       case SIOCGIFGENERIC32:
+               IOCTL_STRUCT_CONV_TO(SIOCGIFGENERIC, ifreq);
+       case SIOCSIFGENERIC32:
+               IOCTL_STRUCT_CONV_TO(SIOCSIFGENERIC, ifreq);
+
        case PPPOESETPARMS32:
                IOCTL_STRUCT_CONV_TO(PPPOESETPARMS, pppoediscparms);
        case PPPOEGETPARMS32:
diff -r 603f8ffb6987 -r d9c1bb55de8e sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Sun Nov 26 16:32:10 2017 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Sun Nov 26 17:46:13 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.56 2016/12/26 23:05:06 christos Exp $     */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.57 2017/11/26 17:46:13 jmcneill Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -374,6 +374,9 @@
 #define        SIOCSIFMEDIA32  _IOWR('i', 53, struct netbsd32_ifreq)   /* set net media */
 #define        OSIOCSIFMEDIA32 _IOWR('i', 53, struct netbsd32_oifreq)  /* set net media */
 
+#define        SIOCSIFGENERIC32 _IOW('i', 57, struct netbsd32_ifreq)   /* generic IF set op */
+#define        SIOCGIFGENERIC32 _IOWR('i', 58, struct netbsd32_ifreq)  /* generic IF get op */
+
 #define        SIOCIFGCLONERS32 _IOWR('i', 120, struct netbsd32_if_clonereq) /* get cloners */
 
 #define        SIOCSIFMTU32     _IOW('i', 127, struct netbsd32_ifreq)  /* set ifnet mtu */



Home | Main Index | Thread Index | Old Index