Re: CVS commit: src

2019-10-24 Thread maya
Is this going to be a trend now of not even publicly proposing changes
and just going straight to core?

On Thu, Oct 24, 2019 at 06:18:07PM +, Kamil Rytarowski wrote:
> Log Message:
> Switch the iconv(3) prototype to the POSIX conformant variation
> 
> Remove const from the 2nd argument.
> 
> const char ** and char ** are incompatible types and it was a cost to keep
> the technically incompatible form for a more purist variation. NetBSD was
> almost the last alive OS to still keep the const argument (known leftovers:
> Minix and Illumos).
> 
> Keep the const form for the internal purposes inside citrus and rump.
> 
> Address the build breakage fallout in the same change.
> 
> There are no ABI changes.
> 
> Change accepted by core@.


CVS commit: src/sys/external/bsd/acpica/dist/namespace

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 01:32:56 UTC 2019

Modified Files:
src/sys/external/bsd/acpica/dist/namespace: nsdump.c

Log Message:
fix printf formats


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/acpica/dist/namespace/nsdump.c

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



CVS commit: src/sys/external/bsd/acpica/dist/namespace

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Oct 25 01:32:56 UTC 2019

Modified Files:
src/sys/external/bsd/acpica/dist/namespace: nsdump.c

Log Message:
fix printf formats


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 \
src/sys/external/bsd/acpica/dist/namespace/nsdump.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/external/bsd/acpica/dist/namespace/nsdump.c
diff -u src/sys/external/bsd/acpica/dist/namespace/nsdump.c:1.15 src/sys/external/bsd/acpica/dist/namespace/nsdump.c:1.16
--- src/sys/external/bsd/acpica/dist/namespace/nsdump.c:1.15	Tue Oct 15 12:13:39 2019
+++ src/sys/external/bsd/acpica/dist/namespace/nsdump.c	Thu Oct 24 21:32:56 2019
@@ -369,7 +369,7 @@ AcpiNsDumpOneObject (
 AcpiOsPrintf (" =");
 for (i = 0; (i < ObjDesc->Buffer.Length && i < 12); i++)
 {
-AcpiOsPrintf (" %.2hX", ObjDesc->Buffer.Pointer[i]);
+AcpiOsPrintf (" %.2hhX", ObjDesc->Buffer.Pointer[i]);
 }
 }
 AcpiOsPrintf ("\n");
