CVS commit: src/sys/netinet6

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Feb  2 06:23:45 UTC 2018

Modified Files:
src/sys/netinet6: ip6_mroute.c

Log Message:
Fix a pretty simple, yet pretty tragic typo: we should return IPPROTO_DONE,
not IPPROTO_NONE. With IPPROTO_NONE we will keep parsing the header chain
on an mbuf that was already freed.


To generate a diff of this commit:
cvs rdiff -u -r1.119 -r1.120 src/sys/netinet6/ip6_mroute.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/netinet6/ip6_mroute.c
diff -u src/sys/netinet6/ip6_mroute.c:1.119 src/sys/netinet6/ip6_mroute.c:1.120
--- src/sys/netinet6/ip6_mroute.c:1.119	Wed Mar  1 08:54:12 2017
+++ src/sys/netinet6/ip6_mroute.c	Fri Feb  2 06:23:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip6_mroute.c,v 1.119 2017/03/01 08:54:12 ozaki-r Exp $	*/
+/*	$NetBSD: ip6_mroute.c,v 1.120 2018/02/02 06:23:45 maxv Exp $	*/
 /*	$KAME: ip6_mroute.c,v 1.49 2001/07/25 09:21:18 jinmei Exp $	*/
 
 /*
@@ -117,7 +117,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.119 2017/03/01 08:54:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_mroute.c,v 1.120 2018/02/02 06:23:45 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1886,7 +1886,7 @@ pim6_input(struct mbuf **mp, int *offp, 
 			(eip6->ip6_vfc & IPV6_VERSION));
 #endif
 			m_freem(m);
-			return (IPPROTO_NONE);
+			return (IPPROTO_DONE);
 		}
 
 		/* verify the inner packet is destined to a mcast group */



CVS commit: src/external/gpl3/gcc/dist

2018-02-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb  2 03:41:13 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist: LAST_UPDATED MD5SUMS NEWS config.guess
config.sub configure configure.ac
src/external/gpl3/gcc/dist/INSTALL: binaries.html build.html
configure.html download.html finalinstall.html gfdl.html index.html
old.html prerequisites.html specific.html test.html
src/external/gpl3/gcc/dist/gcc: ChangeLog Makefile.in alias.c
auto-profile.c builtins.c cfgexpand.c common.opt config.gcc
config.host configure configure.ac cppdefault.c debug.h
diagnostic.c dse.c dwarf2out.c except.c expr.c final.c gcc.c gcc.h
genemit.c gengtype-lex.c genmultilib genrecog.c ggc-common.c
graphite-isl-ast-to-gimple.c hwint.h opts-global.c opts.c output.h
reload.c reload1.c rtlanal.c system.h target-def.h targhooks.c
toplev.c tree-cfg.c tree-ssa-ccp.c var-tracking.c varasm.c
src/external/gpl3/gcc/dist/gcc/c: Make-lang.in
src/external/gpl3/gcc/dist/gcc/c-family: c-format.c c-format.h c-opts.c
c.opt
src/external/gpl3/gcc/dist/gcc/common/config/arm: arm-common.c
src/external/gpl3/gcc/dist/gcc/config: freebsd-spec.h netbsd-elf.h
netbsd.h t-linux
src/external/gpl3/gcc/dist/gcc/config/alpha: alpha.h elf.h netbsd.h
src/external/gpl3/gcc/dist/gcc/config/arc: arc-modes.def arc-protos.h
arc.c arc.h arc.md arc.opt
src/external/gpl3/gcc/dist/gcc/config/arm: arm-cores.def arm.c arm.h
arm.md bpabi.h elf.h freebsd.h netbsd-elf.h t-arm t-rtems thumb2.md
src/external/gpl3/gcc/dist/gcc/config/i386: cpuid.h driver-i386.c
i386.c i386.h netbsd-elf.h netbsd64.h pmm_malloc.h
src/external/gpl3/gcc/dist/gcc/config/m68k: constraints.md m68k.c
m68k.md netbsd-elf.h t-opts
src/external/gpl3/gcc/dist/gcc/config/mips: mips.c netbsd.h t-mips
src/external/gpl3/gcc/dist/gcc/config/pa: pa.c pa.h
src/external/gpl3/gcc/dist/gcc/config/rs6000: netbsd.h ppc-asm.h
rs6000.c sysv4.h t-netbsd t-rs6000 vxworksae.h
src/external/gpl3/gcc/dist/gcc/config/sh: netbsd-elf.h sh.c t-sh
src/external/gpl3/gcc/dist/gcc/config/sparc: constraints.md
netbsd-elf.h predicates.md sparc.md sync.md
src/external/gpl3/gcc/dist/gcc/config/vax: builtins.md constraints.md
elf.h netbsd-elf.h vax-protos.h vax.c vax.h vax.md
src/external/gpl3/gcc/dist/gcc/cp: Make-lang.in cfns.gperf cfns.h
except.c
src/external/gpl3/gcc/dist/gcc/doc: aot-compile.1 cpp.1 cpp.texi
cppenv.texi cppinternals.info cppopts.texi fsf-funding.7
gc-analyze.1 gccinstall.info gccint.info gcj-dbtool.1 gcj.1
gcj.info gcov.texi gfdl.7 gfortran.1 gij.1 gpl.7 grmic.1
invoke.texi jcf-dump.1 jv-convert.1 rebuild-gcj-db.1
src/external/gpl3/gcc/dist/gcc/ginclude: stddef.h unwind-arm-common.h
src/external/gpl3/gcc/dist/gcc/objc: Make-lang.in
src/external/gpl3/gcc/dist/gcc/objcp: Make-lang.in
src/external/gpl3/gcc/dist/include: objalloc.h
src/external/gpl3/gcc/dist/intl: configure
src/external/gpl3/gcc/dist/libbacktrace: configure
src/external/gpl3/gcc/dist/libcpp: Makefile.in configure configure.ac
files.c init.c internal.h lex.c macro.c
src/external/gpl3/gcc/dist/libcpp/include: cpplib.h
src/external/gpl3/gcc/dist/libdecnumber: configure
src/external/gpl3/gcc/dist/libgcc: Makefile.in config.host configure
unwind-compat.c unwind-dw2-fde-dip.c unwind-dw2-fde.c unwind-dw2.c
unwind-generic.h unwind-seh.c unwind-sjlj.c
src/external/gpl3/gcc/dist/libgcc/config/alpha: qrnnd.S
src/external/gpl3/gcc/dist/libgcc/config/arm: pr-support.c
src/external/gpl3/gcc/dist/libgcc/config/c6x: pr-support.c
src/external/gpl3/gcc/dist/libgcc/config/cr16: unwind-cr16.c
src/external/gpl3/gcc/dist/libgcc/config/i386: morestack.S
src/external/gpl3/gcc/dist/libgcc/config/ia64: unwind-ia64.c
src/external/gpl3/gcc/dist/libgcc/config/m68k: lb1sf68.S
src/external/gpl3/gcc/dist/libgcc/config/xtensa: unwind-dw2-xtensa.c
src/external/gpl3/gcc/dist/libgomp: Makefile.am Makefile.in configure
configure.ac libgomp.info
src/external/gpl3/gcc/dist/libiberty: Makefile.in config.in configure
configure.ac floatformat.c
src/external/gpl3/gcc/dist/libobjc: configure encoding.c hash.c
objects.c sendmsg.c
src/external/gpl3/gcc/dist/libsanitizer: configure configure.tgt
src/external/gpl3/gcc/dist/libsanitizer/asan: asan_interceptors.cc
asan_interceptors.h asan_internal.h asan_linux.cc asan_mapping.h
asan_posix.cc asan_rtl.cc asan_stack.h

CVS commit: src

2018-02-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Feb  2 01:02:42 UTC 2018

Modified Files:
src/bin/expr: Makefile
src/distrib/sets/lists/base: ad.mips shl.mi
src/distrib/sets/lists/comp: ad.arm ad.hppa ad.m68k ad.mips ad.powerpc
ad.riscv ad.sh3 md.alpha md.amd64 md.hppa md.i386 md.or1k md.sparc
md.sparc64 md.vax mi shl.mi
src/distrib/sets/lists/debug: ad.mips mi shl.mi
src/external/bsd/dhcpcd/sbin/dhcpcd: Makefile
src/external/bsd/ntp/bin/ntpd: Makefile
src/external/bsd/ntp/lib/libiscntp: Makefile
src/external/bsd/ntp/lib/libntp: Makefile
src/external/bsd/ntp/lib/libopts: Makefile
src/external/gpl2/libmalloc/lib: Makefile
src/external/mit/xorg/lib/libXft: Makefile
src/external/mit/xorg/server/drivers/xf86-video-nouveau: Makefile
src/external/mit/xorg/server/drivers/xf86-video-openchrome: Makefile
src/external/mit/xorg/server/drivers/xf86-video-siliconmotion: Makefile
src/external/mit/xorg/server/drivers/xf86-video-sis: Makefile
src/external/mit/xorg/server/drivers/xf86-video-suncg6: Makefile
src/external/mit/xorg/server/drivers/xf86-video-sunffb: Makefile
src/external/mit/xorg/server/xorg-server/hw/xfree86/common: Makefile
src/share/mk: bsd.own.mk bsd.sys.mk
src/sys/arch/i386/stand/lib: Makefile
src/sys/arch/sun68k/stand/libsa: Makefile
src/tools/gcc: Makefile README.mknative

Log Message:
convert HAVE_GCC handling to modern GCC release numbering:
- HAVE_GCC=5 is now the default (vs. HAVE_GCC=53 we've been using for
  GCC 5.4 and GCC 5.5.)
- remove some more GCC 4.8 code.  we don't support GCC 4 here.
- adjust set lists to gcc=5 from gcc=53.

