CVS commit: src/distrib/sets

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar  1 07:18:40 UTC 2018

Modified Files:
src/distrib/sets: checkflist

Log Message:
no more /usr/X11R6


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/checkflist

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

Modified files:

Index: src/distrib/sets/checkflist
diff -u src/distrib/sets/checkflist:1.44 src/distrib/sets/checkflist:1.45
--- src/distrib/sets/checkflist:1.44	Mon Jun 10 05:03:20 2013
+++ src/distrib/sets/checkflist	Thu Mar  1 07:18:39 2018
@@ -1,6 +1,6 @@
 #! /bin/sh --
 #
-#	$NetBSD: checkflist,v 1.44 2013/06/10 05:03:20 mrg Exp $
+#	$NetBSD: checkflist,v 1.45 2018/03/01 07:18:39 snj Exp $
 #
 # Verify output of makeflist against contents of ${DESTDIR} and ${metalog}.
 
@@ -55,7 +55,7 @@ while getopts xybL:M:em ch; do
 	case ${ch} in
 	x)
 		xargs="-x"
-		origin="./etc/X11 ./etc/fonts ./usr/X11R6 ./usr/X11R7"
+		origin="./etc/X11 ./etc/fonts ./usr/X11R7"
 		;;
 	y)
 		xargs="-y"



CVS commit: src/share/man/man7

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar  1 06:37:40 UTC 2018

Modified Files:
src/share/man/man7: hier.7

Log Message:
remove reference to /usr/X11R6


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.129 src/share/man/man7/hier.7

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

Modified files:

Index: src/share/man/man7/hier.7
diff -u src/share/man/man7/hier.7:1.128 src/share/man/man7/hier.7:1.129
--- src/share/man/man7/hier.7:1.128	Wed Jan 24 09:04:42 2018
+++ src/share/man/man7/hier.7	Thu Mar  1 06:37:40 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: hier.7,v 1.128 2018/01/24 09:04:42 skrll Exp $
+.\"	$NetBSD: hier.7,v 1.129 2018/03/01 06:37:40 snj Exp $
 .\"
 .\" Copyright (c) 1990, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -420,8 +420,6 @@ preserved across a system reboot.
 Contains the majority of the system utilities and files.
 .Pp
 .Bl -tag -width "libdata/" -compact
-.It Pa X11R6/
-X11 files (for X11 revision 6).
 .It Pa X11R7/
 X11 files (for X11 revision 7).
 .Pp



CVS commit: src/sys/arch/x86

2018-02-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Mar  1 06:36:13 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86
src/sys/arch/x86/pci: files.pci

Log Message:
move the imc code into x86/pci/files.pci so that pci is defined in time.


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/x86/pci/files.pci

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

Modified files:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.96 src/sys/arch/x86/conf/files.x86:1.97
--- src/sys/arch/x86/conf/files.x86:1.96	Thu Mar  1 04:45:05 2018
+++ src/sys/arch/x86/conf/files.x86	Thu Mar  1 06:36:12 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.96 2018/03/01 04:45:05 pgoyette Exp $
+#	$NetBSD: files.x86,v 1.97 2018/03/01 06:36:12 mrg Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -161,14 +161,3 @@ file	arch/x86/pci/pciide_machdep.c	pciid
 
 file	arch/x86/pci/pci_bus_fixup.c	pci_bus_fixup
 file	arch/x86/pci/pci_addr_fixup.c	pci_addr_fixup
-
-# Intel Integrated Memory Controller and associated SMBus
-# (Experimental)
-
-device	imc {}: imcsmb
-attach	imc at pci
-file	arch/x86/pci/imcsmb/imc.c		imc
-
-device	imcsmb: i2cbus
-attach	imcsmb at imc
-file	arch/x86/pci/imcsmb/imcsmb.c		imcsmb

Index: src/sys/arch/x86/pci/files.pci
diff -u src/sys/arch/x86/pci/files.pci:1.23 src/sys/arch/x86/pci/files.pci:1.24
--- src/sys/arch/x86/pci/files.pci:1.23	Sat Jan 27 00:21:41 2018
+++ src/sys/arch/x86/pci/files.pci	Thu Mar  1 06:36:12 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.23 2018/01/27 00:21:41 christos Exp $
+#	$NetBSD: files.pci,v 1.24 2018/03/01 06:36:12 mrg Exp $
 
 device 	aapic
 attach 	aapic at pci
@@ -84,3 +84,14 @@ file	arch/x86/pci/fwhrng.c		fwhrng needs
 device	vmx: ether, ifnet, arp
 attach	vmx at pci
 file	arch/x86/pci/if_vmx.c		vmx
+
+# Intel Integrated Memory Controller and associated SMBus
+# (Experimental)
+
+device	imc {}: imcsmb
+attach	imc at pci
+file	arch/x86/pci/imcsmb/imc.c		imc
+
+device	imcsmb: i2cbus
+attach	imcsmb at imc
+file	arch/x86/pci/imcsmb/imcsmb.c		imcsmb



CVS commit: src/share/mk

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar  1 06:34:23 UTC 2018

Modified Files:
src/share/mk: bsd.README

Log Message:
remove mention of /usr/X11R6