@@ -466,7 +466,7 @@ AcpiNsDumpOneObject (
 case ACPI_TYPE_LOCAL_BANK_FIELD:
 case ACPI_TYPE_LOCAL_INDEX_FIELD:
 
-AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hd\n",
+AcpiOsPrintf (" Off %.3X Len %.2X Acc %.2hhd\n",
 (ObjDesc->CommonField.BaseByteOffset * 8)
 + ObjDesc->CommonField.StartFieldBitOffset,
 ObjDesc->CommonField.BitLength,



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:06:25 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: mainbus.c

Log Message:
if we have a /cpus node, use it to find and attach all CPUs.
Now we find all CPUs on a 4x G5.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/macppc/mainbus.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/macppc/mainbus.c
diff -u src/sys/arch/macppc/macppc/mainbus.c:1.21 src/sys/arch/macppc/macppc/mainbus.c:1.22
--- src/sys/arch/macppc/macppc/mainbus.c:1.21	Sun Jun  5 17:03:16 2011
+++ src/sys/arch/macppc/macppc/mainbus.c	Thu Oct 24 23:06:25 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.22 2019/10/24 23:06:25 macallan Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.21 2011/06/05 17:03:16 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.22 2019/10/24 23:06:25 macallan Exp $");
 
 #include 
 #include 
@@ -67,17 +67,29 @@ mainbus_attach(device_t parent, device_t
 {
 	struct ofbus_attach_args oba;
 	struct confargs ca;
-	int node, i;
+	int node, cpus, i;
 	u_int32_t reg[4];
 	char name[32];
 
 	printf("\n");
 
-	for (i = 0; i < 2; i++) {
-		ca.ca_name = "cpu";
-		ca.ca_reg = reg;
-		reg[0] = i;
-		config_found(self, , NULL);
+	cpus = OF_finddevice("/cpus");
+	if (cpus != 0) {
+		node = OF_child(cpus);
+		while (node != 0) {
+			ca.ca_name = "cpu";
+			ca.ca_reg = reg;
+			ca.ca_nreg = OF_getprop(node, "reg", reg, sizeof(reg));
+			config_found(self, , NULL);
+			node = OF_peer(node);
+		}			
+	} else {
+		for (i = 0; i < 2; i++) {
+			ca.ca_name = "cpu";
+			ca.ca_reg = reg;
+			reg[0] = i;
+			config_found(self, , NULL);
+		}
 	}
 
 	pic_finish_setup();



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:06:25 UTC 2019

Modified Files:
src/sys/arch/macppc/macppc: mainbus.c

Log Message:
if we have a /cpus node, use it to find and attach all CPUs.
Now we find all CPUs on a 4x G5.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/macppc/macppc/mainbus.c

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



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:04:46 UTC 2019

Modified Files:
src/sys/arch/macppc/include: cpu.h

Log Message:
bump CPU_MAXNUM to 4, hardware exists and is being asked about on port-macppc@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/macppc/include/cpu.h

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



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:04:46 UTC 2019

Modified Files:
src/sys/arch/macppc/include: cpu.h

Log Message:
bump CPU_MAXNUM to 4, hardware exists and is being asked about on port-macppc@


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/macppc/include/cpu.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/macppc/include/cpu.h
diff -u src/sys/arch/macppc/include/cpu.h:1.20 src/sys/arch/macppc/include/cpu.h:1.21
--- src/sys/arch/macppc/include/cpu.h:1.20	Fri Mar 16 22:08:53 2018
+++ src/sys/arch/macppc/include/cpu.h	Thu Oct 24 23:04:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.20 2018/03/16 22:08:53 macallan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.21 2019/10/24 23:04:46 macallan Exp $	*/
 
 /*
  * Copyright (C) 1995-1997 Wolfgang Solfrank.
@@ -34,7 +34,7 @@
 #define	_MACPPC_CPU_H_
 
 #if defined(_KERNEL) && !defined(_MODULE)
-#define	CPU_MAXNUM	2
+#define	CPU_MAXNUM	4
 extern char bootpath[];
 int get_cpuid(int, uint8_t *);
 #endif /* _KERNEL */



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:03:35 UTC 2019

Modified Files:
src/sys/arch/powerpc/include: intr.h

Log Message:
bump NIRQ to 256 since we're going to use vectors above 128


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/intr.h

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



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

2019-10-24 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Oct 24 23:03:35 UTC 2019

Modified Files:
src/sys/arch/powerpc/include: intr.h

Log Message:
bump NIRQ to 256 since we're going to use vectors above 128


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/powerpc/include/intr.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/powerpc/include/intr.h
diff -u src/sys/arch/powerpc/include/intr.h:1.13 src/sys/arch/powerpc/include/intr.h:1.14
--- src/sys/arch/powerpc/include/intr.h:1.13	Thu Apr 19 21:50:07 2018
+++ src/sys/arch/powerpc/include/intr.h	Thu Oct 24 23:03:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.13 2018/04/19 21:50:07 christos Exp $ */
+/*	$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -28,7 +28,7 @@
 
 #ifndef _LOCORE
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.13 2018/04/19 21:50:07 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.h,v 1.14 2019/10/24 23:03:35 macallan Exp $");
 #endif
 
 #ifndef _POWERPC_INTR_MACHDEP_H_
@@ -105,7 +105,7 @@ extern imask_t imask[];
 
 #define NVIRQ		(sizeof(imask_t)*8)	/* 32 virtual IRQs */
 #ifndef NIRQ
-#define NIRQ		128	/* up to 128 HW IRQs */
+#define NIRQ		256	/* up to 256 HW IRQs */
 #endif
 
 #define HWIRQ_MAX   (NVIRQ - 1)



CVS commit: src/doc

2019-10-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Oct 24 19:28:47 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
libc: Changed the iconv(3) function signature to the POSIX variation


To generate a diff of this commit:
cvs rdiff -u -r1.2602 -r1.2603 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.2602 src/doc/CHANGES:1.2603
--- src/doc/CHANGES:1.2602	Thu Oct 17 20:48:44 2019
+++ src/doc/CHANGES	Thu Oct 24 19:28:47 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2602 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2603 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -55,3 +55,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 	evbarm: Add support for the NanoPi R1 and Duo2. [bad 20191016]
 	alc(4): Add support for Killer E2400 and E2500. [msaitoh 20191017]
 	bind: Import version 9.14.7. [christos 20191017]
+	libc: Changed the iconv(3) function signature to the POSIX variation
+		[kamil 20191024]



CVS commit: src/doc

2019-10-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Oct 24 19:28:47 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
libc: Changed the iconv(3) function signature to the POSIX variation


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

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



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

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:48:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.frontend

Log Message:
arm-common.c uses bitmap stuff so put the common-target.a before common.a


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/Makefile.frontend

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/Makefile.frontend
diff -u src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.6 src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.7
--- src/external/gpl3/gcc/usr.bin/Makefile.frontend:1.6	Fri Feb  1 05:34:18 2019
+++ src/external/gpl3/gcc/usr.bin/Makefile.frontend	Thu Oct 24 14:48:43 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.frontend,v 1.6 2019/02/01 10:34:18 mrg Exp $
+#	$NetBSD: Makefile.frontend,v 1.7 2019/10/24 18:48:43 christos Exp $
 
 BINDIR=		/usr/bin
 
@@ -14,8 +14,8 @@ DPADD+=			${FRONTENDOBJ}/libfrontend.a
 LDADD+=			-L${FRONTENDOBJ} -lfrontend
 .endif
 
-.include "../Makefile.common"
 .include "../Makefile.common-target"
+.include "../Makefile.common"
 .include "../Makefile.libcpp"
 .include "../Makefile.backtrace"
 .include "../Makefile.libiberty"



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

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:48:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin: Makefile.frontend

Log Message:
arm-common.c uses bitmap stuff so put the common-target.a before common.a


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/gpl3/gcc/usr.bin/Makefile.frontend

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



CVS commit: src/external/gpl3/gcc/usr.bin/common-target

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:48:09 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/common-target: Makefile

Log Message:
arm-common.c needs stack-protector treatment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/usr.bin/common-target/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/common-target/Makefile
diff -u src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.8 src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.9
--- src/external/gpl3/gcc/usr.bin/common-target/Makefile:1.8	Mon Feb  4 23:45:07 2019
+++ src/external/gpl3/gcc/usr.bin/common-target/Makefile	Thu Oct 24 14:48:09 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8 2019/02/05 04:45:07 mrg Exp $
+#	$NetBSD: Makefile,v 1.9 2019/10/24 18:48:09 christos Exp $
 
 LIBISPRIVATE=	yes
 
@@ -21,6 +21,7 @@ CPPFLAGS+=	-I${GCCARCH} -I${BACKENDOBJ} 
 COPTS.prefix.c+=	-Wno-stack-protector
 COPTS.opts-common.c+=	-Wno-stack-protector
 COPTS.rs6000-common.c+=	-Wno-stack-protector
+COPTS.arm-common.c+=	-Wno-stack-protector
 
 GENPROG_ERROR_DEPENDS=errors.lo
 



CVS commit: src/external/gpl3/gcc/usr.bin/common-target

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:48:09 UTC 2019

Modified Files:
src/external/gpl3/gcc/usr.bin/common-target: Makefile

Log Message:
arm-common.c needs stack-protector treatment


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/gpl3/gcc/usr.bin/common-target/Makefile

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



CVS commit: src

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:46:21 UTC 2019

Modified Files:
src/compat/arm/oabi: bsd.oabi.mk
src/share/mk: bsd.own.mk
src/sys/arch/acorn32/stand: Makefile.buildboot
src/sys/arch/evbarm/stand/boot2440: Makefile
src/sys/arch/evbarm/stand/bootimx23: Makefile
src/sys/arch/evbarm/stand/gzboot: Makefile.gzboot
src/sys/arch/zaurus/stand/zboot: Makefile

Log Message:
1. All Makefiles that use ARM_APCS_FLAGS add -marm unconditionally and
   bsd.own.mk also adds it for gcc only (so we end up with 2 -marm for gcc).
   Just add -marm unconditionally in bsd.own.mk in ARM_APCS_FLAGS and remove
   it from everywhere else.
2. gcc-8 now warns about thumb internetwork in APCS mode. This does not make
   sense because the documentation says that this flag does not make a
   difference in apcs mode, but might produce larger code in non-APCS mode.
   So we just add it to silence the warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/compat/arm/oabi/bsd.oabi.mk
cvs rdiff -u -r1.1157 -r1.1158 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/acorn32/stand/Makefile.buildboot
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/stand/boot2440/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/stand/bootimx23/Makefile
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/zaurus/stand/zboot/Makefile

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



CVS commit: src

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:46:21 UTC 2019

Modified Files:
src/compat/arm/oabi: bsd.oabi.mk
src/share/mk: bsd.own.mk
src/sys/arch/acorn32/stand: Makefile.buildboot
src/sys/arch/evbarm/stand/boot2440: Makefile
src/sys/arch/evbarm/stand/bootimx23: Makefile
src/sys/arch/evbarm/stand/gzboot: Makefile.gzboot
src/sys/arch/zaurus/stand/zboot: Makefile

Log Message:
1. All Makefiles that use ARM_APCS_FLAGS add -marm unconditionally and
   bsd.own.mk also adds it for gcc only (so we end up with 2 -marm for gcc).
   Just add -marm unconditionally in bsd.own.mk in ARM_APCS_FLAGS and remove
   it from everywhere else.
2. gcc-8 now warns about thumb internetwork in APCS mode. This does not make
   sense because the documentation says that this flag does not make a
   difference in apcs mode, but might produce larger code in non-APCS mode.
   So we just add it to silence the warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/compat/arm/oabi/bsd.oabi.mk
cvs rdiff -u -r1.1157 -r1.1158 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/acorn32/stand/Makefile.buildboot
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/stand/boot2440/Makefile
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/stand/bootimx23/Makefile
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/zaurus/stand/zboot/Makefile

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

Modified files:

Index: src/compat/arm/oabi/bsd.oabi.mk
diff -u src/compat/arm/oabi/bsd.oabi.mk:1.4 src/compat/arm/oabi/bsd.oabi.mk:1.5
--- src/compat/arm/oabi/bsd.oabi.mk:1.4	Wed Jun 24 18:20:24 2015
+++ src/compat/arm/oabi/bsd.oabi.mk	Thu Oct 24 14:46:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.oabi.mk,v 1.4 2015/06/24 22:20:24 matt Exp $
+#	$NetBSD: bsd.oabi.mk,v 1.5 2019/10/24 18:46:20 christos Exp $
 
 .if !defined(MLIBDIR)
 MLIBDIR=		oabi
@@ -11,6 +11,7 @@ ARM_LD=			-m armelf_nbsd
 LDFLAGS+=		-Wl,-m,armelf_nbsd
 COPTS+=			-mcpu=cortex-a53
 ARM_APCS_FLAGS= ${${ACTIVE_CC} == "clang":? -target arm--netbsdelf -B ${TOOLDIR}/aarch64--netbsd/bin :} -mabi=apcs-gnu -mfloat-abi=soft
+ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
 .elif !empty(MACHINE_ARCH:M*eb)
 ARM_MACHINE_ARCH=	armeb
 ARM_LD=			-m armelfb_nbsd

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1157 src/share/mk/bsd.own.mk:1.1158
--- src/share/mk/bsd.own.mk:1.1157	Tue Oct 22 09:49:30 2019
+++ src/share/mk/bsd.own.mk	Thu Oct 24 14:46:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1157 2019/10/22 13:49:30 christos Exp $
+#	$NetBSD: bsd.own.mk,v 1.1158 2019/10/24 18:46:20 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -890,8 +890,8 @@ MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH
 
 .if !empty(MACHINE_ARCH:M*arm*)
 # Flags to pass to CC for using the old APCS ABI on ARM for compat or stand.
-ARM_APCS_FLAGS=	-mabi=apcs-gnu -mfloat-abi=soft
-ARM_APCS_FLAGS+=${${ACTIVE_CC} == "gcc":? -marm :}
+ARM_APCS_FLAGS=	-mabi=apcs-gnu -mfloat-abi=soft -marm
+ARM_APCS_FLAGS+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} >= 8:? -mno-thumb-interwork :}
 ARM_APCS_FLAGS+=${${ACTIVE_CC} == "clang":? -target ${MACHINE_GNU_ARCH}--netbsdelf -B ${TOOLDIR}/${MACHINE_GNU_PLATFORM}/bin :}
 .endif
 

Index: src/sys/arch/acorn32/stand/Makefile.buildboot
diff -u src/sys/arch/acorn32/stand/Makefile.buildboot:1.24 src/sys/arch/acorn32/stand/Makefile.buildboot:1.25
--- src/sys/arch/acorn32/stand/Makefile.buildboot:1.24	Sun Apr  9 12:29:46 2017
+++ src/sys/arch/acorn32/stand/Makefile.buildboot	Thu Oct 24 14:46:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.24 2017/04/09 16:29:46 christos Exp $
+#	$NetBSD: Makefile.buildboot,v 1.25 2019/10/24 18:46:20 christos Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -40,7 +40,6 @@ CPPFLAGS+=	-D_STANDALONE 
 CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
 CPPFLAGS+=	-I${.CURDIR}/../lib
 CPPFLAGS+=	${ARM_APCS_FLAGS} -march=armv3m
-CPPFLAGS+=	-marm
 CPUFLAGS=
 CFLAGS=		-O2
 CFLAGS+=	-ffreestanding -fno-unwind-tables

Index: src/sys/arch/evbarm/stand/boot2440/Makefile
diff -u src/sys/arch/evbarm/stand/boot2440/Makefile:1.18 src/sys/arch/evbarm/stand/boot2440/Makefile:1.19
--- src/sys/arch/evbarm/stand/boot2440/Makefile:1.18	Sat Apr  8 15:53:20 2017
+++ src/sys/arch/evbarm/stand/boot2440/Makefile	Thu Oct 24 14:46:20 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2017/04/08 19:53:20 christos Exp $
+#	$NetBSD: Makefile,v 1.19 2019/10/24 18:46:20 christos Exp $
 
 S=		${.CURDIR}/../../../..
 
@@ -16,7 +16,6 @@ CPPFLAGS+=	-DDM9000MAC="0x08,0x08,0x11,0
 CPPFLAGS+=	-DDEFAULT_BOOTFILE="ld0a:netbsd;net:"
 CPPFLAGS+=	-nostdinc -I. -I${.OBJDIR} -I${S} -I${S}/arch
 CPPFLAGS+=	-march=armv4 ${ARM_APCS_FLAGS}
-CPPFLAGS+=	-marm
 CPUFLAGS=
 DBG=		-Os
 

Index: 

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

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:34:22 UTC 2019

Modified Files:
src/sys/arch/arm/arm: disassem.c

Log Message:
Add a function cast


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/arm/disassem.c

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



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

2019-10-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 24 18:34:22 UTC 2019

Modified Files:
src/sys/arch/arm/arm: disassem.c

Log Message:
Add a function cast


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/arm/arm/disassem.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/arm/disassem.c
diff -u src/sys/arch/arm/arm/disassem.c:1.40 src/sys/arch/arm/arm/disassem.c:1.41
--- src/sys/arch/arm/arm/disassem.c:1.40	Tue Oct 30 05:05:51 2018
+++ src/sys/arch/arm/arm/disassem.c	Thu Oct 24 14:34:22 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: disassem.c,v 1.40 2018/10/30 09:05:51 skrll Exp $	*/
+/*	$NetBSD: disassem.c,v 1.41 2019/10/24 18:34:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1996 Mark Brinicombe.
@@ -49,7 +49,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.40 2018/10/30 09:05:51 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disassem.c,v 1.41 2019/10/24 18:34:22 christos Exp $");
 
 #include 
 
@@ -951,7 +951,7 @@ disassemble_printaddr(u_int address)
 
 static const disasm_interface_t disassemble_di = {
 	disassemble_readword, disassemble_printaddr,
-	(void (*)(const char *, ...))printf
+	__FPTRCAST(void (*)(const char *, ...), printf)
 };
 
 void



CVS commit: xsrc/external/mit/xwininfo/dist

2019-10-24 Thread Kamil Rytarowski
Module Name:xsrc
Committed By:   kamil
Date:   Thu Oct 24 18:19:27 UTC 2019

Modified Files:
xsrc/external/mit/xwininfo/dist: xwininfo.c

Log Message:
Adapt xwininfo for POSIX iconv(3)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xwininfo/dist/xwininfo.c

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

Modified files:

Index: xsrc/external/mit/xwininfo/dist/xwininfo.c
diff -u xsrc/external/mit/xwininfo/dist/xwininfo.c:1.7 xsrc/external/mit/xwininfo/dist/xwininfo.c:1.8
--- xsrc/external/mit/xwininfo/dist/xwininfo.c:1.7	Mon Jul 15 04:54:48 2019
+++ xsrc/external/mit/xwininfo/dist/xwininfo.c	Thu Oct 24 18:19:27 2019
@@ -251,7 +251,7 @@ static Bool window_id_format_dec = False
 static iconv_t iconv_from_utf8;
 #endif
 static const char *user_encoding;
-static void print_utf8 (const char *, const char *, size_t, const char *);
+static void print_utf8 (const char *, char *, size_t, const char *);
 static char *get_friendly_name (const char *, const char *);
 
 static xcb_connection_t *dpy;
@@ -850,7 +850,7 @@ Display_Window_Id (struct wininfo *w, Bo
 	if (wm_name_encoding == XCB_ATOM_STRING) {
 		printf (" \"%.*s\"", wm_name_len, wm_name);
 	} else if (wm_name_encoding == atom_utf8_string) {
-		print_utf8 (" \"", wm_name, wm_name_len,  "\"");
+		print_utf8 (" \"", (char *) wm_name, wm_name_len,  "\"");
 	} else {
 		/* Encodings we don't support, including COMPOUND_TEXT */
 		const char *enc_name = Get_Atom_Name (dpy, wm_name_encoding);
@@ -1887,7 +1887,7 @@ is_valid_utf8 (const char *string, size_
  * Length of the string is specified in bytes, or -1 for going until '\0'
  */
 static void
-print_utf8 (const char *prefix, const char *u8str, size_t length, const char *suffix)
+print_utf8 (const char *prefix, char *u8str, size_t length, const char *suffix)
 {
 size_t inlen = length;
 



CVS commit: xsrc/external/mit/xwininfo/dist

2019-10-24 Thread Kamil Rytarowski
Module Name:xsrc
Committed By:   kamil
Date:   Thu Oct 24 18:19:27 UTC 2019

Modified Files:
xsrc/external/mit/xwininfo/dist: xwininfo.c

Log Message:
Adapt xwininfo for POSIX iconv(3)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xwininfo/dist/xwininfo.c

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



CVS commit: src

2019-10-24 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Oct 24 18:18:00 UTC 2019

Modified Files:
src/external/bsd/libarchive/include: config_netbsd.h
src/external/bsd/nvi/dist/common: conv.c
src/external/bsd/smbfs/dist/lib/smb: nls.c
src/external/gpl2/gettext/include: config.h
src/external/gpl2/grep/include: config.h
src/external/gpl2/texinfo/include: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/aarch64: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/aarch64eb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/alpha: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/arm: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/armeb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/coldfire: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/earm: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/earmeb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/earmhf: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/earmhfeb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/hppa: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/i386: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/ia64: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/m68000: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/m68k: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/mips64eb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/mips64el: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/mipseb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/mipsel: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/or1k: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/powerpc: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/powerpc64: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/riscv32: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/riscv64: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/sh3eb: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/sh3el: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/sparc: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/sparc64: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/vax: config.h
src/external/gpl3/binutils.old/usr.bin/common/arch/x86_64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/aarch64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/aarch64eb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/alpha: config.h
src/external/gpl3/binutils/usr.bin/common/arch/arm: config.h
src/external/gpl3/binutils/usr.bin/common/arch/armeb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/coldfire: config.h
src/external/gpl3/binutils/usr.bin/common/arch/earm: config.h
src/external/gpl3/binutils/usr.bin/common/arch/earmeb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/earmhf: config.h
src/external/gpl3/binutils/usr.bin/common/arch/earmhfeb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/hppa: config.h
src/external/gpl3/binutils/usr.bin/common/arch/i386: config.h
src/external/gpl3/binutils/usr.bin/common/arch/ia64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/m68000: config.h
src/external/gpl3/binutils/usr.bin/common/arch/m68k: config.h
src/external/gpl3/binutils/usr.bin/common/arch/mips64eb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/mips64el: config.h
src/external/gpl3/binutils/usr.bin/common/arch/mipseb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/mipsel: config.h
src/external/gpl3/binutils/usr.bin/common/arch/or1k: config.h
src/external/gpl3/binutils/usr.bin/common/arch/powerpc: config.h
src/external/gpl3/binutils/usr.bin/common/arch/powerpc64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/riscv32: config.h
src/external/gpl3/binutils/usr.bin/common/arch/riscv64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/sh3eb: config.h
src/external/gpl3/binutils/usr.bin/common/arch/sh3el: config.h
src/external/gpl3/binutils/usr.bin/common/arch/sparc: config.h
src/external/gpl3/binutils/usr.bin/common/arch/sparc64: config.h
src/external/gpl3/binutils/usr.bin/common/arch/vax: config.h
src/external/gpl3/binutils/usr.bin/common/arch/x86_64: config.h
src/external/gpl3/gcc.old/lib/libstdc++-v3/arch/aarch64: c++config.h
symver-config.h

CVS commit: src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 18:17:08 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
When we fail to setup for "all of the disk for NetBSD" report
failure, instead of silently aborting the install.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/part_edit.c

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



CVS commit: src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 18:17:08 UTC 2019

Modified Files:
src/usr.sbin/sysinst: part_edit.c

Log Message:
When we fail to setup for "all of the disk for NetBSD" report
failure, instead of silently aborting the install.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/sysinst/part_edit.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/sysinst/part_edit.c
diff -u src/usr.sbin/sysinst/part_edit.c:1.7 src/usr.sbin/sysinst/part_edit.c:1.8
--- src/usr.sbin/sysinst/part_edit.c:1.7	Fri Jul 12 18:25:08 2019
+++ src/usr.sbin/sysinst/part_edit.c	Thu Oct 24 18:17:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: part_edit.c,v 1.7 2019/07/12 18:25:08 martin Exp $ */
+/*	$NetBSD: part_edit.c,v 1.8 2019/10/24 18:17:08 martin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -1152,8 +1152,10 @@ edit_outer_parts(struct disk_partitions 
 return false;
 			}
 		}
-		if (!md_parts_use_wholedisk(parts))
+		if (!md_parts_use_wholedisk(parts)) {
+			hit_enter_to_continue(MSG_No_free_space, NULL);
 			return false;
+		}
 		if (parts->pscheme->post_edit_verify) {
 			return
 			parts->pscheme->post_edit_verify(parts, true) == 2;



CVS commit: [netbsd-8] src/doc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 17:43:43 UTC 2019

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

Log Message:
Tickets #1411 - #1416


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-8.2

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.2
diff -u src/doc/CHANGES-8.2:1.1.2.53 src/doc/CHANGES-8.2:1.1.2.54
--- src/doc/CHANGES-8.2:1.1.2.53	Mon Oct 21 17:03:01 2019
+++ src/doc/CHANGES-8.2	Thu Oct 24 17:43:43 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.2,v 1.1.2.53 2019/10/21 17:03:01 martin Exp $
+# $NetBSD: CHANGES-8.2,v 1.1.2.54 2019/10/24 17:43:43 martin Exp $
 
 A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2
 release:
@@ -1327,3 +1327,56 @@ sys/fs/ntfs/ntfs_vfsops.c			1.108
 	to read consecutive clusters to fill the MFT record.
 	[hannken, ticket #1410]
 
+sys/net/if_vlan.c1.147
+
+	vlan(4): fix input packet statistics.
+	[ozaki-r, ticket #1411]
+
+sys/dev/hpc/hpcapm.c1.21
+
+	Fix an spl(9) leak.
+	[msaitoh, ticket #1412]
+
+sys/dev/mii/rgephy.c			1.43, 1.47, 1.49, 1.54-1.57 (patch)
+sys/dev/mii/rgephyreg.h 		1.10, 1.12 (patch)
+
+	- It seems EEE support is not only on 8211F but on 8211D and newer.
+	- Indicate master mode if the negotiated result say so.
+	- Use symbolic names for chip revision.
+	- Cosmetic changes.
+	- KNF.
+	[msaitoh, ticket #1413]
+
+sys/dev/mii/ciphy.c			1.34-1.37 via patch
+sys/dev/mii/miidevs			1.158
+sys/dev/mii/miidevs.h			regen
+sys/dev/mii/miidevs_data.h		regen
+
+	- Indicate master mode if the negotiated result say so.
+	- Call mii_phy_flowstatus() to show the flow setting.
+	- Match a lot of Cicada and Vitesse devices correctly.
+	- Add support for VSC8221, VSC8234 and VSC8641.
+	- KNF
+	[msaitoh, ticket #1414]
+
+sys/dev/pci/if_bce.c1.55,1.56
+sys/dev/pci/if_bcereg.h1.5
+
+	- Add missing splnet()/splx() around mii_tick().
+	- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
+	- Mark ETHERCAP_VLAN_MTU.
+	- PR kern/24911: clear the powerdown mode.
+	- Set proper LED modes.
+	[msaitoh, ticket #1415]
+
+sys/arch/arm/ep93xx/epe.c			1.45
+sys/arch/mac68k/nubus/if_netdock_nubus.c	1.31
+sys/dev/ic/i82586.c1.86
+sys/dev/pcmcia/if_cnw.c1.66
+sys/dev/pcmcia/if_ray.c1.95
+sys/dev/qbus/if_il.c1.36
+sys/dev/qbus/if_qt.c1.24
+
+	Do not double count incoming packets.
+	[msaitoh, ticket #1416]
+



CVS commit: [netbsd-8] src/doc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 17:43:43 UTC 2019

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

Log Message:
Tickets #1411 - #1416


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.53 -r1.1.2.54 src/doc/CHANGES-8.2

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



CVS commit: src/distrib/sets

2019-10-24 Thread Olaf Seibert
Module Name:src
Committed By:   rhialto
Date:   Thu Oct 24 16:52:11 UTC 2019

Modified Files:
src/distrib/sets: join.awk regpkg

Log Message:
Solve [ vs. \133 in join.awk which replaces fix in r1.23 of regpkg. Ok uki@.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/join.awk
cvs rdiff -u -r1.23 -r1.24 src/distrib/sets/regpkg

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/join.awk
diff -u src/distrib/sets/join.awk:1.6 src/distrib/sets/join.awk:1.7
--- src/distrib/sets/join.awk:1.6	Fri Oct 24 22:19:44 2014
+++ src/distrib/sets/join.awk	Thu Oct 24 16:52:11 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: join.awk,v 1.6 2014/10/24 22:19:44 riz Exp $
+#	$NetBSD: join.awk,v 1.7 2019/10/24 16:52:11 rhialto Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -30,7 +30,9 @@
 # join.awk F1 F2
 #	Similar to join(1), this reads a list of words from F1
 #	and outputs lines in F2 with a first word that is in F1.
-#	Neither file needs to be sorted
+#	For purposes of matching the first word, both instances are
+#	canonicalised via unvis(word); the version from F2 is printed.
+#	Neither file needs to be sorted.
 
 function unvis(s) \
 {
@@ -79,17 +81,16 @@ BEGIN \
 		exit 1
 	}
 	while ( (getline < ARGV[1]) > 0) {
-		$1 = unvis($1)
-		words[$1] = $0
+		f1 = unvis($1)
+		words[f1] = $0
 	}
 	delete ARGV[1]
 }
 
-// { $1 = unvis($1) }
+{ f1 = unvis($1) }
 
-$1 in words \
+f1 in words \
 {
-	f1=$1
 	$1=""
 	print words[f1] $0
 }

Index: src/distrib/sets/regpkg
diff -u src/distrib/sets/regpkg:1.23 src/distrib/sets/regpkg:1.24
--- src/distrib/sets/regpkg:1.23	Thu Apr 11 08:34:19 2019
+++ src/distrib/sets/regpkg	Thu Oct 24 16:52:11 2019
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# $NetBSD: regpkg,v 1.23 2019/04/11 08:34:19 uki Exp $
+# $NetBSD: regpkg,v 1.24 2019/10/24 16:52:11 rhialto Exp $
 #
 # Copyright (c) 2003,2009 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -628,7 +628,7 @@ EOF
 	# "@name" line and a lot of "@comment MD5:" lines.
 	#
 	{
-		rcsid='$NetBSD: regpkg,v 1.23 2019/04/11 08:34:19 uki Exp $'
+		rcsid='$NetBSD: regpkg,v 1.24 2019/10/24 16:52:11 rhialto Exp $'
 		utcdate="$(${ENV_CMD} TZ=UTC LOCALE=C \
 			${DATE} '+%Y-%m-%d %H:%M')"
 		user="${USER:-root}"
@@ -836,11 +836,8 @@ EOF
 		if [ -n "${metalog}" ]; then
 			names1="${SCRATCH}/names1"
 			names2="${SCRATCH}/names2"
-			# There is different format between spec1 and spec2 for test(1).
-			# spec1's format is "./bin/\133" but spec2's format is "./bin/["
-			# XXX filtering for only '[' now
-			${AWK} '{print $1}' <"${spec1}" | ${SORT} | sed -e 's,\\133,\[,g' >"${names1}"
-			${AWK} '{print $1}' <"${spec2}" | ${SORT} | sed -e 's,\[,\\133,g' >"${names2}"
+			${AWK} '{print $1}' <"${spec1}" | ${SORT} >"${names1}"
+			${AWK} '{print $1}' <"${spec2}" | ${SORT} >"${names2}"
 			if ${FGREP} -v -f "${names2}" "${spec1}" >/dev/null
 			then
 cat >&2 <

CVS commit: src/distrib/sets

2019-10-24 Thread Olaf Seibert
Module Name:src
Committed By:   rhialto
Date:   Thu Oct 24 16:52:11 UTC 2019

Modified Files:
src/distrib/sets: join.awk regpkg

Log Message:
Solve [ vs. \133 in join.awk which replaces fix in r1.23 of regpkg. Ok uki@.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/sets/join.awk
cvs rdiff -u -r1.23 -r1.24 src/distrib/sets/regpkg

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



CVS commit: [netbsd-9] src/doc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:34:51 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #373 - #379


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.85 -r1.1.2.86 src/doc/CHANGES-9.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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.85 src/doc/CHANGES-9.0:1.1.2.86
--- src/doc/CHANGES-9.0:1.1.2.85	Thu Oct 24 02:31:34 2019
+++ src/doc/CHANGES-9.0	Thu Oct 24 16:34:51 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.85 2019/10/24 02:31:34 msaitoh Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.86 2019/10/24 16:34:51 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -5238,3 +5238,47 @@ sys/dev/mii/miidevs_data.h			(regen)
 	- Match a lot of Cicada and Vitesse devices correctly.
 	- Add support for VSC8221, VSC8234, VSC8641.
 	[msaitoh, ticket #372]
+
+sys/dev/pci/pcidev1.1386,1.1387
+sys/dev/pci/pcidevs.h(regen)
+sys/dev/pci/pcidevs_data.h			(regen)
+
+	Modify Attansic Ethernet devices' description to clarify.
+	Add Killer E2400 and E2500.
+	[msaitoh, ticket #373]
+
+sys/dev/pci/if_msk.c1.92
+
+	msk(4): fix mbuf deallocation.
+	[msaitoh, ticket #374]
+
+share/man/man4/alc.41.6
+sys/dev/pci/if_alc.c1.39-1.42
+sys/dev/pci/if_alcreg.h1.8
+
+	- Identify device revision correctly in alc_attach().
+	- Correct DMA channel number selection on AR816x family of
+	  controllers.
+	- Add support for Killer E2400 and E2500.
+	[msaitoh, ticket #375]
+
+sys/dev/pci/if_jme.c1.46
+
+	jme(4): fix use-after-free.
+	[msaitoh, ticket #376]
+
+usr.sbin/sysinst/msg.mi.pl			1.24
+
+	Fix polish translation for sysinst.
+	[kamil, ticket #377]
+
+sys/dev/mii/ciphy.c1.36
+
+	ciphy(4): call mii_phy_flowstatus() to show the flow setting.
+	[msaitoh, ticket #378]
+
+sys/external/bsd/drm/dist/shared-core/r128_drv.h 1.3
+
+	Fix undefined behaviour.
+	[hauke, ticket #379]
+



CVS commit: [netbsd-9] src/doc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:34:51 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tickets #373 - #379


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.85 -r1.1.2.86 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/sys/external/bsd/drm/dist/shared-core

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:32:53 UTC 2019

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-9]: r128_drv.h

Log Message:
Pull up following revision(s) (requested by hauke in ticket #379):

sys/external/bsd/drm/dist/shared-core/r128_drv.h: revision 1.3

When building r128drm(4), gcc objects to shifting into bit 31 of a
(signed) int. Make sure we are shifting an unsigned in those cases.

See also .
XXX There are probably more of these in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.60.1 \
src/sys/external/bsd/drm/dist/shared-core/r128_drv.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/external/bsd/drm/dist/shared-core/r128_drv.h
diff -u src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.2 src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.2.60.1
--- src/sys/external/bsd/drm/dist/shared-core/r128_drv.h:1.2	Thu Feb 24 07:59:44 2011
+++ src/sys/external/bsd/drm/dist/shared-core/r128_drv.h	Thu Oct 24 16:32:52 2019
@@ -277,7 +277,7 @@ extern long r128_compat_ioctl(struct fil
  */
 #define R128_PM4_BUFFER_OFFSET		0x0700
 #define R128_PM4_BUFFER_CNTL		0x0704
-#	define R128_PM4_MASK			(15 << 28)
+#	define R128_PM4_MASK			(15u << 28)
 #	define R128_PM4_NONPM4			(0  << 28)
 #	define R128_PM4_192PIO			(1  << 28)
 #	define R128_PM4_192BM			(2  << 28)
@@ -286,8 +286,8 @@ extern long r128_compat_ioctl(struct fil
 #	define R128_PM4_64PIO_128INDBM		(5  << 28)
 #	define R128_PM4_64BM_128INDBM		(6  << 28)
 #	define R128_PM4_64PIO_64VCBM_64INDBM	(7  << 28)
-#	define R128_PM4_64BM_64VCBM_64INDBM	(8  << 28)
-#	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15 << 28)
+#	define R128_PM4_64BM_64VCBM_64INDBM	(8u  << 28)
+#	define R128_PM4_64PIO_64VCPIO_64INDPIO	(15u << 28)
 #	define R128_PM4_BUFFER_CNTL_NOUPDATE	(1  << 27)
 
 #define R128_PM4_BUFFER_WM_CNTL		0x0708



CVS commit: [netbsd-9] src/sys/external/bsd/drm/dist/shared-core

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:32:53 UTC 2019

Modified Files:
src/sys/external/bsd/drm/dist/shared-core [netbsd-9]: r128_drv.h

Log Message:
Pull up following revision(s) (requested by hauke in ticket #379):

sys/external/bsd/drm/dist/shared-core/r128_drv.h: revision 1.3

When building r128drm(4), gcc objects to shifting into bit 31 of a
(signed) int. Make sure we are shifting an unsigned in those cases.

See also .
XXX There are probably more of these in the header.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.2.60.1 \
src/sys/external/bsd/drm/dist/shared-core/r128_drv.h

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



CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:29:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #378):

sys/dev/mii/ciphy.c: revision 1.36

Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.2 -r1.34.4.3 src/sys/dev/mii/ciphy.c

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



CVS commit: [netbsd-9] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:29:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-9]: ciphy.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #378):

sys/dev/mii/ciphy.c: revision 1.36

Call mii_phy_flowstatus() to show the flow setting.


To generate a diff of this commit:
cvs rdiff -u -r1.34.4.2 -r1.34.4.3 src/sys/dev/mii/ciphy.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/mii/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.34.4.2 src/sys/dev/mii/ciphy.c:1.34.4.3
--- src/sys/dev/mii/ciphy.c:1.34.4.2	Wed Oct 23 19:45:56 2019
+++ src/sys/dev/mii/ciphy.c	Thu Oct 24 16:29:13 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $ */
+/* $NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.2 2019/10/23 19:45:56 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34.4.3 2019/10/24 16:29:13 martin Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -339,7 +339,7 @@ ciphy_status(struct mii_softc *sc)
 	}
 
 	if (bmsr & CIPHY_AUXCSR_FDX)
-		mii->mii_media_active |= IFM_FDX;
+		mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
 	else
 		mii->mii_media_active |= IFM_HDX;
 



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:27:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.pl

Log Message:
Pull up following revision(s) (requested by kamil in ticket #377):

usr.sbin/sysinst/msg.mi.pl: revision 1.24

Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.20.2.2 -r1.20.2.3 src/usr.sbin/sysinst/msg.mi.pl

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/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.20.2.2 src/usr.sbin/sysinst/msg.mi.pl:1.20.2.3
--- src/usr.sbin/sysinst/msg.mi.pl:1.20.2.2	Sun Aug 18 13:25:21 2019
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu Oct 24 16:27:21 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.20.2.2 2019/08/18 13:25:21 msaitoh Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.20.2.3 2019/10/24 16:27:21 martin Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp   */
 
@@ -75,15 +75,16 @@ message mount_failed
 
 message hello
 {Witaj w sysinst, systemie instalacyjnym NetBSD-@@VERSION@@.
-To oparte na menu narzedzie zostalo stworzone aby pomoc ci zainstalowac
-NetBSD na twardym dysku, lub zaktualizowac istniejacy system NetBSD,
-zuzywajac minimum czasu. W ponizszych menu mozesz zmienic aktualne
-ustawienia poprzez naciskanie klawiszy (a, b, c, ...). Klawisze strzalek
-takze moga dzialac. Aktywujesz ustawienie poprzez nacisniecie ENTER.
+To oparte na menu narzedzie (sysinst) zostalo zaprojektowane w celu
+ulatwienia instalacji NetBSD na dysku twardym, lub uaktualnienia istniejacego 
+systemu NetBSD przy minimalnym nakladzie pracy. W ponizszych menu, aby wybrac
+pozycje wpisz litere (a, b, c, ...). Mozesz tez uzyc CTRL+N/CTRL+P, aby wybrac
+nastepna/poprzednia pozycje. Klawisze strzalek i Page-up/Page-down takze moga
+dzialac. Aby aktywowac biezacy wybor z menu, nacisnij klawisz Enter.
 }
 
 message thanks
-{Dziekujemy za uzywanie NetBSD!
+{Dziekujemy za wybranie NetBSD!
 }
 
 message installusure
@@ -483,8 +484,12 @@ message distset
 {Dystrybucja NetBSD jest rozbita w kolekcje pakietow dystrybucyjnych.
 Czesc z nich to pakiety podstawowe wymagane przez wszystkie instalacje,
 a czesc nie jest przez wszystkie wymagana. Mozesz zainstalowac je
-wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow.
-} /* XXX add 'minimal installation' */
+wszystkie (Pelna instalacja) lub wybrac z opcjonalnych pakietow. Mozesz
+takze zainstalowac tylko podstawowy zestaw (minimalna instalacja), lub
+wybrac te, ktore chcesz (Inna instalacja)
+}
+
+
 
 message ftpsource
 {Ponizej masz site %s, katalog, uzytkownika, oraz haslo gotowe do uzycia.



CVS commit: [netbsd-9] src/usr.sbin/sysinst

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:27:22 UTC 2019

Modified Files:
src/usr.sbin/sysinst [netbsd-9]: msg.mi.pl

Log Message:
Pull up following revision(s) (requested by kamil in ticket #377):

usr.sbin/sysinst/msg.mi.pl: revision 1.24

Fix polish translation for sysinst

PR install/53870 by Guest01
PR install/53871 by Guest01

patch by Krzysztof Lasocki


To generate a diff of this commit:
cvs rdiff -u -r1.20.2.2 -r1.20.2.3 src/usr.sbin/sysinst/msg.mi.pl

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



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:25:33 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_jme.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #376):

sys/dev/pci/if_jme.c: revision 1.46

A * is missing here. This could cause a use-after-free.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/dev/pci/if_jme.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_jme.c
diff -u src/sys/dev/pci/if_jme.c:1.44 src/sys/dev/pci/if_jme.c:1.44.2.1
--- src/sys/dev/pci/if_jme.c:1.44	Tue Jul  9 08:46:59 2019
+++ src/sys/dev/pci/if_jme.c	Thu Oct 24 16:25:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_jme.c,v 1.44 2019/07/09 08:46:59 msaitoh Exp $	*/
+/*	$NetBSD: if_jme.c,v 1.44.2.1 2019/10/24 16:25:33 martin Exp $	*/
 
 /*
  * Copyright (c) 2008 Manuel Bouyer.  All rights reserved.
@@ -58,7 +58,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.44 2019/07/09 08:46:59 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_jme.c,v 1.44.2.1 2019/10/24 16:25:33 martin Exp $");
 
 
 #include 
@@ -1453,7 +1453,7 @@ jme_encap(struct jme_softc *sc, struct m
 			"DMA segments, dropping...\n",
 			device_xname(sc->jme_dev));
 			m_freem(*m_head);
-			m_head = NULL;
+			*m_head = NULL;
 		}
 		return (error);
 	}



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:25:33 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_jme.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #376):

sys/dev/pci/if_jme.c: revision 1.46

A * is missing here. This could cause a use-after-free.
Found by the lgtm bot.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.2.1 src/sys/dev/pci/if_jme.c

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



CVS commit: [netbsd-9] src

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:23:17 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: alc.4
src/sys/dev/pci [netbsd-9]: if_alc.c if_alcreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #375):

sys/dev/pci/if_alc.c: revision 1.40
sys/dev/pci/if_alc.c: revision 1.41
sys/dev/pci/if_alc.c: revision 1.42
sys/dev/pci/if_alc.c: revision 1.39
sys/dev/pci/if_alcreg.h: revision 1.8
share/man/man4/alc.4: revision 1.6

Apply FreeBSD r218141:
 > alc_rev was used without initialization such that it failed to
 > apply AR8152 v1.0 specific initialization code. Fix this bug by
 > explicitly reading PCI device revision id via PCI accessor.
 >
 > Reported by: Gabriel Linder ( linder.gabriel <> gmail dot com )

 Move PCIe initialization code from alc_attach() to alc_init_pcie().
No functional change.

Some alc(4) fixes:
- Apply FreeBSD r218141:
 > alc_rev was used without initialization such that it failed to
 > apply AR8152 v1.0 specific initialization code. Fix this bug by
 > explicitly reading PCI device revision id via PCI accessor.
 >
 > Reported by: Gabriel Linder ( linder.gabriel <> gmail dot com )

- Apply FreeBSD r304574:
 > Correct DMA channel number selection on AR816x family of
 > controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x
 > except L1D controller, use vendor recommended ASPM parameters.
 > While here, increase alc_dma_burst array size.  Broken H/W can
 > return bogus value in theory.

- Use static.

- Whitespace fix. Remove extra backslash.

Add support for Killer E2400 and E2500.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.18.1 src/share/man/man4/alc.4
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/pci/if_alcreg.h

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/alc.4
diff -u src/share/man/man4/alc.4:1.5 src/share/man/man4/alc.4:1.5.18.1
--- src/share/man/man4/alc.4:1.5	Mon Jan 19 11:53:59 2015
+++ src/share/man/man4/alc.4	Thu Oct 24 16:23:17 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: alc.4,v 1.5 2015/01/19 11:53:59 wiz Exp $
+.\"	$NetBSD: alc.4,v 1.5.18.1 2019/10/24 16:23:17 martin Exp $
 .\"
 .\" Copyright (c) 2009 Kevin Lo 
 .\"
@@ -14,12 +14,12 @@
 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 .\"
-.Dd January 18, 2015
+.Dd October 16, 2019
 .Dt ALC 4
 .Os
 .Sh NAME
 .Nm alc
-.Nd Atheros AR813x/AR815x/AR816x/AR817x Ethernet device
+.Nd Atheros AR813x/AR815x/AR816x/AR817x Killer E2200/2400/2500 Ethernet device
 .Sh SYNOPSIS
 .Cd "alc* at pci?"
 .Cd "atphy* at mii?"
@@ -27,7 +27,8 @@
 The
 .Nm
 driver provides support for Ethernet interfaces based on the
-Atheros AR813x/AR815x/AR816x/AR817x Gigabit/Fast Ethernet chipsets.
+Atheros AR813x/AR815x/AR816x/AR817x Gigabit/Fast Ethernet chipsets and
+Killer E2200/2400/2500 Ethernet chipsets.
 .Pp
 The following
 .Ar media

Index: src/sys/dev/pci/if_alc.c
diff -u src/sys/dev/pci/if_alc.c:1.38 src/sys/dev/pci/if_alc.c:1.38.2.1
--- src/sys/dev/pci/if_alc.c:1.38	Tue Jul  9 08:46:58 2019
+++ src/sys/dev/pci/if_alc.c	Thu Oct 24 16:23:17 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_alc.c,v 1.38 2019/07/09 08:46:58 msaitoh Exp $	*/
+/*	$NetBSD: if_alc.c,v 1.38.2.1 2019/10/24 16:23:17 martin Exp $	*/
 /*	$OpenBSD: if_alc.c,v 1.1 2009/08/08 09:31:13 kevlo Exp $	*/
 /*-
  * Copyright (c) 2009, Pyun YongHyeon 
@@ -101,6 +101,10 @@ static struct alc_ident alc_ident_table[
 		"Atheros AR8172 PCIe Fast Ethernet" },
 	{ PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2200, 9 * 1024,
 		"Killer E2200 Gigabit Ethernet" },
+	{ PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2400, 9 * 1024,
+		"Killer E2400 Gigabit Ethernet" },
+	{ PCI_VENDOR_ATTANSIC, PCI_PRODUCT_ATTANSIC_E2500, 9 * 1024,
+		"Killer E2500 Gigabit Ethernet" },
 	{ 0, 0, 0, NULL },
 };
 
@@ -166,8 +170,9 @@ static void	alc_stop_mac(struct alc_soft
 static void	alc_stop_queue(struct alc_softc *);
 static void	alc_tick(void *);
 static void	alc_txeof(struct alc_softc *);
+static void	alc_init_pcie(struct alc_softc *);
 
-uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0 };
+static uint32_t alc_dma_burst[] = { 128, 256, 512, 1024, 2048, 4096, 0, 0 };
 
 CFATTACH_DECL_NEW(alc, sizeof(struct alc_softc),
 alc_match, alc_attach, alc_detach, NULL);
@@ -763,7 +768,6 @@ alc_get_macaddr_816x(struct alc_softc *s
 	alc_get_macaddr_par(sc);
 }
 
-
 static void
 alc_get_macaddr_par(struct alc_softc *sc)
 {
@@ -1002,6 +1006,8 @@ alc_phy_down(struct alc_softc *sc)
 	switch (sc->alc_ident->deviceid) {
 	case PCI_PRODUCT_ATTANSIC_AR8161:
 	case PCI_PRODUCT_ATTANSIC_E2200:
+	case PCI_PRODUCT_ATTANSIC_E2400:
+	case PCI_PRODUCT_ATTANSIC_E2500:
 	case PCI_PRODUCT_ATTANSIC_AR8162:
 	case 

CVS commit: [netbsd-9] src

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:23:17 UTC 2019

Modified Files:
src/share/man/man4 [netbsd-9]: alc.4
src/sys/dev/pci [netbsd-9]: if_alc.c if_alcreg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #375):

sys/dev/pci/if_alc.c: revision 1.40
sys/dev/pci/if_alc.c: revision 1.41
sys/dev/pci/if_alc.c: revision 1.42
sys/dev/pci/if_alc.c: revision 1.39
sys/dev/pci/if_alcreg.h: revision 1.8
share/man/man4/alc.4: revision 1.6

Apply FreeBSD r218141:
 > alc_rev was used without initialization such that it failed to
 > apply AR8152 v1.0 specific initialization code. Fix this bug by
 > explicitly reading PCI device revision id via PCI accessor.
 >
 > Reported by: Gabriel Linder ( linder.gabriel <> gmail dot com )

 Move PCIe initialization code from alc_attach() to alc_init_pcie().
No functional change.

Some alc(4) fixes:
- Apply FreeBSD r218141:
 > alc_rev was used without initialization such that it failed to
 > apply AR8152 v1.0 specific initialization code. Fix this bug by
 > explicitly reading PCI device revision id via PCI accessor.
 >
 > Reported by: Gabriel Linder ( linder.gabriel <> gmail dot com )

- Apply FreeBSD r304574:
 > Correct DMA channel number selection on AR816x family of
 > controllers. For Gigabit Ethernet version of AR816x, AR813x/AR815x
 > except L1D controller, use vendor recommended ASPM parameters.
 > While here, increase alc_dma_burst array size.  Broken H/W can
 > return bogus value in theory.

- Use static.

- Whitespace fix. Remove extra backslash.

Add support for Killer E2400 and E2500.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.18.1 src/share/man/man4/alc.4
cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/pci/if_alc.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/pci/if_alcreg.h

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



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:19:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_msk.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #374):

sys/dev/pci/if_msk.c: revision 1.92

Fix order of m_freem(). Found by kASan. OK'd by jdolecek and mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.2.1 src/sys/dev/pci/if_msk.c

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



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:19:23 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: if_msk.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #374):

sys/dev/pci/if_msk.c: revision 1.92

Fix order of m_freem(). Found by kASan. OK'd by jdolecek and mrg.


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.91.2.1 src/sys/dev/pci/if_msk.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_msk.c
diff -u src/sys/dev/pci/if_msk.c:1.91 src/sys/dev/pci/if_msk.c:1.91.2.1
--- src/sys/dev/pci/if_msk.c:1.91	Mon Jun  3 05:22:57 2019
+++ src/sys/dev/pci/if_msk.c	Thu Oct 24 16:19:23 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.91 2019/06/03 05:22:57 msaitoh Exp $ */
+/* $NetBSD: if_msk.c,v 1.91.2.1 2019/10/24 16:19:23 martin Exp $ */
 /*	$OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $	*/
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.91 2019/06/03 05:22:57 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.91.2.1 2019/10/24 16:19:23 martin Exp $");
 
 #include 
 #include 
@@ -2118,9 +2118,6 @@ msk_txeof(struct sk_if_softc *sc_if)
 		if (sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf != NULL) {
 			entry = sc_if->sk_cdata.sk_tx_map[idx];
 
-			m_freem(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf = NULL;
-
 			bus_dmamap_sync(sc->sc_dmatag, entry->dmamap, 0,
 			entry->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
 
@@ -2128,6 +2125,8 @@ msk_txeof(struct sk_if_softc *sc_if)
 			SIMPLEQ_INSERT_TAIL(_if->sk_txmap_head, entry,
 	  link);
 			sc_if->sk_cdata.sk_tx_map[idx] = NULL;
+			m_freem(sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf);
+			sc_if->sk_cdata.sk_tx_chain[idx].sk_mbuf = NULL;
 		}
 		sc_if->sk_cdata.sk_tx_cnt--;
 		SK_INC(idx, MSK_TX_RING_CNT);
@@ -2646,13 +2645,19 @@ msk_stop(struct ifnet *ifp, int disable)
 
 	for (i = 0; i < MSK_TX_RING_CNT; i++) {
 		if (sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf != NULL) {
-			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
-			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
+			dma = sc_if->sk_cdata.sk_tx_map[i];
+
+			bus_dmamap_sync(sc->sc_dmatag, dma->dmamap, 0,
+			dma->dmamap->dm_mapsize, BUS_DMASYNC_POSTWRITE);
+
+			bus_dmamap_unload(sc->sc_dmatag, dma->dmamap);
 #if 1
 			SIMPLEQ_INSERT_HEAD(_if->sk_txmap_head,
 			sc_if->sk_cdata.sk_tx_map[i], link);
 			sc_if->sk_cdata.sk_tx_map[i] = 0;
 #endif
+			m_freem(sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf);
+			sc_if->sk_cdata.sk_tx_chain[i].sk_mbuf = NULL;
 		}
 	}
 



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:14:11 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #373


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.2 -r1.1371.2.3 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.2 -r1.1370.2.3 src/sys/dev/pci/pcidevs_data.h

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



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:14:11 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs.h pcidevs_data.h

Log Message:
Regen for ticket #373


To generate a diff of this commit:
cvs rdiff -u -r1.1371.2.2 -r1.1371.2.3 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.1370.2.2 -r1.1370.2.3 src/sys/dev/pci/pcidevs_data.h

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

diffs are larger than 1MB and have been omitted


CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:12:42 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #373):

sys/dev/pci/pcidevs: revision 1.1386
sys/dev/pci/pcidevs: revision 1.1387

Modify Attansic Ethernet devices' description to clarify.
Add Killer E2400 and E2500.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.2 -r1.1383.2.3 src/sys/dev/pci/pcidevs

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



CVS commit: [netbsd-9] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:12:42 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-9]: pcidevs

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #373):

sys/dev/pci/pcidevs: revision 1.1386
sys/dev/pci/pcidevs: revision 1.1387

Modify Attansic Ethernet devices' description to clarify.
Add Killer E2400 and E2500.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.2 -r1.1383.2.3 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.1383.2.2 src/sys/dev/pci/pcidevs:1.1383.2.3
--- src/sys/dev/pci/pcidevs:1.1383.2.2	Tue Sep 24 02:59:35 2019
+++ src/sys/dev/pci/pcidevs	Thu Oct 24 16:12:42 2019
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.2 2019/09/24 02:59:35 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.3 2019/10/24 16:12:42 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1332,18 +1332,20 @@ product ASUSTEK HFCPCI		0x0675	ISDN
 /* Attansic Technology Corp. */
 product ATTANSIC ETHERNET_L1E	0x1026	L1E Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_GIGA	0x1048	L1 Gigabit Ethernet Adapter
-product ATTANSIC AR8132		0x1062	AR8132 Fast Ethernet Adapter
-product ATTANSIC AR8131		0x1063	AR8131 Gigabit Ethernet Adapter
-product ATTANSIC AR8151		0x1073	AR8151 v1.0 Gigabit Ethernet Adapter
-product ATTANSIC AR8151_V2	0x1083	AR8151 v2.0 Gigabit Ethernet Adapter
+product ATTANSIC AR8132		0x1062	AR8132 L2C Fast Ethernet Adapter
+product ATTANSIC AR8131		0x1063	AR8131 L1C Gigabit Ethernet Adapter
+product ATTANSIC AR8151		0x1073	AR8151 v1.0 L1D Gigabit Ethernet Adapter
+product ATTANSIC AR8151_V2	0x1083	AR8151 v2.0 L1D Gigabit Ethernet Adapter
 product ATTANSIC AR8162		0x1090	AR8162
 product ATTANSIC AR8161		0x1091	AR8161
 product ATTANSIC AR8172		0x10a0	AR8172
 product ATTANSIC AR8171		0x10a1	AR8171
 product ATTANSIC ETHERNET_100	0x2048	L2 100 Mbit Ethernet Adapter
-product ATTANSIC AR8152_B	0x2060	AR8152 v1.1 Fast Ethernet Adapter
-product ATTANSIC AR8152_B2	0x2062	AR8152 v2.0 Fast Ethernet Adapter
-product ATTANSIC E2200		0xe091	E2200
+product ATTANSIC AR8152_B	0x2060	AR8152 v1.1 L2C Fast Ethernet Adapter
+product ATTANSIC AR8152_B2	0x2062	AR8152 v2.0 L2C Fast Ethernet Adapter
+product ATTANSIC E2200		0xe091	Killer E2200
+product ATTANSIC E2400		0xe0a1	Killer E2400
+product ATTANSIC E2500		0xe0b1	Killer E2500
 
 /* ATI products */
 /* See http://www.x.org/wiki/Radeon%20ASICs */



CVS commit: [netbsd-8] src/sys

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:06:09 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx [netbsd-8]: epe.c
src/sys/arch/mac68k/nubus [netbsd-8]: if_netdock_nubus.c
src/sys/dev/ic [netbsd-8]: i82586.c
src/sys/dev/pcmcia [netbsd-8]: if_cnw.c if_ray.c
src/sys/dev/qbus [netbsd-8]: if_il.c if_qt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.


To generate a diff of this commit:
cvs rdiff -u -r1.36.6.1 -r1.36.6.2 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.25.8.1 -r1.25.8.2 \
src/sys/arch/mac68k/nubus/if_netdock_nubus.c
cvs rdiff -u -r1.76.6.1 -r1.76.6.2 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.61.8.1 -r1.61.8.2 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.86.8.1 -r1.86.8.2 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.29 -r1.29.10.1 src/sys/dev/qbus/if_il.c
cvs rdiff -u -r1.21.8.1 -r1.21.8.2 src/sys/dev/qbus/if_qt.c

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



CVS commit: [netbsd-8] src/sys

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:06:09 UTC 2019

Modified Files:
src/sys/arch/arm/ep93xx [netbsd-8]: epe.c
src/sys/arch/mac68k/nubus [netbsd-8]: if_netdock_nubus.c
src/sys/dev/ic [netbsd-8]: i82586.c
src/sys/dev/pcmcia [netbsd-8]: if_cnw.c if_ray.c
src/sys/dev/qbus [netbsd-8]: if_il.c if_qt.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1416):

sys/dev/ic/i82586.c: revision 1.86
sys/arch/arm/ep93xx/epe.c: revision 1.45
sys/dev/pcmcia/if_cnw.c: revision 1.66
sys/arch/mac68k/nubus/if_netdock_nubus.c: revision 1.31
sys/dev/qbus/if_il.c: revision 1.36
sys/dev/pcmcia/if_ray.c: revision 1.95
sys/dev/qbus/if_qt.c: revision 1.24

if_percpuq(9) automatically increments if_ipackets, so don't increment it in
the driver itself to prevent double count.


To generate a diff of this commit:
cvs rdiff -u -r1.36.6.1 -r1.36.6.2 src/sys/arch/arm/ep93xx/epe.c
cvs rdiff -u -r1.25.8.1 -r1.25.8.2 \
src/sys/arch/mac68k/nubus/if_netdock_nubus.c
cvs rdiff -u -r1.76.6.1 -r1.76.6.2 src/sys/dev/ic/i82586.c
cvs rdiff -u -r1.61.8.1 -r1.61.8.2 src/sys/dev/pcmcia/if_cnw.c
cvs rdiff -u -r1.86.8.1 -r1.86.8.2 src/sys/dev/pcmcia/if_ray.c
cvs rdiff -u -r1.29 -r1.29.10.1 src/sys/dev/qbus/if_il.c
cvs rdiff -u -r1.21.8.1 -r1.21.8.2 src/sys/dev/qbus/if_qt.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/ep93xx/epe.c
diff -u src/sys/arch/arm/ep93xx/epe.c:1.36.6.1 src/sys/arch/arm/ep93xx/epe.c:1.36.6.2
--- src/sys/arch/arm/ep93xx/epe.c:1.36.6.1	Thu Jul 26 23:55:28 2018
+++ src/sys/arch/arm/ep93xx/epe.c	Thu Oct 24 16:06:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: epe.c,v 1.36.6.1 2018/07/26 23:55:28 snj Exp $	*/
+/*	$NetBSD: epe.c,v 1.36.6.2 2019/10/24 16:06:09 martin Exp $	*/
 
 /*
  * Copyright (c) 2004 Jesse Off
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.36.6.1 2018/07/26 23:55:28 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epe.c,v 1.36.6.2 2019/10/24 16:06:09 martin Exp $");
 
 #include 
 #include 
@@ -259,7 +259,6 @@ begin:
 	}
 
 	if (ndq > 0) {
-		ifp->if_ipackets += ndq;
 		CTRLPAGE_DMASYNC(TX_QLEN * 3 * sizeof(uint32_t),
  			RX_QLEN * 4 * sizeof(uint32_t), 
 			BUS_DMASYNC_PREWRITE|BUS_DMASYNC_PREREAD);

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.25.8.1 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.25.8.2
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.25.8.1	Sat Aug  5 04:19:27 2017
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Thu Oct 24 16:06:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.25.8.1 2017/08/05 04:19:27 snj Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.25.8.2 2019/10/24 16:06:09 martin Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.25.8.1 2017/08/05 04:19:27 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.25.8.2 2019/10/24 16:06:09 martin Exp $");
 
 #include 
 #include 
@@ -726,9 +726,7 @@ netdock_rxint(struct netdock_softc *sc)
 		len -= ETHER_CRC_LEN;
 
 		if ((regdata1 & 0x00ac) == 0) {
-			if (netdock_read(sc, len))
-ifp->if_ipackets++;
-			else
+			if (netdock_read(sc, len) == 0)
 ifp->if_ierrors++;
 		} else {
 			ifp->if_ierrors++;

Index: src/sys/dev/ic/i82586.c
diff -u src/sys/dev/ic/i82586.c:1.76.6.1 src/sys/dev/ic/i82586.c:1.76.6.2
--- src/sys/dev/ic/i82586.c:1.76.6.1	Thu Jul 26 23:55:29 2018
+++ src/sys/dev/ic/i82586.c	Thu Oct 24 16:06:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82586.c,v 1.76.6.1 2018/07/26 23:55:29 snj Exp $	*/
+/*	$NetBSD: i82586.c,v 1.76.6.2 2019/10/24 16:06:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -137,7 +137,7 @@ Mode of operation:
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.76.6.1 2018/07/26 23:55:29 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.76.6.2 2019/10/24 16:06:09 martin Exp $");
 
 
 #include 
@@ -1041,7 +1041,6 @@ ie_readframe(
 	 * Finally pass this packet up to higher layers.
 	 */
 	if_percpuq_enqueue((>sc_ethercom.ec_if)->if_percpuq, m);
-	sc->sc_ethercom.ec_if.if_ipackets++;
 	return (0);
 }
 

Index: src/sys/dev/pcmcia/if_cnw.c
diff -u src/sys/dev/pcmcia/if_cnw.c:1.61.8.1 src/sys/dev/pcmcia/if_cnw.c:1.61.8.2
--- src/sys/dev/pcmcia/if_cnw.c:1.61.8.1	Thu Jul 26 23:55:30 2018
+++ src/sys/dev/pcmcia/if_cnw.c	Thu Oct 24 16:06:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cnw.c,v 1.61.8.1 2018/07/26 23:55:30 snj Exp $	*/
+/*	$NetBSD: if_cnw.c,v 1.61.8.2 2019/10/24 16:06:09 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 1.61.8.1 2018/07/26 23:55:30 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cnw.c,v 

CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:03:38 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1415):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

 -

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.156.1 src/sys/dev/pci/if_bcereg.h

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

Modified files:

Index: src/sys/dev/pci/if_bce.c
diff -u src/sys/dev/pci/if_bce.c:1.46 src/sys/dev/pci/if_bce.c:1.46.4.1
--- src/sys/dev/pci/if_bce.c:1.46	Wed Apr 19 07:35:44 2017
+++ src/sys/dev/pci/if_bce.c	Thu Oct 24 16:03:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bce.c,v 1.46 2017/04/19 07:35:44 msaitoh Exp $	 */
+/* $NetBSD: if_bce.c,v 1.46.4.1 2019/10/24 16:03:38 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.46 2017/04/19 07:35:44 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1.46.4.1 2019/10/24 16:03:38 martin Exp $");
 
 #include "vlan.h"
 
@@ -63,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: if_bce.c,v 1
 
 #include 
 #include 
-#include 
-#include 
 
 #include 
 
@@ -419,6 +417,8 @@ bce_attach(device_t parent, device_t sel
 	ifp->if_stop = bce_stop;
 	IFQ_SET_READY(>if_snd);
 
+	sc->ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU;
+
 	/* Initialize our media structures and probe the MII. */
 
 	sc->bce_mii.mii_ifp = ifp;
@@ -648,7 +648,7 @@ bce_watchdog(struct ifnet *ifp)
 {
 	struct bce_softc *sc = ifp->if_softc;
 
-	aprint_error_dev(sc->bce_dev, "device timeout\n");
+	device_printf(sc->bce_dev, "device timeout\n");
 	ifp->if_oerrors++;
 
 	(void) bce_init(ifp);
@@ -915,10 +915,15 @@ bce_init(struct ifnet *ifp)
 	sc->bce_txsnext = 0;
 	sc->bce_txin = 0;
 
-	/* enable crc32 generation */
+	/* enable crc32 generation and set proper LED modes */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
 	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) |
-	BCE_EMC_CG);
+	BCE_EMC_CRC32_ENAB | BCE_EMC_LED);
+
+	/* reset or clear powerdown control bit  */
+	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL,
+	bus_space_read_4(sc->bce_btag, sc->bce_bhandle, BCE_MACCTL) &
+	~BCE_EMC_PDOWN);
 
 	/* setup DMA interrupt control */
 	bus_space_write_4(sc->bce_btag, sc->bce_bhandle, BCE_DMAI_CTL, 1 << 24);	/* MAGIC */
@@ -1464,9 +1469,11 @@ static void
 bce_tick(void *v)
 {
 	struct bce_softc *sc = v;
+	int s;
 
-	/* Tick the MII. */
+	s = splnet();
 	mii_tick(>bce_mii);
+	splx(s);
 
 	callout_reset(>bce_timeout, hz, bce_tick, sc);
 }

Index: src/sys/dev/pci/if_bcereg.h
diff -u src/sys/dev/pci/if_bcereg.h:1.4 src/sys/dev/pci/if_bcereg.h:1.4.156.1
--- src/sys/dev/pci/if_bcereg.h:1.4	Sun Dec 11 12:22:49 2005
+++ src/sys/dev/pci/if_bcereg.h	Thu Oct 24 16:03:38 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: if_bcereg.h,v 1.4 2005/12/11 12:22:49 christos Exp $	 */
+/* $NetBSD: if_bcereg.h,v 1.4.156.1 2019/10/24 16:03:38 martin Exp $	 */
 
 /*
  * Copyright (c) 2003 Clifford Wright. All rights reserved.
@@ -71,7 +71,10 @@
 /* Ethernet MAC Control */
 #define BCE_MACCTL			0x00A8	/* ethernet mac control */
 /* mac control bits */
-#define BCE_EMC_CG			0x0001	/* crc32 generation */
+#define BCE_EMC_CRC32_ENAB		0x0001	/* crc32 generation */
+#define BCE_EMC_PDOWN			0x0004	/* PHY powerdown */
+#define BCE_EMC_EDET			0x0008	/* PHY energy detect */
+#define BCE_EMC_LED			0x00e0	/* PHY LED control */
 
 /* DMA Interrupt control */
 #define BCE_DMAI_CTL			0x0100



CVS commit: [netbsd-8] src/sys/dev/pci

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 16:03:38 UTC 2019

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bce.c if_bcereg.h

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1415):

sys/dev/pci/if_bce.c: revision 1.55
sys/dev/pci/if_bce.c: revision 1.56
sys/dev/pci/if_bcereg.h: revision 1.5

- Add missing splnet()/splx() around mii_tick(). Same as OpenBSD rev. 1.23
- Use device_printf() instead of aprint_error_dev)() in bce_watchdog().
- Remove unnecessary inclusion.

 -

>From OpenBSD:
 - Mark ETHERCAP_VLAN_MTU.
 - Clear the powerdown mode. Fixes PR kern/24911 reported by Werner Backes.
 - Set proper LED modes.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.46.4.1 src/sys/dev/pci/if_bce.c
cvs rdiff -u -r1.4 -r1.4.156.1 src/sys/dev/pci/if_bcereg.h

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



CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:59:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #1414


To generate a diff of this commit:
cvs rdiff -u -r1.128.6.6 -r1.128.6.7 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.116.6.6 -r1.116.6.7 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.128.6.6 src/sys/dev/mii/miidevs.h:1.128.6.7
--- src/sys/dev/mii/miidevs.h:1.128.6.6	Thu Aug  1 14:24:21 2019
+++ src/sys/dev/mii/miidevs.h	Thu Oct 24 15:59:13 2019
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.128.6.6 2019/08/01 14:24:21 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.128.6.7 2019/10/24 15:59:13 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.125.6.6 2019/08/01 14:22:55 martin Exp
+ *	NetBSD: miidevs,v 1.125.6.7 2019/10/24 15:58:45 martin Exp
  */
 
 /*-
@@ -57,10 +57,8 @@
  */
 
 #define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
-#define	MII_OUI_VITESSE	0x0001c1	/* Vitesse */
 #define	MII_OUI_TRIDIUM	0x0001f0	/* Tridium */
 #define	MII_OUI_DATATRACK	0x0002c6	/* Data Track Technology */
-#define	MII_OUI_CICADA	0x0003f1	/* Cicada Semiconductor */
 #define	MII_OUI_AGERE	0x00053d	/* Agere */
 #define	MII_OUI_BANKSPEED	0x0006b8	/* Bankspeed Pty */
 #define	MII_OUI_NETEXCELL	0x0008bb	/* NetExcell */
@@ -118,6 +116,7 @@
 #define	MII_OUI_xxBROADCOM_ALT1	0x0050ef	/* Broadcom Corporation */
 #define	MII_OUI_yyINTEL	0x005500	/* Intel */
 #define	MII_OUI_yyASIX	0x007063	/* Asix Semiconductor */
+#define	MII_OUI_xxVITESSE	0x008083	/* Vitesse Semiconductor */
 #define	MII_OUI_xxPMCSIERRA2	0x009057	/* PMC-Sierra */
 #define	MII_OUI_xxCICADA	0x00c08f	/* Cicada Semiconductor */
 #define	MII_OUI_xxNATSEMI	0x1000e8	/* National Semiconductor */
@@ -303,23 +302,26 @@
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004
 #define	MII_STR_xxBROADCOM_ALT1_BCM5906	"BCM5906 10/100baseTX media interface"
 
-/* Cicada Semiconductor PHYs (now owned by Vitesse?) */
-#define	MII_MODEL_CICADA_CS8201	0x0001
-#define	MII_STR_CICADA_CS8201	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8204	0x0004
-#define	MII_STR_CICADA_CS8204	"Cicada CS8204 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_VSC8211	0x000b
-#define	MII_STR_CICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201A	0x0020
-#define	MII_STR_CICADA_CS8201A	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8201B	0x0021
-#define	MII_STR_CICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
-#define	MII_MODEL_CICADA_CS8244	0x002c
-#define	MII_STR_CICADA_CS8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
+/* Cicada Semiconductor PHYs (-> Vitesse -> Microsemi) */
+
+#define	MII_MODEL_xxCICADA_CIS8201	0x0001
+#define	MII_STR_xxCICADA_CIS8201	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8204	0x0004
+#define	MII_STR_xxCICADA_CIS8204	"Cicada CIS8204 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8211	0x000b
+#define	MII_STR_xxCICADA_VSC8211	"Cicada VSC8211 10/100/1000TX PHY"
 #define	MII_MODEL_xxCICADA_VSC8221	0x0015
 #define	MII_STR_xxCICADA_VSC8221	"Vitesse VSC8221 10/100/1000BASE-T PHY"
-#define	MII_MODEL_xxCICADA_CS8201B	0x0021
-#define	MII_STR_xxCICADA_CS8201B	"Cicada CS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8224	0x0018
+#define	MII_STR_xxCICADA_VSC8224	"Vitesse VSC8224 10/100/1000BASE-T PHY"
+#define	MII_MODEL_xxCICADA_CIS8201A	0x0020
+#define	MII_STR_xxCICADA_CIS8201A	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_CIS8201B	0x0021
+#define	MII_STR_xxCICADA_CIS8201B	"Cicada CIS8201 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8234	0x0022
+#define	MII_STR_xxCICADA_VSC8234	"Vitesse VSC8234 10/100/1000TX PHY"
+#define	MII_MODEL_xxCICADA_VSC8244	0x002c
+#define	MII_STR_xxCICADA_VSC8244	"Vitesse VSC8244 Quad 10/100/1000BASE-T PHY"
 
 /* Davicom Semiconductor PHYs */
 /* AMD Am79C873 seems to be a relabeled DM9101 */
@@ -599,9 +601,13 @@
 #define	MII_MODEL_VIA_VT6103_2	0x0034
 #define	MII_STR_VIA_VT6103_2	"VT6103 10/100 PHY"
 
-/* Vitesse PHYs */
-#define	MII_MODEL_VITESSE_VSC8601	0x0002
-#define	MII_STR_VITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+/* Vitesse PHYs (Now Microsemi) */
+#define	MII_MODEL_xxVITESSE_VSC8601	0x0002
+#define	MII_STR_xxVITESSE_VSC8601	"VSC8601 10/100/1000 PHY"
+#define	MII_MODEL_xxVITESSE_VSC8641	0x0003
+#define	MII_STR_xxVITESSE_VSC8641	"Vitesse VSC8641 10/100/1000TX PHY"
+#define	MII_MODEL_xxVITESSE_VSC8501	0x0013
+#define	MII_STR_xxVITESSE_VSC8501	"Vitesse VSC8501 10/100/1000TX PHY"
 
 /* XaQti Corp. PHYs */
 #define	MII_MODEL_xxXAQTI_XMACII	0x

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.116.6.6 src/sys/dev/mii/miidevs_data.h:1.116.6.7
--- 

CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:59:13 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: miidevs.h miidevs_data.h

Log Message:
Regen for ticket #1414


To generate a diff of this commit:
cvs rdiff -u -r1.128.6.6 -r1.128.6.7 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.116.6.6 -r1.116.6.7 src/sys/dev/mii/miidevs_data.h

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



CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:58:45 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: ciphy.c miidevs

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1414:

sys/dev/mii/ciphy.c 1.34-1.37 via patch
sys/dev/mii/miidevs 1.158

- Indicate master mode if the negotiated result say so.
- Call mii_phy_flowstatus() to show the flow setting.
- Match a lot of Cicada and Vitesse devices correctly.
- Add support for VSC8221, VSC8234 and VSC8641.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.26.10.2 -r1.26.10.3 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.125.6.6 -r1.125.6.7 src/sys/dev/mii/miidevs

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



CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:58:45 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: ciphy.c miidevs

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1414:

sys/dev/mii/ciphy.c 1.34-1.37 via patch
sys/dev/mii/miidevs 1.158

- Indicate master mode if the negotiated result say so.
- Call mii_phy_flowstatus() to show the flow setting.
- Match a lot of Cicada and Vitesse devices correctly.
- Add support for VSC8221, VSC8234 and VSC8641.
- KNF


To generate a diff of this commit:
cvs rdiff -u -r1.26.10.2 -r1.26.10.3 src/sys/dev/mii/ciphy.c
cvs rdiff -u -r1.125.6.6 -r1.125.6.7 src/sys/dev/mii/miidevs

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/mii/ciphy.c
diff -u src/sys/dev/mii/ciphy.c:1.26.10.2 src/sys/dev/mii/ciphy.c:1.26.10.3
--- src/sys/dev/mii/ciphy.c:1.26.10.2	Sun Sep  1 10:19:04 2019
+++ src/sys/dev/mii/ciphy.c	Thu Oct 24 15:58:45 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.26.10.2 2019/09/01 10:19:04 martin Exp $ */
+/* $NetBSD: ciphy.c,v 1.26.10.3 2019/10/24 15:58:45 martin Exp $ */
 
 /*-
  * Copyright (c) 2004
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.26.10.2 2019/09/01 10:19:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.26.10.3 2019/10/24 15:58:45 martin Exp $");
 
 /*
  * Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -74,35 +74,35 @@ static const struct mii_phy_funcs ciphy_
 };
 
 static const struct mii_phydesc ciphys[] = {
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_CS8201,
-	  MII_STR_CICADA_CS8201 },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_CIS8201,
+	  MII_STR_xxCICADA_CIS8201 },
 
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_CS8201A,
-	  MII_STR_CICADA_CS8201A },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_CIS8201A,
+	  MII_STR_xxCICADA_CIS8201A },
 
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_CS8201B,
-	  MII_STR_CICADA_CS8201B },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_CIS8201B,
+	  MII_STR_xxCICADA_CIS8201B },
 
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_CS8204,
-	  MII_STR_CICADA_CS8204 },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_CIS8204,
+	  MII_STR_xxCICADA_CIS8204 },
 
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_VSC8211,
-	  MII_STR_CICADA_VSC8211 },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_VSC8211,
+	  MII_STR_xxCICADA_VSC8211 },
 
-	{ MII_OUI_CICADA,		MII_MODEL_CICADA_CS8244,
-	  MII_STR_CICADA_CS8244 },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_VSC8221,
+	  MII_STR_xxCICADA_VSC8221 },
 
-	{ MII_OUI_xxCICADA,		MII_MODEL_CICADA_CS8201,
-	  MII_STR_CICADA_CS8201 },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_VSC8234,
+	  MII_STR_xxCICADA_VSC8234 },
 
-	{ MII_OUI_xxCICADA,		MII_MODEL_CICADA_CS8201A,
-	  MII_STR_CICADA_CS8201A },
+	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_VSC8244,
+	  MII_STR_xxCICADA_VSC8244 },
 
-	{ MII_OUI_xxCICADA,		MII_MODEL_xxCICADA_CS8201B,
-	  MII_STR_xxCICADA_CS8201B },
+	{ MII_OUI_xxVITESSE,		MII_MODEL_xxVITESSE_VSC8601,
+	  MII_STR_xxVITESSE_VSC8601 },
 
-	{ MII_OUI_VITESSE,		MII_MODEL_VITESSE_VSC8601,
-	  MII_STR_VITESSE_VSC8601 },
+	{ MII_OUI_xxVITESSE,		MII_MODEL_xxVITESSE_VSC8641,
+	  MII_STR_xxVITESSE_VSC8641 },
 
 	{ 0,0,
 	  NULL },
@@ -231,9 +231,8 @@ setit:
 			if ((mii->mii_ifp->if_flags & IFF_LINK0)) {
 PHY_WRITE(sc, MII_100T2CR,
 gig | GTCR_MAN_MS | GTCR_ADV_MS);
-			} else {
+			} else
 PHY_WRITE(sc, MII_100T2CR, gig | GTCR_MAN_MS);
-			}
 			break;
 		case IFM_NONE:
 			PHY_WRITE(sc, MII_BMCR, BMCR_ISO | BMCR_PDOWN);
@@ -316,7 +315,7 @@ static void
 ciphy_status(struct mii_softc *sc)
 {
 	struct mii_data *mii = sc->mii_pdata;
-	int bmsr, bmcr;
+	int bmsr, bmcr, gtsr;
 
 	mii->mii_media_status = IFM_AVALID;
 	mii->mii_media_active = IFM_ETHER;
@@ -357,20 +356,23 @@ ciphy_status(struct mii_softc *sc)
 	}
 
 	if (bmsr & CIPHY_AUXCSR_FDX)
-		mii->mii_media_active |= IFM_FDX;
+		mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
 	else
 		mii->mii_media_active |= IFM_HDX;
 
-	return;
+	if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
+		gtsr = PHY_READ(sc, MII_100T2SR);
+		if ((gtsr & GTSR_MS_RES) != 0)
+			mii->mii_media_active |= IFM_ETH_MASTER;
+	}
 }
 
 static void
 ciphy_reset(struct mii_softc *sc)
 {
+
 	mii_phy_reset(sc);
 	DELAY(1000);
-
-	return;
 }
 
 #define PHY_SETBIT(x, y, z) \
@@ -395,9 +397,8 @@ ciphy_fixup(struct mii_softc *sc)
 	}
 
 	switch (model) {
-	case MII_MODEL_CICADA_CS8201:
-	case MII_MODEL_CICADA_CS8204:
-
+	case MII_MODEL_xxCICADA_CIS8201:
+	case MII_MODEL_xxCICADA_CIS8204:
 		/* Turn off "aux mode" (whatever that means) */
 		PHY_SETBIT(sc, CIPHY_MII_AUXCSR, CIPHY_AUXCSR_MDPPS);
 
@@ -406,40 +407,39 @@ ciphy_fixup(struct mii_softc *sc)
 		 * when using MII in full duplex mode.
 		 */
 		if ((speed == CIPHY_SPEED10 || speed == CIPHY_SPEED100) &&
-		(status & CIPHY_AUXCSR_FDX)) {
+		(status & 

CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:54:46 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: rgephy.c rgephyreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1413:

sys/dev/mii/rgephy.c1.43, 1.47, 1.49, 1.54-1.57
sys/dev/mii/rgephyreg.h 1.10, 1.12
(both via patch)

- It seems EEE support is not only on 8211F but on 8211D and newer.
- Indicate master mode if the negotiated result say so.
- Use symbolic names for chip revision.
- Cosmetic changes.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.40.10.2 -r1.40.10.3 src/sys/dev/mii/rgephy.c
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/dev/mii/rgephyreg.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/mii/rgephy.c
diff -u src/sys/dev/mii/rgephy.c:1.40.10.2 src/sys/dev/mii/rgephy.c:1.40.10.3
--- src/sys/dev/mii/rgephy.c:1.40.10.2	Mon May 13 12:40:13 2019
+++ src/sys/dev/mii/rgephy.c	Thu Oct 24 15:54:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rgephy.c,v 1.40.10.2 2019/05/13 12:40:13 martin Exp $	*/
+/*	$NetBSD: rgephy.c,v 1.40.10.3 2019/10/24 15:54:46 martin Exp $	*/
 
 /*
  * Copyright (c) 2003
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.40.10.2 2019/05/13 12:40:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.40.10.3 2019/10/24 15:54:46 martin Exp $");
 
 
 /*
@@ -73,6 +73,7 @@ static int	rgephy_service(struct mii_sof
 static void	rgephy_status(struct mii_softc *);
 static int	rgephy_mii_phy_auto(struct mii_softc *);
 static void	rgephy_reset(struct mii_softc *);
+static bool	rgephy_linkup(struct mii_softc *);
 static void	rgephy_loop(struct mii_softc *);
 static void	rgephy_load_dspcode(struct mii_softc *);
 
@@ -116,13 +117,9 @@ rgephy_attach(device_t parent, device_t 
 	int rev;
 	const char *sep = "";
 
-	ma = aux;
-	mii = ma->mii_data;
-
 	rev = MII_REV(ma->mii_id2);
 	mpd = mii_phy_match(ma, rgephys);
 	aprint_naive(": Media interface\n");
-	aprint_normal(": %s, rev. %d\n", mpd->mpd_name, rev);
 
 	sc->mii_dev = self;
 	sc->mii_inst = mii->mii_instance;
@@ -130,6 +127,15 @@ rgephy_attach(device_t parent, device_t 
 	sc->mii_mpd_oui = MII_OUI(ma->mii_id1, ma->mii_id2);
 	sc->mii_mpd_model = MII_MODEL(ma->mii_id2);
 	sc->mii_mpd_rev = MII_REV(ma->mii_id2);
+
+	if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8169S) {
+		aprint_normal(": RTL8211");
+		if (sc->mii_mpd_rev != 0)
+			aprint_normal("%c",'@' + sc->mii_mpd_rev);
+		aprint_normal(" 1000BASE-T media interface\n");
+	} else
+		aprint_normal(": %s, rev. %d\n", mpd->mpd_name, rev);
+
 	sc->mii_pdata = mii;
 	sc->mii_flags = ma->mii_flags;
 	sc->mii_anegticks = MII_ANEGTICKS_GIGE;
@@ -152,9 +158,9 @@ rgephy_attach(device_t parent, device_t 
 	 * media explicitly. Why?
 	 */
 	aprint_normal_dev(self, "");
-	if (sc->mii_capabilities & BMSR_EXTSTAT) {
+	if (sc->mii_capabilities & BMSR_EXTSTAT)
 		sc->mii_extcapabilities = PHY_READ(sc, MII_EXTSR);
-	}
+
 	mii_phy_add_media(sc);
 
 	/* rtl8169S does not report auto-sense; add manually.  */
@@ -257,9 +263,8 @@ rgephy_service(struct mii_softc *sc, str
 			if ((mii->mii_ifp->if_flags & IFF_LINK0)) {
 PHY_WRITE(sc, MII_100T2CR,
 gig|GTCR_MAN_MS|GTCR_ADV_MS);
-			} else {
-PHY_WRITE(sc, MII_100T2CR, gig|GTCR_MAN_MS);
-			}
+			} else
+PHY_WRITE(sc, MII_100T2CR, gig | GTCR_MAN_MS);
 			PHY_WRITE(sc, MII_BMCR, speed |
 			BMCR_AUTOEN | BMCR_STARTNEG);
 			break;
@@ -303,26 +308,9 @@ rgephy_service(struct mii_softc *sc, str
 		 * need to restart the autonegotiation process.  Read
 		 * the BMSR twice in case it's latched.
 		 */
-		if (sc->mii_mpd_rev >= 6) {
-			/* RTL8211F */
-			reg = PHY_READ(sc, RGEPHY_MII_PHYSR);
-			if (reg & RGEPHY_PHYSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else if (sc->mii_mpd_rev >= 2) {
-			/* RTL8211B(L) */
-			reg = PHY_READ(sc, RGEPHY_MII_SSR);
-			if (reg & RGEPHY_SSR_LINK) {
-sc->mii_ticks = 0;
-break;
-			}
-		} else {
-			reg = PHY_READ(sc, RTK_GMEDIASTAT);
-			if ((reg & RTK_GMEDIASTAT_LINK) != 0) {
-sc->mii_ticks = 0;
-break;
-			}
+		if (rgephy_linkup(sc)) {
+			sc->mii_ticks = 0;
+			break;
 		}
 
 		/* Announce link loss right after it happens. */
@@ -343,7 +331,6 @@ rgephy_service(struct mii_softc *sc, str
 	/*
 	 * Callback if something changed. Note that we need to poke
 	 * the DSP on the RealTek PHYs if the media changes.
-	 *
 	 */
 	if (sc->mii_media_active != mii->mii_media_active ||
 	sc->mii_media_status != mii->mii_media_status ||
@@ -354,29 +341,41 @@ rgephy_service(struct mii_softc *sc, str
 	return 0;
 }
 
+static bool
+rgephy_linkup(struct mii_softc *sc)
+{
+	bool linkup = false;
+	u_int reg;
+
+	if (sc->mii_mpd_rev >= RGEPHY_8211F) {
+		reg = PHY_READ(sc, RGEPHY_MII_PHYSR);
+		if (reg & RGEPHY_PHYSR_LINK)
+			linkup = true;
+	} else if (sc->mii_mpd_rev >= 

CVS commit: [netbsd-8] src/sys/dev/mii

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:54:46 UTC 2019

Modified Files:
src/sys/dev/mii [netbsd-8]: rgephy.c rgephyreg.h

Log Message:
Pull up the following revisions, requested by msaitoh in ticket #1413:

sys/dev/mii/rgephy.c1.43, 1.47, 1.49, 1.54-1.57
sys/dev/mii/rgephyreg.h 1.10, 1.12
(both via patch)

- It seems EEE support is not only on 8211F but on 8211D and newer.
- Indicate master mode if the negotiated result say so.
- Use symbolic names for chip revision.
- Cosmetic changes.
- KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.40.10.2 -r1.40.10.3 src/sys/dev/mii/rgephy.c
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/dev/mii/rgephyreg.h

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



CVS commit: [netbsd-8] src/sys/dev/hpc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:51:28 UTC 2019

Modified Files:
src/sys/dev/hpc [netbsd-8]: hpcapm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1412):

sys/dev/hpc/hpcapm.c: revision 1.21

spl leak, found by Mootja


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.22.1 src/sys/dev/hpc/hpcapm.c

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



CVS commit: [netbsd-8] src/sys/dev/hpc

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:51:28 UTC 2019

Modified Files:
src/sys/dev/hpc [netbsd-8]: hpcapm.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1412):

sys/dev/hpc/hpcapm.c: revision 1.21

spl leak, found by Mootja


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.22.1 src/sys/dev/hpc/hpcapm.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/hpc/hpcapm.c
diff -u src/sys/dev/hpc/hpcapm.c:1.20 src/sys/dev/hpc/hpcapm.c:1.20.22.1
--- src/sys/dev/hpc/hpcapm.c:1.20	Sat Nov  9 21:31:56 2013
+++ src/sys/dev/hpc/hpcapm.c	Thu Oct 24 15:51:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpcapm.c,v 1.20 2013/11/09 21:31:56 christos Exp $	*/
+/*	$NetBSD: hpcapm.c,v 1.20.22.1 2019/10/24 15:51:28 martin Exp $	*/
 
 /*
  * Copyright (c) 2000 Takemura Shin
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpcapm.c,v 1.20 2013/11/09 21:31:56 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpcapm.c,v 1.20.22.1 2019/10/24 15:51:28 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_hpcapm.h"
@@ -415,6 +415,8 @@ hpcapm_get_event(void *scx, u_int *event
 sc->power_state = APM_SYS_READY;
 			} else
 *event_info = 0;
+			splx(s);
+
 			return (0);
 		}
 	}



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

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:48:37 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1411):

sys/net/if_vlan.c: revision 1.147

vlan: get rid of unnecessary if_ipackets++ in vlan_input

It's done by if_input() below now.
Pointed out by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.16 -r1.97.2.17 src/sys/net/if_vlan.c

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



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

2019-10-24 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Oct 24 15:48:37 UTC 2019

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

Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #1411):

sys/net/if_vlan.c: revision 1.147

vlan: get rid of unnecessary if_ipackets++ in vlan_input

It's done by if_input() below now.
Pointed out by msaitoh@


To generate a diff of this commit:
cvs rdiff -u -r1.97.2.16 -r1.97.2.17 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.97.2.16 src/sys/net/if_vlan.c:1.97.2.17
--- src/sys/net/if_vlan.c:1.97.2.16	Mon Oct 22 07:41:12 2018
+++ src/sys/net/if_vlan.c	Thu Oct 24 15:48:37 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.97.2.16 2018/10/22 07:41:12 martin Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.97.2.17 2019/10/24 15:48:37 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.16 2018/10/22 07:41:12 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.97.2.17 2019/10/24 15:48:37 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1622,7 +1622,6 @@ vlan_input(struct ifnet *ifp, struct mbu
 	}
 
 	m_set_rcvif(m, >ifv_if);
-	ifv->ifv_if.if_ipackets++;
 
 	if (pfil_run_hooks(ifp->if_pfil, , ifp, PFIL_IN) != 0)
 		goto out;



CVS commit: src/usr.sbin/syslogd

2019-10-24 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Oct 24 08:21:18 UTC 2019

Modified Files:
src/usr.sbin/syslogd: tls.c

Log Message:
With TLSv1.3 a client has to receive and process metadata.

Update dispatch_tls_eof() to check for metadata and
rearm on success.

Ok: christos@


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/syslogd/tls.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/syslogd/tls.c
diff -u src/usr.sbin/syslogd/tls.c:1.16 src/usr.sbin/syslogd/tls.c:1.17
--- src/usr.sbin/syslogd/tls.c:1.16	Thu Feb  8 17:45:29 2018
+++ src/usr.sbin/syslogd/tls.c	Thu Oct 24 08:21:18 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tls.c,v 1.16 2018/02/08 17:45:29 christos Exp $	*/
+/*	$NetBSD: tls.c,v 1.17 2019/10/24 08:21:18 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: tls.c,v 1.16 2018/02/08 17:45:29 christos Exp $");
+__RCSID("$NetBSD: tls.c,v 1.17 2019/10/24 08:21:18 hannken Exp $");
 
 #ifndef DISABLE_TLS
 #include 
@@ -1450,7 +1450,7 @@ dispatch_socket_accept(int fd, short eve
  *
  * I do not know if libevent can tell us the difference
  * between available data and an EOF. But it does not matter
- * because there should not be any incoming data.
+ * because there should not be any incoming data beside metadata.
  * So we close the connection either because the peer closed its
  * side or because the peer broke the protocol by sending us stuff  ;-)
  */
@@ -1460,11 +1460,26 @@ dispatch_tls_eof(int fd, short event, vo
 	struct tls_conn_settings *conn_info = (struct tls_conn_settings *) arg;
 	sigset_t newmask, omask;
 	struct timeval tv;
+	int rc;
+	char buf[1];
 
 	BLOCK_SIGNALS(omask, newmask);
 	DPRINTF((D_TLS|D_EVENT|D_CALL), "dispatch_eof_tls(%d, %d, %p)\n",
 	fd, event, arg);
 	assert(conn_info->state == ST_TLS_EST);
+
+	/* First check for incoming metadata. */
+	ST_CHANGE(conn_info->state, ST_READING);
+	rc = SSL_read(conn_info->sslptr, buf, sizeof(buf));
+	ST_CHANGE(conn_info->state, ST_TLS_EST);
+	if (rc <= 0 && tls_examine_error("SSL_read()", conn_info->sslptr,
+	conn_info, rc) == TLS_RETRY_READ) {
+		/* Connection is still alive, rearm and return. */
+		EVENT_ADD(conn_info->event);
+		RESTORE_SIGNALS(omask);
+		return;
+	}
+
 	ST_CHANGE(conn_info->state, ST_EOF);
 	DEL_EVENT(conn_info->event);
 



CVS commit: src/usr.sbin/syslogd

2019-10-24 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Oct 24 08:21:18 UTC 2019

Modified Files:
src/usr.sbin/syslogd: tls.c

Log Message:
With TLSv1.3 a client has to receive and process metadata.

Update dispatch_tls_eof() to check for metadata and
rearm on success.

Ok: christos@


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.sbin/syslogd/tls.c

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