add some basic HAVE_GCC=6 handling (totally unused so far.)


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/bin/expr/Makefile
cvs rdiff -u -r1.74 -r1.75 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.825 -r1.826 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.81 -r1.82 src/distrib/sets/lists/comp/ad.arm
cvs rdiff -u -r1.10 -r1.11 src/distrib/sets/lists/comp/ad.hppa
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/comp/ad.m68k
cvs rdiff -u -r1.70 -r1.71 src/distrib/sets/lists/comp/ad.mips
cvs rdiff -u -r1.87 -r1.88 src/distrib/sets/lists/comp/ad.powerpc
cvs rdiff -u -r1.7 -r1.8 src/distrib/sets/lists/comp/ad.riscv \
src/distrib/sets/lists/comp/md.hppa
cvs rdiff -u -r1.35 -r1.36 src/distrib/sets/lists/comp/ad.sh3
cvs rdiff -u -r1.71 -r1.72 src/distrib/sets/lists/comp/md.alpha
cvs rdiff -u -r1.252 -r1.253 src/distrib/sets/lists/comp/md.amd64
cvs rdiff -u -r1.175 -r1.176 src/distrib/sets/lists/comp/md.i386
cvs rdiff -u -r1.3 -r1.4 src/distrib/sets/lists/comp/md.or1k
cvs rdiff -u -r1.90 -r1.91 src/distrib/sets/lists/comp/md.sparc
cvs rdiff -u -r1.197 -r1.198 src/distrib/sets/lists/comp/md.sparc64
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/comp/md.vax
cvs rdiff -u -r1.2172 -r1.2173 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.310 -r1.311 src/distrib/sets/lists/comp/shl.mi
cvs rdiff -u -r1.65 -r1.66 src/distrib/sets/lists/debug/ad.mips
cvs rdiff -u -r1.237 -r1.238 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.188 -r1.189 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.42 -r1.43 src/external/bsd/dhcpcd/sbin/dhcpcd/Makefile
cvs rdiff -u -r1.21 -r1.22 src/external/bsd/ntp/bin/ntpd/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/lib/libiscntp/Makefile
cvs rdiff -u -r1.19 -r1.20 src/external/bsd/ntp/lib/libntp/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/bsd/ntp/lib/libopts/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/libmalloc/lib/Makefile
cvs rdiff -u -r1.7 -r1.8 src/external/mit/xorg/lib/libXft/Makefile
cvs rdiff -u -r1.6 -r1.7 \
src/external/mit/xorg/server/drivers/xf86-video-nouveau/Makefile
cvs rdiff -u -r1.12 -r1.13 \
src/external/mit/xorg/server/drivers/xf86-video-openchrome/Makefile
cvs rdiff -u -r1.11 -r1.12 \
src/external/mit/xorg/server/drivers/xf86-video-siliconmotion/Makefile
cvs rdiff -u -r1.15 -r1.16 \
src/external/mit/xorg/server/drivers/xf86-video-sis/Makefile
cvs rdiff -u -r1.9 -r1.10 \
src/external/mit/xorg/server/drivers/xf86-video-suncg6/Makefile
cvs rdiff -u -r1.13 -r1.14 \
src/external/mit/xorg/server/drivers/xf86-video-sunffb/Makefile
cvs rdiff -u -r1.31 -r1.32 \
src/external/mit/xorg/server/xorg-server/hw/xfree86/common/Makefile
cvs rdiff -u -r1.1029 -r1.1030 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.274 -r1.275 src/share/mk/bsd.sys.mk
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/sun68k/stand/libsa/Makefile
cvs rdiff -u -r1.83 -r1.84 src/tools/gcc/Makefile
cvs rdiff -u -r1.21 -r1.22 src/tools/gcc/README.mknative

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

Modified files:

Index: src/bin/expr/Makefile
diff -u 

CVS commit: src/sys/arch/sparc/sparc

2018-02-01 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Feb  1 22:58:44 UTC 2018

Modified Files:
src/sys/arch/sparc/sparc: cpu.c

Log Message:
"save fp ipi" is an interrupt type counter, mark it so.


To generate a diff of this commit:
cvs rdiff -u -r1.252 -r1.253 src/sys/arch/sparc/sparc/cpu.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/sparc/sparc/cpu.c
diff -u src/sys/arch/sparc/sparc/cpu.c:1.252 src/sys/arch/sparc/sparc/cpu.c:1.253
--- src/sys/arch/sparc/sparc/cpu.c:1.252	Wed Jan 17 07:38:20 2018
+++ src/sys/arch/sparc/sparc/cpu.c	Thu Feb  1 22:58:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.252 2018/01/17 07:38:20 mrg Exp $ */
+/*	$NetBSD: cpu.c,v 1.253 2018/02/01 22:58:44 mrg Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.252 2018/01/17 07:38:20 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.253 2018/02/01 22:58:44 mrg Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_lockdebug.h"
@@ -363,7 +363,7 @@ cpu_init_evcnt(struct cpu_info *cpi)
 	 * The "savefp null" counter should go away when the NULL
 	 * struct fpstate * bug is fixed.
 	 */
-	evcnt_attach_dynamic(>ci_savefpstate, EVCNT_TYPE_MISC,
+	evcnt_attach_dynamic(>ci_savefpstate, EVCNT_TYPE_INTR,
 			 NULL, cpu_name(cpi), "savefp ipi");
 	evcnt_attach_dynamic(>ci_savefpstate_null, EVCNT_TYPE_MISC,
 			 NULL, cpu_name(cpi), "savefp null ipi");



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

2018-02-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  1 21:47:07 UTC 2018

Modified Files:
src/sys/arch/macppc/conf: POWERMAC_G5_11_2

Log Message:
add dstemp at iic


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/macppc/conf/POWERMAC_G5_11_2

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/macppc/conf/POWERMAC_G5_11_2
diff -u src/sys/arch/macppc/conf/POWERMAC_G5_11_2:1.7 src/sys/arch/macppc/conf/POWERMAC_G5_11_2:1.8
--- src/sys/arch/macppc/conf/POWERMAC_G5_11_2:1.7	Tue Jan 23 14:47:55 2018
+++ src/sys/arch/macppc/conf/POWERMAC_G5_11_2	Thu Feb  1 21:47:07 2018
@@ -138,6 +138,7 @@ iic*		at ki2c?
 
 admtemp* 	at iic?
 lmtemp* 	at iic?
+dstemp* 	at iic?
 deq* 		at iic?
 
 # Audio support



CVS commit: src/sys/dev/i2c

2018-02-01 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Feb  1 21:44:18 UTC 2018

Modified Files:
src/sys/dev/i2c: files.i2c
Added Files:
src/sys/dev/i2c: dstemp.c

Log Message:
add driver for Maxim DS1631 High-Precision Digital Thermometer and Thermostat
temperature reading only for now


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/dstemp.c
cvs rdiff -u -r1.81 -r1.82 src/sys/dev/i2c/files.i2c

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/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.81 src/sys/dev/i2c/files.i2c:1.82
--- src/sys/dev/i2c/files.i2c:1.81	Fri Jan  5 03:07:15 2018
+++ src/sys/dev/i2c/files.i2c	Thu Feb  1 21:44:17 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.81 2018/01/05 03:07:15 uwe Exp $
+#	$NetBSD: files.i2c,v 1.82 2018/02/01 21:44:17 macallan Exp $
 
 obsolete defflag	opt_i2cbus.h		I2C_SCAN
 define	i2cbus { }
@@ -295,6 +295,11 @@ device	sy8106a
 attach	sy8106a at iic
 file	dev/i2c/sy8106a.c			sy8106a
 
+# Maxim DS1631 High-Precision Digital Thermometer and Thermostat
+device	dstemp: sysmon_envsys
+attach	dstemp at iic
+file	dev/i2c/dstemp.c			dstemp
+
 # EM3027 Real Time Clock and Temperature Sensor
 device	em3027rtc: sysmon_envsys
 attach	em3027rtc at iic

Added files:

Index: src/sys/dev/i2c/dstemp.c
diff -u /dev/null src/sys/dev/i2c/dstemp.c:1.1
--- /dev/null	Thu Feb  1 21:44:18 2018
+++ src/sys/dev/i2c/dstemp.c	Thu Feb  1 21:44:17 2018
@@ -0,0 +1,152 @@
+/* $NetBSD: dstemp.c,v 1.1 2018/02/01 21:44:17 macallan Exp $ */
+
+/*-
+ * Copyright (c) 2018 Michael Lorenz
+ * 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 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.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: dstemp.c,v 1.1 2018/02/01 21:44:17 macallan Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#ifdef macppc
+#define HAVE_OF 1
+#endif
+
+#ifdef HAVE_OF
+#include 
+#endif
+
+#define DSTEMP_CMD_START	0x51	/* command, no data */
+#define DSTEMP_CMD_POR		0x54	/* command, no data */
+#define DSTEMP_CMD_STOP		0x22	/* command, no data */
+#define DSTEMP_TCURRENT		0xaa	/* current temperature, 2 bytes */
+#define DSTEMP_THIGH		0xa1	/* high threshold, 2 bytes */
+#define DSTEMP_TLOW		0xa2	/* low threshold, 2 bytes */
+#define DSTEMP_CONFIG		0xac	/* 1 byte */
+
+struct dstemp_softc {
+	device_t	sc_dev;
+	i2c_tag_t	sc_i2c;
+	i2c_addr_t	sc_addr;
+
+	struct sysmon_envsys *sc_sme;
+	envsys_data_t	sc_sensor_temp;
+};
+
+static int	dstemp_match(device_t, cfdata_t, void *);
+static void	dstemp_attach(device_t, device_t, void *);
+
+static void	dstemp_sensors_refresh(struct sysmon_envsys *, envsys_data_t *);
+
+CFATTACH_DECL_NEW(dstemp, sizeof(struct dstemp_softc),
+dstemp_match, dstemp_attach, NULL, NULL);
+
+static const char * dstemp_compats[] = {
+	"ds1631",
+	NULL
+};
+
+static int
+dstemp_match(device_t parent, cfdata_t match, void *aux)
+{
+	struct i2c_attach_args *ia = aux;
+
+	if (ia->ia_name == NULL) {
+		/* no ID registers on this chip */
+		if ((ia->ia_addr & 0xf8) == 0x48)
+			return 1;
+		return 0;
+	} else {
+		return iic_compat_match(ia, dstemp_compats);
+	}
+}
+
+static void
+dstemp_attach(device_t parent, device_t self, void *aux)
+{
+	struct dstemp_softc *sc = device_private(self);
+	struct i2c_attach_args *ia = aux;
+	char name[64] = "temperature";
+
+	sc->sc_dev = self;
+	sc->sc_i2c = ia->ia_tag;
+	sc->sc_addr = ia->ia_addr;
+
+	aprint_naive("\n");
+	aprint_normal(": DS1361\n");
+
+	sc->sc_sme = sysmon_envsys_create();
+	sc->sc_sme->sme_name = device_xname(self);
+	sc->sc_sme->sme_cookie = sc;
+	sc->sc_sme->sme_refresh = 

CVS commit: src/external/gpl3/gcc/usr.bin/include

2018-02-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb  1 21:10:46 UTC 2018

Modified Files:
src/external/gpl3/gcc/usr.bin/include: Makefile
Added Files:
src/external/gpl3/gcc/usr.bin/include/sanitizer: Makefile

Log Message:
Install GCC (gcc) headers for Sanitizers

Sync this code with gcc.old.

PR 52265 by Kamil Rytarowski

Proposed and accepted on tech-toolchain@.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/gpl3/gcc/usr.bin/include/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile

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

Modified files:

Index: src/external/gpl3/gcc/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc/usr.bin/include/Makefile:1.9 src/external/gpl3/gcc/usr.bin/include/Makefile:1.10
--- src/external/gpl3/gcc/usr.bin/include/Makefile:1.9	Sun Oct  8 20:40:06 2017
+++ src/external/gpl3/gcc/usr.bin/include/Makefile	Thu Feb  1 21:10:46 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile,v 1.9 2017/10/08 20:40:06 christos Exp $
+#	$NetBSD: Makefile,v 1.10 2018/02/01 21:10:46 kamil Exp $
 
 .include "../Makefile.inc"
 
+SUBDIR=	sanitizer
+
 .if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}.mk)
 .include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}.mk"
 .endif
