CVS commit: src/sys/compat/netbsd32

2018-04-13 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Apr 14 04:04:39 UTC 2018

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

Log Message:
redo the previous -- compat/sys/siginfo.h is already included
later, as is another header.  move them up near the top.


To generate a diff of this commit:
cvs rdiff -u -r1.116 -r1.117 src/sys/compat/netbsd32/netbsd32.h

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.116 src/sys/compat/netbsd32/netbsd32.h:1.117
--- src/sys/compat/netbsd32/netbsd32.h:1.116	Mon Dec 18 00:33:32 2017
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Apr 14 04:04:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.116 2017/12/18 00:33:32 mrg Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.117 2018/04/14 04:04:39 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -50,6 +50,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -1122,8 +1123,6 @@ int	coredump_netbsd32(struct lwp *, stru
 /*
  * random other stuff
  */
-#include 
-#include 
 
 vaddr_t netbsd32_vm_default_addr(struct proc *, vaddr_t, vsize_t, int);
 void netbsd32_adjust_limits(struct proc *);



CVS commit: [netbsd-8] src/doc

2018-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr 14 03:13:38 UTC 2018

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

Log Message:
update #713


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.180 -r1.1.2.181 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.180 src/doc/CHANGES-8.0:1.1.2.181
--- src/doc/CHANGES-8.0:1.1.2.180	Thu Apr 12 14:16:42 2018
+++ src/doc/CHANGES-8.0	Sat Apr 14 03:13:38 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.180 2018/04/12 14:16:42 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.181 2018/04/14 03:13:38 snj Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -12717,7 +12717,7 @@ share/man/man9/kauth.91.109
 sys/compat/linux/arch/arm/linux_ptrace.c	1.20
 sys/compat/linux/arch/i386/linux_ptrace.c	1.32
 sys/compat/linux/arch/powerpc/linux_ptrace.c	1.30
-sys/compat/netbsd32/netbsd32.h			1.115
+sys/compat/netbsd32/netbsd32.h			1.115-1.116
 sys/compat/netbsd32/netbsd32_ptrace.c		1.5
 sys/compat/netbsd32/netbsd32_signal.c		1.45
 sys/kern/kern_exit.c1.269



CVS commit: [netbsd-8] src/sys/compat/netbsd32

2018-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Apr 14 03:04:06 UTC 2018

Modified Files:
src/sys/compat/netbsd32 [netbsd-8]: netbsd32.h

Log Message:
Pull up revision 1.116 of sys/compat/netbsd32/netbsd32.h to fix fallout
from ticket #713:
include  for siginfo32_t.


To generate a diff of this commit:
cvs rdiff -u -r1.114.8.1 -r1.114.8.2 src/sys/compat/netbsd32/netbsd32.h

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.114.8.1 src/sys/compat/netbsd32/netbsd32.h:1.114.8.2
--- src/sys/compat/netbsd32/netbsd32.h:1.114.8.1	Thu Apr 12 13:42:49 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Sat Apr 14 03:04:06 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.114.8.1 2018/04/12 13:42:49 martin Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.114.8.2 2018/04/14 03:04:06 snj Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 



CVS commit: src/sys/kern

2018-04-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 14 01:53:38 UTC 2018

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

Log Message:
Change the default precision of timestamps from 9 digits (nanosecs)
to 7 (100's of nanosecs).   This should perhaps depend upon the
port (what resolution is rational) the CPU speed, and the clock
update frequency (no point printing nanoseconds if the value being
brinted is only updated every few microseconds).

Eventually it should be able to be controlled by a sysctl, but
the default still matters, as that's what the autoconf (boot time,
before init starts) messages will use.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/kern/subr_prf.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/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.169 src/sys/kern/subr_prf.c:1.170
--- src/sys/kern/subr_prf.c:1.169	Sat Apr 14 01:45:37 2018
+++ src/sys/kern/subr_prf.c	Sat Apr 14 01:53:38 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.169 2018/04/14 01:45:37 kre Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.169 2018/04/14 01:45:37 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.170 2018/04/14 01:53:38 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -484,7 +484,7 @@ putlogpri(int level)
 
 #ifndef KLOG_NOTIMESTAMP
 static int needtstamp = 1;
-int log_ts_prec = 9;
+int log_ts_prec = 7;
 
 static void
 addtstamp(int flags, struct tty *tp)



CVS commit: src/sys/kern

2018-04-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 14 01:45:37 UTC 2018

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

Log Message:
Allow the precision of the sub-second field of timestamps to
be controlled - for now that is done by editing this file and
recompiling (or using gdb or equiv to patch /netbsd or /dev/kmem)
but adding a sysctl to allow dynamic userland control should be easy.

Also reduce the initial seconds field width of timestamp from 5 to 4
(it grows wider as needed.)

Avoid printing timestamps if we cannot be sure there will be
a message to accompany them.   (Observed happening...)


To generate a diff of this commit:
cvs rdiff -u -r1.168 -r1.169 src/sys/kern/subr_prf.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/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.168 src/sys/kern/subr_prf.c:1.169
--- src/sys/kern/subr_prf.c:1.168	Fri Apr 13 09:21:16 2018
+++ src/sys/kern/subr_prf.c	Sat Apr 14 01:45:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.168 2018/04/13 09:21:16 christos Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.169 2018/04/14 01:45:37 kre Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.168 2018/04/13 09:21:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.169 2018/04/14 01:45:37 kre Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -484,17 +484,34 @@ putlogpri(int level)
 
 #ifndef KLOG_NOTIMESTAMP
 static int needtstamp = 1;
+int log_ts_prec = 9;
 
 static void
 addtstamp(int flags, struct tty *tp)
 {
 	char buf[64];
 	struct timespec ts;
-	int n;
+	int n, prec;
+	long fsec;
+
+	prec = log_ts_prec;
+	if (prec < 0) {
+		prec = 0;
+		log_ts_prec = prec;
+	} else if (prec > 9) {
+		prec = 9;
+		log_ts_prec = prec;
+	}
 
 	getnanouptime();
-	n = snprintf(buf, sizeof(buf), "[% 5jd.%.9ld] ",
-	(intmax_t)ts.tv_sec, ts.tv_nsec);
+
+	for (n = prec, fsec = ts.tv_nsec; n < 8; n++)
+		fsec /= 10;
+	if (n < 9)
+		fsec = (fsec / 10) + ((fsec % 10) >= 5);
+
+	n = snprintf(buf, sizeof(buf), "[% 4jd.%.*ld] ",
+	(intmax_t)ts.tv_sec, prec, fsec);
 
 	for (int i = 0; i < n; i++)
 		putone(buf[i], flags, tp);
@@ -517,13 +534,13 @@ putchar(int c, int flags, struct tty *tp
 	}
 
 #ifndef KLOG_NOTIMESTAMP
-	if (needtstamp) {
+	if (c != '\0' && c != '\n' && needtstamp) {
 		addtstamp(flags, tp);
 		needtstamp = 0;
 	}
 
 	if (c == '\n')
-		needtstamp++;
+		needtstamp = 1;
 #endif
 	putone(c, flags, tp);
 



CVS commit: src/sbin/dmesg

2018-04-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 14 01:37:34 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.c

Log Message:
Make timestamp reading code adapt to whatever precision (up to
nanoseconds, 9 digits) the kernel happens to send in the timestamps
in log messages.

Output (numeric) timestamps (when produced) are unchanged and always
in microseconds (for now).


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sbin/dmesg/dmesg.c

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

Modified files:

Index: src/sbin/dmesg/dmesg.c
diff -u src/sbin/dmesg/dmesg.c:1.32 src/sbin/dmesg/dmesg.c:1.33
--- src/sbin/dmesg/dmesg.c:1.32	Wed Apr 11 06:41:23 2018
+++ src/sbin/dmesg/dmesg.c	Sat Apr 14 01:37:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmesg.c,v 1.32 2018/04/11 06:41:23 wiz Exp $	*/
+/*	$NetBSD: dmesg.c,v 1.33 2018/04/14 01:37:34 kre Exp $	*/
 /*-
  * Copyright (c) 1991, 1993
  *	The Regents of the University of California.  All rights reserved.
@@ -38,7 +38,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 19
 #if 0
 static char sccsid[] = "@(#)dmesg.c	8.1 (Berkeley) 6/5/93";
 #else
-__RCSID("$NetBSD: dmesg.c,v 1.32 2018/04/11 06:41:23 wiz Exp $");
+__RCSID("$NetBSD: dmesg.c,v 1.33 2018/04/14 01:37:34 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -84,8 +84,10 @@ main(int argc, char *argv[])
 	struct timeval boottime;
 	struct timespec lasttime;
 	intmax_t sec;
-	long nsec;
+	long nsec, fsec;
+	int scale;
 	int deltas, quiet, humantime;
+	bool frac;
 	
 	static const int bmib[] = { CTL_KERN, KERN_BOOTTIME };
 	size = sizeof(boottime);
@@ -183,16 +185,23 @@ main(int argc, char *argv[])
 	 * over cur.msg_bufs times.  Unused area is skipped since it
 	 * contains nul.
 	 */
+#ifndef SMALL
+	frac = false;
+	scale = 0;
+#endif
 	for (tstamp = 0, newl = 1, log = i = 0, p = bufdata + cur.msg_bufx;
 	i < cur.msg_bufs; i++, p++) {
+
 #ifndef SMALL
 		if (p == bufdata + cur.msg_bufs)
 			p = bufdata;
 #define ADDC(c)\
-do 	\
+do {\
 	if (tstamp < sizeof(tbuf) - 1)	\
 		tbuf[tstamp++] = (c);	\
-while (/*CONSTCOND*/0)
+	if (frac)			\
+		scale++;		\
+} while (/*CONSTCOND*/0)
 #else
 #define ADDC(c)
 #endif
@@ -202,8 +211,16 @@ main(int argc, char *argv[])
 		/* Skip "\n<.*>" syslog sequences. */
 		/* Gather timestamp sequences */
 		if (newl) {
+#ifndef SMALL
+			int j;
+#endif
+
 			switch (ch) {
 			case '[':
+#ifndef SMALL
+frac = false;
+scale = 0;
+#endif
 ADDC(ch);
 continue;
 			case '<':
@@ -213,16 +230,37 @@ main(int argc, char *argv[])
 log = 0;
 continue;
 			case ']':
+#ifndef SMALL
+frac = false;
+#endif
 ADDC(ch);
 ADDC('\0');
 tstamp = 0;
 #ifndef SMALL
-sscanf(tbuf, "[%jd.%ld]", , );
+sec = fsec = 0;
+switch (sscanf(tbuf, "[%jd.%ld]", , )){
+case EOF:
+case 0:
+	/*???*/
+	continue;
+case 1:
+	fsec = 0;
+	break;
+case 2:
+	break;
+default:
+	/* Help */
+	continue;
+}
+
+for (nsec = fsec, j = 9 - scale; --j >= 0; )
+	nsec *= 10;
 if (!quiet || deltas)
 	printf("[");
 if (humantime) {
 	time_t t;
 	struct tm tm;
+
 	t = boottime.tv_sec + sec;
 	if (localtime_r(, ) != NULL) {
 		strftime(tbuf, sizeof(tbuf),
@@ -231,17 +269,23 @@ main(int argc, char *argv[])
 		printf("%s", tbuf);
 	}
 } else if (!quiet) {
-	printf("% 9jd.%06ld",
-	sec, nsec / 1000);
+	if (scale > 6)
+		printf("% 5jd.%6.6ld",
+		sec, (nsec + 499) / 1000);
+	else
+		printf("% 5jd.%*.*ld%.*s",
+		sec, scale, scale, fsec,
+		6 - scale, "00");
 }
 if (deltas) {
 	struct timespec nt = { sec, nsec };
 	struct timespec dt;
+
 	timespecsub(, , );
 	if (humantime || !quiet)
 		printf(" ");
 	printf("<% 4jd.%06ld>", (intmax_t)
-	dt.tv_sec, dt.tv_nsec / 1000);
+	dt.tv_sec, (dt.tv_nsec+499) / 1000);
 	lasttime = nt;
 }
 if (!quiet || deltas)
@@ -255,6 +299,10 @@ main(int argc, char *argv[])
 			default:
 if (tstamp) {
 ADDC(ch);
+#ifndef SMALL
+if (ch == '.')
+	frac = true;
+#endif
 continue;
 }
 if (log)



CVS commit: src/sbin/dmesg

2018-04-13 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sat Apr 14 01:34:47 UTC 2018

Modified Files:
src/sbin/dmesg: dmesg.8

Log Message:
Minor wording change (no date bump needed.)


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sbin/dmesg/dmesg.8

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

Modified files:

Index: src/sbin/dmesg/dmesg.8
diff -u src/sbin/dmesg/dmesg.8:1.20 src/sbin/dmesg/dmesg.8:1.21
--- src/sbin/dmesg/dmesg.8:1.20	Wed Apr 11 06:40:53 2018
+++ src/sbin/dmesg/dmesg.8	Sat Apr 14 01:34:47 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: dmesg.8,v 1.20 2018/04/11 06:40:53 wiz Exp $
+.\"	$NetBSD: dmesg.8,v 1.21 2018/04/14 01:34:47 kre Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -47,7 +47,7 @@ displays the contents of the system mess
 The options are as follows:
 .Bl -tag -width Ds
 .It Fl d
-Show just the timestamp deltas.
+Show the timestamp deltas.
 Used together with
 .Fl t
 only the deltas are shown.



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

2018-04-13 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Fri Apr 13 22:13:09 UTC 2018

Modified Files:
src/sys/arch/macppc/pci: u3.c

Log Message:
track bus-range for every bus and restrict config space accesses to that
range. Now pcictl pci* list no longer crashes the kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/macppc/pci/u3.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/macppc/pci/u3.c
diff -u src/sys/arch/macppc/pci/u3.c:1.8 src/sys/arch/macppc/pci/u3.c:1.9
--- src/sys/arch/macppc/pci/u3.c:1.8	Fri Oct  2 05:22:51 2015
+++ src/sys/arch/macppc/pci/u3.c	Fri Apr 13 22:13:09 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: u3.c,v 1.8 2015/10/02 05:22:51 msaitoh Exp $ */
+/* $NetBSD: u3.c,v 1.9 2018/04/13 22:13:09 macallan Exp $ */
 
 /*
  * Copyright 2006 Kyma Systems LLC.
@@ -54,8 +54,12 @@ struct ibmcpc_softc
 	struct genppc_pci_chipset sc_pc[8];
 	struct powerpc_bus_space sc_iot;
 	struct powerpc_bus_space sc_memt;
+	int sc_ranges[8];	
 };
 
+/* kinda ugly but there can be only one */
+static struct ibmcpc_softc *cpc0 = NULL;
+
 static void ibmcpc_attach(device_t, device_t, void *);
 static int ibmcpc_match(device_t, cfdata_t, void *);
 
@@ -108,6 +112,8 @@ ibmcpc_attach(device_t parent, device_t 
 	reg[1], reg[2]);
 	pc_data = mapiodev(reg[1], reg[2], false);
 
+	cpc0 = sc;
+
 	for (child = OF_child(OF_finddevice("/ht")), i = 1; child;
 	child = OF_peer(child), i++) {
 
@@ -141,6 +147,7 @@ ibmcpc_attach(device_t parent, device_t 
 		macppc_pci_get_chipset_tag(pc);
 		pc->pc_node = child;
 		pc->pc_bus = busrange[0];
+		sc->sc_ranges[pc->pc_bus] = busrange[1];
 		pc->pc_addr = 0x0;
 		pc->pc_data = pc_data;
 		pc->pc_conf_read = ibmcpc_conf_read;
@@ -167,6 +174,7 @@ static pcireg_t
 ibmcpc_conf_read(void *cookie, pcitag_t tag, int reg)
 {
 	pci_chipset_tag_t pc = cookie;
+	struct ibmcpc_softc *sc = cpc0;
 	u_int32_t daddr = (u_int32_t) pc->pc_data;
 	pcireg_t data;
 	u_int32_t bus, dev, func, x, devfn;
@@ -176,6 +184,11 @@ ibmcpc_conf_read(void *cookie, pcitag_t 
 
 	pci_decompose_tag(pc, tag, , , );
 
+	if ((bus < pc->pc_bus) || (bus > sc->sc_ranges[pc->pc_bus])) {
+		data = 0x;
+		goto done;
+	}		 
+
 	devfn = PCI_DEVFN(dev, func);
 
 	if (bus == 0) {
@@ -200,6 +213,7 @@ static void
 ibmcpc_conf_write(void *cookie, pcitag_t tag, int reg, pcireg_t data)
 {
 	pci_chipset_tag_t pc = cookie;
+	struct ibmcpc_softc *sc = cpc0;
 	int32_t *daddr = pc->pc_data;
 	u_int32_t bus, dev, func;
 	u_int32_t x, devfn;
@@ -209,6 +223,9 @@ ibmcpc_conf_write(void *cookie, pcitag_t
 
 	pci_decompose_tag(pc, tag, , , );
 
+	if ((bus < pc->pc_bus) || (bus > sc->sc_ranges[pc->pc_bus]))
+		return;
+
 	devfn = PCI_DEVFN(dev, func);
 
 	if (bus == 0) {



CVS commit: src/external/bsd/mdocml

2018-04-13 Thread Takeshi Nakayama
Module Name:src
Committed By:   nakayama
Date:   Fri Apr 13 21:52:49 UTC 2018

Modified Files:
src/external/bsd/mdocml/dist: term_ascii.c
src/external/bsd/mdocml/include: config.h

Log Message:
Re-enable wchar_t support.  mandoc(1) can now fall back to ascii
output if the locale is non-UTF-8 locale with the following change.

https://marc.info/?l=openbsd-cvs=152364416720474

| Modified files:
|   usr.bin/mandoc : term_ascii.c
|
| Log message:
| Make sure that mandoc only goes into UTF-8 mode if the user really
| selected UTF-8, not some other multibyte locale.  This obviously
| makes no difference on OpenBSD but improves portability.
| Issue reported by  via wiz@.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11 -r1.2 src/external/bsd/mdocml/dist/term_ascii.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/mdocml/include/config.h

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

Modified files:

Index: src/external/bsd/mdocml/dist/term_ascii.c
diff -u src/external/bsd/mdocml/dist/term_ascii.c:1.1.1.11 src/external/bsd/mdocml/dist/term_ascii.c:1.2
--- src/external/bsd/mdocml/dist/term_ascii.c:1.1.1.11	Sat Mar 18 15:06:54 2017
+++ src/external/bsd/mdocml/dist/term_ascii.c	Fri Apr 13 21:52:49 2018
@@ -21,11 +21,13 @@
 
 #include 
 #if HAVE_WCHAR
+#include 
 #include 
 #endif
 #include 
 #include 
 #include 
+#include 
 #include 
 #if HAVE_WCHAR
 #include 
@@ -99,7 +101,17 @@ ascii_init(enum termenc enc, const struc
 		v = TERMENC_LOCALE == enc ?
 		setlocale(LC_CTYPE, "") :
 		setlocale(LC_CTYPE, UTF8_LOCALE);
-		if (NULL != v && MB_CUR_MAX > 1) {
+
+		/*
+		 * We only support UTF-8,
+		 * so revert to ASCII for anything else.
+		 */
+
+		if (v != NULL &&
+		strcmp(nl_langinfo(CODESET), "UTF-8") != 0)
+			v = setlocale(LC_CTYPE, "C");
+
+		if (v != NULL && MB_CUR_MAX > 1) {
 			p->enc = enc;
 			p->advance = locale_advance;
 			p->endline = locale_endline;

Index: src/external/bsd/mdocml/include/config.h
diff -u src/external/bsd/mdocml/include/config.h:1.4 src/external/bsd/mdocml/include/config.h:1.5
--- src/external/bsd/mdocml/include/config.h:1.4	Sat Mar 17 11:06:48 2018
+++ src/external/bsd/mdocml/include/config.h	Fri Apr 13 21:52:48 2018
@@ -41,7 +41,7 @@
 #define HAVE_STRTONUM 0
 #define HAVE_SYS_ENDIAN 1
 #define HAVE_VASPRINTF 1
-#define HAVE_WCHAR 0
+#define HAVE_WCHAR 1
 #define HAVE_OHASH 0
 
 #define BINM_APROPOS "apropos"



CVS commit: src/sys/modules/examples

2018-04-13 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Apr 13 20:30:09 UTC 2018

Modified Files:
src/sys/modules/examples: Makefile README
Added Files:
src/sys/modules/examples/executor: Makefile executor.c

Log Message:
Add a new example kernel module

executor - basic implementation of callout and RUN_ONCE

While there, perform a small cleanup in README.

Patch by 
Polishing by myself.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/modules/examples/Makefile
cvs rdiff -u -r1.5 -r1.6 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/executor/Makefile \
src/sys/modules/examples/executor/executor.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/modules/examples/Makefile
diff -u src/sys/modules/examples/Makefile:1.3 src/sys/modules/examples/Makefile:1.4
--- src/sys/modules/examples/Makefile:1.3	Fri Apr 13 01:20:27 2018
+++ src/sys/modules/examples/Makefile	Fri Apr 13 20:30:09 2018
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.3 2018/04/13 01:20:27 kamil Exp $
+#	$NetBSD: Makefile,v 1.4 2018/04/13 20:30:09 kamil Exp $
 
 .include 
 
 SUBDIR+=	hello
+SUBDIR+=	executor
 #SUBDIR+=	luahello	# Nothing to build here, only text files
 SUBDIR+=	luareadhappy	# Needs an additional Lua script
 SUBDIR+=	ping		# Needs an additional helper program

Index: src/sys/modules/examples/README
diff -u src/sys/modules/examples/README:1.5 src/sys/modules/examples/README:1.6
--- src/sys/modules/examples/README:1.5	Fri Apr 13 01:20:27 2018
+++ src/sys/modules/examples/README	Fri Apr 13 20:30:09 2018
@@ -1,17 +1,18 @@
-	$NetBSD: README,v 1.5 2018/04/13 01:20:27 kamil Exp $
+	$NetBSD: README,v 1.6 2018/04/13 20:30:09 kamil Exp $
 
Kernel Developer's Manual
 
 DESCRIPTION
  The kernel example dynamic modules.
 
- This directory contains the following example modules
+ This directory contains the following example modules:
+ * executor- basic implementation of callout and RUN_ONCE
  * hello   - the simplest `hello world' module
- * properties  - handle incoming properties during the module load
- * readhappy   - basic implementation of read(9) with happy numbers
- * ping- basic ioctl(9)
  * luahello- the simplest `hello world' Lua module
  * luareadhappy- demonstrates calling Lua code from C
+ * properties  - handle incoming properties during the module load
+ * ping- basic ioctl(9)
+ * readhappy   - basic implementation of read(9) with happy numbers
  * sysctl  - demonstrates adding a sysctl handle dynamically
 
  To build the examples you need a local copy of NetBSD sources. You also
@@ -57,8 +58,8 @@ HISTORY
  ping, luahello and luareadhappy) first appeared in NetBSD 8.0; they were
  written by Kamil Rytarowski.
 
- The sysctl module first appeared in NetBSD 9.0 and was authored by
- Siddharth Muralee.
+ The executor and sysctls module first appeared in NetBSD 9.0 and were
+ authored by Siddharth Muralee.
 
 AUTHORS
  This document was written by Kamil Rytarowski.

Added files:

Index: src/sys/modules/examples/executor/Makefile
diff -u /dev/null src/sys/modules/examples/executor/Makefile:1.1
--- /dev/null	Fri Apr 13 20:30:09 2018
+++ src/sys/modules/examples/executor/Makefile	Fri Apr 13 20:30:09 2018
@@ -0,0 +1,11 @@
+#	$NetBSD: Makefile,v 1.1 2018/04/13 20:30:09 kamil Exp $
+
+.include "../Makefile.inc"
+
+#S?=	/usr/src/sys
+
+KMOD=	executor
+SRCS=	executor.c
+
+.include 
+
Index: src/sys/modules/examples/executor/executor.c
diff -u /dev/null src/sys/modules/examples/executor/executor.c:1.1
--- /dev/null	Fri Apr 13 20:30:09 2018
+++ src/sys/modules/examples/executor/executor.c	Fri Apr 13 20:30:09 2018
@@ -0,0 +1,108 @@
+/*	$NetBSD: executor.c,v 1.1 2018/04/13 20:30:09 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2018 The NetBSD Foundation, Inc.
+ * 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
+ * 

CVS commit: src/usr.sbin/npf/npfctl

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 17:43:37 UTC 2018

Modified Files:
src/usr.sbin/npf/npfctl: npfctl.c

Log Message:
Document "debug" in usage().


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.sbin/npf/npfctl/npfctl.c

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npfctl.c
diff -u src/usr.sbin/npf/npfctl/npfctl.c:1.54 src/usr.sbin/npf/npfctl/npfctl.c:1.55
--- src/usr.sbin/npf/npfctl/npfctl.c:1.54	Mon Oct 30 04:53:43 2017
+++ src/usr.sbin/npf/npfctl/npfctl.c	Fri Apr 13 17:43:37 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfctl.c,v 1.54 2017/10/30 04:53:43 ozaki-r Exp $	*/
+/*	$NetBSD: npfctl.c,v 1.55 2018/04/13 17:43:37 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: npfctl.c,v 1.54 2017/10/30 04:53:43 ozaki-r Exp $");
+__RCSID("$NetBSD: npfctl.c,v 1.55 2018/04/13 17:43:37 maxv Exp $");
 
 #include 
 #include 
@@ -155,6 +155,9 @@ usage(void)
 	fprintf(stderr,
 	"\t%s list [-46hNnw] [-i ]\n",
 	progname);
+	fprintf(stderr,
+	"\t%s debug [] []\n",
+	progname);
 	exit(EXIT_FAILURE);
 }
 



CVS commit: src/share/misc

2018-04-13 Thread Eitan Adler
Module Name:src
Committed By:   eadler
Date:   Fri Apr 13 14:31:35 UTC 2018

Modified Files:
src/share/misc: bsd-family-tree

Log Message:
[bsd-family-tree] announce OpenBSD 6.3 & DragonFly 5.2.0

ok pgoyette@ maya@


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/share/misc/bsd-family-tree

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.65 src/share/misc/bsd-family-tree:1.66
--- src/share/misc/bsd-family-tree:1.65	Wed Mar 21 09:54:39 2018
+++ src/share/misc/bsd-family-tree	Fri Apr 13 14:31:35 2018
@@ -367,6 +367,8 @@ FreeBSD 5.2   |  |  
  | |  | |  |   |   |
  | |  | |  NetBSD 7.1.2|   |
  | |  | |  |   |   |
+ | |  | |  |  OpenBSD 6.3  |
+ | |  | |  |   |   DragonFly 5.2.0
  | |  | |  v   |   |
  | v  | |  |   |
  || |  |   |
@@ -739,6 +741,8 @@ DragonFly 5.0.1		2017-11-06 [DFB]
 DragonFly 5.0.2		2017-12-04 [DFB]
 NetBSD 7.1.1		2017-12-22 [NBD]
 NetBSD 7.1.2		2018-03-15 [NBD]
+OpenBSD 6.3		2018-04-02 [OBD]
+DragonFly 5.2.0		2018-04-10 [DFB]
 
 Bibliography
 
@@ -803,5 +807,5 @@ Steven M. Schultz for providing 2.8BSD, 
 Copyright (c) 1997-2012 Wolfram Schneider 
 URL: http://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 
-$FreeBSD: head/share/misc/bsd-family-tree 331285 2018-03-21 09:07:01Z eadler $
-$NetBSD: bsd-family-tree,v 1.65 2018/03/21 09:54:39 eadler Exp $
+$FreeBSD: head/share/misc/bsd-family-tree 332425 2018-04-12 07:39:24Z maxim $
+$NetBSD: bsd-family-tree,v 1.66 2018/04/13 14:31:35 eadler Exp $



CVS commit: src/sys/netinet6

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 11:32:44 UTC 2018

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

Log Message:
Localify global variables, style, and add two XXXs.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.70 src/sys/netinet6/frag6.c:1.71
--- src/sys/netinet6/frag6.c:1.70	Fri Apr 13 11:19:09 2018
+++ src/sys/netinet6/frag6.c	Fri Apr 13 11:32:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.70 2018/04/13 11:19:09 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.71 2018/04/13 11:32:44 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.70 2018/04/13 11:19:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.71 2018/04/13 11:32:44 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -59,8 +59,10 @@ __KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.
 #include 
 
 /*
- * IP6 reassembly queue structure.  Each fragment
- * being reassembled is attached to one of these structures.
+ * IPv6 reassembly queue structure. Each fragment being reassembled is
+ * attached to one of these structures.
+ *
+ * XXX: Would be better to use TAILQ.
  */
 struct	ip6q {
 	u_int32_t	ip6q_head;
@@ -93,7 +95,6 @@ struct	ip6asfrag {
 	bool		ip6af_mff;	/* more fragment bit in frag off */
 };
 
-
 static void frag6_enq(struct ip6asfrag *, struct ip6asfrag *);
 static void frag6_deq(struct ip6asfrag *);
 static void frag6_insque(struct ip6q *, struct ip6q *);
@@ -102,9 +103,9 @@ static void frag6_freef(struct ip6q *);
 
 static int frag6_drainwanted;
 
-u_int frag6_nfragpackets;
-u_int frag6_nfrags;
-struct ip6q ip6q;	/* ip6 reassembly queue */
+static u_int frag6_nfragpackets;
+static u_int frag6_nfrags;
+static struct ip6q ip6q;	/* ip6 reassembly queue */
 
 /* Protects ip6q */
 static kmutex_t	frag6_lock __cacheline_aligned;
@@ -216,6 +217,10 @@ frag6_input(struct mbuf **mp, int *offp,
 	 * a Fragment Header with the "Fragment Offset" equal to 0 and
 	 * the "M" bit equal to 0 MUST process such packet in isolation
 	 * from any other packets/fragments.
+	 *
+	 * XXX: Would be better to remove this fragment header entirely,
+	 * for us not to get confused later when looking back at the
+	 * previous headers in the chain.
 	 */
 	fragoff = ntohs(ip6f->ip6f_offlg & IP6F_OFF_MASK);
 	if (fragoff == 0 && !(ip6f->ip6f_offlg & IP6F_MORE_FRAG)) {
@@ -664,7 +669,7 @@ frag6_slowtimo(void)
 
 	mutex_enter(_lock);
 	q6 = ip6q.ip6q_next;
-	if (q6)
+	if (q6) {
 		while (q6 != ) {
 			--q6->ip6q_ttl;
 			q6 = q6->ip6q_next;
@@ -674,6 +679,8 @@ frag6_slowtimo(void)
 frag6_freef(q6->ip6q_prev);
 			}
 		}
+	}
+
 	/*
 	 * If we are over the maximum number of fragments
 	 * (due to the limit being lowered), drain off
@@ -698,7 +705,6 @@ frag6_slowtimo(void)
 	rtcache_free(_forward_rt);
 	rtcache_free(_rt);
 #endif
-
 }
 
 void



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

2018-04-13 Thread NONAKA Kimihiro
Module Name:src
Committed By:   nonaka
Date:   Fri Apr 13 11:24:34 UTC 2018

Modified Files:
src/sys/arch/x86/include: bootinfo.h

Log Message:
x86: Increase BOOTINFO_MAXSIZE to 8Kib.

Proposed on port-i386 and port-amd64 with no objections:
http://mail-index.netbsd.org/port-i386/2018/04/11/msg003692.html
http://mail-index.netbsd.org/port-amd64/2018/04/11/msg002697.html


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/x86/include/bootinfo.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/include/bootinfo.h
diff -u src/sys/arch/x86/include/bootinfo.h:1.28 src/sys/arch/x86/include/bootinfo.h:1.29
--- src/sys/arch/x86/include/bootinfo.h:1.28	Thu Nov  9 01:01:33 2017
+++ src/sys/arch/x86/include/bootinfo.h	Fri Apr 13 11:24:34 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootinfo.h,v 1.28 2017/11/09 01:01:33 christos Exp $	*/
+/*	$NetBSD: bootinfo.h,v 1.29 2018/04/13 11:24:34 nonaka Exp $	*/
 
 /*
  * Copyright (c) 1997
@@ -251,7 +251,7 @@ struct btinfo_efimemmap {
 
 #ifdef _KERNEL
 
-#define BOOTINFO_MAXSIZE 4096
+#define BOOTINFO_MAXSIZE 8192
 
 #ifndef _LOCORE
 /*



CVS commit: src/sys/netinet6

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 11:19:10 UTC 2018

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

Log Message:
Add XXX, using a pool would be better than kmem.


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.69 src/sys/netinet6/frag6.c:1.70
--- src/sys/netinet6/frag6.c:1.69	Fri Apr 13 11:18:08 2018
+++ src/sys/netinet6/frag6.c	Fri Apr 13 11:19:09 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.69 2018/04/13 11:18:08 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.70 2018/04/13 11:19:09 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.69 2018/04/13 11:18:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.70 2018/04/13 11:19:09 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -150,6 +150,8 @@ frag6_init(void)
  *		-> should grab it from the first fragment only
  *
  * There is no explicit reason given in the RFC.  Historical reason maybe?
+ *
+ * XXX: It would be better to use a pool, rather than kmem.
  */
 int
 frag6_input(struct mbuf **mp, int *offp, int proto)



CVS commit: src/sys/netinet6

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 11:18:08 UTC 2018

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

Log Message:
Release the lock a little earlier.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.68 src/sys/netinet6/frag6.c:1.69
--- src/sys/netinet6/frag6.c:1.68	Fri Apr 13 08:55:50 2018
+++ src/sys/netinet6/frag6.c	Fri Apr 13 11:18:08 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.68 2018/04/13 08:55:50 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.69 2018/04/13 11:18:08 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.68 2018/04/13 08:55:50 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.69 2018/04/13 11:18:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -501,15 +501,13 @@ insert:
 	IP6_STATINC(IP6_STAT_REASSEMBLED);
 	in6_ifstat_inc(dstifp, ifs6_reass_ok);
 	rtcache_unref(rt, );
+	mutex_exit(_lock);
 
 	/*
-	 * Tell launch routine the next header
+	 * Tell launch routine the next header.
 	 */
-
 	*mp = m;
 	*offp = offset;
-
-	mutex_exit(_lock);
 	return nxt;
 
  dropfrag:



CVS commit: src/sys/netinet6

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 11:01:14 UTC 2018

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

Log Message:
style


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/netinet6/dest6.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/dest6.c
diff -u src/sys/netinet6/dest6.c:1.21 src/sys/netinet6/dest6.c:1.22
--- src/sys/netinet6/dest6.c:1.21	Tue Jan 23 15:13:56 2018
+++ src/sys/netinet6/dest6.c	Fri Apr 13 11:01:14 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: dest6.c,v 1.21 2018/01/23 15:13:56 maxv Exp $	*/
+/*	$NetBSD: dest6.c,v 1.22 2018/04/13 11:01:14 maxv Exp $	*/
 /*	$KAME: dest6.c,v 1.25 2001/02/22 01:39:16 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dest6.c,v 1.21 2018/01/23 15:13:56 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dest6.c,v 1.22 2018/04/13 11:01:14 maxv Exp $");
 
 #include 
 #include 
@@ -92,7 +92,7 @@ dest6_input(struct mbuf **mp, int *offp,
 			erroff = *offp + (opt - (u_int8_t *)dstopts);
 			optlen = ip6_unknown_opt(opt, m, erroff);
 			if (optlen == -1)
-return (IPPROTO_DONE);
+return IPPROTO_DONE;
 			optlen += 2;
 			break;
 		}



CVS commit: src/sys/dev/pci

2018-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 13 09:35:10 UTC 2018

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

Log Message:
 I354 uses an external PHY, so don't use wm_set_eee_i350().


To generate a diff of this commit:
cvs rdiff -u -r1.571 -r1.572 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.571 src/sys/dev/pci/if_wm.c:1.572
--- src/sys/dev/pci/if_wm.c:1.571	Fri Apr 13 06:04:12 2018
+++ src/sys/dev/pci/if_wm.c	Fri Apr 13 09:35:10 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.571 2018/04/13 06:04:12 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.572 2018/04/13 09:35:10 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.571 2018/04/13 06:04:12 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.572 2018/04/13 09:35:10 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -4763,7 +4763,12 @@ wm_reset(struct wm_softc *sc)
 	/* reload sc_ctrl */
 	sc->sc_ctrl = CSR_READ(sc, WMREG_CTRL);
 
-	if ((sc->sc_type >= WM_T_I350) && (sc->sc_type <= WM_T_I211))
+	if (sc->sc_type == WM_T_I354) {
+#if 0
+		/* I354 uses an external PHY */
+		wm_set_eee_i354(sc);
+#endif
+	} else if ((sc->sc_type >= WM_T_I350) && (sc->sc_type <= WM_T_I211))
 		wm_set_eee_i350(sc);
 
 	/*



CVS commit: src/sys/netipsec

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 09:34:20 UTC 2018

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

Log Message:
Remove duplicate, to better show that this place doesn't make a lot of
sense. The code should probably be removed, it's a leftover from when we
had #ifdef __FreeBSD__.


To generate a diff of this commit:
cvs rdiff -u -r1.87 -r1.88 src/sys/netipsec/xform_ah.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/xform_ah.c
diff -u src/sys/netipsec/xform_ah.c:1.87 src/sys/netipsec/xform_ah.c:1.88
--- src/sys/netipsec/xform_ah.c:1.87	Mon Feb 26 06:40:08 2018
+++ src/sys/netipsec/xform_ah.c	Fri Apr 13 09:34:20 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: xform_ah.c,v 1.87 2018/02/26 06:40:08 maxv Exp $	*/
+/*	$NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $	*/
 /*	$FreeBSD: src/sys/netipsec/xform_ah.c,v 1.1.4.1 2003/01/24 05:11:36 sam Exp $	*/
 /*	$OpenBSD: ip_ah.c,v 1.63 2001/06/26 06:18:58 angelos Exp $ */
 /*
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.87 2018/02/26 06:40:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xform_ah.c,v 1.88 2018/04/13 09:34:20 maxv Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -310,21 +310,16 @@ ah_massage_headers(struct mbuf **m0, int
 		 * whereas on NetBSD, we should not.
 		 */
 		if (!out) {
+			/* XXX XXX: What are we trying to achieve here? */
 			uint16_t inlen = ntohs(ip->ip_len);
-
 			ip->ip_len = htons(inlen);
-
-			if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
-ip->ip_off  &= htons(IP_DF);
-			else
-ip->ip_off = 0;
-		} else {
-			if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
-ip->ip_off &= htons(IP_DF);
-			else
-ip->ip_off = 0;
 		}
 
+		if (alg == CRYPTO_MD5_KPDK || alg == CRYPTO_SHA1_KPDK)
+			ip->ip_off &= htons(IP_DF);
+		else
+			ip->ip_off = 0;
+
 		ptr = mtod(m, unsigned char *);
 
 		/* IPv4 option processing */



CVS commit: src/sys/netinet

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 09:29:04 UTC 2018

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

Log Message:
Improve the check, we want to have len >= udphdr all the time, and not
just when the packet size doesn't match the mbuf size.

Normally that's not a huge problem, since IP6_EXTHDR_GET gets called
earlier, so we can't have

(ip_len == iphlen + len) && (len < sizeof(struct udphdr))


To generate a diff of this commit:
cvs rdiff -u -r1.247 -r1.248 src/sys/netinet/udp_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/udp_usrreq.c
diff -u src/sys/netinet/udp_usrreq.c:1.247 src/sys/netinet/udp_usrreq.c:1.248
--- src/sys/netinet/udp_usrreq.c:1.247	Thu Apr 12 06:49:39 2018
+++ src/sys/netinet/udp_usrreq.c	Fri Apr 13 09:29:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp_usrreq.c,v 1.247 2018/04/12 06:49:39 maxv Exp $	*/
+/*	$NetBSD: udp_usrreq.c,v 1.248 2018/04/13 09:29:04 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.247 2018/04/12 06:49:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: udp_usrreq.c,v 1.248 2018/04/13 09:29:04 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -374,8 +374,12 @@ udp_input(struct mbuf *m, ...)
 	 */
 	ip_len = ntohs(ip->ip_len);
 	len = ntohs((u_int16_t)uh->uh_ulen);
+	if (len < sizeof(struct udphdr)) {
+		UDP_STATINC(UDP_STAT_BADLEN);
+		goto bad;
+	}
 	if (ip_len != iphlen + len) {
-		if (ip_len < iphlen + len || len < sizeof(struct udphdr)) {
+		if (ip_len < iphlen + len) {
 			UDP_STATINC(UDP_STAT_BADLEN);
 			goto bad;
 		}



CVS commit: src/sys/kern

2018-04-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Apr 13 09:21:16 UTC 2018

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

Log Message:
make this narrower by popular request.


To generate a diff of this commit:
cvs rdiff -u -r1.167 -r1.168 src/sys/kern/subr_prf.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/subr_prf.c
diff -u src/sys/kern/subr_prf.c:1.167 src/sys/kern/subr_prf.c:1.168
--- src/sys/kern/subr_prf.c:1.167	Wed Apr 11 19:20:15 2018
+++ src/sys/kern/subr_prf.c	Fri Apr 13 05:21:16 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_prf.c,v 1.167 2018/04/11 23:20:15 christos Exp $	*/
+/*	$NetBSD: subr_prf.c,v 1.168 2018/04/13 09:21:16 christos Exp $	*/
 
 /*-
  * Copyright (c) 1986, 1988, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.167 2018/04/11 23:20:15 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.168 2018/04/13 09:21:16 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -493,7 +493,7 @@ addtstamp(int flags, struct tty *tp)
 	int n;
 
 	getnanouptime();
-	n = snprintf(buf, sizeof(buf), "[% 9jd.%.9ld] ",
+	n = snprintf(buf, sizeof(buf), "[% 5jd.%.9ld] ",
 	(intmax_t)ts.tv_sec, ts.tv_nsec);
 
 	for (int i = 0; i < n; i++)



CVS commit: src/sys/netinet

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 09:00:29 UTC 2018

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

Log Message:
Remove useless comment and style.


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/sys/netinet/ip_output.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/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.301 src/sys/netinet/ip_output.c:1.302
--- src/sys/netinet/ip_output.c:1.301	Fri Apr 13 08:47:46 2018
+++ src/sys/netinet/ip_output.c	Fri Apr 13 09:00:29 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.301 2018/04/13 08:47:46 maxv Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.302 2018/04/13 09:00:29 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.301 2018/04/13 08:47:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.302 2018/04/13 09:00:29 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -980,13 +980,11 @@ in_delayed_cksum(struct mbuf *m)
 	offset += M_CSUM_DATA_IPv4_OFFSET(m->m_pkthdr.csum_data);
 
 	if ((offset + sizeof(u_int16_t)) > m->m_len) {
-		/* This happen when ip options were inserted
-		printf("in_delayed_cksum: pullup len %d off %d proto %d\n",
-		m->m_len, offset, ip->ip_p);
-		 */
-		m_copyback(m, offset, sizeof(csum), (void *) );
-	} else
+		/* This happens when ip options were inserted */
+		m_copyback(m, offset, sizeof(csum), (void *));
+	} else {
 		*(u_int16_t *)(mtod(m, char *) + offset) = csum;
+	}
 }
 
 /*



CVS commit: src/sys/netinet6

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 08:55:50 UTC 2018

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

Log Message:
Add XXX. In fact, it would be better, if all the fragments were offloaded,
to quickly recompute the checksum on the fly, and keep it in the mbuf
header.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/netinet6/frag6.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/frag6.c
diff -u src/sys/netinet6/frag6.c:1.67 src/sys/netinet6/frag6.c:1.68
--- src/sys/netinet6/frag6.c:1.67	Fri Mar  9 11:57:38 2018
+++ src/sys/netinet6/frag6.c	Fri Apr 13 08:55:50 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: frag6.c,v 1.67 2018/03/09 11:57:38 maxv Exp $	*/
+/*	$NetBSD: frag6.c,v 1.68 2018/04/13 08:55:50 maxv Exp $	*/
 /*	$KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.67 2018/03/09 11:57:38 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: frag6.c,v 1.68 2018/04/13 08:55:50 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -480,6 +480,7 @@ insert:
 			plen += t->m_len;
 		}
 		m->m_pkthdr.len = plen;
+		/* XXX XXX: clear csum_flags? */
 	}
 
 	/*



CVS commit: src/sys/netinet

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 08:47:46 UTC 2018

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

Log Message:
Reduce the diff between similar blocks.


To generate a diff of this commit:
cvs rdiff -u -r1.300 -r1.301 src/sys/netinet/ip_output.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/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.300 src/sys/netinet/ip_output.c:1.301
--- src/sys/netinet/ip_output.c:1.300	Fri Apr 13 08:12:51 2018
+++ src/sys/netinet/ip_output.c	Fri Apr 13 08:47:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.300 2018/04/13 08:12:51 maxv Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.301 2018/04/13 08:47:46 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.300 2018/04/13 08:12:51 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.301 2018/04/13 08:47:46 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1822,12 +1822,13 @@ ip_add_membership(struct ip_moptions *im
 	bound = curlwp_bind();
 	if (sopt->sopt_size == sizeof(struct ip_mreq))
 		error = ip_get_membership(sopt, , , , true);
-	else
+	else {
 #ifdef INET6
 		error = ip6_get_membership(sopt, , , , sizeof(ia));
 #else
 		error = EINVAL;
 #endif
+	}
 
 	if (error)
 		goto out;
@@ -1902,7 +1903,6 @@ ip_drop_membership(struct ip_moptions *i
 		error = ip6_get_membership(sopt, , , , sizeof(ia));
 #else
 		error = EINVAL;
-		goto out;
 #endif
 	}
 



CVS commit: src/sys/sys

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 08:44:41 UTC 2018

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

Log Message:
Add a KASSERT, we want M_PKTHDR.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.184 src/sys/sys/mbuf.h:1.185
--- src/sys/sys/mbuf.h:1.184	Fri Apr 13 07:36:11 2018
+++ src/sys/sys/mbuf.h	Fri Apr 13 08:44:41 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.184 2018/04/13 07:36:11 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.185 2018/04/13 08:44:41 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -585,6 +585,7 @@ do {	\
  */
 #define	M_COPY_PKTHDR(to, from)		\
 do {	\
+	KASSERT(((from)->m_flags & M_PKTHDR) != 0);			\
 	(to)->m_pkthdr = (from)->m_pkthdr;\
 	(to)->m_flags = (from)->m_flags & M_COPYFLAGS;			\
 	SLIST_INIT(&(to)->m_pkthdr.tags);\



CVS commit: src/sys/netinet

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 08:12:51 UTC 2018

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

Log Message:
Reorder a few instructions to clarify. Replace two bcopy by memcpy.


To generate a diff of this commit:
cvs rdiff -u -r1.299 -r1.300 src/sys/netinet/ip_output.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/ip_output.c
diff -u src/sys/netinet/ip_output.c:1.299 src/sys/netinet/ip_output.c:1.300
--- src/sys/netinet/ip_output.c:1.299	Fri Mar 30 22:54:37 2018
+++ src/sys/netinet/ip_output.c	Fri Apr 13 08:12:51 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_output.c,v 1.299 2018/03/30 22:54:37 maya Exp $	*/
+/*	$NetBSD: ip_output.c,v 1.300 2018/04/13 08:12:51 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.299 2018/03/30 22:54:37 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.300 2018/04/13 08:12:51 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1031,10 +1031,10 @@ ip_insertoptions(struct mbuf *m, struct 
 		m->m_len -= sizeof(struct ip);
 		m->m_data += sizeof(struct ip);
 		n->m_next = m;
+		n->m_len = optlen + sizeof(struct ip);
+		n->m_data += max_linkhdr;
+		memcpy(mtod(n, void *), ip, sizeof(struct ip));
 		m = n;
-		m->m_len = optlen + sizeof(struct ip);
-		m->m_data += max_linkhdr;
-		bcopy((void *)ip, mtod(m, void *), sizeof(struct ip));
 	} else {
 		m->m_data -= optlen;
 		m->m_len += optlen;
@@ -1042,7 +1042,7 @@ ip_insertoptions(struct mbuf *m, struct 
 	}
 	m->m_pkthdr.len += optlen;
 	ip = mtod(m, struct ip *);
-	bcopy((void *)p->ipopt_list, (void *)(ip + 1), (unsigned)optlen);
+	memcpy(ip + 1, p->ipopt_list, optlen);
 	*phlen = sizeof(struct ip) + optlen;
 	ip->ip_len = htons(ntohs(ip->ip_len) + optlen);
 	return m;



CVS commit: src/doc

2018-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 13 08:01:23 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
- ichsmb(4), puc(4): add new devices.
- Add missing comma.


To generate a diff of this commit:
cvs rdiff -u -r1.2379 -r1.2380 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.2379 src/doc/CHANGES:1.2380
--- src/doc/CHANGES:1.2379	Fri Apr 13 06:07:20 2018
+++ src/doc/CHANGES	Fri Apr 13 08:01:23 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2379 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2380 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -125,11 +125,11 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	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]
-	ichsmb(4) Add Apollo Lake and Gemini Lake devices. [msaitoh 20180302]
+	ichsmb(4): Add Apollo Lake and Gemini Lake devices. [msaitoh 20180302]
 	lm(4): Add NCT6796D support. [msaitoh 20180308]
 	macppc: Enable Bluetooth support by default in GENERIC kernel.
 		[sevan 20180316]
-	tzdata updated to 2017d [kre 20180324]
+	tzdata: updated to 2017d [kre 20180324]
 	dhcpcd: Import 7.0.2. [roy 20180327]
 	aarch64: Add initial support for aarch64. [ryo 20180401]
 	dhcpcd: Import 7.0.3. [roy 20180406]
@@ -139,4 +139,6 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	acpi(4): Updated ACPICA to 20180313. [christos 20180407]
 	dhcp: Import version 4.4.1 (move to MPL). [christos 20180407]
 	bind: Import version 9.10.7. [christos 20180407]
+	ichsmb(4): Add Intel 300 series chipset support. [msaitoh 20180409]
 	wm(4): Enable I219 support. [msaitoh 20180413]
+	puc(4): Add Intel 300 series chipset support. [msaitoh 20180413]



CVS commit: src/sys/dev/pci

2018-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 13 07:57:04 UTC 2018

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

Log Message:
 Add 300 series chipset support.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/dev/pci/pucdata.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/pucdata.c
diff -u src/sys/dev/pci/pucdata.c:1.100 src/sys/dev/pci/pucdata.c:1.101
--- src/sys/dev/pci/pucdata.c:1.100	Wed Dec 27 20:27:02 2017
+++ src/sys/dev/pci/pucdata.c	Fri Apr 13 07:57:04 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: pucdata.c,v 1.100 2017/12/27 20:27:02 christos Exp $	*/
+/*	$NetBSD: pucdata.c,v 1.101 2018/04/13 07:57:04 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998, 1999 Christopher G. Demetriou.  All rights reserved.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.100 2017/12/27 20:27:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pucdata.c,v 1.101 2018/04/13 07:57:04 msaitoh Exp $");
 
 #include 
 #include 
@@ -1936,7 +1936,16 @@ const struct puc_device_description puc_
 		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
 	},
 	},
-	
+
+	/* Intel 300 Series KT */
+	{   "Intel 300 Series KT",
+	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3HS_KT, 0, 0 },
+	{	0x,	0x,	0,	0	},
+	{
+		{ PUC_PORT_TYPE_COM, PCI_BAR0, 0x00, COM_FREQ },
+	},
+	},
+
 	/* Intel C600/X79 Series KT */
 	{   "Intel C600/X79 Series KT",
 	{	PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_C600_KT, 0, 0 },



CVS commit: src/sys/sys

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 07:36:11 UTC 2018

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

Log Message:
No, fix previous.


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.183 src/sys/sys/mbuf.h:1.184
--- src/sys/sys/mbuf.h:1.183	Fri Apr 13 07:30:46 2018
+++ src/sys/sys/mbuf.h	Fri Apr 13 07:36:11 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.183 2018/04/13 07:30:46 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.184 2018/04/13 07:36:11 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -164,17 +164,14 @@ struct m_hdr {
  * A note about csum_data:
  *
  *  o For the out-bound direction, the low 16 bits indicates the offset after
- *the L4 header where the final L4 checksum value is to be stored
- *(checksumming flags) and the high 16 bits is the length of the L3 header
- *(the start of the data to be checksummed):
- *
- * +--++
- *  csum_data: | L3 header length | Checksumming flags |
- * +--++
+ *the L4 header where the final L4 checksum value is to be stored and the
+ *high 16 bits is the length of the L3 header (the start of the data to
+ *be checksummed):
  *
  *  o For the in-bound direction, it is only valid if the M_CSUM_DATA flag is
- *set. In this case, an L4 checksum has been calculated by hardware, but
- *it is up to software to perform final verification.
+ *set. In this case, an L4 checksum has been calculated by hardware and
+ *is stored in csum_data, but it is up to software to perform final
+ *verification.
  *
  * Note for in-bound TCP/UDP checksums: we expect the csum_data to NOT
  * be bit-wise inverted (the final step in the calculation of an IP
@@ -207,7 +204,7 @@ struct pkthdr {
 	void	*pattr_hdr;		/* ALTQ: saved header position in mbuf */
 };
 
-/* Checksumming flags. */
+/* Checksumming flags (csum_flags). */
 #define	M_CSUM_TCPv4		0x0001	/* TCP header/payload */
 #define	M_CSUM_UDPv4		0x0002	/* UDP header/payload */
 #define	M_CSUM_TCP_UDP_BAD	0x0004	/* TCP/UDP checksum bad */



CVS commit: src/sys/sys

2018-04-13 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Fri Apr 13 07:30:46 UTC 2018

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

Log Message:
Improve comment.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 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/sys/mbuf.h
diff -u src/sys/sys/mbuf.h:1.182 src/sys/sys/mbuf.h:1.183
--- src/sys/sys/mbuf.h:1.182	Tue Apr 10 16:12:30 2018
+++ src/sys/sys/mbuf.h	Fri Apr 13 07:30:46 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: mbuf.h,v 1.182 2018/04/10 16:12:30 maxv Exp $	*/
+/*	$NetBSD: mbuf.h,v 1.183 2018/04/13 07:30:46 maxv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -161,15 +161,22 @@ struct m_hdr {
 /*
  * record/packet header in first mbuf of chain; valid if M_PKTHDR set
  *
- * A note about csum_data: For the out-bound direction, the low 16 bits
- * indicates the offset after the L4 header where the final L4 checksum value
- * is to be stored and the high 16 bits is the length of the L3 header (the
- * start of the data to be checksumed).  For the in-bound direction, it is only
- * valid if the M_CSUM_DATA flag is set.  In this case, an L4 checksum has been
- * calculated by hardware, but it is up to software to perform final
- * verification.
+ * A note about csum_data:
  *
- * Note for in-bound TCP/UDP checksums, we expect the csum_data to NOT
+ *  o For the out-bound direction, the low 16 bits indicates the offset after
+ *the L4 header where the final L4 checksum value is to be stored
+ *(checksumming flags) and the high 16 bits is the length of the L3 header
+ *(the start of the data to be checksummed):
+ *
+ * +--++
+ *  csum_data: | L3 header length | Checksumming flags |
+ * +--++
+ *
+ *  o For the in-bound direction, it is only valid if the M_CSUM_DATA flag is
+ *set. In this case, an L4 checksum has been calculated by hardware, but
+ *it is up to software to perform final verification.
+ *
+ * Note for in-bound TCP/UDP checksums: we expect the csum_data to NOT
  * be bit-wise inverted (the final step in the calculation of an IP
  * checksum) -- this is so we can accumulate the checksum for fragmented
  * packets during reassembly.



CVS commit: src/tools

2018-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Apr 13 06:15:26 UTC 2018

Modified Files:
src/tools: Makefile.gnuhost

Log Message:
GCC build exceeds the macOS clang default bracket nesting level of 256.
Work around with -fbracket-depth=512.

>From potr in PR toolchain/53178.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/tools/Makefile.gnuhost

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

Modified files:

Index: src/tools/Makefile.gnuhost
diff -u src/tools/Makefile.gnuhost:1.44 src/tools/Makefile.gnuhost:1.45
--- src/tools/Makefile.gnuhost:1.44	Sat Jan 16 18:38:53 2016
+++ src/tools/Makefile.gnuhost	Fri Apr 13 06:15:26 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.gnuhost,v 1.44 2016/01/16 18:38:53 christos Exp $
+#	$NetBSD: Makefile.gnuhost,v 1.45 2018/04/13 06:15:26 snj Exp $
 #
 # Rules used when building a GNU host package.  Expects MODULE to be set.
 #
@@ -18,9 +18,12 @@
 .include 
 
 # Disable use of pre-compiled headers on Darwin.
+# GCC build exceeds the macOS clang default bracket nesting level of 256.
 BUILD_OSTYPE!= uname -s
 .if ${BUILD_OSTYPE} == "Darwin"
 HOST_CFLAGS+=-O2 -no-cpp-precomp
+HOST_CFLAGS+=-O2 -no-cpp-precomp -fbracket-depth=512
+HOST_CXXFLAGS+= -fbracket-depth=512
 .endif
 MAKE_PROGRAM?=	${MAKE}
 



CVS commit: src/doc

2018-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 13 06:07:20 UTC 2018

Modified Files:
src/doc: CHANGES

Log Message:
 Enable I219 by default.


To generate a diff of this commit:
cvs rdiff -u -r1.2378 -r1.2379 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.2378 src/doc/CHANGES:1.2379
--- src/doc/CHANGES:1.2378	Tue Apr 10 22:58:54 2018
+++ src/doc/CHANGES	Fri Apr 13 06:07:20 2018
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2378 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2379 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -139,3 +139,4 @@ Changes from NetBSD 8.0 to NetBSD 9.0:
 	acpi(4): Updated ACPICA to 20180313. [christos 20180407]
 	dhcp: Import version 4.4.1 (move to MPL). [christos 20180407]
 	bind: Import version 9.10.7. [christos 20180407]
+	wm(4): Enable I219 support. [msaitoh 20180413]



CVS commit: src

2018-04-13 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Apr 13 06:04:12 UTC 2018

Modified Files:
src/share/man/man4: wm.4
src/sys/dev/pci: if_wm.c

Log Message:
 Enable I219.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/share/man/man4/wm.4
cvs rdiff -u -r1.570 -r1.571 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/share/man/man4/wm.4
diff -u src/share/man/man4/wm.4:1.39 src/share/man/man4/wm.4:1.40
--- src/share/man/man4/wm.4:1.39	Wed Feb  7 03:26:36 2018
+++ src/share/man/man4/wm.4	Fri Apr 13 06:04:12 2018
@@ -1,4 +1,4 @@
-.\"	$NetBSD: wm.4,v 1.39 2018/02/07 03:26:36 knakahara Exp $
+.\"	$NetBSD: wm.4,v 1.40 2018/04/13 06:04:12 msaitoh Exp $
 .\"
 .\" Copyright 2002, 2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -33,7 +33,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 18, 2018
+.Dd April 13, 2018
 .Dt WM 4
 .Os
 .Sh NAME
@@ -152,6 +152,8 @@ Intel I210 Ethernet (Copper, Fiber)
 Intel I211 Ethernet
 .It
 Intel I217 and I218 Ethernet
+.It
+Intel I219 Ethernet (with Intel [123]00 series chipset)
 .El
 .Pp
 In addition to Intel's own

Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.570 src/sys/dev/pci/if_wm.c:1.571
--- src/sys/dev/pci/if_wm.c:1.570	Thu Apr 12 03:25:08 2018
+++ src/sys/dev/pci/if_wm.c	Fri Apr 13 06:04:12 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.570 2018/04/12 03:25:08 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.571 2018/04/13 06:04: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.570 2018/04/12 03:25:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.571 2018/04/13 06:04:12 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1485,7 +1485,6 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I218_LM3,
 	  "I218 LM Ethernet Connection",
 	  WM_T_PCH_LPT,		WMP_F_COPPER },
-#if 0
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_V,
 	  "I219 V Ethernet Connection",
 	  WM_T_PCH_SPT,		WMP_F_COPPER },
@@ -1525,7 +1524,6 @@ static const struct wm_product {
 	{ PCI_VENDOR_INTEL,	PCI_PRODUCT_INTEL_I219_LM7,
 	  "I219 LM Ethernet Connection",
 	  WM_T_PCH_CNP,		WMP_F_COPPER },
-#endif
 	{ 0,			0,
 	  NULL,
 	  0,			0 },