To generate a diff of this commit:
cvs rdiff -u -r1.366 -r1.367 src/share/mk/bsd.README

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.366 src/share/mk/bsd.README:1.367
--- src/share/mk/bsd.README:1.366	Sun Jan  7 20:59:25 2018
+++ src/share/mk/bsd.README	Thu Mar  1 06:34:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.366 2018/01/07 20:59:25 jmcneill Exp $
+#	$NetBSD: bsd.README,v 1.367 2018/03/01 06:34:23 snj Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -688,8 +688,7 @@ X11SRCDIR.
 		The path to the xorg src tree for the specificed package>.
 		[${X11SRCDIR}/external/mit/xorg//dist]
 
-X11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R6 or
-		[/usr/X11R7]
+X11ROOTDIR	Root directory of the X11 installation.  [/usr/X11R7]
 
 X11BINDIR	X11 bin directory.  [${X11ROOTDIR}/bin]
 



CVS commit: src/libexec/rpc.rusersd

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar  1 06:24:12 UTC 2018

Modified Files:
src/libexec/rpc.rusersd: rusers_proc.c

Log Message:
delete now-irrelevant comment


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/libexec/rpc.rusersd/rusers_proc.c

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

Modified files:

Index: src/libexec/rpc.rusersd/rusers_proc.c
diff -u src/libexec/rpc.rusersd/rusers_proc.c:1.28 src/libexec/rpc.rusersd/rusers_proc.c:1.29
--- src/libexec/rpc.rusersd/rusers_proc.c:1.28	Wed Feb 28 23:45:56 2018
+++ src/libexec/rpc.rusersd/rusers_proc.c	Thu Mar  1 06:24:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $	*/
+/*	$NetBSD: rusers_proc.c,v 1.29 2018/03/01 06:24:12 snj Exp $	*/
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -30,7 +30,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $");
+__RCSID("$NetBSD: rusers_proc.c,v 1.29 2018/03/01 06:24:12 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -144,10 +144,6 @@ getidle(const char *tty, char *display)
 	time_t now;
 	long idle;
 	
-	/*
-	 * If this is an X terminal or console, then try the
-	 * XIdle extension
-	 */
 	idle = 0;
 	if (*tty == 'X') {
 		long kbd_idle, mouse_idle;



CVS commit: src/etc

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar  1 06:12:09 UTC 2018

Modified Files:
src/etc: login.conf man.conf
src/etc/root: dot.cshrc dot.profile
src/etc/skel: dot.cshrc dot.profile

Log Message:
/usr/X11R6 has been empty on most NetBSD installations since 2008,
and the last few straggling ports dumped it in 2015.  It's time to
prune references to /usr/X11R6 from our config files.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/etc/login.conf
cvs rdiff -u -r1.36 -r1.37 src/etc/man.conf
cvs rdiff -u -r1.26 -r1.27 src/etc/root/dot.cshrc
cvs rdiff -u -r1.29 -r1.30 src/etc/root/dot.profile
cvs rdiff -u -r1.7 -r1.8 src/etc/skel/dot.cshrc
cvs rdiff -u -r1.9 -r1.10 src/etc/skel/dot.profile

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

Modified files:

Index: src/etc/login.conf
diff -u src/etc/login.conf:1.6 src/etc/login.conf:1.7
--- src/etc/login.conf:1.6	Thu Sep 25 11:33:33 2014
+++ src/etc/login.conf	Thu Mar  1 06:12:09 2018
@@ -1,4 +1,4 @@
-# $NetBSD: login.conf,v 1.6 2014/09/25 11:33:33 mbalmer Exp $
+# $NetBSD: login.conf,v 1.7 2018/03/01 06:12:09 snj Exp $
 
 # Based on:
 # OpenBSD: login.conf,v 1.22 2005/08/12 18:48:20 millert Exp 
@@ -12,7 +12,7 @@
 # Any value changed in the daemon class should be reset in the default class.
 #
 #default:\
-#	:path=/usr/bin /bin /usr/sbin /sbin /usr/X11R7/bin /usr/X11R6/bin /usr/pkg/bin /usr/pkg/sbin /usr/local/bin:\
+#	:path=/usr/bin /bin /usr/sbin /sbin /usr/X11R7/bin /usr/pkg/bin /usr/pkg/sbin /usr/local/bin:\
 #	:umask=022:\
 #	:datasize-max=512M:\
 #	:datasize-cur=512M:\

Index: src/etc/man.conf
diff -u src/etc/man.conf:1.36 src/etc/man.conf:1.37
--- src/etc/man.conf:1.36	Sun Dec 25 12:10:52 2016
+++ src/etc/man.conf	Thu Mar  1 06:12:09 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: man.conf,v 1.36 2016/12/25 12:10:52 kim Exp $
+#	$NetBSD: man.conf,v 1.37 2018/03/01 06:12:09 snj Exp $
 
 # Sheer, raging paranoia...
 _version	BSD.2
@@ -40,11 +40,10 @@ _crunch		.xz		/usr/bin/xz -c > %s
 # directory with all of the subdirectories listed for the keyword _subdir.
 
 # default
-_default	/usr/{share,X11R7,X11R6,pkg,local}/man/
+_default	/usr/{share,X11R7,pkg,local}/man/
 
 # Other sections that represent complete man subdirectories.
 X11R7		/usr/X11R7/man/
-X11R6		/usr/X11R6/man/
 packages	/usr/pkg/man/
 local		/usr/local/man/
 

Index: src/etc/root/dot.cshrc
diff -u src/etc/root/dot.cshrc:1.26 src/etc/root/dot.cshrc:1.27
--- src/etc/root/dot.cshrc:1.26	Thu Dec  7 18:26:51 2017
+++ src/etc/root/dot.cshrc	Thu Mar  1 06:12:09 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: dot.cshrc,v 1.26 2017/12/07 18:26:51 jmcneill Exp $
+#	$NetBSD: dot.cshrc,v 1.27 2018/03/01 06:12:09 snj Exp $
 
 alias	h	history
 alias	j	jobs -l
@@ -25,7 +25,7 @@ setenv BLOCKSIZE 1k
 #setenv PKG_PATH "http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/`uname -p`/`uname -r|cut -f '1 2' -d.|cut -f 1 -d_`/All"
 
 set history=1000
-set path=(/sbin /usr/sbin /bin /usr/bin /usr/pkg/sbin /usr/pkg/bin /usr/X11R7/bin /usr/X11R6/bin /usr/local/sbin /usr/local/bin)
+set path=(/sbin /usr/sbin /bin /usr/bin /usr/pkg/sbin /usr/pkg/bin /usr/X11R7/bin /usr/local/sbin /usr/local/bin)
 
 # directory stuff: cdpath/cd/back
 set cdpath=(/usr/src/{sys,bin,sbin,usr.{bin,sbin},lib,libexec,share,local,games,gnu/{usr.{bin,sbin},libexec,lib,games}})

Index: src/etc/root/dot.profile
diff -u src/etc/root/dot.profile:1.29 src/etc/root/dot.profile:1.30
--- src/etc/root/dot.profile:1.29	Thu Dec  7 18:26:51 2017
+++ src/etc/root/dot.profile	Thu Mar  1 06:12:09 2018
@@ -1,7 +1,7 @@
-#	$NetBSD: dot.profile,v 1.29 2017/12/07 18:26:51 jmcneill Exp $
+#	$NetBSD: dot.profile,v 1.30 2018/03/01 06:12:09 snj Exp $
 
 export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/pkg/sbin:/usr/pkg/bin
-export PATH=${PATH}:/usr/X11R7/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin
+export PATH=${PATH}:/usr/X11R7/bin:/usr/local/sbin:/usr/local/bin
 
 # Uncomment the following line(s) to install binary packages
 # from cdn.NetBSD.org via pkg_add.  (See also pkg_install.conf)

Index: src/etc/skel/dot.cshrc
diff -u src/etc/skel/dot.cshrc:1.7 src/etc/skel/dot.cshrc:1.8
--- src/etc/skel/dot.cshrc:1.7	Wed Oct 19 14:42:37 2011
+++ src/etc/skel/dot.cshrc	Thu Mar  1 06:12:09 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: dot.cshrc,v 1.7 2011/10/19 14:42:37 christos Exp $
+#	$NetBSD: dot.cshrc,v 1.8 2018/03/01 06:12:09 snj Exp $
 #
 # This is the default .cshrc file.
 # Users are expected to edit it to meet their own needs.
@@ -32,7 +32,7 @@ setenv	EDITOR	vi
 #setenv	PRINTER	change-this-to-a-printer
 
 # Set the search path for programs.
-set path = (~/bin /bin /sbin /usr/{bin,sbin,X11R7/bin,X11R6/bin,pkg/{,s}bin,games} \
+set path = (~/bin /bin /sbin /usr/{bin,sbin,X11R7/bin,pkg/{,s}bin,games} \
 	/usr/local/{,s}bin)
 
 if ($?prompt) then

Index: src/etc/skel/dot.profile
diff -u src/etc/skel/dot.profile:1.9 src/etc/skel/dot.profile:1.10
--- src/etc/skel/dot.profile:1.9	Tue Apr 10 

CVS commit: src/sys/netinet

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Mar  1 06:08:44 UTC 2018

Modified Files:
src/sys/netinet: tcp_input.c

Log Message:
Revert rev1.183 (2003).

It was intended as an optimization, but it increases the attack surface:
the IPsec policy is not enforced on RST packets when the socket is in the
LISTEN state, and an (unauthenticated) attacker could jam the connection
between two IPsec hosts by sending RST packets between the client's SYN
and ACK packets.

Discussed with ozaki-r@.


To generate a diff of this commit:
cvs rdiff -u -r1.382 -r1.383 src/sys/netinet/tcp_input.c

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

Modified files:

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.382 src/sys/netinet/tcp_input.c:1.383
--- src/sys/netinet/tcp_input.c:1.382	Wed Feb 28 11:23:24 2018
+++ src/sys/netinet/tcp_input.c	Thu Mar  1 06:08:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.382 2018/02/28 11:23:24 maxv Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.383 2018/03/01 06:08:43 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.382 2018/02/28 11:23:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.383 2018/03/01 06:08:43 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1457,15 +1457,11 @@ findpcb:
 		}
 #if defined(IPSEC)
 		if (ipsec_used) {
-			if (inp &&
-			(inp->inp_socket->so_options & SO_ACCEPTCONN) == 0
-			&& ipsec_in_reject(m, inp)) {
+			if (inp && ipsec_in_reject(m, inp)) {
 goto drop;
 			}
 #ifdef INET6
-			else if (in6p &&
-			(in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0
-			&& ipsec_in_reject(m, in6p)) {
+			else if (in6p && ipsec_in_reject(m, in6p)) {
 goto drop;
 			}
 #endif
@@ -1500,9 +1496,7 @@ findpcb:
 			goto dropwithreset_ratelim;
 		}
 #if defined(IPSEC)
-		if (ipsec_used && in6p &&
-		(in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0 &&
-		ipsec_in_reject(m, in6p)) {
+		if (ipsec_used && in6p && ipsec_in_reject(m, in6p)) {
 			goto drop;
 		}
 #endif /*IPSEC*/
@@ -1769,35 +1763,6 @@ nosave:;
 			}
 #endif
 
-#if defined(IPSEC)
-			if (ipsec_used) {
-switch (af) {
-#ifdef INET
-case AF_INET:
-	/*
-	 * inp can be NULL when receiving an
-	 * IPv4 packet on an IPv4-mapped IPv6
-	 * address.
-	 */
-	KASSERT(inp == NULL ||
-	sotoinpcb(so) == inp);
-	if (!ipsec_in_reject(m, inp))
-		break;
-	tp = NULL;
-	goto dropwithreset;
-#endif
-#ifdef INET6
-case AF_INET6:
-	KASSERT(sotoin6pcb(so) == in6p);
-	if (!ipsec_in_reject(m, in6p))
-		break;
-	tp = NULL;
-	goto dropwithreset;
-#endif /*INET6*/
-}
-			}
-#endif /*IPSEC*/
-
 			/*
 			 * LISTEN socket received a SYN from itself? This
 			 * can't possibly be valid; drop the packet.



CVS commit: src/sys/dev/acpi

2018-02-28 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Thu Mar  1 06:00:49 UTC 2018

Modified Files:
src/sys/dev/acpi: acpi.c files.acpi

Log Message:
Limit building & calling ACPI MCFG to kernels with PCI and ACPI.

pci_quirks.c requires pci
acpi_mcfg.c was recently changed to use pci_quirks.c functions.

as a result, ia64 kernels with acpi but no pci failed to link.

tested an ia64 and amd64 kernels build.


To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/dev/acpi/acpi.c
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/acpi/files.acpi

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

Modified files:

Index: src/sys/dev/acpi/acpi.c
diff -u src/sys/dev/acpi/acpi.c:1.265 src/sys/dev/acpi/acpi.c:1.266
--- src/sys/dev/acpi/acpi.c:1.265	Thu Nov 23 15:48:24 2017
+++ src/sys/dev/acpi/acpi.c	Thu Mar  1 06:00:49 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: acpi.c,v 1.265 2017/11/23 15:48:24 jmcneill Exp $	*/
+/*	$NetBSD: acpi.c,v 1.266 2018/03/01 06:00:49 maya Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc.
@@ -100,9 +100,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.265 2017/11/23 15:48:24 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.266 2018/03/01 06:00:49 maya Exp $");
 
 #include "opt_acpi.h"
+#include "opt_pci.h"
 #include "opt_pcifixup.h"
 
 #include 
@@ -487,10 +488,12 @@ acpi_attach(device_t parent, device_t se
 	 */
 	acpi_build_tree(sc);
 
+#ifdef NPCI
 	/*
 	 * Probe MCFG table
 	 */
 	acpimcfg_probe(sc);
+#endif
 
 	acpi_md_callback(sc);
 

Index: src/sys/dev/acpi/files.acpi
diff -u src/sys/dev/acpi/files.acpi:1.100 src/sys/dev/acpi/files.acpi:1.101
--- src/sys/dev/acpi/files.acpi:1.100	Sun Dec 10 16:51:30 2017
+++ src/sys/dev/acpi/files.acpi	Thu Mar  1 06:00:49 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.acpi,v 1.100 2017/12/10 16:51:30 bouyer Exp $
+#	$NetBSD: files.acpi,v 1.101 2018/03/01 06:00:49 maya Exp $
 
 include "dev/acpi/acpica/files.acpica"
 
@@ -19,7 +19,7 @@ attach	acpi at acpibus
 file	dev/acpi/acpi.c			acpi
 file	dev/acpi/acpi_debug.c		acpi
 file	dev/acpi/acpi_i2c.c		acpi
-file	dev/acpi/acpi_mcfg.c		acpi
+file	dev/acpi/acpi_mcfg.c		acpi & pci
 file	dev/acpi/acpi_pci.c		acpi
 file	dev/acpi/acpi_pci_link.c	acpi
 file	dev/acpi/acpi_power.c		acpi



CVS commit: src/sys/dev/i2c

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 05:47:22 UTC 2018

Modified Files:
src/sys/dev/i2c: spdmem_i2c.c

Log Message:
Use 1-byte data-buffers when writing to the "control" device for the
SPD ROMs (we do this for page-selection).  The imcsmb doesn't support
zero-byte transfers.

With this, I'm able to get the data for all 8 of my DIMMs (on two
different imcsmb busses) using the spdmem(4) driver.  And the data
decodes correctly using the decode-dimms utility (from the linux
i2ctools).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/i2c/spdmem_i2c.c

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

Modified files:

Index: src/sys/dev/i2c/spdmem_i2c.c
diff -u src/sys/dev/i2c/spdmem_i2c.c:1.13 src/sys/dev/i2c/spdmem_i2c.c:1.14
--- src/sys/dev/i2c/spdmem_i2c.c:1.13	Fri Sep  9 05:36:59 2016
+++ src/sys/dev/i2c/spdmem_i2c.c	Thu Mar  1 05:47:22 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem_i2c.c,v 1.13 2016/09/09 05:36:59 msaitoh Exp $ */
+/* $NetBSD: spdmem_i2c.c,v 1.14 2018/03/01 05:47:22 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.13 2016/09/09 05:36:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.14 2018/03/01 05:47:22 pgoyette Exp $");
 
 #include 
 #include 
@@ -102,6 +102,7 @@ static int
 spdmem_reset_page(struct spdmem_i2c_softc *sc)
 {
 	uint8_t reg, byte0, byte2;
+	static uint8_t dummy = 0;
 	int rv;
 
 	reg = 0;
@@ -142,7 +143,7 @@ spdmem_reset_page(struct spdmem_i2c_soft
 		 * I don't know whether our icc_exec()'s API is good or not.
 		 */
 		rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_page0,
-		, 1, NULL, 0, I2C_F_POLL);
+		, 1, , 1, I2C_F_POLL);
 		if (rv != 0) {
 			/*
 			 * The possibilities are:
@@ -152,7 +153,7 @@ spdmem_reset_page(struct spdmem_i2c_soft
 			 * Is there no way to distinguish them now?
 			 */
 			rv = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
-			sc->sc_page0, , 1, NULL, 0, I2C_F_POLL);
+			sc->sc_page0, , 1, , 1, I2C_F_POLL);
 			if (rv == 0) {
 aprint_debug("Page 1 was selected. Page 0 is "
 "selected now.\n");
@@ -245,11 +246,11 @@ spdmem_i2c_read(struct spdmem_softc *sof
 
 	if (addr & 0x100) {
 		rv = iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP, sc->sc_page1,
-		, 1, NULL, 0, I2C_F_POLL);
+		, 1, , 1, I2C_F_POLL);
 		rv |= iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
 		, 1, val, 1, I2C_F_POLL);
 		rv |= iic_exec(sc->sc_tag, I2C_OP_WRITE_WITH_STOP,
-		sc->sc_page0, , 1, NULL, 0, I2C_F_POLL);
+		sc->sc_page0, , 1, , 1, I2C_F_POLL);
 	} else {
 		rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr,
 		, 1, val, 1, I2C_F_POLL);



CVS commit: src/sys/modules

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:53:05 UTC 2018

Modified Files:
src/sys/modules/imc: Makefile
src/sys/modules/imcsmb: Makefile

Log Message:
Adjust PATHs for files that were moved


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/imc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/imcsmb/Makefile

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

Modified files:

Index: src/sys/modules/imc/Makefile
diff -u src/sys/modules/imc/Makefile:1.1 src/sys/modules/imc/Makefile:1.2
--- src/sys/modules/imc/Makefile:1.1	Sun Feb 25 08:20:28 2018
+++ src/sys/modules/imc/Makefile	Thu Mar  1 04:53:05 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.1 2018/02/25 08:20:28 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.2 2018/03/01 04:53:05 pgoyette Exp $
 
 .include "../Makefile.inc"
 
 .PATH:	${S}/dev
-.PATH:	${S}/dev/pci
-.PATH:	${S}/dev/imcsmb
+.PATH:	${S}/arch/x86/pci
+.PATH:	${S}/arch/x86/pci/imcsmb
 
 KMOD=	imc
 IOCONF= imc.ioconf

Index: src/sys/modules/imcsmb/Makefile
diff -u src/sys/modules/imcsmb/Makefile:1.1 src/sys/modules/imcsmb/Makefile:1.2
--- src/sys/modules/imcsmb/Makefile:1.1	Sun Feb 25 08:20:29 2018
+++ src/sys/modules/imcsmb/Makefile	Thu Mar  1 04:53:05 2018
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.1 2018/02/25 08:20:29 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.2 2018/03/01 04:53:05 pgoyette Exp $
 
 .include "../Makefile.inc"
 
 .PATH:	${S}/dev
-.PATH:	${S}/dev/pci
-.PATH:	${S}/dev/imcsmb
+.PATH:	${S}/arch/x86/pci
+.PATH:	${S}/arch/x86/pci/imcsmb
 
 KMOD=	imcsmb
 IOCONF= imcsmb.ioconf



CVS commit: src/sys/dev/imcsmb

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:48:32 UTC 2018

Removed Files:
src/sys/dev/imcsmb: imc.c imcsmb.c imcsmb_reg.h imcsmb_var.h

Log Message:
The imc and imcsmb drivers have moved to x86-specific directory


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r0 src/sys/dev/imcsmb/imc.c
cvs rdiff -u -r1.19 -r0 src/sys/dev/imcsmb/imcsmb.c
cvs rdiff -u -r1.1 -r0 src/sys/dev/imcsmb/imcsmb_reg.h \
src/sys/dev/imcsmb/imcsmb_var.h

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



CVS commit: src/sys/arch/x86

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:45:06 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86
Added Files:
src/sys/arch/x86/pci/imcsmb: imc.c imcsmb.c imcsmb_reg.h imcsmb_var.h

Log Message:
Move the imc(4) and imcsmb(4) sources into architecture-specific
directory (for previous CVS history see the sys/dev/pci/imcsmb/
Attic)


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/pci/imcsmb/imc.c \
src/sys/arch/x86/pci/imcsmb/imcsmb.c \
src/sys/arch/x86/pci/imcsmb/imcsmb_reg.h \
src/sys/arch/x86/pci/imcsmb/imcsmb_var.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/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.95 src/sys/arch/x86/conf/files.x86:1.96
--- src/sys/arch/x86/conf/files.x86:1.95	Thu Mar  1 04:35:04 2018
+++ src/sys/arch/x86/conf/files.x86	Thu Mar  1 04:45:05 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.95 2018/03/01 04:35:04 pgoyette Exp $
+#	$NetBSD: files.x86,v 1.96 2018/03/01 04:45:05 pgoyette Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -167,8 +167,8 @@ file	arch/x86/pci/pci_addr_fixup.c	pci_a
 
 device	imc {}: imcsmb
 attach	imc at pci
-file	dev/imcsmb/imc.c		imc
+file	arch/x86/pci/imcsmb/imc.c		imc
 
 device	imcsmb: i2cbus
 attach	imcsmb at imc
-file	dev/imcsmb/imcsmb.c		imcsmb
+file	arch/x86/pci/imcsmb/imcsmb.c		imcsmb

Added files:

Index: src/sys/arch/x86/pci/imcsmb/imc.c
diff -u /dev/null src/sys/arch/x86/pci/imcsmb/imc.c:1.1
--- /dev/null	Thu Mar  1 04:45:06 2018
+++ src/sys/arch/x86/pci/imcsmb/imc.c	Thu Mar  1 04:45:06 2018
@@ -0,0 +1,404 @@
+/* $NetBSD: imc.c,v 1.1 2018/03/01 04:45:06 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Authors: Joe Kloss; Ravi Pokala (rpok...@freebsd.org)
+ *
+ * Copyright (c) 2017-2018 Panasas
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Driver to expose the SMBus controllers in Intel's Integrated
+ * 

CVS commit: src/sys/arch/x86/conf

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:35:04 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86

Log Message:
Replace spaces with tabs (xterm copy-&-pasto)


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/x86/conf/files.x86

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

Modified files:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.94 src/sys/arch/x86/conf/files.x86:1.95
--- src/sys/arch/x86/conf/files.x86:1.94	Thu Mar  1 04:29:38 2018
+++ src/sys/arch/x86/conf/files.x86	Thu Mar  1 04:35:04 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.94 2018/03/01 04:29:38 pgoyette Exp $
+#	$NetBSD: files.x86,v 1.95 2018/03/01 04:35:04 pgoyette Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -165,10 +165,10 @@ file	arch/x86/pci/pci_addr_fixup.c	pci_a
 # Intel Integrated Memory Controller and associated SMBus
 # (Experimental)
 
-device  imc {}: imcsmb
-attach  imc at pci
-filedev/imcsmb/imc.cimc
-
-device  imcsmb: i2cbus
-attach  imcsmb at imc
-filedev/imcsmb/imcsmb.c imcsmb
+device	imc {}: imcsmb
+attach	imc at pci
+file	dev/imcsmb/imc.c		imc
+
+device	imcsmb: i2cbus
+attach	imcsmb at imc
+file	dev/imcsmb/imcsmb.c		imcsmb



CVS commit: src/sys/dev

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:31:22 UTC 2018

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Use imc and imcsmb for the new x86 device names.  Now that they're
defined in the architecture-specific files.x86 they won't conflict
with the sgimips imc device.


To generate a diff of this commit:
cvs rdiff -u -r1.303 -r1.304 src/sys/dev/DEVNAMES

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

Modified files:

Index: src/sys/dev/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.303 src/sys/dev/DEVNAMES:1.304
--- src/sys/dev/DEVNAMES:1.303	Thu Mar  1 04:20:12 2018
+++ src/sys/dev/DEVNAMES	Thu Mar  1 04:31:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.303 2018/03/01 04:20:12 pgoyette Exp $
+#	$NetBSD: DEVNAMES,v 1.304 2018/03/01 04:31:22 pgoyette Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -646,8 +646,8 @@ iic			acorn32
 ik			vax
 il			MI
 imc			sgimips
-iimc			x86_64,i386
-iimcsmb			x86_64,i386
+imc			x86_64,i386
+imcsmb			x86_64,i386
 inphy			MI
 intersil7170		MI		Attribute
 interwave		MI		Attribute



CVS commit: src/sys

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:29:38 UTC 2018

Modified Files:
src/sys/arch/x86/conf: files.x86
src/sys/dev/pci: files.pci

Log Message:
Move the imc and imcsmb stuff out of general files.pci and into the
architecture-specific files.x86

Should unbreak the sgimips build.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r1.393 -r1.394 src/sys/dev/pci/files.pci

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

Modified files:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.93 src/sys/arch/x86/conf/files.x86:1.94
--- src/sys/arch/x86/conf/files.x86:1.93	Sun Feb 11 09:39:37 2018
+++ src/sys/arch/x86/conf/files.x86	Thu Mar  1 04:29:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.93 2018/02/11 09:39:37 maxv Exp $
+#	$NetBSD: files.x86,v 1.94 2018/03/01 04:29:38 pgoyette Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -161,3 +161,14 @@ file	arch/x86/pci/pciide_machdep.c	pciid
 
 file	arch/x86/pci/pci_bus_fixup.c	pci_bus_fixup
 file	arch/x86/pci/pci_addr_fixup.c	pci_addr_fixup
+
+# Intel Integrated Memory Controller and associated SMBus
+# (Experimental)
+
+device  imc {}: imcsmb
+attach  imc at pci
+filedev/imcsmb/imc.cimc
+
+device  imcsmb: i2cbus
+attach  imcsmb at imc
+filedev/imcsmb/imcsmb.c imcsmb

Index: src/sys/dev/pci/files.pci
diff -u src/sys/dev/pci/files.pci:1.393 src/sys/dev/pci/files.pci:1.394
--- src/sys/dev/pci/files.pci:1.393	Sun Feb 25 08:19:34 2018
+++ src/sys/dev/pci/files.pci	Thu Mar  1 04:29:37 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.393 2018/02/25 08:19:34 pgoyette Exp $
+#	$NetBSD: files.pci,v 1.394 2018/03/01 04:29:37 pgoyette Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -1189,14 +1189,3 @@ include "external/bsd/drm2/pci/files.drm
 device	ismt: i2cbus
 attach	ismt at pci
 file	dev/pci/ismt.c		ismt
-
-# Intel Integrated Memory Controller and associated SMBus
-# (Experimental)
-
-device	imc {}: imcsmb
-attach	imc at pci
-file	dev/imcsmb/imc.c		imc
-
-device	imcsmb: i2cbus
-attach	imcsmb at imc
-file	dev/imcsmb/imcsmb.c		imcsmb



CVS commit: src/sys/dev

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar  1 04:20:12 UTC 2018

Modified Files:
src/sys/dev: DEVNAMES

Log Message:
Note that we're now using iimc and iimcsmb

XXX Existing recently-added imc and imcsmb drivers for x86_64 and i386
XXX will be renamed appropriately.


To generate a diff of this commit:
cvs rdiff -u -r1.302 -r1.303 src/sys/dev/DEVNAMES

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

Modified files:

Index: src/sys/dev/DEVNAMES
diff -u src/sys/dev/DEVNAMES:1.302 src/sys/dev/DEVNAMES:1.303
--- src/sys/dev/DEVNAMES:1.302	Tue Feb 27 14:28:01 2018
+++ src/sys/dev/DEVNAMES	Thu Mar  1 04:20:12 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: DEVNAMES,v 1.302 2018/02/27 14:28:01 maxv Exp $
+#	$NetBSD: DEVNAMES,v 1.303 2018/03/01 04:20:12 pgoyette Exp $
 #
 # This file contains all used device names and defined attributes in
 # alphabetical order. New devices added to the system somewhere should first
@@ -646,6 +646,8 @@ iic			acorn32
 ik			vax
 il			MI
 imc			sgimips
+iimc			x86_64,i386
+iimcsmb			x86_64,i386
 inphy			MI
 intersil7170		MI		Attribute
 interwave		MI		Attribute



CVS commit: src/sys/dev/pci

2018-02-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Mar  1 03:32:33 UTC 2018

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
 Do wm_reset_mdicnfg_82580() on 82580 only.


To generate a diff of this commit:
cvs rdiff -u -r1.565 -r1.566 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.565 src/sys/dev/pci/if_wm.c:1.566
--- src/sys/dev/pci/if_wm.c:1.565	Thu Mar  1 03:30:12 2018
+++ src/sys/dev/pci/if_wm.c	Thu Mar  1 03:32:33 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.565 2018/03/01 03:30:12 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.566 2018/03/01 03:32:33 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.565 2018/03/01 03:30:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.566 2018/03/01 03:32:33 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -14309,6 +14309,8 @@ wm_reset_mdicnfg_82580(struct wm_softc *
 	uint16_t nvmword;
 	int rv;
 
+	if (sc->sc_type != WM_T_82580)
+		return;
 	if ((sc->sc_flags & WM_F_SGMII) == 0)
 		return;
 



CVS commit: src/sys/dev/pci

2018-02-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Mar  1 03:30:13 UTC 2018

Modified Files:
src/sys/dev/pci: if_wm.c

Log Message:
- Fix a bug that wm_pll_workaround_i210() is not called on some cases.
  As I wrote in if_wm.c rev 1.329's commit message, There are three cases:

a) Chip is I211
b) Chip is I210 and it uses INVM (not FLASH)
c) Chip is I210 (it uses FLASH) and NVM image version < 3.25

  Before this commit, the workaround function was not called on a) and b).

- Rename function.


To generate a diff of this commit:
cvs rdiff -u -r1.564 -r1.565 src/sys/dev/pci/if_wm.c

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

Modified files:

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.564 src/sys/dev/pci/if_wm.c:1.565
--- src/sys/dev/pci/if_wm.c:1.564	Fri Feb 16 04:49:27 2018
+++ src/sys/dev/pci/if_wm.c	Thu Mar  1 03:30:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.564 2018/02/16 04:49:27 knakahara Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.565 2018/03/01 03:30:12 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.564 2018/02/16 04:49:27 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.565 2018/03/01 03:30:12 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -885,7 +885,7 @@ static int	wm_nvm_read_word_invm(struct 
 static int	wm_nvm_read_invm(struct wm_softc *, int, int, uint16_t *);
 /* Lock, detecting NVM type, validate checksum and read */
 static int	wm_nvm_is_onboard_eeprom(struct wm_softc *);
-static int	wm_nvm_get_flash_presence_i210(struct wm_softc *);
+static int	wm_nvm_flash_presence_i210(struct wm_softc *);
 static int	wm_nvm_validate_checksum(struct wm_softc *);
 static void	wm_nvm_version_invm(struct wm_softc *);
 static void	wm_nvm_version(struct wm_softc *);
@@ -2256,7 +2256,7 @@ alloc_retry:
 	case WM_T_I211:
 		/* Allow a single clear of the SW semaphore on I210 and newer*/
 		sc->sc_flags |= WM_F_WA_I210_CLSEM;
-		if (wm_nvm_get_flash_presence_i210(sc)) {
+		if (wm_nvm_flash_presence_i210(sc)) {
 			sc->nvm.read = wm_nvm_read_eerd;
 			/* Don't use WM_F_LOCK_EECD because we use EERD */
 			sc->sc_flags |= WM_F_EEPROM_FLASH_HW;
@@ -2353,12 +2353,20 @@ alloc_retry:
 	/* Reset the chip to a known state. */
 	wm_reset(sc);
 
-	/* Check for I21[01] PLL workaround */
-	if (sc->sc_type == WM_T_I210)
+	/*
+	 * Check for I21[01] PLL workaround.
+	 *
+	 * Three cases:
+	 * a) Chip is I211.
+	 * b) Chip is I210 and it uses INVM (not FLASH).
+	 * c) Chip is I210 (and it uses FLASH) and the NVM image version < 3.25
+	 */
+	if (sc->sc_type == WM_T_I211)
 		sc->sc_flags |= WM_F_PLL_WA_I210;
-	if ((sc->sc_type == WM_T_I210) && wm_nvm_get_flash_presence_i210(sc)) {
-		/* NVM image release 3.25 has a workaround */
-		if ((sc->sc_nvm_ver_major < 3)
+	if (sc->sc_type == WM_T_I210) {
+		if (!wm_nvm_flash_presence_i210(sc))
+			sc->sc_flags |= WM_F_PLL_WA_I210;
+		else if ((sc->sc_nvm_ver_major < 3)
 		|| ((sc->sc_nvm_ver_major == 3)
 			&& (sc->sc_nvm_ver_minor < 25))) {
 			aprint_verbose_dev(sc->sc_dev,
@@ -12485,7 +12493,7 @@ wm_nvm_is_onboard_eeprom(struct wm_softc
 }
 
 static int
-wm_nvm_get_flash_presence_i210(struct wm_softc *sc)
+wm_nvm_flash_presence_i210(struct wm_softc *sc)
 {
 	uint32_t eec;
 
@@ -12649,7 +12657,7 @@ wm_nvm_version(struct wm_softc *sc)
 		have_uid = false;
 		goto printver;
 	case WM_T_I210:
-		if (!wm_nvm_get_flash_presence_i210(sc)) {
+		if (!wm_nvm_flash_presence_i210(sc)) {
 			wm_nvm_version_invm(sc);
 			have_uid = false;
 			goto printver;



CVS commit: src/libexec/rpc.rusersd

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb 28 23:45:56 UTC 2018

Modified Files:
src/libexec/rpc.rusersd: Makefile rusers_proc.c

Log Message:
prune disabled XIDLE support. the required X server extension hasn't been
around for a couple decades now. even if someone wanted to modernize this,
it wouldn't be appropriate for NetBSD, since we don't want programs in base
to be linked against X libs.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/rpc.rusersd/Makefile
cvs rdiff -u -r1.27 -r1.28 src/libexec/rpc.rusersd/rusers_proc.c

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

Modified files:

Index: src/libexec/rpc.rusersd/Makefile
diff -u src/libexec/rpc.rusersd/Makefile:1.18 src/libexec/rpc.rusersd/Makefile:1.19
--- src/libexec/rpc.rusersd/Makefile:1.18	Mon Nov  4 22:03:38 2002
+++ src/libexec/rpc.rusersd/Makefile	Wed Feb 28 23:45:56 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2002/11/04 22:03:38 christos Exp $
+#	$NetBSD: Makefile,v 1.19 2018/02/28 23:45:56 snj Exp $
 
 .include 
 
@@ -15,15 +15,5 @@ CPPFLAGS+=-I${NETBSDSRCDIR}/usr.bin/who 
 DPADD+=	${LIBRPCSVC}
 LDADD+=	-lrpcsvc
 
-.if exists(/usr/X11R6)
-XINCDIR=	/usr/X11R6/include
-XLIBDIR=	/usr/X11R6/lib
-.endif
-
-#.if defined(XINCDIR) && exists($(XINCDIR)/X11/extensions/xidle.h)
-#CPPFLAGS+=	-I$(XINCDIR) -DXIDLE
-#LDADD+=		-L$(XLIBDIR) -lXext -lX11
-#.endif
-
 .include 
 

Index: src/libexec/rpc.rusersd/rusers_proc.c
diff -u src/libexec/rpc.rusersd/rusers_proc.c:1.27 src/libexec/rpc.rusersd/rusers_proc.c:1.28
--- src/libexec/rpc.rusersd/rusers_proc.c:1.27	Tue Aug 30 17:06:20 2011
+++ src/libexec/rpc.rusersd/rusers_proc.c	Wed Feb 28 23:45:56 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rusers_proc.c,v 1.27 2011/08/30 17:06:20 plunky Exp $	*/
+/*	$NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $	*/
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -30,7 +30,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: rusers_proc.c,v 1.27 2011/08/30 17:06:20 plunky Exp $");
+__RCSID("$NetBSD: rusers_proc.c,v 1.28 2018/02/28 23:45:56 snj Exp $");
 #endif /* not lint */
 
 #include 
@@ -53,12 +53,6 @@ __RCSID("$NetBSD: rusers_proc.c,v 1.27 2
 #include "rusers_proc.h"
 #include "utmpentry.h"
 
-#ifdef XIDLE
-#include 
-#include 
-#include 
-#endif
-
 #include 	/* New version */
 static size_t maxusers3 = 0;
 static struct rusers_utmp *utmps;
@@ -89,57 +83,6 @@ struct utmpidlearr *rusersproc_names_2_s
 struct utmpidlearr *rusersproc_allnames_2_svc(void *, struct svc_req *);
 
 
-#ifdef XIDLE
-static Display *dpy;
-static sigjmp_buf openAbort;
-
-static int XqueryIdle(char *);
-static void abortOpen(int);
-
-static void
-abortOpen(int n)
-{
-	siglongjmp(openAbort, 1);
-}
-
-static int
-XqueryIdle(char *display)
-{
-	int first_event, first_error;
-	Time IdleTime;
-
-	(void)signal(SIGALRM, abortOpen);
-	(void)alarm(10);
-	if (!sigsetjmp(openAbort, 0)) {
-		if ((dpy = XOpenDisplay(display)) == NULL) {
-			syslog(LOG_DEBUG, "cannot open display %s", display);
-			return -1;
-		}
-		if (XidleQueryExtension(dpy, _event, _error)) {
-			if (!XGetIdleTime(dpy, )) {
-syslog(LOG_DEBUG,
-"%s: unable to get idle time", display);
-return -1;
-			}
-		} else {
-			syslog(LOG_DEBUG, "%s: Xidle extension not loaded",
-			display);
-			return -1;
-		}
-		XCloseDisplay(dpy);
-	} else {
-		syslog(LOG_DEBUG, "%s: server grabbed for over 10 seconds",
-		display);
-		return -1;
-	}
-	(void)alarm(0);
-	(void)signal(SIGALRM, SIG_DFL);
-
-	IdleTime /= 1000;
-	return (IdleTime + 30) / 60;
-}
-#endif /* XIDLE */
-
 static int
 getarrays2(int ne)
 {
@@ -205,11 +148,6 @@ getidle(const char *tty, char *display)
 	 * If this is an X terminal or console, then try the
 	 * XIdle extension
 	 */
-#ifdef XIDLE
-	if (display && *display && strchr(display, ':') != NULL &&
-	(idle = XqueryIdle(display)) >= 0)
-		return idle;
-#endif
 	idle = 0;
 	if (*tty == 'X') {
 		long kbd_idle, mouse_idle;



CVS commit: src/sys/dev/ic

2018-02-28 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Feb 28 23:08:30 UTC 2018

Modified Files:
src/sys/dev/ic: gem.c

Log Message:
add workaround for PHY detection on Apple K2 GMAC
adapted from openbsd


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/ic/gem.c

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

Modified files:

Index: src/sys/dev/ic/gem.c
diff -u src/sys/dev/ic/gem.c:1.108 src/sys/dev/ic/gem.c:1.109
--- src/sys/dev/ic/gem.c:1.108	Mon Feb 20 07:43:29 2017
+++ src/sys/dev/ic/gem.c	Wed Feb 28 23:08:30 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: gem.c,v 1.108 2017/02/20 07:43:29 ozaki-r Exp $ */
+/*	$NetBSD: gem.c,v 1.109 2018/02/28 23:08:30 macallan Exp $ */
 
 /*
  *
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.108 2017/02/20 07:43:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gem.c,v 1.109 2018/02/28 23:08:30 macallan Exp $");
 
 #include "opt_inet.h"
 
@@ -410,7 +410,8 @@ gem_attach(struct gem_softc *sc, const u
 #endif
 		/* Look for internal PHY if no external PHY was found */
 		if (LIST_EMPTY(>mii_phys) && 
-		sc->sc_mif_config & GEM_MIF_CONFIG_MDI0) {
+		((sc->sc_mif_config & GEM_MIF_CONFIG_MDI0) ||
+		 (sc->sc_variant == GEM_APPLE_K2_GMAC))) {
 			sc->sc_mif_config &= ~GEM_MIF_CONFIG_PHY_SEL;
 			bus_space_write_4(t, h, GEM_MIF_CONFIG,
 			sc->sc_mif_config);



CVS commit: src/sys/dev/pci

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Feb 28 22:36:02 UTC 2018

Modified Files:
src/sys/dev/pci: ichsmb.c

Log Message:
Teach the ichsmb(4) driver how to detach.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/pci/ichsmb.c

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

Modified files:

Index: src/sys/dev/pci/ichsmb.c
diff -u src/sys/dev/pci/ichsmb.c:1.54 src/sys/dev/pci/ichsmb.c:1.55
--- src/sys/dev/pci/ichsmb.c:1.54	Tue Feb 27 00:18:02 2018
+++ src/sys/dev/pci/ichsmb.c	Wed Feb 28 22:36:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ichsmb.c,v 1.54 2018/02/27 00:18:02 pgoyette Exp $	*/
+/*	$NetBSD: ichsmb.c,v 1.55 2018/02/28 22:36:02 pgoyette Exp $	*/
 /*	$OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $	*/
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.54 2018/02/27 00:18:02 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.55 2018/02/28 22:36:02 pgoyette Exp $");
 
 #include 
 #include 
@@ -56,6 +56,8 @@ struct ichsmb_softc {
 
 	bus_space_tag_t		sc_iot;
 	bus_space_handle_t	sc_ioh;
+	bus_size_t		sc_size;
+	pci_chipset_tag_t	sc_pc;
 	void *			sc_ih;
 	int			sc_poll;
 
@@ -73,6 +75,7 @@ struct ichsmb_softc {
 
 static int	ichsmb_match(device_t, cfdata_t, void *);
 static void	ichsmb_attach(device_t, device_t, void *);
+static int	ichsmb_detach(device_t, int);
 static int	ichsmb_rescan(device_t, const char *, const int *);
 static void	ichsmb_chdet(device_t, device_t);
 
@@ -86,7 +89,8 @@ static int	ichsmb_intr(void *);
 #include "ioconf.h"
 
 CFATTACH_DECL3_NEW(ichsmb, sizeof(struct ichsmb_softc),
-ichsmb_match, ichsmb_attach, NULL, NULL, ichsmb_rescan, ichsmb_chdet, 0);
+ichsmb_match, ichsmb_attach, ichsmb_detach, NULL, ichsmb_rescan,
+ichsmb_chdet, 0);
 
 
 static int
@@ -147,13 +151,13 @@ ichsmb_attach(device_t parent, device_t 
 	struct ichsmb_softc *sc = device_private(self);
 	struct pci_attach_args *pa = aux;
 	pcireg_t conf;
-	bus_size_t iosize;
 	pci_intr_handle_t ih;
 	const char *intrstr = NULL;
 	char intrbuf[PCI_INTRSTR_LEN];
 	int flags;
 
 	sc->sc_dev = self;
+	sc->sc_pc = pa->pa_pc;
 
 	pci_aprint_devinfo(pa, NULL);
 
@@ -168,12 +172,13 @@ ichsmb_attach(device_t parent, device_t 
 
 	/* Map I/O space */
 	if (pci_mapreg_map(pa, LPCIB_SMB_BASE, PCI_MAPREG_TYPE_IO, 0,
-	>sc_iot, >sc_ioh, NULL, )) {
+	>sc_iot, >sc_ioh, NULL, >sc_size)) {
 		aprint_error_dev(self, "can't map I/O space\n");
 		goto out;
 	}
 
 	sc->sc_poll = 1;
+	sc->sc_ih = NULL;
 	if (conf & LPCIB_SMB_HOSTC_SMIEN) {
 		/* No PCI IRQ */
 		aprint_normal_dev(self, "interrupting at SMI\n");
@@ -229,6 +234,28 @@ ichsmb_rescan(device_t self, const char 
 	return 0;
 }
 
+static int
+ichsmb_detach(device_t self, int flags)
+{
+	struct ichsmb_softc *sc = device_private(self);
+	int error;
+
+	if (sc->sc_i2c_device) {
+		error = config_detach(sc->sc_i2c_device, flags);
+		if (error)
+			return error;
+	}
+
+	mutex_destroy(>sc_i2c_mutex);
+
+	if (sc->sc_ih)
+		pci_intr_disestablish(sc->sc_pc, sc->sc_ih);
+
+	bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size);
+
+	return 0;
+}
+
 static void
 ichsmb_chdet(device_t self, device_t child)
 {
@@ -236,7 +263,6 @@ ichsmb_chdet(device_t self, device_t chi
 
 	if (sc->sc_i2c_device == child)
 		sc->sc_i2c_device = NULL;
-
 }
 
 static int



CVS commit: src/tests/lib/libpthread

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 21:36:50 UTC 2018

Modified Files:
src/tests/lib/libpthread: t_swapcontext.c

Log Message:
Simplify - it's enough to set nctx.uc_link to  to restore old
context automatically when swapfunc() returns.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/tests/lib/libpthread/t_swapcontext.c

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

Modified files:

Index: src/tests/lib/libpthread/t_swapcontext.c
diff -u src/tests/lib/libpthread/t_swapcontext.c:1.8 src/tests/lib/libpthread/t_swapcontext.c:1.9
--- src/tests/lib/libpthread/t_swapcontext.c:1.8	Wed Feb 28 21:29:10 2018
+++ src/tests/lib/libpthread/t_swapcontext.c	Wed Feb 28 21:36:50 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_swapcontext.c,v 1.8 2018/02/28 21:29:10 uwe Exp $ */
+/* $NetBSD: t_swapcontext.c,v 1.9 2018/02/28 21:36:50 uwe Exp $ */
 
 /*
  * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_swapcontext.c,v 1.8 2018/02/28 21:29:10 uwe Exp $");
+__RCSID("$NetBSD: t_swapcontext.c,v 1.9 2018/02/28 21:36:50 uwe Exp $");
 
 #include 
 #include 
@@ -61,11 +61,6 @@ swapfunc(void)
 
 	ATF_REQUIRE_EQ(oself, nself);
 	printf("Test succeeded\n");
-	/* Go back in main */
-	ATF_REQUIRE(swapcontext(, ));
-
-	/* NOTREACHED */
-	return;
 }
 
 /* ARGSUSED0 */
@@ -74,6 +69,7 @@ threadfunc(void *arg)
 {
 	nctx.uc_stack.ss_sp = stack;
 	nctx.uc_stack.ss_size = sizeof(stack);
+	nctx.uc_link = 
 
 	makecontext(, swapfunc, 0);
 



CVS commit: src/tests/lib/libpthread

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 21:29:11 UTC 2018

Modified Files:
src/tests/lib/libpthread: t_swapcontext.c

Log Message:
Add missing $ in the RCSID.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libpthread/t_swapcontext.c

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

Modified files:

Index: src/tests/lib/libpthread/t_swapcontext.c
diff -u src/tests/lib/libpthread/t_swapcontext.c:1.7 src/tests/lib/libpthread/t_swapcontext.c:1.8
--- src/tests/lib/libpthread/t_swapcontext.c:1.7	Tue Feb 27 20:34:04 2018
+++ src/tests/lib/libpthread/t_swapcontext.c	Wed Feb 28 21:29:10 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_swapcontext.c,v 1.7 2018/02/27 20:34:04 uwe Exp $ */
+/* $NetBSD: t_swapcontext.c,v 1.8 2018/02/28 21:29:10 uwe Exp $ */
 
 /*
  * Copyright (c) 2012 Emmanuel Dreyfus. All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__RCSID("$NetBSD");
+__RCSID("$NetBSD: t_swapcontext.c,v 1.8 2018/02/28 21:29:10 uwe Exp $");
 
 #include 
 #include 



CVS commit: src/lib/libc/arch/powerpc

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 21:00:02 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc: genassym.cf

Log Message:
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.

(oops, forgot to commit this along with swapcontext.S)


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/powerpc/genassym.cf

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

Modified files:

Index: src/lib/libc/arch/powerpc/genassym.cf
diff -u src/lib/libc/arch/powerpc/genassym.cf:1.4 src/lib/libc/arch/powerpc/genassym.cf:1.5
--- src/lib/libc/arch/powerpc/genassym.cf:1.4	Fri Aug 30 21:28:59 2013
+++ src/lib/libc/arch/powerpc/genassym.cf	Wed Feb 28 21:00:02 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.4 2013/08/30 21:28:59 matt Exp $
+#	$NetBSD: genassym.cf,v 1.5 2018/02/28 21:00:02 uwe Exp $
 
 #
 # Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ define CALLFRAME_R31	offsetof(struct cal
 
 define UC_GREGS_R1	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1])
 define UC_GREGS_R3	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3])
+define UC_GREGS_R30	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R30])
 define UC_GREGS_PC	offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
 
 define SIG_BLOCK	SIG_BLOCK



CVS commit: src/lib/libc/arch/powerpc/gen

2018-02-28 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Wed Feb 28 20:51:58 UTC 2018

Modified Files:
src/lib/libc/arch/powerpc/gen: swapcontext.S

Log Message:
PIC code clobbers %r30 so we need to update the saved oucp with
caller's %r30 manually.  Makes old context happy when it needs to do
more function calls after restore.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/swapcontext.S

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

Modified files:

Index: src/lib/libc/arch/powerpc/gen/swapcontext.S
diff -u src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7 src/lib/libc/arch/powerpc/gen/swapcontext.S:1.8
--- src/lib/libc/arch/powerpc/gen/swapcontext.S:1.7	Thu Sep 12 15:36:15 2013
+++ src/lib/libc/arch/powerpc/gen/swapcontext.S	Wed Feb 28 20:51:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $	*/
+/*	$NetBSD: swapcontext.S,v 1.8 2018/02/28 20:51:58 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
 #include "SYS.h"
 #include "assym.h"
 
-__RCSID("$NetBSD: swapcontext.S,v 1.7 2013/09/12 15:36:15 joerg Exp $")
+__RCSID("$NetBSD: swapcontext.S,v 1.8 2018/02/28 20:51:58 uwe Exp $")
 
 #define	XCALLFRAMELEN	(((2+3)*SZREG + CALLFRAMELEN - 1) & -CALLFRAMELEN)
 #define	XCALLFRAME_R30	(XCALLFRAMELEN-1*SZREG)
@@ -57,6 +57,10 @@ ENTRY(swapcontext)
 	stw	%r0,UC_GREGS_PC(%r11)		# pc <- lr
 	addi	%r0,%r1,XCALLFRAMELEN
 	stw	%r0,UC_GREGS_R1(%r11)		# adjust sp
+#ifdef __PIC__
+	lwz	%r0,XCALLFRAME_R30(%r1)
+	stw	%r0,UC_GREGS_R30(%r11)		# caller's r30
+#endif
 	lwz	%r3,XCALLFRAME_UCP(%r1)		# load ucp
 	bl	PIC_PLT(_C_LABEL(setcontext))	# setcontext(ucp)
 1:



CVS commit: src/distrib/notes/common

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb 28 20:13:09 UTC 2018

Modified Files:
src/distrib/notes/common: main

Log Message:
prune 5.x upgrade section


To generate a diff of this commit:
cvs rdiff -u -r1.541 -r1.542 src/distrib/notes/common/main

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

Modified files:

Index: src/distrib/notes/common/main
diff -u src/distrib/notes/common/main:1.541 src/distrib/notes/common/main:1.542
--- src/distrib/notes/common/main:1.541	Thu Jan 25 04:48:45 2018
+++ src/distrib/notes/common/main	Wed Feb 28 20:13:09 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: main,v 1.541 2018/01/25 04:48:45 yamaguchi Exp $
+.\"	$NetBSD: main,v 1.542 2018/02/28 20:13:09 snj Exp $
 .\"
 .\" Copyright (c) 1999-2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -801,39 +801,6 @@ again.
 .enum)
 .
 .\}
-.Ss2 Issues affecting an upgrade from NetBSD 5.x releases
-.Pp
-See the section below on upgrading from NetBSD 6.x as well.
-.Pp
-The following users need to be created:
-.(bullet -compact -offset indent
-_mdnsd
-.It
-_tests
-.It
-_tcpdump
-.It
-_tss
-.bullet)
-.Pp
-The following groups need to be created:
-.(bullet -compact -offset indent
-_mdnsd
-.It
-_tests
-.It
-_tcpdump
-.It
-_tss
-.bullet)
-.Pp
-The implementation of SHA2-HMAC in KAME_IPSEC as used in
-.Nx
-5.0 and before did not comply with current standards.
-FAST_IPSEC does, with the result that old and new systems cannot
-communicate over IPSEC if one of the affected authentication
-algorithms (hmac_sha256, hmac_sha384, hmac_sha512) is used.
-.
 .Ss2 Issues affecting an upgrade from NetBSD 6.x releases
 .Pp
 The following user needs to be created:



CVS commit: src/sys/arch/powerpc/powerpc

2018-02-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb 28 20:11:09 UTC 2018

Modified Files:
src/sys/arch/powerpc/powerpc: db_trace.c

Log Message:
switch an assert in backtrace to an error return.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/powerpc/powerpc/db_trace.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/db_trace.c
diff -u src/sys/arch/powerpc/powerpc/db_trace.c:1.57 src/sys/arch/powerpc/powerpc/db_trace.c:1.58
--- src/sys/arch/powerpc/powerpc/db_trace.c:1.57	Tue Dec 13 11:03:52 2011
+++ src/sys/arch/powerpc/powerpc/db_trace.c	Wed Feb 28 20:11:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_trace.c,v 1.57 2011/12/13 11:03:52 kiyohara Exp $	*/
+/*	$NetBSD: db_trace.c,v 1.58 2018/02/28 20:11:09 mrg Exp $	*/
 /*	$OpenBSD: db_trace.c,v 1.3 1997/03/21 02:10:48 niklas Exp $	*/
 
 /*
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.57 2011/12/13 11:03:52 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_trace.c,v 1.58 2018/02/28 20:11:09 mrg Exp $");
 
 #include "opt_ppcarch.h"
 
@@ -161,7 +161,10 @@ db_stack_trace_print(db_expr_t addr, boo
 	return;
 }
 l = LIST_FIRST(>p_lwps);
-KASSERT(l != NULL);
+if (l == NULL) {
+	(*pr)("trace: no LWP?\n");
+	return;
+}
 			}
 			(*pr)("lid %d ", l->l_lid);
 			pcb = lwp_getpcb(l);



CVS commit: src/distrib/notes/vax

2018-02-28 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Wed Feb 28 20:09:29 UTC 2018

Modified Files:
src/distrib/notes/vax: upgrade

Log Message:
vax folks probably aren't the _most_ interested in current developments,
but i think most of them probably know, 16 years later, that we switched
from a.out to ELF.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/notes/vax/upgrade

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

Modified files:

Index: src/distrib/notes/vax/upgrade
diff -u src/distrib/notes/vax/upgrade:1.8 src/distrib/notes/vax/upgrade:1.9
--- src/distrib/notes/vax/upgrade:1.8	Sun Jun 30 13:03:41 2002
+++ src/distrib/notes/vax/upgrade	Wed Feb 28 20:09:29 2018
@@ -1,32 +1,3 @@
-.\"	$NetBSD: upgrade,v 1.8 2002/06/30 13:03:41 lukem Exp $
+.\"	$NetBSD: upgrade,v 1.9 2018/02/28 20:09:29 snj Exp $
 .
 .so ../common/upgrade
-.Pp
-.Nx*M
-has switched its executable format from the old a.out format
-to ELF, the now more commonly used and supported format.
-Your old binaries will continue to work just fine.
-The installation procedure will try to take the necessary steps to
-accomplish this.
-The most important step is to move the old a.out shared libraries in
-.Pa /usr/lib
-and
-.Pa /usr/X11R6/lib
-(if X was installed) to
-.Pa /emul/aout ,
-where they will be automatically found if an older a.out binary
-is executed.
-.Ic sysinst
-will use an existing
-.Pa /emul
-and / or
-.Pa /emul/aout
-directory if available, and will create it (as a symbolic link to
-.Pa /usr/aout )
-if necessary.
-.Pp
-If you already had a
-.Pa /emul
-directory, or a symbolic link by that name,
-.Ic sysinst
-should rename it and tell you about it.



CVS commit: [netbsd-8] src/doc

2018-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 28 18:55:54 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #594 and #595


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.134 -r1.1.2.135 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.134 src/doc/CHANGES-8.0:1.1.2.135
--- src/doc/CHANGES-8.0:1.1.2.134	Tue Feb 27 09:08:22 2018
+++ src/doc/CHANGES-8.0	Wed Feb 28 18:55:54 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.134 2018/02/27 09:08:22 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.135 2018/02/28 18:55:54 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -9989,3 +9989,15 @@ sys/uvm/uvm_fault.c1.202
 	Allow only one pending call to a pool's backing allocator at a time.
 	[mrg, ticket #593]
 
+lib/librumphijack/hijack.c			1.123
+
+	Since ln(1) now uses linkat(2) provide a wrapper.
+	[maya, ticket #594]
+
+sys/net/if.c	1.398
+sys/net/rtsock.c1.231
+
+	Remove useless cast, initialize family.
+	Avoid using a zero family mask.
+	[mrg, ticket #595]
+



CVS commit: [netbsd-8] src/sys/net

2018-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 28 18:54:43 UTC 2018

Modified Files:
src/sys/net [netbsd-8]: if.c rtsock.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #595):
sys/net/if.c: revision 1.398
sys/net/rtsock.c: revision 1.231
remove useless cast, initialize family.
Avoid using a zero family mask.


To generate a diff of this commit:
cvs rdiff -u -r1.394.2.8 -r1.394.2.9 src/sys/net/if.c
cvs rdiff -u -r1.213.2.6 -r1.213.2.7 src/sys/net/rtsock.c

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

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.394.2.8 src/sys/net/if.c:1.394.2.9
--- src/sys/net/if.c:1.394.2.8	Sun Feb 11 21:17:34 2018
+++ src/sys/net/if.c	Wed Feb 28 18:54:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.394.2.8 2018/02/11 21:17:34 snj Exp $	*/
+/*	$NetBSD: if.c,v 1.394.2.9 2018/02/28 18:54:43 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.8 2018/02/11 21:17:34 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.394.2.9 2018/02/28 18:54:43 martin Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -450,13 +450,14 @@ if_dl_create(const struct ifnet *ifp, co
 	addrlen = ifp->if_addrlen;
 	socksize = roundup(sockaddr_dl_measure(namelen, addrlen), sizeof(long));
 	ifasize = sizeof(*ifa) + 2 * socksize;
-	ifa = (struct ifaddr *)malloc(ifasize, M_IFADDR, M_WAITOK|M_ZERO);
+	ifa = malloc(ifasize, M_IFADDR, M_WAITOK|M_ZERO);
 
 	sdl = (struct sockaddr_dl *)(ifa + 1);
 	mask = (struct sockaddr_dl *)(socksize + (char *)sdl);
 
 	sockaddr_dl_init(sdl, socksize, ifp->if_index, ifp->if_type,
 	ifp->if_xname, namelen, NULL, addrlen);
+	mask->sdl_family = AF_LINK;
 	mask->sdl_len = sockaddr_dl_measure(namelen, 0);
 	memset(>sdl_data[0], 0xff, namelen);
 	ifa->ifa_rtrequest = link_rtrequest;

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.213.2.6 src/sys/net/rtsock.c:1.213.2.7
--- src/sys/net/rtsock.c:1.213.2.6	Sat Feb  3 22:07:26 2018
+++ src/sys/net/rtsock.c	Wed Feb 28 18:54:43 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.213.2.6 2018/02/03 22:07:26 snj Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.213.2.7 2018/02/28 18:54:43 martin Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.6 2018/02/03 22:07:26 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.213.2.7 2018/02/28 18:54:43 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -836,8 +836,13 @@ COMPATNAME(route_output)(struct mbuf *m,
 	 * (padded with 0's). We keep the original length of the sockaddr.
 	 */
 	if (info.rti_info[RTAX_NETMASK]) {
+		/*
+		 * Use the family of RTAX_DST, because RTAX_NETMASK
+		 * can have a zero family if it comes from the radix
+		 * tree via rt_mask().
+		 */
 		socklen_t sa_len = sockaddr_getsize_by_family(
-		info.rti_info[RTAX_NETMASK]->sa_family);
+		info.rti_info[RTAX_DST]->sa_family);
 		socklen_t masklen = sockaddr_getlen(
 		info.rti_info[RTAX_NETMASK]);
 		if (sa_len != 0 && sa_len > masklen) {



CVS commit: [netbsd-8] src/lib/librumphijack

2018-02-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Feb 28 18:53:06 UTC 2018

Modified Files:
src/lib/librumphijack [netbsd-8]: hijack.c

Log Message:
Pull up following revision(s) (requested by maya in ticket #594):
lib/librumphijack/hijack.c: revision 1.123
since ln(1) now uses linkat(2) provide a dumb wrapper.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.122.4.1 src/lib/librumphijack/hijack.c

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

Modified files:

Index: src/lib/librumphijack/hijack.c
diff -u src/lib/librumphijack/hijack.c:1.122 src/lib/librumphijack/hijack.c:1.122.4.1
--- src/lib/librumphijack/hijack.c:1.122	Thu Feb 16 08:08:01 2017
+++ src/lib/librumphijack/hijack.c	Wed Feb 28 18:53:06 2018
@@ -1,4 +1,4 @@
-/*  $NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $	*/
+/*  $NetBSD: hijack.c,v 1.122.4.1 2018/02/28 18:53:06 martin Exp $	*/
 
 /*-
  * Copyright (c) 2011 Antti Kantee.  All Rights Reserved.
@@ -34,7 +34,7 @@
 #include 
 
 #if !defined(lint)
-__RCSID("$NetBSD: hijack.c,v 1.122 2017/02/16 08:08:01 ozaki-r Exp $");
+__RCSID("$NetBSD: hijack.c,v 1.122.4.1 2018/02/28 18:53:06 martin Exp $");
 #endif
 
 #include 
@@ -163,6 +163,9 @@ enum dualcall {
 #ifdef HAVE___QUOTACTL
 	DUALCALL_QUOTACTL,
 #endif
+#ifdef __NetBSD__
+	DUALCALL_LINKAT,
+#endif
 	DUALCALL__NUM
 };
 
@@ -379,6 +382,9 @@ struct sysnames {
 	{ DUALCALL_QUOTACTL,	"__quotactl",	RSYS_NAME(__QUOTACTL)	},
 #endif /* HAVE___QUOTACTL */
 
+#ifdef __NetBSD__
+	{ DUALCALL_LINKAT,	"linkat",	RSYS_NAME(LINKAT)	},
+#endif
 };
 #undef S
 
@@ -1271,6 +1277,19 @@ moveish(const char *from, const char *to
 	return op(from, to);
 }
 
+#ifdef __NetBSD__
+int
+linkat(int fromfd, const char *from, int tofd, const char *to, int flags)
+{
+	if (fromfd != AT_FDCWD || tofd != AT_FDCWD
+	|| flags != AT_SYMLINK_FOLLOW)
+		return ENOSYS;
+
+	return moveish(from, to,
+	GETSYSCALL(rump, LINK), GETSYSCALL(host, LINK));
+}
+#endif
+
 int
 link(const char *from, const char *to)
 {



CVS commit: src/sys/dev/pci

2018-02-28 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Wed Feb 28 18:03:48 UTC 2018

Modified Files:
src/sys/dev/pci: if_vr.c

Log Message:
Cosmetic printf/aprint changes.
Add missing return statement after failed pci_intr_establish().


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/dev/pci/if_vr.c

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

Modified files:

Index: src/sys/dev/pci/if_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.122 src/sys/dev/pci/if_vr.c:1.123
--- src/sys/dev/pci/if_vr.c:1.122	Wed Feb 28 17:13:44 2018
+++ src/sys/dev/pci/if_vr.c	Wed Feb 28 18:03:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.122 2018/02/28 17:13:44 flxd Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.123 2018/02/28 18:03:48 flxd Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.122 2018/02/28 17:13:44 flxd Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.123 2018/02/28 18:03:48 flxd Exp $");
 
 
 
@@ -436,8 +436,7 @@ vr_mii_statchg(struct ifnet *ifp)
 		}
 		if (i == 0) {
 #ifdef VR_DEBUG
-			printf("%s: rx shutdown error!\n",
-			device_xname(sc->vr_dev));
+			aprint_error_dev(sc->vr_dev, "rx shutdown error!\n");
 #endif
 			sc->vr_flags |= VR_F_RESTART;
 		}
@@ -522,12 +521,12 @@ vr_reset(struct vr_softc *sc)
 	}
 	if (i == VR_TIMEOUT) {
 		if (sc->vr_revid < REV_ID_VT3065_A) {
-			printf("%s: reset never completed!\n",
-			device_xname(sc->vr_dev));
+			aprint_error_dev(sc->vr_dev,
+			"reset never completed!\n");
 		} else {
 			/* Use newer force reset command */
-			printf("%s: using force reset command.\n",
-			device_xname(sc->vr_dev));
+			aprint_normal_dev(sc->vr_dev,
+			"using force reset command.\n");
 			VR_SETBIT(sc, VR_MISC_CR1, VR_MISCCR1_FORSRST);
 		}
 	}
@@ -649,7 +648,7 @@ vr_rxeof(struct vr_softc *sc)
 errstr = "unknown rx error";
 break;
 			}
-			printf("%s: receive error: %s\n", device_xname(sc->vr_dev),
+			aprint_error_dev(sc->vr_dev, "receive error: %s\n",
 			errstr);
 
 			VR_INIT_RXDESC(sc, i);
@@ -664,10 +663,10 @@ vr_rxeof(struct vr_softc *sc)
 			 */
 			ifp->if_ierrors++;
 
-			printf("%s: receive error: incomplete frame; "
-			   "size = %d, status = 0x%x\n",
-			   device_xname(sc->vr_dev),
-			   VR_RXBYTES(le32toh(d->vr_status)), rxstat);
+			aprint_error_dev(sc->vr_dev,
+			"receive error: incomplete frame; "
+			"size = %d, status = 0x%x\n",
+			VR_RXBYTES(le32toh(d->vr_status)), rxstat);
 
 			VR_INIT_RXDESC(sc, i);
 
@@ -688,9 +687,9 @@ vr_rxeof(struct vr_softc *sc)
 			 */
 			ifp->if_ierrors++;
 
-			printf("%s: receive error: zero-length packet; "
-			   "status = 0x%x\n",
-			   device_xname(sc->vr_dev), rxstat);
+			aprint_error_dev(sc->vr_dev,
+			"receive error: zero-length packet; "
+			"status = 0x%x\n", rxstat);
 
 			VR_INIT_RXDESC(sc, i);
 
@@ -805,8 +804,7 @@ vr_rxeoc(struct vr_softc *sc)
 	}
 	if (i == VR_TIMEOUT) {
 		/* XXX need reset? */
-		printf("%s: RX shutdown never complete\n",
-		device_xname(sc->vr_dev));
+		aprint_error_dev(sc->vr_dev, "RX shutdown never completed\n");
 	}
 
 	vr_rxeof(sc);
@@ -854,8 +852,8 @@ vr_txeof(struct vr_softc *sc)
 			}
 			if (j == VR_TIMEOUT) {
 /* XXX need reset? */
-printf("%s: TX shutdown never complete\n",
-device_xname(sc->vr_dev));
+aprint_error_dev(sc->vr_dev,
+"TX shutdown never completed\n");
 			}
 			d->vr_status = htole32(VR_TXSTAT_OWN);
 			CSR_WRITE_4(sc, VR_TXADDR, VR_CDTXADDR(sc, i));
@@ -930,7 +928,7 @@ vr_intr(void *arg)
 			vr_rxeof(sc);
 
 		if (status & VR_ISR_RX_DROPPED) {
-			printf("%s: rx packet lost\n", device_xname(sc->vr_dev));
+			aprint_error_dev(sc->vr_dev, "rx packet lost\n");
 			ifp->if_ierrors++;
 		}
 
@@ -941,11 +939,10 @@ vr_intr(void *arg)
 
 		if (status & (VR_ISR_BUSERR | VR_ISR_TX_UNDERRUN)) {
 			if (status & VR_ISR_BUSERR)
-printf("%s: PCI bus error\n",
-device_xname(sc->vr_dev));
+aprint_error_dev(sc->vr_dev, "PCI bus error\n");
 			if (status & VR_ISR_TX_UNDERRUN)
-printf("%s: transmit underrun\n",
-device_xname(sc->vr_dev));
+aprint_error_dev(sc->vr_dev,
+"transmit underrun\n");
 			/* vr_init() calls vr_start() */
 			dotx = 0;
 			(void)vr_init(ifp);
@@ -960,11 +957,11 @@ vr_intr(void *arg)
 		if (status &
 		(VR_ISR_TX_ABRT | VR_ISR_TX_ABRT2 | VR_ISR_TX_UDFI)) {
 			if (status & (VR_ISR_TX_ABRT | VR_ISR_TX_ABRT2))
-printf("%s: transmit aborted\n",
-device_xname(sc->vr_dev));
+aprint_error_dev(sc->vr_dev,
+"transmit aborted\n");
 			if (status & VR_ISR_TX_UDFI)
-printf("%s: transmit underflow\n",
-device_xname(sc->vr_dev));
+aprint_error_dev(sc->vr_dev,
+"transmit underflow\n");
 			ifp->if_oerrors++;
 			dotx = 1;
 			vr_txeof(sc);
@@ -1045,15 +1042,15 @@ vr_start(struct ifnet *ifp)
 		 

CVS commit: src/sys/dev/pci

2018-02-28 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Wed Feb 28 17:13:44 UTC 2018

Modified Files:
src/sys/dev/pci: if_vr.c if_vrreg.h

Log Message:
Cosmetic fix for the Physical Address Registers PAR0 to PAR5.


To generate a diff of this commit:
cvs rdiff -u -r1.121 -r1.122 src/sys/dev/pci/if_vr.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/pci/if_vrreg.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/dev/pci/if_vr.c
diff -u src/sys/dev/pci/if_vr.c:1.121 src/sys/dev/pci/if_vr.c:1.122
--- src/sys/dev/pci/if_vr.c:1.121	Thu Dec 15 09:28:05 2016
+++ src/sys/dev/pci/if_vr.c	Wed Feb 28 17:13:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vr.c,v 1.121 2016/12/15 09:28:05 ozaki-r Exp $	*/
+/*	$NetBSD: if_vr.c,v 1.122 2018/02/28 17:13:44 flxd Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.121 2016/12/15 09:28:05 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vr.c,v 1.122 2018/02/28 17:13:44 flxd Exp $");
 
 
 
@@ -1594,8 +1594,7 @@ vr_attach(device_t parent, device_t self
 	 * Get station address. The way the Rhine chips work,
 	 * you're not allowed to directly access the EEPROM once
 	 * they've been programmed a special way. Consequently,
-	 * we need to read the node address from the PAR0 and PAR1
-	 * registers.
+	 * we need to read the node address from the PAR registers.
 	 *
 	 * XXXSCW: On the Rhine III, setting VR_EECSR_LOAD forces a reload
 	 * of the *whole* EEPROM, not just the MAC address. This is

Index: src/sys/dev/pci/if_vrreg.h
diff -u src/sys/dev/pci/if_vrreg.h:1.16 src/sys/dev/pci/if_vrreg.h:1.17
--- src/sys/dev/pci/if_vrreg.h:1.16	Sun Nov  5 13:05:18 2006
+++ src/sys/dev/pci/if_vrreg.h	Wed Feb 28 17:13:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vrreg.h,v 1.16 2006/11/05 13:05:18 tsutsui Exp $	*/
+/*	$NetBSD: if_vrreg.h,v 1.17 2018/02/28 17:13:44 flxd Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998
@@ -38,8 +38,12 @@
  * Rhine register definitions.
  */
 
-#define	VR_PAR0			0x00	/* node address 0 to 4 */
-#define	VR_PAR1			0x04	/* node address 2 to 6 */
+#define	VR_PAR0			0x00	/* node address 0 */
+#define	VR_PAR1			0x01	/* node address 1 */
+#define	VR_PAR2			0x02	/* node address 2 */
+#define	VR_PAR3			0x03	/* node address 3 */
+#define	VR_PAR4			0x04	/* node address 4 */
+#define	VR_PAR5			0x05	/* node address 5 */
 #define	VR_RXCFG		0x06	/* receiver config register */
 #define	VR_TXCFG		0x07	/* transmit config register */
 #define	VR_COMMAND		0x08	/* command register */



CVS commit: src/sys/net

2018-02-28 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Feb 28 13:12:53 UTC 2018

Modified Files:
src/sys/net: bridgestp.c

Log Message:
Remove an obsolete assertion too (fix build)

bif_refs was removed when migrated to use psref.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/net/bridgestp.c

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

Modified files:

Index: src/sys/net/bridgestp.c
diff -u src/sys/net/bridgestp.c:1.25 src/sys/net/bridgestp.c:1.26
--- src/sys/net/bridgestp.c:1.25	Wed Feb 28 10:34:04 2018
+++ src/sys/net/bridgestp.c	Wed Feb 28 13:12:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bridgestp.c,v 1.25 2018/02/28 10:34:04 ozaki-r Exp $	*/
+/*	$NetBSD: bridgestp.c,v 1.26 2018/02/28 13:12:53 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2000 Jason L. Wright (ja...@thought.net)
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bridgestp.c,v 1.25 2018/02/28 10:34:04 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bridgestp.c,v 1.26 2018/02/28 13:12:53 ozaki-r Exp $");
 
 #include 
 #include 
@@ -594,8 +594,6 @@ bstp_input(struct bridge_softc *sc, stru
 	struct bstp_tcn_unit tu;
 	uint16_t len;
 
-	KASSERT(bif->bif_refs > 0);
-
 	eh = mtod(m, struct ether_header *);
 
 	if ((bif->bif_flags & IFBIF_STP) == 0)



CVS commit: src/sys/netipsec

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 11:29:14 UTC 2018

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
add missing static


To generate a diff of this commit:
cvs rdiff -u -r1.148 -r1.149 src/sys/netipsec/ipsec.c

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

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.148 src/sys/netipsec/ipsec.c:1.149
--- src/sys/netipsec/ipsec.c:1.148	Wed Feb 28 10:16:19 2018
+++ src/sys/netipsec/ipsec.c	Wed Feb 28 11:29:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.148 2018/02/28 10:16:19 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.149 2018/02/28 11:29:14 maxv Exp $ */
 /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.148 2018/02/28 10:16:19 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.149 2018/02/28 11:29:14 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -1483,7 +1483,7 @@ ipsec_get_reqlevel(const struct ipsecreq
  * If the SP requires an IPsec packet, and the packet was neither AH nor ESP,
  * then kick it.
  */
-int
+static int
 ipsec_sp_reject(const struct secpolicy *sp, const struct mbuf *m)
 {
 	struct ipsecrequest *isr;



CVS commit: src/sys

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 11:23:24 UTC 2018

Modified Files:
src/sys/netinet: raw_ip.c tcp_input.c udp_usrreq.c
src/sys/netinet6: icmp6.c raw_ip6.c udp6_usrreq.c

Log Message:
Remove unused ipsec_private.h includes.


To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/netinet/raw_ip.c
cvs rdiff -u -r1.381 -r1.382 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.244 -r1.245 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.222 -r1.223 src/sys/netinet6/icmp6.c
cvs rdiff -u -r1.164 -r1.165 src/sys/netinet6/raw_ip6.c
cvs rdiff -u -r1.136 -r1.137 src/sys/netinet6/udp6_usrreq.c

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

Modified files:

Index: src/sys/netinet/raw_ip.c
diff -u src/sys/netinet/raw_ip.c:1.170 src/sys/netinet/raw_ip.c:1.171
--- src/sys/netinet/raw_ip.c:1.170	Wed Feb 28 11:10:22 2018
+++ src/sys/netinet/raw_ip.c	Wed Feb 28 11:23:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip.c,v 1.170 2018/02/28 11:10:22 maxv Exp $	*/
+/*	$NetBSD: raw_ip.c,v 1.171 2018/02/28 11:23:24 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.170 2018/02/28 11:10:22 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.171 2018/02/28 11:23:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -101,8 +101,7 @@ __KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1
 #ifdef IPSEC
 #include 
 #include 
-#include 
-#endif	/* IPSEC */
+#endif
 
 struct inpcbtable rawcbtable;
 

Index: src/sys/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.381 src/sys/netinet/tcp_input.c:1.382
--- src/sys/netinet/tcp_input.c:1.381	Wed Feb 28 11:09:03 2018
+++ src/sys/netinet/tcp_input.c	Wed Feb 28 11:23:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.381 2018/02/28 11:09:03 maxv Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.382 2018/02/28 11:23:24 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.381 2018/02/28 11:09:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.382 2018/02/28 11:23:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -227,7 +227,6 @@ __KERNEL_RCSID(0, "$NetBSD: tcp_input.c,
 #ifdef IPSEC
 #include 
 #include 
-#include 
 #include 
 #ifdef INET6
 #include 

Index: src/sys/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.244 src/sys/netinet/udp_usrreq.c:1.245
--- src/sys/netinet/udp_usrreq.c:1.244	Wed Feb 28 11:09:03 2018
+++ src/sys/netinet/udp_usrreq.c	Wed Feb 28 11:23:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.244 2018/02/28 11:09:03 maxv Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.245 2018/02/28 11:23:24 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.244 2018/02/28 11:09:03 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.245 2018/02/28 11:23:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -119,7 +119,6 @@ __KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c
 #ifdef IPSEC
 #include 
 #include 
-#include 
 #include 
 #ifdef INET6
 #include 

Index: src/sys/netinet6/icmp6.c
diff -u src/sys/netinet6/icmp6.c:1.222 src/sys/netinet6/icmp6.c:1.223
--- src/sys/netinet6/icmp6.c:1.222	Mon Feb 26 09:13:00 2018
+++ src/sys/netinet6/icmp6.c	Wed Feb 28 11:23:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: icmp6.c,v 1.222 2018/02/26 09:13:00 maxv Exp $	*/
+/*	$NetBSD: icmp6.c,v 1.223 2018/02/28 11:23:24 maxv Exp $	*/
 /*	$KAME: icmp6.c,v 1.217 2001/06/20 15:03:29 jinmei Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.222 2018/02/26 09:13:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.223 2018/02/28 11:23:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -105,12 +105,10 @@ __KERNEL_RCSID(0, "$NetBSD: icmp6.c,v 1.
 #ifdef IPSEC
 #include 
 #include 
-#include 
 #include 
 #include 
 #endif
 
-
 #include "faith.h"
 #if defined(NFAITH) && 0 < NFAITH
 #include 

Index: src/sys/netinet6/raw_ip6.c
diff -u src/sys/netinet6/raw_ip6.c:1.164 src/sys/netinet6/raw_ip6.c:1.165
--- src/sys/netinet6/raw_ip6.c:1.164	Mon Feb 26 09:13:00 2018
+++ src/sys/netinet6/raw_ip6.c	Wed Feb 28 11:23:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip6.c,v 1.164 2018/02/26 09:13:00 maxv Exp $	*/
+/*	$NetBSD: raw_ip6.c,v 1.165 2018/02/28 11:23:24 maxv Exp $	*/
 /*	$KAME: raw_ip6.c,v 1.82 2001/07/23 18:57:56 jinmei Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.164 2018/02/26 09:13:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.165 2018/02/28 11:23:24 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -100,7 +100,6 @@ __KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 
 #ifdef IPSEC
 #include 
 #include 
-#include 
 #include 
 #endif
 


CVS commit: src/sys/netipsec

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 11:19:49 UTC 2018

Modified Files:
src/sys/netipsec: ipsec_private.h

Log Message:
Remove unused macros, and while here style.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/netipsec/ipsec_private.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/netipsec/ipsec_private.h
diff -u src/sys/netipsec/ipsec_private.h:1.6 src/sys/netipsec/ipsec_private.h:1.7
--- src/sys/netipsec/ipsec_private.h:1.6	Wed Feb 28 11:09:03 2018
+++ src/sys/netipsec/ipsec_private.h	Wed Feb 28 11:19:49 2018
@@ -1,6 +1,6 @@
-/*	$NetBSD: ipsec_private.h,v 1.6 2018/02/28 11:09:03 maxv Exp $	*/
+/*	$NetBSD: ipsec_private.h,v 1.7 2018/02/28 11:19:49 maxv Exp $	*/
 
-/*-
+/*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -35,21 +35,18 @@
 #ifdef _KERNEL
 #include 
 
-extern	percpu_t *ipsecstat_percpu;
-extern	percpu_t *ahstat_percpu;
-extern	percpu_t *espstat_percpu;
-extern	percpu_t *ipcompstat_percpu;
-extern	percpu_t *ipipstat_percpu;
-extern	percpu_t *pfkeystat_percpu;
+extern percpu_t *ipsecstat_percpu;
+extern percpu_t *ahstat_percpu;
+extern percpu_t *espstat_percpu;
+extern percpu_t *ipcompstat_percpu;
+extern percpu_t *ipipstat_percpu;
+extern percpu_t *pfkeystat_percpu;
 
 #define	IPSEC_STAT_GETREF()	_NET_STAT_GETREF(ipsecstat_percpu)
 #define	IPSEC_STAT_PUTREF()	_NET_STAT_PUTREF(ipsecstat_percpu)
 #define	IPSEC_STATINC(x)	_NET_STATINC(ipsecstat_percpu, x)
 #define	IPSEC_STATADD(x, v)	_NET_STATADD(ipsecstat_percpu, x, v)
 
-#define	IPSEC6_STAT_GETREF()	IPSEC_STAT_GETREF()
-#define	IPSEC6_STAT_PUTREF()	IPSEC_STAT_PUTREF()
-
 #define	AH_STATINC(x)		_NET_STATINC(ahstat_percpu, x)
 #define	AH_STATADD(x, v)	_NET_STATADD(ahstat_percpu, x, v)
 
@@ -90,14 +87,16 @@ extern	percpu_t *pfkeystat_percpu;
 #include  /* for softnet_lock */
 
 #define IPSEC_DECLARE_LOCK_VARIABLE	int __s
-#define IPSEC_ACQUIRE_GLOBAL_LOCKS()	do {	\
-	__s = splsoftnet();		\
-	mutex_enter(softnet_lock);	\
-} while (0)
-#define IPSEC_RELEASE_GLOBAL_LOCKS()	do {	\
-	mutex_exit(softnet_lock);	\
-	splx(__s);			\
-} while (0)
+#define IPSEC_ACQUIRE_GLOBAL_LOCKS()	\
+	do {	\
+		__s = splsoftnet();		\
+		mutex_enter(softnet_lock);	\
+	} while (0)
+#define IPSEC_RELEASE_GLOBAL_LOCKS()	\
+	do {	\
+		mutex_exit(softnet_lock);	\
+		splx(__s);			\
+	} while (0)
 #endif
 
 #endif /* _KERNEL */



CVS commit: src/sys/netinet

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 11:10:22 UTC 2018

Modified Files:
src/sys/netinet: raw_ip.c

Log Message:
(just forgot to commit this file, the message was)

Remove duplicate IPSEC_STATINC(IPSEC_STAT_IN_POLVIO), ipsec_in_reject
already increases it. IPSEC6_STATINC is now unused, so remove it too.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/netinet/raw_ip.c

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

Modified files:

Index: src/sys/netinet/raw_ip.c
diff -u src/sys/netinet/raw_ip.c:1.169 src/sys/netinet/raw_ip.c:1.170
--- src/sys/netinet/raw_ip.c:1.169	Mon Feb 26 09:04:29 2018
+++ src/sys/netinet/raw_ip.c	Wed Feb 28 11:10:22 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip.c,v 1.169 2018/02/26 09:04:29 maxv Exp $	*/
+/*	$NetBSD: raw_ip.c,v 1.170 2018/02/28 11:10:22 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.169 2018/02/26 09:04:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip.c,v 1.170 2018/02/28 11:10:22 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -205,7 +205,6 @@ rip_input(struct mbuf *m, ...)
 #if defined(IPSEC)
 		/* check AH/ESP integrity. */
 		else if (ipsec_used && ipsec_in_reject(m, last)) {
-			IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 			/* do not inject data to pcb */
 		}
 #endif /*IPSEC*/
@@ -220,7 +219,6 @@ rip_input(struct mbuf *m, ...)
 	/* check AH/ESP integrity. */
 	if (ipsec_used && last != NULL && ipsec_in_reject(m, last)) {
 		m_freem(m);
-		IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 		IP_STATDEC(IP_STAT_DELIVERED);
 		/* do not inject data to pcb */
 	} else



CVS commit: src/sys

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 11:09:03 UTC 2018

Modified Files:
src/sys/netinet: tcp_input.c udp_usrreq.c
src/sys/netinet6: udp6_usrreq.c
src/sys/netipsec: ipsec_private.h

Log Message:
Remove duplicate IPSEC_STATINC(IPSEC_STAT_IN_POLVIO), ipsec_in_reject
already increases it. IPSEC6_STATINC is now unused, so remove it too.


To generate a diff of this commit:
cvs rdiff -u -r1.380 -r1.381 src/sys/netinet/tcp_input.c
cvs rdiff -u -r1.243 -r1.244 src/sys/netinet/udp_usrreq.c
cvs rdiff -u -r1.135 -r1.136 src/sys/netinet6/udp6_usrreq.c
cvs rdiff -u -r1.5 -r1.6 src/sys/netipsec/ipsec_private.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/netinet/tcp_input.c
diff -u src/sys/netinet/tcp_input.c:1.380 src/sys/netinet/tcp_input.c:1.381
--- src/sys/netinet/tcp_input.c:1.380	Mon Feb 26 09:04:29 2018
+++ src/sys/netinet/tcp_input.c	Wed Feb 28 11:09:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: tcp_input.c,v 1.380 2018/02/26 09:04:29 maxv Exp $	*/
+/*	$NetBSD: tcp_input.c,v 1.381 2018/02/28 11:09:03 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -148,7 +148,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.380 2018/02/26 09:04:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tcp_input.c,v 1.381 2018/02/28 11:09:03 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1461,14 +1461,12 @@ findpcb:
 			if (inp &&
 			(inp->inp_socket->so_options & SO_ACCEPTCONN) == 0
 			&& ipsec_in_reject(m, inp)) {
-IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 goto drop;
 			}
 #ifdef INET6
 			else if (in6p &&
 			(in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0
 			&& ipsec_in_reject(m, in6p)) {
-IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 goto drop;
 			}
 #endif
@@ -1506,7 +1504,6 @@ findpcb:
 		if (ipsec_used && in6p &&
 		(in6p->in6p_socket->so_options & SO_ACCEPTCONN) == 0 &&
 		ipsec_in_reject(m, in6p)) {
-			IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
 			goto drop;
 		}
 #endif /*IPSEC*/
@@ -1787,7 +1784,6 @@ nosave:;
 	sotoinpcb(so) == inp);
 	if (!ipsec_in_reject(m, inp))
 		break;
-	IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 	tp = NULL;
 	goto dropwithreset;
 #endif
@@ -1796,7 +1792,6 @@ nosave:;
 	KASSERT(sotoin6pcb(so) == in6p);
 	if (!ipsec_in_reject(m, in6p))
 		break;
-	IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
 	tp = NULL;
 	goto dropwithreset;
 #endif /*INET6*/

Index: src/sys/netinet/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.243 src/sys/netinet/udp_usrreq.c:1.244
--- src/sys/netinet/udp_usrreq.c:1.243	Mon Feb 26 09:04:29 2018
+++ src/sys/netinet/udp_usrreq.c	Wed Feb 28 11:09:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.243 2018/02/26 09:04:29 maxv Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.244 2018/02/28 11:09:03 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.243 2018/02/26 09:04:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.244 2018/02/28 11:09:03 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -480,7 +480,6 @@ udp4_sendup(struct mbuf *m, int off /* o
 #if defined(IPSEC)
 	/* check AH/ESP integrity. */
 	if (ipsec_used && ipsec_in_reject(m, inp)) {
-		IPSEC_STATINC(IPSEC_STAT_IN_POLVIO);
 		if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
 			icmp_error(n, ICMP_UNREACH, ICMP_UNREACH_ADMIN_PROHIBIT,
 			0, 0);

Index: src/sys/netinet6/udp6_usrreq.c
diff -u src/sys/netinet6/udp6_usrreq.c:1.135 src/sys/netinet6/udp6_usrreq.c:1.136
--- src/sys/netinet6/udp6_usrreq.c:1.135	Mon Feb 26 09:04:29 2018
+++ src/sys/netinet6/udp6_usrreq.c	Wed Feb 28 11:09:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: udp6_usrreq.c,v 1.135 2018/02/26 09:04:29 maxv Exp $ */
+/* $NetBSD: udp6_usrreq.c,v 1.136 2018/02/28 11:09:03 maxv Exp $ */
 /* $KAME: udp6_usrreq.c,v 1.86 2001/05/27 17:33:00 itojun Exp $ */
 /* $KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $ */
 
@@ -63,7 +63,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.135 2018/02/26 09:04:29 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp6_usrreq.c,v 1.136 2018/02/28 11:09:03 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -354,7 +354,6 @@ udp6_sendup(struct mbuf *m, int off /* o
 #if defined(IPSEC)
 	/* check AH/ESP integrity. */
 	if (ipsec_used && ipsec_in_reject(m, in6p)) {
-		IPSEC6_STATINC(IPSEC_STAT_IN_POLVIO);
 		if ((n = m_copypacket(m, M_DONTWAIT)) != NULL)
 			icmp6_error(n, ICMP6_DST_UNREACH,
 			ICMP6_DST_UNREACH_ADMIN, 0);

Index: src/sys/netipsec/ipsec_private.h
diff -u src/sys/netipsec/ipsec_private.h:1.5 src/sys/netipsec/ipsec_private.h:1.6
--- src/sys/netipsec/ipsec_private.h:1.5	Thu Jul 27 06:59:28 2017
+++ src/sys/netipsec/ipsec_private.h	Wed Feb 28 11:09:03 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

CVS commit: src/sys/net

2018-02-28 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Wed Feb 28 10:34:04 UTC 2018

Modified Files:
src/sys/net: bridgestp.c

Log Message:
Sweep obsolete BRIDGE_MPSAFE (it's always on now)


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/net/bridgestp.c

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

Modified files:

Index: src/sys/net/bridgestp.c
diff -u src/sys/net/bridgestp.c:1.24 src/sys/net/bridgestp.c:1.25
--- src/sys/net/bridgestp.c:1.24	Thu Mar  9 04:37:23 2017
+++ src/sys/net/bridgestp.c	Wed Feb 28 10:34:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bridgestp.c,v 1.24 2017/03/09 04:37:23 ozaki-r Exp $	*/
+/*	$NetBSD: bridgestp.c,v 1.25 2018/02/28 10:34:04 ozaki-r Exp $	*/
 
 /*
  * Copyright (c) 2000 Jason L. Wright (ja...@thought.net)
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bridgestp.c,v 1.24 2017/03/09 04:37:23 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bridgestp.c,v 1.25 2018/02/28 10:34:04 ozaki-r Exp $");
 
 #include 
 #include 
@@ -594,9 +594,7 @@ bstp_input(struct bridge_softc *sc, stru
 	struct bstp_tcn_unit tu;
 	uint16_t len;
 
-#ifdef BRIDGE_MPSAFE
 	KASSERT(bif->bif_refs > 0);
-#endif
 
 	eh = mtod(m, struct ether_header *);
 



CVS commit: src/sys

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 10:30:20 UTC 2018

Modified Files:
src/sys/netinet: ip_encap.h
src/sys/sys: mbuf.h

Log Message:
Remove unused mbuf tags.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/netinet/ip_encap.h
cvs rdiff -u -r1.177 -r1.178 src/sys/sys/mbuf.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/netinet/ip_encap.h
diff -u src/sys/netinet/ip_encap.h:1.23 src/sys/netinet/ip_encap.h:1.24
--- src/sys/netinet/ip_encap.h:1.23	Wed Nov 15 10:42:41 2017
+++ src/sys/netinet/ip_encap.h	Wed Feb 28 10:30:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_encap.h,v 1.23 2017/11/15 10:42:41 knakahara Exp $	*/
+/*	$NetBSD: ip_encap.h,v 1.24 2018/02/28 10:30:20 maxv Exp $	*/
 /*	$KAME: ip_encap.h,v 1.7 2000/03/25 07:23:37 sumikawa Exp $	*/
 
 /*
@@ -75,7 +75,7 @@ struct encaptab {
 	struct sockaddr *dstmask;
 	int (*func) (struct mbuf *, int, int, void *);
 	const struct encapsw *esw;
-	void *arg;			/* passed via PACKET_TAG_ENCAP */
+	void *arg;
 	struct psref_target	psref;
 };
 

Index: src/sys/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.177 src/sys/sys/mbuf.h:1.178
--- src/sys/sys/mbuf.h:1.177	Tue Feb 27 14:28:01 2018
+++ src/sys/sys/mbuf.h	Wed Feb 28 10:30:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.177 2018/02/27 14:28:01 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.178 2018/02/28 10:30:20 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -899,32 +899,16 @@ struct	m_tag *m_tag_next(struct mbuf *, 
 
 /* Packet tag types */
 #define PACKET_TAG_NONE0  /* Nothing */
-		   /* 1: Used to be VLAN ID */
-#define PACKET_TAG_ENCAP			2  /* encapsulation data */
-#define PACKET_TAG_ESP3  /* ESP information */
 #define PACKET_TAG_SO4  /* sending socket pointer */
 #define PACKET_TAG_PF11 /* packet filter */
 #define PACKET_TAG_ALTQ_QID			12 /* ALTQ queue id */
-
-#define PACKET_TAG_IPSEC_IN_CRYPTO_DONE		16
-#define PACKET_TAG_IPSEC_IN_DONE		17
 #define PACKET_TAG_IPSEC_OUT_DONE		18
-#define	PACKET_TAG_IPSEC_OUT_CRYPTO_NEEDED	19  /* NIC IPsec crypto req'ed */
-#define	PACKET_TAG_IPSEC_IN_COULD_DO_CRYPTO	20  /* NIC notifies IPsec */
-#define	PACKET_TAG_IPSEC_PENDING_TDB		21  /* Reminder to do IPsec */
-
-#define	PACKET_TAG_IPSEC_SOCKET			22 /* IPSEC socket ref */
-#define	PACKET_TAG_IPSEC_HISTORY		23 /* IPSEC history */
-
 #define	PACKET_TAG_IPSEC_NAT_T_PORTS		25 /* two uint16_t */
-
 #define	PACKET_TAG_INET6			26 /* IPv6 info */
-
 #define	PACKET_TAG_TUNNEL_INFO			28 /* tunnel identification and
 		* protocol callback, for
 		* loop detection/recovery
 		*/
-
 #define	PACKET_TAG_MPLS29 /* Indicate it's for MPLS */
 #define	PACKET_TAG_SRCROUTE			30 /* IPv4 source routing */
 



CVS commit: src/sys/netipsec

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 10:16:19 UTC 2018

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
Dedup: merge ipsec4_setspidx_inpcb and ipsec6_setspidx_in6pcb.


To generate a diff of this commit:
cvs rdiff -u -r1.147 -r1.148 src/sys/netipsec/ipsec.c

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

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.147 src/sys/netipsec/ipsec.c:1.148
--- src/sys/netipsec/ipsec.c:1.147	Wed Feb 28 10:09:17 2018
+++ src/sys/netipsec/ipsec.c	Wed Feb 28 10:16:19 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.147 2018/02/28 10:09:17 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.148 2018/02/28 10:16:19 maxv Exp $ */
 /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.147 2018/02/28 10:09:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.148 2018/02/28 10:16:19 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -170,10 +170,7 @@ struct secpolicy ip6_def_policy;
 int ip6_ipsec_ecn = 0;		/* ECN ignore(-1)/forbidden(0)/allowed(1) */
 #endif
 
-static int ipsec4_setspidx_inpcb(struct mbuf *, struct inpcb *);
-#ifdef INET6
-static int ipsec6_setspidx_in6pcb(struct mbuf *, struct in6pcb *);
-#endif
+static int ipsec_setspidx_inpcb(struct mbuf *, void *);
 static int ipsec_setspidx(struct mbuf *, struct secpolicyindex *, int);
 static void ipsec4_get_ulp(struct mbuf *m, struct secpolicyindex *, int);
 static int ipsec4_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *);
@@ -439,7 +436,7 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 	case AF_INET: {
 		struct inpcb *in4p = (struct inpcb *)inph;
 		/* set spidx in pcb */
-		*error = ipsec4_setspidx_inpcb(m, in4p);
+		*error = ipsec_setspidx_inpcb(m, in4p);
 		pcbsp = in4p->inp_sp;
 		break;
 		}
@@ -447,7 +444,7 @@ ipsec_getpolicybysock(struct mbuf *m, u_
 	case AF_INET6: {
 		struct in6pcb *in6p = (struct in6pcb *)inph;
 		/* set spidx in pcb */
-		*error = ipsec6_setspidx_in6pcb(m, in6p);
+		*error = ipsec_setspidx_inpcb(m, in6p);
 		pcbsp = in6p->in6p_sp;
 		break;
 		}
@@ -794,54 +791,29 @@ ipsec4_forward(struct mbuf *m, int *dest
 }
 
 static int
-ipsec4_setspidx_inpcb(struct mbuf *m, struct inpcb *pcb)
+ipsec_setspidx_inpcb(struct mbuf *m, void *pcb)
 {
+	struct inpcb_hdr *inph = (struct inpcb_hdr *)pcb;
 	int error;
 
-	KASSERT(pcb != NULL);
-	KASSERT(pcb->inp_sp != NULL);
-	KASSERT(pcb->inp_sp->sp_out != NULL);
-	KASSERT(pcb->inp_sp->sp_in != NULL);
-
-	error = ipsec_setspidx(m, >inp_sp->sp_in->spidx, 1);
-	if (error == 0) {
-		pcb->inp_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND;
-		pcb->inp_sp->sp_out->spidx = pcb->inp_sp->sp_in->spidx;
-		pcb->inp_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND;
-	} else {
-		memset(>inp_sp->sp_in->spidx, 0,
-		sizeof(pcb->inp_sp->sp_in->spidx));
-		memset(>inp_sp->sp_out->spidx, 0,
-		sizeof(pcb->inp_sp->sp_out->spidx));
-	}
-	return error;
-}
-
-#ifdef INET6
-static int
-ipsec6_setspidx_in6pcb(struct mbuf *m, struct in6pcb *pcb)
-{
-	int error;
-
-	KASSERT(pcb != NULL);
-	KASSERT(pcb->in6p_sp != NULL);
-	KASSERT(pcb->in6p_sp->sp_out != NULL);
-	KASSERT(pcb->in6p_sp->sp_in != NULL);
+	KASSERT(inph != NULL);
+	KASSERT(inph->inph_sp != NULL);
+	KASSERT(inph->inph_sp->sp_out != NULL);
+	KASSERT(inph->inph_sp->sp_in != NULL);
 
-	error = ipsec_setspidx(m, >in6p_sp->sp_in->spidx, 1);
+	error = ipsec_setspidx(m, >inph_sp->sp_in->spidx, 1);
 	if (error == 0) {
-		pcb->in6p_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND;
-		pcb->in6p_sp->sp_out->spidx = pcb->in6p_sp->sp_in->spidx;
-		pcb->in6p_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND;
+		inph->inph_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND;
+		inph->inph_sp->sp_out->spidx = inph->inph_sp->sp_in->spidx;
+		inph->inph_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND;
 	} else {
-		memset(>in6p_sp->sp_in->spidx, 0,
-		sizeof(pcb->in6p_sp->sp_in->spidx));
-		memset(>in6p_sp->sp_out->spidx, 0,
-		sizeof(pcb->in6p_sp->sp_out->spidx));
+		memset(>inph_sp->sp_in->spidx, 0,
+		sizeof(inph->inph_sp->sp_in->spidx));
+		memset(>inph_sp->sp_out->spidx, 0,
+		sizeof(inph->inph_sp->sp_out->spidx));
 	}
 	return error;
 }
-#endif
 
 /*
  * configure security policy index (src/dst/proto/sport/dport)



CVS commit: src/sys/netipsec

2018-02-28 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Wed Feb 28 10:09:17 UTC 2018

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
ipsec6_setspidx_in6pcb: call ipsec_setspidx() only once, just like the
IPv4 code. While here put the correct variable in sizeof.

ok ozaki-r@


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/netipsec/ipsec.c

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

Modified files:

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.146 src/sys/netipsec/ipsec.c:1.147
--- src/sys/netipsec/ipsec.c:1.146	Tue Feb 27 15:01:30 2018
+++ src/sys/netipsec/ipsec.c	Wed Feb 28 10:09:17 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.146 2018/02/27 15:01:30 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.147 2018/02/28 10:09:17 maxv Exp $ */
 /* $FreeBSD: src/sys/netipsec/ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.146 2018/02/27 15:01:30 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.147 2018/02/28 10:09:17 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -812,7 +812,7 @@ ipsec4_setspidx_inpcb(struct mbuf *m, st
 		memset(>inp_sp->sp_in->spidx, 0,
 		sizeof(pcb->inp_sp->sp_in->spidx));
 		memset(>inp_sp->sp_out->spidx, 0,
-		sizeof(pcb->inp_sp->sp_in->spidx));
+		sizeof(pcb->inp_sp->sp_out->spidx));
 	}
 	return error;
 }
@@ -821,7 +821,6 @@ ipsec4_setspidx_inpcb(struct mbuf *m, st
 static int
 ipsec6_setspidx_in6pcb(struct mbuf *m, struct in6pcb *pcb)
 {
-	struct secpolicyindex *spidx;
 	int error;
 
 	KASSERT(pcb != NULL);
@@ -829,26 +828,17 @@ ipsec6_setspidx_in6pcb(struct mbuf *m, s
 	KASSERT(pcb->in6p_sp->sp_out != NULL);
 	KASSERT(pcb->in6p_sp->sp_in != NULL);
 
-	memset(>in6p_sp->sp_in->spidx, 0, sizeof(*spidx));
-	memset(>in6p_sp->sp_out->spidx, 0, sizeof(*spidx));
-
-	spidx = >in6p_sp->sp_in->spidx;
-	error = ipsec_setspidx(m, spidx, 1);
-	if (error)
-		goto bad;
-	spidx->dir = IPSEC_DIR_INBOUND;
-
-	spidx = >in6p_sp->sp_out->spidx;
-	error = ipsec_setspidx(m, spidx, 1);
-	if (error)
-		goto bad;
-	spidx->dir = IPSEC_DIR_OUTBOUND;
-
-	return 0;
-
-bad:
-	memset(>in6p_sp->sp_in->spidx, 0, sizeof(*spidx));
-	memset(>in6p_sp->sp_out->spidx, 0, sizeof(*spidx));
+	error = ipsec_setspidx(m, >in6p_sp->sp_in->spidx, 1);
+	if (error == 0) {
+		pcb->in6p_sp->sp_in->spidx.dir = IPSEC_DIR_INBOUND;
+		pcb->in6p_sp->sp_out->spidx = pcb->in6p_sp->sp_in->spidx;
+		pcb->in6p_sp->sp_out->spidx.dir = IPSEC_DIR_OUTBOUND;
+	} else {
+		memset(>in6p_sp->sp_in->spidx, 0,
+		sizeof(pcb->in6p_sp->sp_in->spidx));
+		memset(>in6p_sp->sp_out->spidx, 0,
+		sizeof(pcb->in6p_sp->sp_out->spidx));
+	}
 	return error;
 }
 #endif



CVS commit: src/sys/kern

2018-02-28 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb 28 09:44:26 UTC 2018

Modified Files:
src/sys/kern: uipc_domain.c

Log Message:
in sockaddr_getsize_by_family() print the p_comm, pid and lid
for unknown address family.  helps location where missing
af settings are.


To generate a diff of this commit:
cvs rdiff -u -r1.101 -r1.102 src/sys/kern/uipc_domain.c

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

Modified files:

Index: src/sys/kern/uipc_domain.c
diff -u src/sys/kern/uipc_domain.c:1.101 src/sys/kern/uipc_domain.c:1.102
--- src/sys/kern/uipc_domain.c:1.101	Wed Jan 10 02:50:26 2018
+++ src/sys/kern/uipc_domain.c	Wed Feb 28 09:44:25 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_domain.c,v 1.101 2018/01/10 02:50:26 ozaki-r Exp $	*/
+/*	$NetBSD: uipc_domain.c,v 1.102 2018/02/28 09:44:25 mrg Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.101 2018/01/10 02:50:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_domain.c,v 1.102 2018/02/28 09:44:25 mrg Exp $");
 
 #include 
 #include 
@@ -289,7 +289,9 @@ sockaddr_getsize_by_family(sa_family_t a
 		return sizeof(struct sockaddr_at);
 	default:
 #ifdef DIAGNOSTIC
-		printf("%s: Unhandled address family=%hhu\n", __func__, af);
+		printf("%s: (%s:%u:%u) Unhandled address family=%hhu\n",
+		__func__, curlwp->l_proc->p_comm,
+		curlwp->l_proc->p_pid, curlwp->l_lid, af);
 #endif
 		return 0;
 	}



CVS commit: src/sys/dev/imcsmb

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Feb 28 09:25:02 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imcsmb.c

Log Message:
Remove exgtra / in the $NetBSD$ line.  Thanks to leot@ for spotting it!


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/imcsmb/imcsmb.c

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

Modified files:

Index: src/sys/dev/imcsmb/imcsmb.c
diff -u src/sys/dev/imcsmb/imcsmb.c:1.18 src/sys/dev/imcsmb/imcsmb.c:1.19
--- src/sys/dev/imcsmb/imcsmb.c:1.18	Wed Feb 28 09:07:18 2018
+++ src/sys/dev/imcsmb/imcsmb.c	Wed Feb 28 09:25:02 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imcsmb.c,v 1.18 2018/02/28 09:07:18 pgoyette Exp $/ */
+/* $NetBSD: imcsmb.c,v 1.19 2018/02/28 09:25:02 pgoyette Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.18 2018/02/28 09:07:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.19 2018/02/28 09:25:02 pgoyette Exp $");
 
 #include 
 #include 



CVS commit: src/sys/dev/imcsmb

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Feb 28 09:07:18 UTC 2018

Modified Files:
src/sys/dev/imcsmb: imcsmb.c

Log Message:
Remove extra */ from comment - fix build


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/dev/imcsmb/imcsmb.c

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

Modified files:

Index: src/sys/dev/imcsmb/imcsmb.c
diff -u src/sys/dev/imcsmb/imcsmb.c:1.17 src/sys/dev/imcsmb/imcsmb.c:1.18
--- src/sys/dev/imcsmb/imcsmb.c:1.17	Wed Feb 28 06:08:14 2018
+++ src/sys/dev/imcsmb/imcsmb.c	Wed Feb 28 09:07:18 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: imcsmb.c,v 1.17 2018/02/28 06:08:14 pgoyette Exp $/ */
+/* $NetBSD: imcsmb.c,v 1.18 2018/02/28 09:07:18 pgoyette Exp $/ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -62,11 +62,11 @@
 /* 
  * Driver for the SMBus controllers in Intel's Integrated Memory Controllers
  * in certain CPUs.  A more detailed description of this device is present
- * in imc.c */
+ * in imc.c
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.17 2018/02/28 06:08:14 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imcsmb.c,v 1.18 2018/02/28 09:07:18 pgoyette Exp $");
 
 #include 
 #include 



CVS commit: src/doc

2018-02-28 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Feb 28 08:15:27 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
Mention imcsmb(4)


To generate a diff of this commit:
cvs rdiff -u -r1.2362 -r1.2363 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2362 src/doc/CHANGES:1.2363
--- src/doc/CHANGES:1.2362	Mon Feb 26 23:12:59 2018
+++ src/doc/CHANGES	Wed Feb 28 08:15:27 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2362 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2363 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -119,3 +119,7 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	mdnsd(8), dns-sd(1), libdns_sd: import mDNSResponder 878.30.4
 		[christos 20180225]
 	macppc: Remove macofcons(4). [sevan 20180226]
+	imcsmb(4): For amd64 and i386 on Intel {Ivy,Sandy}bridge and
+		{Broad,Has}well CPUs, enable access to Integrated Memory
+		Controller-based SMBus [pgoyette 20170228]
+