@@ -25,6 +27,7 @@ CLEANFILES+=	mm_malloc.h
 
 INCSDIR=	/usr/include/gcc-5
 
+.include 
 .include 
 
 .PATH: ${G_EXTRA_HEADERS:H:O:u}

Added files:

Index: src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile
diff -u /dev/null src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile:1.1
--- /dev/null	Thu Feb  1 21:10:46 2018
+++ src/external/gpl3/gcc/usr.bin/include/sanitizer/Makefile	Thu Feb  1 21:10:46 2018
@@ -0,0 +1,24 @@
+#	$NetBSD: Makefile,v 1.1 2018/02/01 21:10:46 kamil Exp $
+
+.include "../../../Makefile.gcc_path"
+
+NOOBJ=	#defined
+
+SANITIZER=	${GCCDIST}/libsanitizer
+
+.PATH:	${SANITIZER}/include/sanitizer
+
+INCS=	#
+INCS+=	allocator_interface.h
+INCS+=	asan_interface.h
+INCS+=	common_interface_defs.h
+#INCS+=	dfsan_interface.h # not supported
+#INCS+=	lsan_interface.h # not supported
+#INCS+=	msan_interface.h # not ready in GCC
+INCS+=	tsan_interface_atomic.h
+
+.include 
+
+INCSDIR=	/usr/include/gcc-5/sanitizer
+
+.include 



CVS commit: src

2018-02-01 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Feb  1 20:50:23 UTC 2018

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/comp: mi
src/etc/mtree: NetBSD.dist.base
src/external/gpl3/gcc.old/usr.bin/include: Makefile
Added Files:
src/external/gpl3/gcc.old/usr.bin/include/sanitizer: Makefile

Log Message:
Install GCC (gcc.old/) headers for Sanitizers

Install:
 - allocator_interface.h
 - asan_interface.h
 - common_interface_defs.h
 - tsan_interface_atomic.h

Into:
 - /usr/include/gcc-5/sanitizer

Note headers in a comment headers for introduction in future:
 - dfsan_interface.h
 - lsan_interface.h
 - msan_interface.h

Skip a file that will never be relevant on NetBSD:
 - linux_syscall_hooks.h

PR 52265 by Kamil Rytarowski

Proposed and accepted on tech-toolchain@.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.1170 -r1.1171 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2171 -r1.2172 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.167 -r1.168 src/etc/mtree/NetBSD.dist.base
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gcc.old/usr.bin/include/Makefile
cvs rdiff -u -r0 -r1.1 \
src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile

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/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1170 src/distrib/sets/lists/base/mi:1.1171
--- src/distrib/sets/lists/base/mi:1.1170	Wed Jan 24 09:51:25 2018
+++ src/distrib/sets/lists/base/mi	Thu Feb  1 20:50:23 2018
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1170 2018/01/24 09:51:25 wiz Exp $
+# $NetBSD: mi,v 1.1171 2018/02/01 20:50:23 kamil Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -1168,6 +1168,7 @@
 ./usr/include/gcc-4.5base-obsolete		obsolete
 ./usr/include/gcc-4.8base-c-usr
 ./usr/include/gcc-5base-c-usr
+./usr/include/gcc-5/sanitizer			base-c-usr
 ./usr/include/gssapibase-c-usr
 ./usr/include/gssapi/rpc			base-obsolete		obsolete
 ./usr/include/isofsbase-c-usr

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2171 src/distrib/sets/lists/comp/mi:1.2172
--- src/distrib/sets/lists/comp/mi:1.2171	Wed Jan 24 09:51:26 2018
+++ src/distrib/sets/lists/comp/mi	Thu Feb  1 20:50:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2171 2018/01/24 09:51:26 wiz Exp $
+#	$NetBSD: mi,v 1.2172 2018/02/01 20:50:22 kamil Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -1997,6 +1997,10 @@
 ./usr/include/gcc-5/omp.h			comp-gcc-include	gcc=53
 ./usr/include/gcc-5/openacc.h			comp-gcc-include	gcc=53
 ./usr/include/gcc-5/stdatomic.h			comp-gcc-include	gcc=53,gcccmds
+./usr/include/gcc-5/sanitizer/allocator_interface.h	comp-gcc-include	gcc=53
+./usr/include/gcc-5/sanitizer/asan_interface.h	comp-gcc-include	gcc=53
+./usr/include/gcc-5/sanitizer/common_interface_defs.h	comp-gcc-include	gcc=53
+./usr/include/gcc-5/sanitizer/tsan_interface_atomic.h	comp-gcc-include	gcc=53
 ./usr/include/gelf.hcomp-c-include
 ./usr/include/getopt.hcomp-c-include
 ./usr/include/glob.hcomp-c-include

Index: src/etc/mtree/NetBSD.dist.base
diff -u src/etc/mtree/NetBSD.dist.base:1.167 src/etc/mtree/NetBSD.dist.base:1.168
--- src/etc/mtree/NetBSD.dist.base:1.167	Wed Jan 24 09:04:41 2018
+++ src/etc/mtree/NetBSD.dist.base	Thu Feb  1 20:50:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: NetBSD.dist.base,v 1.167 2018/01/24 09:04:41 skrll Exp $
+#	$NetBSD: NetBSD.dist.base,v 1.168 2018/02/01 20:50:22 kamil Exp $
 #	@(#)4.4BSD.dist	8.1 (Berkeley) 6/13/93
 
 # Do not customize this file as it may be overwritten on upgrades.
@@ -193,6 +193,7 @@
 ./usr/include/g++/tr2
 ./usr/include/gcc-4.8
 ./usr/include/gcc-5
+./usr/include/gcc-5/sanitizer
 ./usr/include/gssapi
 ./usr/include/isofs
 ./usr/include/isofs/cd9660

Index: src/external/gpl3/gcc.old/usr.bin/include/Makefile
diff -u src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.7 src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.8
--- src/external/gpl3/gcc.old/usr.bin/include/Makefile:1.7	Thu Oct  5 06:30:19 2017
+++ src/external/gpl3/gcc.old/usr.bin/include/Makefile	Thu Feb  1 20:50:22 2018
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile,v 1.7 2017/10/05 06:30:19 wiz Exp $
+#	$NetBSD: Makefile,v 1.8 2018/02/01 20:50:22 kamil Exp $
 
 .include "../Makefile.inc"
 
+SUBDIR=	sanitizer
+
 .if exists(${.CURDIR}/arch/${GCC_MACHINE_ARCH}.mk)
 .include "${.CURDIR}/arch/${GCC_MACHINE_ARCH}.mk"
 .endif
@@ -25,6 +27,7 @@ CLEANFILES+=	mm_malloc.h
 
 INCSDIR=	/usr/include/gcc-5
 
+.include 
 .include 
 
 .PATH: ${G_EXTRA_HEADERS:H:O:u}

Added files:

Index: src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile
diff -u /dev/null src/external/gpl3/gcc.old/usr.bin/include/sanitizer/Makefile:1.1
--- /dev/null	Thu Feb  1 20:50:23 2018
+++ 

CVS commit: src/sys/fs/nfs/common

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 17:22:45 UTC 2018

Modified Files:
src/sys/fs/nfs/common: nfsport.h

