Module Name:    src
Committed By:   jmcneill
Date:           Sun Nov 26 17:46:13 UTC 2017

Modified Files:
        src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
Add support for SIOCGIFGENERIC and SIOCSIFGENERIC ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.89 -r1.90 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.56 -r1.57 src/sys/compat/netbsd32/netbsd32_ioctl.h

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.90
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.89	Sat Jan 14 16:34:44 2017
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Sun Nov 26 17:46:13 2017
@@ -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 @@ netbsd32_to_ifreq(struct netbsd32_ifreq 
 	 * 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 @@ netbsd32_from_ifreq(struct ifreq *p, str
 	 * 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 @@ netbsd32_ioctl(struct lwp *l, const stru
 	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:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.57
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.56	Mon Dec 26 23:05:06 2016
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Sun Nov 26 17:46:13 2017
@@ -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 @@ struct netbsd32_if_clonereq {
 #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 */

Reply via email to