Log Message:
Remove unused (and a reference to ovbcopy along the way).


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/nfs/common/nfsport.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/fs/nfs/common/nfsport.h
diff -u src/sys/fs/nfs/common/nfsport.h:1.3 src/sys/fs/nfs/common/nfsport.h:1.4
--- src/sys/fs/nfs/common/nfsport.h:1.3	Tue Dec 13 22:52:46 2016
+++ src/sys/fs/nfs/common/nfsport.h	Thu Feb  1 17:22:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfsport.h,v 1.3 2016/12/13 22:52:46 pgoyette Exp $	*/
+/*	$NetBSD: nfsport.h,v 1.4 2018/02/01 17:22:45 maxv Exp $	*/
 /*-
  * Copyright (c) 1989, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  *
  * FreeBSD: head/sys/fs/nfs/nfsport.h 304026 2016-08-12 22:44:59Z rmacklem 
- * $NetBSD: nfsport.h,v 1.3 2016/12/13 22:52:46 pgoyette Exp $
+ * $NetBSD: nfsport.h,v 1.4 2018/02/01 17:22:45 maxv Exp $
  */
 
 #ifndef _NFS_NFSPORT_H_
@@ -751,12 +751,10 @@ int nfsmsleep(void *, void *, int, const
 /*
  * Macros for handling memory for different BSDen.
  * NFSBCOPY(src, dst, len) - copies len bytes, non-overlapping
- * NFSOVBCOPY(src, dst, len) - ditto, but data areas might overlap
  * NFSBCMP(cp1, cp2, len) - compare len bytes, return 0 if same
  * NFSBZERO(cp, len) - set len bytes to 0x0
  */
 #define	NFSBCOPY(s, d, l)	bcopy((s), (d), (l))
-#define	NFSOVBCOPY(s, d, l)	ovbcopy((s), (d), (l))
 #define	NFSBCMP(s, d, l)	bcmp((s), (d), (l))
 #define	NFSBZERO(s, l)		bzero((s), (l))
 



CVS commit: src/sys/netipsec

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 17:16:11 UTC 2018

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

Log Message:
Replace ovbcopy -> memmove, same.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/netipsec/ipsec_mbuf.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_mbuf.c
diff -u src/sys/netipsec/ipsec_mbuf.c:1.16 src/sys/netipsec/ipsec_mbuf.c:1.17
--- src/sys/netipsec/ipsec_mbuf.c:1.16	Fri May 19 04:34:09 2017
+++ src/sys/netipsec/ipsec_mbuf.c	Thu Feb  1 17:16:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec_mbuf.c,v 1.16 2017/05/19 04:34:09 ozaki-r Exp $	*/
+/*	$NetBSD: ipsec_mbuf.c,v 1.17 2018/02/01 17:16:11 maxv Exp $	*/
 /*-
  * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting
  * All rights reserved.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.16 2017/05/19 04:34:09 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec_mbuf.c,v 1.17 2018/02/01 17:16:11 maxv Exp $");
 
 /*
  * IPsec-specific mbuf routines.
@@ -299,8 +299,8 @@ m_makespace(struct mbuf *m0, int skip, i
 		 * so there's space to write the new header.
 		 */
 		/* XXX can this be memcpy? does it handle overlap? */
-		ovbcopy(mtod(m, char *) + skip,
-			mtod(m, char *) + skip + hlen, remain);
+		memmove(mtod(m, char *) + skip + hlen,
+			mtod(m, char *) + skip, remain);
 		m->m_len += hlen;
 		*off = skip;
 	}
@@ -439,8 +439,8 @@ m_striphdr(struct mbuf *m, int skip, int
 		 * the remainder of the mbuf down over the header.
 		 */
 		IPSEC_STATINC(IPSEC_STAT_INPUT_MIDDLE);
-		ovbcopy(mtod(m1, u_char *) + roff + hlen,
-		  mtod(m1, u_char *) + roff,
+		memmove(mtod(m1, u_char *) + roff,
+		  mtod(m1, u_char *) + roff + hlen,
 		  m1->m_len - (roff + hlen));
 		m1->m_len -= hlen;
 		m->m_pkthdr.len -= hlen;



CVS commit: src/sys/dev

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 16:49:35 UTC 2018

Modified Files:
src/sys/dev/ic: arn5008.c arn9003.c
src/sys/dev/usb: if_athn_usb.c if_run.c

Log Message:
Replace ovbcopy -> memmove, same.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/arn5008.c
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/arn9003.c
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/usb/if_athn_usb.c \
src/sys/dev/usb/if_run.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/arn5008.c
diff -u src/sys/dev/ic/arn5008.c:1.13 src/sys/dev/ic/arn5008.c:1.14
--- src/sys/dev/ic/arn5008.c:1.13	Tue May 23 02:19:14 2017
+++ src/sys/dev/ic/arn5008.c	Thu Feb  1 16:49:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: arn5008.c,v 1.13 2017/05/23 02:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: arn5008.c,v 1.14 2018/02/01 16:49:34 maxv Exp $	*/
 /*	$OpenBSD: ar5008.c,v 1.21 2012/08/25 12:14:31 kettenis Exp $	*/
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.13 2017/05/23 02:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn5008.c,v 1.14 2018/02/01 16:49:34 maxv Exp $");
 
 #include 
 #include 
@@ -920,7 +920,7 @@ ar5008_rx_process(struct athn_softc *sc)
 	if (!(wh->i_fc[0] & IEEE80211_FC0_TYPE_CTL)) {
 		u_int hdrlen = ieee80211_anyhdrsize(wh);
 		if (hdrlen & 3) {
-			ovbcopy(wh, (uint8_t *)wh + 2, hdrlen);
+			memmove((uint8_t *)wh + 2, wh, hdrlen);
 			m_adj(m, 2);
 		}
 	}

Index: src/sys/dev/ic/arn9003.c
diff -u src/sys/dev/ic/arn9003.c:1.11 src/sys/dev/ic/arn9003.c:1.12
--- src/sys/dev/ic/arn9003.c:1.11	Tue May 23 02:19:14 2017
+++ src/sys/dev/ic/arn9003.c	Thu Feb  1 16:49:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: arn9003.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: arn9003.c,v 1.12 2018/02/01 16:49:34 maxv Exp $	*/
 /*	$OpenBSD: ar9003.c,v 1.25 2012/10/20 09:53:32 stsp Exp $	*/
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.11 2017/05/23 02:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arn9003.c,v 1.12 2018/02/01 16:49:34 maxv Exp $");
 
 #include 
 #include 
@@ -1053,7 +1053,7 @@ ar9003_rx_process(struct athn_softc *sc,
 	if (!(wh->i_fc[0] & IEEE80211_FC0_TYPE_CTL)) {
 		u_int hdrlen = ieee80211_anyhdrsize(wh);
 		if (hdrlen & 3) {
-			ovbcopy(wh, (uint8_t *)wh + 2, hdrlen);
+			memmove((uint8_t *)wh + 2, wh, hdrlen);
 			m_adj(m, 2);
 		}
 	}

Index: src/sys/dev/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.25 src/sys/dev/usb/if_athn_usb.c:1.26
--- src/sys/dev/usb/if_athn_usb.c:1.25	Sun Jan 21 13:57:11 2018
+++ src/sys/dev/usb/if_athn_usb.c	Thu Feb  1 16:49:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.25 2018/01/21 13:57:11 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.26 2018/02/01 16:49:34 maxv Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.25 2018/01/21 13:57:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.26 2018/02/01 16:49:34 maxv Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -2259,7 +2259,7 @@ athn_usb_rx_frame(struct athn_usb_softc 
 	if (!(wh->i_fc[0] & IEEE80211_FC0_TYPE_CTL)) {
 		u_int hdrlen = ieee80211_anyhdrsize(wh);
 		if (hdrlen & 3) {
-			ovbcopy(wh, (uint8_t *)wh + 2, hdrlen);
+			memmove((uint8_t *)wh + 2, wh, hdrlen);
 			m_adj(m, 2);
 		}
 	}
Index: src/sys/dev/usb/if_run.c
diff -u src/sys/dev/usb/if_run.c:1.25 src/sys/dev/usb/if_run.c:1.26
--- src/sys/dev/usb/if_run.c:1.25	Sun Jan 21 13:57:12 2018
+++ src/sys/dev/usb/if_run.c	Thu Feb  1 16:49:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_run.c,v 1.25 2018/01/21 13:57:12 skrll Exp $	*/
+/*	$NetBSD: if_run.c,v 1.26 2018/02/01 16:49:34 maxv Exp $	*/
 /*	$OpenBSD: if_run.c,v 1.90 2012/03/24 15:11:04 jsg Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.25 2018/01/21 13:57:12 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_run.c,v 1.26 2018/02/01 16:49:34 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2241,7 +2241,7 @@ run_rx_frame(struct run_softc *sc, uint8
 
 	if (flags & RT2860_RX_L2PAD) {
 		u_int hdrlen = ieee80211_hdrspace(ic, wh);
-		ovbcopy(wh, (uint8_t *)wh + 2, hdrlen);
+		memmove((uint8_t *)wh + 2, wh, hdrlen);
 		wh = (struct ieee80211_frame *)((uint8_t *)wh + 2);
 	}
 



CVS commit: src/sys/netinet6

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 16:36:01 UTC 2018

Modified Files:
src/sys/netinet6: scope6.c

Log Message:
Style, no real functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/netinet6/scope6.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/netinet6/scope6.c
diff -u src/sys/netinet6/scope6.c:1.18 src/sys/netinet6/scope6.c:1.19
--- src/sys/netinet6/scope6.c:1.18	Sun Sep 17 17:36:06 2017
+++ src/sys/netinet6/scope6.c	Thu Feb  1 16:36:01 2018
@@ -1,7 +1,7 @@
-/*	$NetBSD: scope6.c,v 1.18 2017/09/17 17:36:06 christos Exp $	*/
+/*	$NetBSD: scope6.c,v 1.19 2018/02/01 16:36:01 maxv Exp $	*/
 /*	$KAME$	*/
 
-/*-
+/*
  * Copyright (C) 2000 WIDE Project.
  * All rights reserved.
  *
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.18 2017/09/17 17:36:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scope6.c,v 1.19 2018/02/01 16:36:01 maxv Exp $");
 
 #include 
 #include 
@@ -72,8 +72,7 @@ scope6_ifattach(struct ifnet *ifp)
 {
 	struct scope6_id *sid;
 
-	sid = (struct scope6_id *)malloc(sizeof(*sid), M_IFADDR, M_WAITOK);
-	memset(sid, 0, sizeof(*sid));
+	sid = malloc(sizeof(*sid), M_IFADDR, M_WAITOK | M_ZERO);
 
 	/*
 	 * XXX: IPV6_ADDR_SCOPE_xxx macros are not standard.
@@ -105,7 +104,7 @@ scope6_set(struct ifnet *ifp, const stru
 	struct scope6_id *sid = SID(ifp);
 
 	if (!sid)	/* paranoid? */
-		return (EINVAL);
+		return EINVAL;
 
 	/*
 	 * XXX: We need more consistency checks of the relationship among
@@ -127,7 +126,7 @@ scope6_set(struct ifnet *ifp, const stru
 			 */
 			if (i == IPV6_ADDR_SCOPE_INTFACELOCAL &&
 			idlist->s6id_list[i] != ifp->if_index)
-return (EINVAL);
+return EINVAL;
 
 			s = pserialize_read_enter();
 			if (i == IPV6_ADDR_SCOPE_LINKLOCAL &&
@@ -139,7 +138,7 @@ scope6_set(struct ifnet *ifp, const stru
  * safety in later use.
  */
 pserialize_read_exit(s);
-return (EINVAL);
+return EINVAL;
 			}
 			pserialize_read_exit(s);
 
@@ -152,7 +151,7 @@ scope6_set(struct ifnet *ifp, const stru
 		}
 	}
 
-	return (error);
+	return error;
 }
 
 int
@@ -191,7 +190,6 @@ in6_addrscope(const struct in6_addr *add
 		}
 	}
 
-
 	if (addr->s6_addr[0] == 0xff) {
 		scope = addr->s6_addr[1] & 0x0f;
 
@@ -255,7 +253,7 @@ scope6_get_default(struct scope6_id *idl
 
 	*idlist = sid_default;
 
-	return (0);
+	return 0;
 }
 
 uint32_t
@@ -268,7 +266,7 @@ scope6_addr2default(const struct in6_add
 	 * link-local, but there's no ambiguity in the syntax.
 	 */
 	if (IN6_IS_ADDR_LOOPBACK(addr))
-		return (0);
+		return 0;
 
 	/*
 	 * XXX: 32-bit read is atomic on all our platforms, is it OK
@@ -276,7 +274,7 @@ scope6_addr2default(const struct in6_add
 	 */
 	id = sid_default.s6id_list[in6_addrscope(addr)];
 
-	return (id);
+	return id;
 }
 
 /*
@@ -310,7 +308,7 @@ sa6_embedscope(struct sockaddr_in6 *sin6
 		ifp = if_byindex(zoneid);
 		if (ifp == NULL) {
 			pserialize_read_exit(s);
-			return (ENXIO);
+			return ENXIO;
 		}
 		pserialize_read_exit(s);
 
@@ -362,7 +360,7 @@ sa6_recoverscope(struct sockaddr_in6 *si
 			int s = pserialize_read_enter();
 			if (!if_byindex(zoneid)) {
 pserialize_read_exit(s);
-return (ENXIO);
+return ENXIO;
 			}
 			pserialize_read_exit(s);
 			sin6->sin6_addr.s6_addr16[1] = 0;
@@ -385,7 +383,7 @@ in6_setzoneid(struct in6_addr *in6, uint
 /*
  * Determine the appropriate scope zone ID for in6 and ifp.  If ret_id is
  * non NULL, it is set to the zone ID.  If the zone ID needs to be embedded
- * in the in6_addr structure, in6 will be modified. 
+ * in the in6_addr structure, in6 will be modified.
  */
 int
 in6_setscope(struct in6_addr *in6, const struct ifnet *ifp, uint32_t *ret_id)
@@ -452,15 +450,22 @@ const char *
 in6_getscopename(const struct in6_addr *addr)
 {
 	switch (in6_addrscope(addr)) {
-	case IPV6_ADDR_SCOPE_INTFACELOCAL:	return "interface";
+	case IPV6_ADDR_SCOPE_INTFACELOCAL:
+		return "interface";
 #if IPV6_ADDR_SCOPE_INTFACELOCAL != IPV6_ADDR_SCOPE_NODELOCAL
-	case IPV6_ADDR_SCOPE_NODELOCAL:		return "node";
+	case IPV6_ADDR_SCOPE_NODELOCAL:
+		return "node";
 #endif
-	case IPV6_ADDR_SCOPE_LINKLOCAL:		return "link";
-	case IPV6_ADDR_SCOPE_SITELOCAL:		return "site";
-	case IPV6_ADDR_SCOPE_ORGLOCAL:		return "organization";
-	case IPV6_ADDR_SCOPE_GLOBAL:		return "global";
-	default:return "unknown";
+	case IPV6_ADDR_SCOPE_LINKLOCAL:
+		return "link";
+	case IPV6_ADDR_SCOPE_SITELOCAL:
+		return "site";
+	case IPV6_ADDR_SCOPE_ORGLOCAL:
+		return "organization";
+	case IPV6_ADDR_SCOPE_GLOBAL:
+		return "global";
+	default:
+		return "unknown";
 	}
 }
 
@@ -479,5 +484,5 @@ in6_clearscope(struct in6_addr *in6)
 		in6->s6_addr16[1] = 0;
 	}
 
-	return (modified);
+	return modified;
 }



CVS commit: src/sys/netinet6

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 16:23:28 UTC 2018

Modified Files:
src/sys/netinet6: route6.c

Log Message:
Remove this code, RH0 must be dropped, according to RFC5095. FreeBSD and
OpenBSD already do the same. Also, style, and remove useless includes.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/netinet6/route6.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/netinet6/route6.c
diff -u src/sys/netinet6/route6.c:1.24 src/sys/netinet6/route6.c:1.25
--- src/sys/netinet6/route6.c:1.24	Thu Feb  1 16:17:00 2018
+++ src/sys/netinet6/route6.c	Thu Feb  1 16:23:28 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route6.c,v 1.24 2018/02/01 16:17:00 maxv Exp $	*/
+/*	$NetBSD: route6.c,v 1.25 2018/02/01 16:23:28 maxv Exp $	*/
 /*	$KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $	*/
 
 /*
@@ -31,13 +31,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.24 2018/02/01 16:17:00 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.25 2018/02/01 16:23:28 maxv Exp $");
 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #include 
 
@@ -46,14 +44,9 @@ __KERNEL_RCSID(0, "$NetBSD: route6.c,v 1
 #include 
 #include 
 #include 
-#include 
 
 #include 
 
-#if 0
-static int ip6_rthdr0(struct mbuf *, struct ip6_hdr *, struct ip6_rthdr0 *);
-#endif
-
 int
 route6_input(struct mbuf **mp, int *offp, int proto)
 {
@@ -68,41 +61,10 @@ route6_input(struct mbuf **mp, int *offp
 	}
 
 	switch (rh->ip6r_type) {
-#if 0
-	/*
-	 * See http://www.secdev.org/conf/IPv6_RH_security-csw07.pdf
-	 * for why IPV6_RTHDR_TYPE_0 is banned here.
-	 *
-	 * We return ICMPv6 parameter problem so that innocent people
-	 * (not an attacker) would notice about the use of IPV6_RTHDR_TYPE_0.
-	 * Since there's no amplification, and ICMPv6 error will be rate-
-	 * controlled, it shouldn't cause any problem.
-	 * If you are concerned about this, you may want to use the following
-	 * code fragment:
-	 *
-	 * case IPV6_RTHDR_TYPE_0:
-	 *	m_freem(m);
-	 *	return (IPPROTO_DONE);
-	 */
 	case IPV6_RTHDR_TYPE_0:
-		rhlen = (rh->ip6r_len + 1) << 3;
 		/*
-		 * note on option length:
-		 * maximum rhlen: 2048
-		 * max mbuf m_pulldown can handle: MCLBYTES == usually 2048
-		 * so, here we are assuming that m_pulldown can handle
-		 * rhlen == 2048 case.  this may not be a good thing to
-		 * assume - we may want to avoid pulling it up altogether.
+		 * RFC5095: RH0 must be treated as unrecognized.
 		 */
-		IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, rhlen);
-		if (rh == NULL) {
-			IP6_STATINC(IP6_STAT_TOOSHORT);
-			return IPPROTO_DONE;
-		}
-		if (ip6_rthdr0(m, ip6, (struct ip6_rthdr0 *)rh))
-			return (IPPROTO_DONE);
-		break;
-#endif
 	default:
 		/* unknown routing type */
 		if (rh->ip6r_segleft == 0) {
@@ -112,111 +74,9 @@ route6_input(struct mbuf **mp, int *offp
 		IP6_STATINC(IP6_STAT_BADOPTIONS);
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
 		off + offsetof(struct ip6_rthdr, ip6r_type));
-		return (IPPROTO_DONE);
+		return IPPROTO_DONE;
 	}
 
 	*offp += rhlen;
-	return (rh->ip6r_nxt);
-}
-
-#if 0
-/*
- * Type0 routing header processing
- *
- * RFC2292 backward compatibility warning: no support for strict/loose bitmap,
- * as it was dropped between RFC1883 and RFC2460.
- */
-static int
-ip6_rthdr0(struct mbuf *m, struct ip6_hdr *ip6, 
-	struct ip6_rthdr0 *rh0)
-{
-	int addrs, index;
-	struct in6_addr *nextaddr, tmpaddr;
-	const struct ip6aux *ip6a;
-
-	if (rh0->ip6r0_segleft == 0)
-		return (0);
-
-	if (rh0->ip6r0_len % 2
-#ifdef COMPAT_RFC1883
-	|| rh0->ip6r0_len > 46
-#endif
-		) {
-		/*
-		 * Type 0 routing header can't contain more than 23 addresses.
-		 * RFC 2462: this limitation was removed since strict/loose
-		 * bitmap field was deleted.
-		 */
-		IP6_STATINC(IP6_STAT_BADOPTIONS);
-		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)>ip6r0_len - (char *)ip6);
-		return (-1);
-	}
-
-	if ((addrs = rh0->ip6r0_len / 2) < rh0->ip6r0_segleft) {
-		IP6_STATINC(IP6_STAT_BADOPTIONS);
-		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)>ip6r0_segleft - (char *)ip6);
-		return (-1);
-	}
-
-	index = addrs - rh0->ip6r0_segleft;
-	rh0->ip6r0_segleft--;
-	nextaddr = ((struct in6_addr *)(rh0 + 1)) + index;
-
-	/*
-	 * reject invalid addresses.  be proactive about malicious use of
-	 * IPv4 mapped/compat address.
-	 * XXX need more checks?
-	 */
-	if (IN6_IS_ADDR_MULTICAST(nextaddr) ||
-	IN6_IS_ADDR_UNSPECIFIED(nextaddr) ||
-	IN6_IS_ADDR_V4MAPPED(nextaddr) ||
-	IN6_IS_ADDR_V4COMPAT(nextaddr)) {
-		p6stat[IP6_STAT_BADOPTIONS]++;
-		goto bad;
-	}
-	if (IN6_IS_ADDR_MULTICAST(>ip6_dst) ||
-	IN6_IS_ADDR_UNSPECIFIED(>ip6_dst) ||
-	IN6_IS_ADDR_V4MAPPED(>ip6_dst) ||
-	IN6_IS_ADDR_V4COMPAT(>ip6_dst)) {
-		IP6_STATINC(IP6_STAT_BADOPTIONS);
-		goto bad;
-	}
-
-	/*
-	 * Determine the scope zone of the 

CVS commit: src/sys/netinet6

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 16:17:00 UTC 2018

Modified Files:
src/sys/netinet6: route6.c

Log Message:
Fix the ICMP error code. rh was obtained via IP6_EXTHDR_GET, and it is not
guaranteed to be in the same mbuf as ip6, so computing the difference
between the pointers may result in a wrong offset.

ip6 is now unused, so remove it.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/netinet6/route6.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/netinet6/route6.c
diff -u src/sys/netinet6/route6.c:1.23 src/sys/netinet6/route6.c:1.24
--- src/sys/netinet6/route6.c:1.23	Tue Apr 15 03:57:04 2008
+++ src/sys/netinet6/route6.c	Thu Feb  1 16:17:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: route6.c,v 1.23 2008/04/15 03:57:04 thorpej Exp $	*/
+/*	$NetBSD: route6.c,v 1.24 2018/02/01 16:17:00 maxv Exp $	*/
 /*	$KAME: route6.c,v 1.22 2000/12/03 00:54:00 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.23 2008/04/15 03:57:04 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route6.c,v 1.24 2018/02/01 16:17:00 maxv Exp $");
 
 #include 
 #include 
@@ -57,12 +57,10 @@ static int ip6_rthdr0(struct mbuf *, str
 int
 route6_input(struct mbuf **mp, int *offp, int proto)
 {
-	struct ip6_hdr *ip6;
 	struct mbuf *m = *mp;
 	struct ip6_rthdr *rh;
 	int off = *offp, rhlen;
 
-	ip6 = mtod(m, struct ip6_hdr *);
 	IP6_EXTHDR_GET(rh, struct ip6_rthdr *, m, off, sizeof(*rh));
 	if (rh == NULL) {
 		IP6_STATINC(IP6_STAT_TOOSHORT);
@@ -113,7 +111,7 @@ route6_input(struct mbuf **mp, int *offp
 		}
 		IP6_STATINC(IP6_STAT_BADOPTIONS);
 		icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
-			(char *)>ip6r_type - (char *)ip6);
+		off + offsetof(struct ip6_rthdr, ip6r_type));
 		return (IPPROTO_DONE);
 	}
 



CVS commit: src/sys/netinet6

2018-02-01 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu Feb  1 15:53:16 UTC 2018

Modified Files:
src/sys/netinet6: raw_ip6.c

Log Message:
Fix use-after-free, the first m_copyback_cow may have freed the mbuf, so
it is wrong to read ip6->ip6_nxt.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/netinet6/raw_ip6.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/netinet6/raw_ip6.c
diff -u src/sys/netinet6/raw_ip6.c:1.160 src/sys/netinet6/raw_ip6.c:1.161
--- src/sys/netinet6/raw_ip6.c:1.160	Tue Jan 30 14:49:25 2018
+++ src/sys/netinet6/raw_ip6.c	Thu Feb  1 15:53:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: raw_ip6.c,v 1.160 2018/01/30 14:49:25 maxv Exp $	*/
+/*	$NetBSD: raw_ip6.c,v 1.161 2018/02/01 15:53:16 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.160 2018/01/30 14:49:25 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: raw_ip6.c,v 1.161 2018/02/01 15:53:16 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -475,6 +475,7 @@ rip6_output(struct mbuf *m, struct socke
 
 	if (so->so_proto->pr_protocol == IPPROTO_ICMPV6 ||
 	in6p->in6p_cksum != -1) {
+		const uint8_t nxt = ip6->ip6_nxt;
 		int off;
 		u_int16_t sum;
 
@@ -496,7 +497,7 @@ rip6_output(struct mbuf *m, struct socke
 			error = ENOBUFS;
 			goto bad;
 		}
-		sum = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
+		sum = in6_cksum(m, nxt, sizeof(*ip6), plen);
 		m = m_copyback_cow(m, off, sizeof(sum), (void *),
 		M_DONTWAIT);
 		if (m == NULL) {



CVS commit: src/sys/arch/arm/sunxi

2018-02-01 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Feb  1 14:50:36 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun6i_spi.c

Log Message:
wait at most one second for controller to complete reset


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun6i_spi.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/arm/sunxi/sun6i_spi.c
diff -u src/sys/arch/arm/sunxi/sun6i_spi.c:1.1 src/sys/arch/arm/sunxi/sun6i_spi.c:1.2
--- src/sys/arch/arm/sunxi/sun6i_spi.c:1.1	Wed Jan 31 16:24:11 2018
+++ src/sys/arch/arm/sunxi/sun6i_spi.c	Thu Feb  1 14:50:36 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: sun6i_spi.c,v 1.1 2018/01/31 16:24:11 jakllsch Exp $	*/
+/*	$NetBSD: sun6i_spi.c,v 1.2 2018/02/01 14:50:36 jakllsch Exp $	*/
 
 /*
  * Copyright (c) 2018 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun6i_spi.c,v 1.1 2018/01/31 16:24:11 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun6i_spi.c,v 1.2 2018/02/01 14:50:36 jakllsch Exp $");
 
 #include 
 #include 
@@ -169,8 +169,17 @@ sun6ispi_attach(device_t parent, device_
 
 	gcr = SPI_GCR_SRST;
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, SPI_GCR, gcr);
-	do {
-	} while ((bus_space_read_4(sc->sc_iot, sc->sc_ioh, SPI_GCR) & SPI_GCR_SRST) != 0);
+	for (u_int i = 0; ; i++) {
+		if (i >= 100) {
+			aprint_error_dev(self, "reset timeout\n");
+			return;
+		}
+		gcr = bus_space_read_4(sc->sc_iot, sc->sc_ioh, SPI_GCR);
+		if ((gcr & SPI_GCR_SRST) == 0)
+			break;
+		else
+			DELAY(1);
+	}
 	gcr = SPI_GCR_TP_EN | SPI_GCR_MODE | SPI_GCR_EN;
 	bus_space_write_4(sc->sc_iot, sc->sc_ioh, SPI_GCR, gcr);
 



CVS commit: src/doc

2018-02-01 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Feb  1 12:09:19 UTC 2018

Modified Files:
src/doc: 3RDPARTY

Log Message:
gdb-8.1 out.


To generate a diff of this commit:
cvs rdiff -u -r1.1499 -r1.1500 src/doc/3RDPARTY

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1499 src/doc/3RDPARTY:1.1500
--- src/doc/3RDPARTY:1.1499	Wed Jan 31 22:12:21 2018
+++ src/doc/3RDPARTY	Thu Feb  1 12:09:19 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1499 2018/01/31 22:12:21 mlelstv Exp $
+#	$NetBSD: 3RDPARTY,v 1.1500 2018/02/01 12:09:19 wiz Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -483,7 +483,7 @@ Before importing a new version of extern
 
 Package:	gdb
 Version:	8.0.1
-Current Vers:	8.0.1
+Current Vers:	8.1
 Maintainer:	FSF
 Archive Site:	ftp://ftp.gnu.org/gnu/gdb/
 Home Page:	http://www.gnu.org/software/gdb/



CVS commit: src/sys

2018-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  1 09:55:37 UTC 2018

Modified Files:
src/sys/dev/usb: ohci.c xhci.c
src/sys/external/bsd/dwc2: dwc2.c

Log Message:
 Fix KASSERT panic. When detaching USB host controoler, the following panic
occured:
kernel diagnostic assertion "sc->sc_intrxfer == xfer" failed: file 
"../../../../dev/usb/ohci.c", line 1720
Clear sc_intrxfer correctly. Adviced by Nick and tested by me.


To generate a diff of this commit:
cvs rdiff -u -r1.277 -r1.278 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.84 -r1.85 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.47 -r1.48 src/sys/external/bsd/dwc2/dwc2.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/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.277 src/sys/dev/usb/ohci.c:1.278
--- src/sys/dev/usb/ohci.c:1.277	Thu Feb  1 09:47:47 2018
+++ src/sys/dev/usb/ohci.c	Thu Feb  1 09:55:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.277 2018/02/01 09:47:47 msaitoh Exp $	*/
+/*	$NetBSD: ohci.c,v 1.278 2018/02/01 09:55:37 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.277 2018/02/01 09:47:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.278 2018/02/01 09:55:37 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2591,8 +2591,6 @@ ohci_root_intr_abort(struct usbd_xfer *x
 	KASSERT(mutex_owned(>sc_lock));
 	KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-	sc->sc_intrxfer = NULL;
-
 	xfer->ux_status = USBD_CANCELLED;
 	usb_transfer_complete(xfer);
 }

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.84 src/sys/dev/usb/xhci.c:1.85
--- src/sys/dev/usb/xhci.c:1.84	Tue Jan 30 08:53:39 2018
+++ src/sys/dev/usb/xhci.c	Thu Feb  1 09:55:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $	*/
+/*	$NetBSD: xhci.c,v 1.85 2018/02/01 09:55:37 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.85 2018/02/01 09:55:37 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -3659,15 +3659,12 @@ static void
 xhci_root_intr_abort(struct usbd_xfer *xfer)
 {
 	struct xhci_softc * const sc = XHCI_XFER2SC(xfer);
-	const size_t bn = XHCI_XFER2BUS(xfer) == >sc_bus ? 0 : 1;
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
 	KASSERT(mutex_owned(>sc_lock));
 	KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-	sc->sc_intrxfer[bn] = NULL;
-
 	xfer->ux_status = USBD_CANCELLED;
 	usb_transfer_complete(xfer);
 }

Index: src/sys/external/bsd/dwc2/dwc2.c
diff -u src/sys/external/bsd/dwc2/dwc2.c:1.47 src/sys/external/bsd/dwc2/dwc2.c:1.48
--- src/sys/external/bsd/dwc2/dwc2.c:1.47	Fri Nov 17 08:22:02 2017
+++ src/sys/external/bsd/dwc2/dwc2.c	Thu Feb  1 09:55:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dwc2.c,v 1.47 2017/11/17 08:22:02 skrll Exp $	*/
+/*	$NetBSD: dwc2.c,v 1.48 2018/02/01 09:55:37 msaitoh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.47 2017/11/17 08:22:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.48 2018/02/01 09:55:37 msaitoh Exp $");
 
 #include "opt_usb.h"
 
@@ -642,8 +642,6 @@ dwc2_root_intr_abort(struct usbd_xfer *x
 	KASSERT(mutex_owned(>sc_lock));
 	KASSERT(xfer->ux_pipe->up_intrxfer == xfer);
 
-	sc->sc_intrxfer = NULL;
-
 	xfer->ux_status = USBD_CANCELLED;
 	usb_transfer_complete(xfer);
 }



CVS commit: src/sys/dev/usb

2018-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  1 09:50:48 UTC 2018

Modified Files:
src/sys/dev/usb: uhub.c

Log Message:
 Mark DVF_DETACH_SHUTDOWN to USB root HUB. This change makes USB host
controller drivers detachable. OK'd by Nick.


To generate a diff of this commit:
cvs rdiff -u -r1.137 -r1.138 src/sys/dev/usb/uhub.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/usb/uhub.c
diff -u src/sys/dev/usb/uhub.c:1.137 src/sys/dev/usb/uhub.c:1.138
--- src/sys/dev/usb/uhub.c:1.137	Sat Oct 28 00:37:12 2017
+++ src/sys/dev/usb/uhub.c	Thu Feb  1 09:50:48 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhub.c,v 1.137 2017/10/28 00:37:12 pgoyette Exp $	*/
+/*	$NetBSD: uhub.c,v 1.138 2018/02/01 09:50:48 msaitoh Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $	*/
 /*	$OpenBSD: uhub.c,v 1.86 2015/06/29 18:27:40 mpi Exp $ */
 
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.137 2017/10/28 00:37:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhub.c,v 1.138 2018/02/01 09:50:48 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -144,8 +144,9 @@ extern struct cfdriver uhub_cd;
 CFATTACH_DECL3_NEW(uhub, sizeof(struct uhub_softc), uhub_match,
 uhub_attach, uhub_detach, NULL, uhub_rescan, uhub_childdet,
 DVF_DETACH_SHUTDOWN);
-CFATTACH_DECL2_NEW(uroothub, sizeof(struct uhub_softc), uhub_match,
-uhub_attach, uhub_detach, NULL, uhub_rescan, uhub_childdet);
+CFATTACH_DECL3_NEW(uroothub, sizeof(struct uhub_softc), uhub_match,
+uhub_attach, uhub_detach, NULL, uhub_rescan, uhub_childdet,
+DVF_DETACH_SHUTDOWN);
 
 /*
  * Setting this to 1 makes sure than an uhub attaches even at higher



CVS commit: src/sys/dev/usb

2018-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  1 09:47:47 UTC 2018

Modified Files:
src/sys/dev/usb: ohci.c

Log Message:
- Fix panic on shutdown reported by ozaki-r in PR kern/52961. Use callot_halt()
  correctly. Tested by me and OK'd by Nick.
- Disable interrupt in och_shutdown() to prevent hangup. OK'd by Nick.


To generate a diff of this commit:
cvs rdiff -u -r1.276 -r1.277 src/sys/dev/usb/ohci.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/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.276 src/sys/dev/usb/ohci.c:1.277
--- src/sys/dev/usb/ohci.c:1.276	Fri Nov 17 08:22:02 2017
+++ src/sys/dev/usb/ohci.c	Thu Feb  1 09:47:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.276 2017/11/17 08:22:02 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.277 2018/02/01 09:47:47 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.276 2017/11/17 08:22:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.277 2018/02/01 09:47:47 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -377,13 +377,11 @@ ohci_detach(struct ohci_softc *sc, int f
 	if (rv != 0)
 		return rv;
 
-	callout_halt(>sc_tmo_rhsc, >sc_lock);
+	softint_disestablish(sc->sc_rhsc_si);
 
-	usb_delay_ms(>sc_bus, 300); /* XXX let stray task complete */
+	callout_halt(>sc_tmo_rhsc, NULL);
 	callout_destroy(>sc_tmo_rhsc);
 
-	softint_disestablish(sc->sc_rhsc_si);
-
 	cv_destroy(>sc_softwake_cv);
 
 	mutex_destroy(>sc_lock);
@@ -,6 +1109,7 @@ ohci_shutdown(device_t self, int flags)
 	OHCIHIST_FUNC(); OHCIHIST_CALLED();
 
 	DPRINTF("stopping the HC", 0, 0, 0, 0);
+	OWRITE4(sc, OHCI_INTERRUPT_DISABLE, OHCI_ALL_INTRS);
 	OWRITE4(sc, OHCI_CONTROL, OHCI_HCFS_RESET);
 	return true;
 }



CVS commit: src/sys/dev/pci

2018-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  1 09:09:14 UTC 2018

Modified Files:
src/sys/dev/pci: pci_subr.c pcireg.h

Log Message:
- Add PCie Link Activation ECN.
- Use macro.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.136 -r1.137 src/sys/dev/pci/pcireg.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/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.199 src/sys/dev/pci/pci_subr.c:1.200
--- src/sys/dev/pci/pci_subr.c:1.199	Thu Feb  1 08:18:47 2018
+++ src/sys/dev/pci/pci_subr.c	Thu Feb  1 09:09:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.199 2018/02/01 08:18:47 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.200 2018/02/01 09:09:14 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.199 2018/02/01 08:18:47 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.200 2018/02/01 09:09:14 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1769,10 +1769,10 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	/* Capability Register */
 	reg = regs[o2i(capoff)];
 	printf("Capability register: 0x%04x\n", reg >> 16);
-	pciever = (unsigned int)((reg & 0x000f) >> 16);
+	pciever = (unsigned int)(PCIE_XCAP_VER(reg));
 	printf("  Capability version: %u\n", pciever);
 	printf("  Device type: ");
-	switch ((reg & 0x00f0) >> 20) {
+	switch (PCIE_XCAP_TYPE(reg)) {
 	case PCIE_XCAP_TYPE_PCIE_DEV:	/* 0x0 */
 		printf("PCI Express Endpoint device\n");
 		check_upstreamport = true;
@@ -3634,7 +3634,7 @@ pci_conf_print_sec_pcie_cap(const pcireg
 	printf("Lane Error Status register: 0x%08x\n", reg);
 
 	/* Get Max Link Width */
-	if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, _capoff)){
+	if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, _capoff)) {
 		reg = regs[o2i(pcie_capoff + PCIE_LCAP)];
 		maxlinkwidth = __SHIFTOUT(reg, PCIE_LCAP_MAX_WIDTH);
 	} else {
@@ -3873,6 +3873,7 @@ pci_conf_print_l1pm_cap(const pcireg_t *
 {
 	pcireg_t reg;
 	int scale, val;
+	int pcie_capoff;
 
 	printf("\n  L1 PM Substates\n");
 
@@ -3883,6 +3884,14 @@ pci_conf_print_l1pm_cap(const pcireg_t *
 	onoff("ASPM L1.2 Supported", reg, PCI_L1PM_CAP_ASPM12);
 	onoff("ASPM L1.1 Supported", reg, PCI_L1PM_CAP_ASPM11);
 	onoff("L1 PM Substates Supported", reg, PCI_L1PM_CAP_L1PM);
+	/* The Link Activation Supported bit is only for Downstream Port */
+	if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, _capoff)) {
+		uint32_t t = regs[o2i(pcie_capoff)];
+
+		if ((t == PCIE_XCAP_TYPE_ROOT) || (t == PCIE_XCAP_TYPE_DOWN))
+			onoff("Link Activation Supported", reg,
+			PCI_L1PM_CAP_LA);
+	}
 	printf("  Port Common Mode Restore Time: %uus\n",
 	(unsigned int)__SHIFTOUT(reg, PCI_L1PM_CAP_PCMRT));
 	scale = pci_conf_l1pm_cap_tposcale(
@@ -3900,6 +3909,8 @@ pci_conf_print_l1pm_cap(const pcireg_t *
 	onoff("PCI-PM L1.1 Enable", reg, PCI_L1PM_CTL1_PCIPM11_EN);
 	onoff("ASPM L1.2 Enable", reg, PCI_L1PM_CTL1_ASPM12_EN);
 	onoff("ASPM L1.1 Enable", reg, PCI_L1PM_CTL1_ASPM11_EN);
+	onoff("Link Activation Interrupt Enable", reg, PCI_L1PM_CTL1_LAIE);
+	onoff("Link Activation Control", reg, PCI_L1PM_CTL1_LA);
 	printf("  Common Mode Restore Time: %uus\n",
 	(unsigned int)__SHIFTOUT(reg, PCI_L1PM_CTL1_CMRT));
 	scale = PCI_LTR_SCALETONS(__SHIFTOUT(reg, PCI_L1PM_CTL1_LTRTHSCALE));
@@ -3916,6 +3927,12 @@ pci_conf_print_l1pm_cap(const pcireg_t *
 		printf("unknown\n");
 	else
 		printf("%dus\n", val * scale);
+
+	if (PCI_EXTCAPLIST_VERSION(regs[o2i(extcapoff)]) >= 2) {
+		reg = regs[o2i(extcapoff + PCI_L1PM_CTL2)];
+		printf("L1 PM Substates Status register: 0x%08x\n", reg);
+		onoff("Link Activation Status", reg, PCI_L1PM_STAT_LA);
+	}
 }
 
 static void

Index: src/sys/dev/pci/pcireg.h
diff -u src/sys/dev/pci/pcireg.h:1.136 src/sys/dev/pci/pcireg.h:1.137
--- src/sys/dev/pci/pcireg.h:1.136	Mon Dec 18 04:48:28 2017
+++ src/sys/dev/pci/pcireg.h	Thu Feb  1 09:09:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcireg.h,v 1.136 2017/12/18 04:48:28 msaitoh Exp $	*/
+/*	$NetBSD: pcireg.h,v 1.137 2018/02/01 09:09:14 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1995, 1996, 1999, 2000
@@ -2041,6 +2041,7 @@ struct pci_rom {
 #define	PCI_L1PM_CAP_ASPM12	__BIT(2)	/* ASPM L1.2 Supported */
 #define	PCI_L1PM_CAP_ASPM11	__BIT(3)	/* ASPM L1.1 Supported */
 #define	PCI_L1PM_CAP_L1PM	__BIT(4)	/* L1 PM Substates Supported */
+#define	PCI_L1PM_CAP_LA	__BIT(5)		/* Link Activation Supported */
 #define	PCI_L1PM_CAP_PCMRT	__BITS(15, 8) /*Port Common Mode Restore Time*/
 #define	PCI_L1PM_CAP_PTPOSCALE	__BITS(17, 16)	/* Port T_POWER_ON Scale */
 #define	PCI_L1PM_CAP_PTPOVAL	__BITS(23, 19)	/* Port T_POWER_ON Value */
@@ -2049,12 +2050,16 @@ struct pci_rom {
 #define	PCI_L1PM_CTL1_PCIPM11_EN __BIT(1)	/* PCI-PM L1.1 Enable */
 #define	

CVS commit: src/sys/dev/pci

2018-02-01 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu Feb  1 08:18:47 UTC 2018

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

Log Message:
Cleanup:
- Don't pass a capability pointer as a argument of pci_conf_find_cap() and
  determine the first pointer in the pci_conf_find_cap() function.
- Don't pass a capability pointer as a argument of pci_conf_find_extcap()
  because it's not used.
- Remove unsed code.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/dev/pci/pci_subr.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/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.198 src/sys/dev/pci/pci_subr.c:1.199
--- src/sys/dev/pci/pci_subr.c:1.198	Thu Feb  1 02:50:51 2018
+++ src/sys/dev/pci/pci_subr.c	Thu Feb  1 08:18:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.198 2018/02/01 02:50:51 msaitoh Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.199 2018/02/01 08:18:47 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.198 2018/02/01 02:50:51 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.199 2018/02/01 08:18:47 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -70,7 +70,8 @@ __KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v
 #include 
 #endif
 
-static int pci_conf_find_cap(const pcireg_t *, int, unsigned int, int *);
+static int pci_conf_find_cap(const pcireg_t *, unsigned int, int *);
+static int pci_conf_find_extcap(const pcireg_t *, unsigned int, int *);
 static void pci_conf_print_pcie_power(uint8_t, unsigned int);
 
 /*
@@ -831,8 +832,7 @@ pci_conf_print_common(
 		int pcie_capoff;
 		pcireg_t reg;
 
-		if (pci_conf_find_cap(regs, PCI_CAPLISTPTR_REG,
-		PCI_CAP_PCIEXPRESS, _capoff)) {
+		if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, _capoff)) {
 			reg = regs[o2i(pcie_capoff + PCIE_XCAP)];
 			if (PCIE_XCAP_TYPE(reg) == PCIE_XCAP_TYPE_ROOT_EVNTC)
 subclass = PCI_SUBCLASS_SYSTEM_RCEC;
@@ -2446,13 +2446,29 @@ static struct {
 };
 
 static int
-pci_conf_find_cap(const pcireg_t *regs, int capoff, unsigned int capid,
-int *offsetp)
+pci_conf_find_cap(const pcireg_t *regs, unsigned int capid, int *offsetp)
 {
 	pcireg_t rval;
+	unsigned int capptr;
 	int off;
 
-	for (off = PCI_CAPLIST_PTR(regs[o2i(capoff)]);
+	if (!(regs[o2i(PCI_COMMAND_STATUS_REG)] & PCI_STATUS_CAPLIST_SUPPORT))
+		return 0;
+
+	/* Determine the Capability List Pointer register to start with. */
+	switch (PCI_HDRTYPE_TYPE(regs[o2i(PCI_BHLC_REG)])) {
+	case 0:	/* standard device header */
+	case 1: /* PCI-PCI bridge header */
+		capptr = PCI_CAPLISTPTR_REG;
+		break;
+	case 2:	/* PCI-CardBus Bridge header */
+		capptr = PCI_CARDBUS_CAPLISTPTR_REG;
+		break;
+	default:
+		return 0;
+	}
+	
+	for (off = PCI_CAPLIST_PTR(regs[o2i(capptr)]);
 	 off != 0; off = PCI_CAPLIST_NEXT(rval)) {
 		rval = regs[o2i(off)];
 		if (capid == PCI_CAPLIST_CAP(rval)) {
@@ -2511,13 +2527,6 @@ pci_conf_print_caplist(
 		 * the same. This is required because some capabilities
 		 * appear multiple times (e.g. HyperTransport capability).
 		 */
-#if 0
-		if (pci_conf_find_cap(regs, capoff, i, )) {
-			rval = regs[o2i(off)];
-			if (pci_captab[i].printfunc != NULL)
-pci_captab[i].printfunc(regs, off);
-		}
-#else
 		for (off = PCI_CAPLIST_PTR(regs[o2i(capoff)]);
 		 off != 0; off = PCI_CAPLIST_NEXT(regs[o2i(off)])) {
 			rval = regs[o2i(off)];
@@ -2525,7 +2534,6 @@ pci_conf_print_caplist(
 			&& (pci_captab[i].printfunc != NULL))
 pci_captab[i].printfunc(regs, off);
 		}
-#endif
 	}
 }
 
@@ -2633,14 +2641,14 @@ pci_conf_print_aer_cap_errsrc_id(pcireg_
 }
 
 static void
-pci_conf_print_aer_cap(const pcireg_t *regs, int capoff, int extcapoff)
+pci_conf_print_aer_cap(const pcireg_t *regs, int extcapoff)
 {
 	pcireg_t reg;
 	int pcie_capoff;
 	int pcie_devtype = -1;
 	bool tlp_prefix_log = false;
 
-	if (pci_conf_find_cap(regs, capoff, PCI_CAP_PCIEXPRESS, _capoff)) {
+	if (pci_conf_find_cap(regs, PCI_CAP_PCIEXPRESS, _capoff)) {
 		reg = regs[o2i(pcie_capoff)];
 		pcie_devtype = PCIE_XCAP_TYPE(reg);
 		/* PCIe DW9 to DW14 is for PCIe 2.0 and newer */
@@ -2727,7 +2735,7 @@ pci_conf_print_vc_cap_arbtab(const pcire
 }
 
 static void
-pci_conf_print_vc_cap(const pcireg_t *regs, int capoff, int extcapoff)
+pci_conf_print_vc_cap(const pcireg_t *regs, int extcapoff)
 {
 	pcireg_t reg, n;
 	int parbtab, parbsize;
@@ -2918,7 +2926,7 @@ pci_conf_print_pwrbdgt_pwrrail(uint8_t r
 }
 
 static void
-pci_conf_print_pwrbdgt_cap(const pcireg_t *regs, int capoff, int extcapoff)
+pci_conf_print_pwrbdgt_cap(const pcireg_t *regs, int extcapoff)
 {
 	pcireg_t reg;
 
@@ -2967,7 +2975,7 @@ pci_conf_print_rclink_dcl_cap_elmtype(un
 }
 
 static void
-pci_conf_print_rclink_dcl_cap(const pcireg_t *regs, int capoff, int extcapoff)
+pci_conf_print_rclink_dcl_cap(const pcireg_t *regs, int extcapoff)
 {