CVS commit: src/doc

2020-03-19 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Mar 20 03:21:14 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
bsd-family-tree


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

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

Modified files:

Index: src/doc/3RDPARTY
diff -u src/doc/3RDPARTY:1.1699 src/doc/3RDPARTY:1.1700
--- src/doc/3RDPARTY:1.1699	Wed Mar 18 19:34:15 2020
+++ src/doc/3RDPARTY	Fri Mar 20 03:21:14 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1699 2020/03/18 19:34:15 wiz Exp $
+#	$NetBSD: 3RDPARTY,v 1.1700 2020/03/20 03:21:14 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -195,12 +195,12 @@ Todo[4]: Re-entrant functions of net/*
 Todo[5]: Reconcile the doc directory.
 
 Package:	bsd-family-tree
-Version:	358264
-Current Vers:	358264
+Version:	359157
+Current Vers:	359157
 Maintainer:	The FreeBSD Project
 Archive Site:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 Home Page:	https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
-Date:		2020-02-23
+Date:		2020-03-20
 Mailing List:
 Responsible:
 License:	BSD (2-clause) (see http://www.freebsd.org/cgi/cvsweb.cgi/src/COPYRIGHT)



CVS commit: src/share/misc

2020-03-19 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Fri Mar 20 03:19:43 UTC 2020

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

Log Message:
Update to r359157 from FreeBSD


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

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

Modified files:

Index: src/share/misc/bsd-family-tree
diff -u src/share/misc/bsd-family-tree:1.79 src/share/misc/bsd-family-tree:1.80
--- src/share/misc/bsd-family-tree:1.79	Sun Feb 23 23:31:55 2020
+++ src/share/misc/bsd-family-tree	Fri Mar 20 03:19:43 2020
@@ -408,6 +408,10 @@ FreeBSD 5.2   |  |  
  | |  |  *--NetBSD||
  | v  |  |   9.0  ||
  ||  |||
+ ||  ||DragonFly 5.8
+ ||  |||
+ ||  ||DragonFly 5.6.3
+ ||  |||
 FreeBSD 13 -current   |  NetBSD -current   OpenBSD -currentDragonFly -current
  ||  |||
  vv  vvv
@@ -800,6 +804,8 @@ macOS 10.15		2019-10-07 [APL]
 macOS 10.15.1		2019-10-29 [APL] (security/critical release)
 FreeBSD 12.1		2019-11-04 [FBD]
 NetBSD 9.0 		2020-02-14 [NBD]
+DragonFly 5.8 		2020-03-03 [DFB]
+DragonFly 5.6.3 	2020-03-11 [DFB]
 
 Bibliography
 
@@ -864,5 +870,5 @@ Steven M. Schultz for providing 2.8BSD, 
 Copyright (c) 1997-2012 Wolfram Schneider 
 URL: https://svnweb.freebsd.org/base/head/share/misc/bsd-family-tree
 
-$FreeBSD: head/share/misc/bsd-family-tree 358264 2020-02-23 23:29:53Z sevan $
-$NetBSD: bsd-family-tree,v 1.79 2020/02/23 23:31:55 sevan Exp $
+$FreeBSD: head/share/misc/bsd-family-tree 359157 2020-03-20 03:15:23Z sevan $
+$NetBSD: bsd-family-tree,v 1.80 2020/03/20 03:19:43 sevan Exp $



CVS commit: src/share/man/man9

2020-03-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Fri Mar 20 01:15:05 UTC 2020

Modified Files:
src/share/man/man9: usbnet.9

Log Message:
Update for recent locking changes.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man9/usbnet.9

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/man9/usbnet.9
diff -u src/share/man/man9/usbnet.9:1.9 src/share/man/man9/usbnet.9:1.10
--- src/share/man/man9/usbnet.9:1.9	Fri Aug 23 07:14:35 2019
+++ src/share/man/man9/usbnet.9	Fri Mar 20 01:15:05 2020
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.9 2019/08/23 07:14:35 wiz Exp $
+.\"	$NetBSD: usbnet.9,v 1.10 2020/03/20 01:15:05 thorpej Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 22, 2019
+.Dd March 15, 2020
 .Dt USBNET 9
 .Os
 .Sh NAME
@@ -54,13 +54,13 @@
 .Ft bool
 .Fn usbnet_isdying "struct usbnet *un"
 .Ft void
-.Fn usbnet_lock "struct usbnet *un"
+.Fn usbnet_lock_core "struct usbnet *un"
 .Ft void
-.Fn usbnet_unlock "struct usbnet *un"
+.Fn usbnet_unlock_core "struct usbnet *un"
 .Ft kmutex_t *
-.Fn usbnet_mutex "struct usbnet *un"
+.Fn usbnet_mutex_core "struct usbnet *un"
 .Ft void
-.Fn usbnet_isowned "struct usbnet *un"
+.Fn usbnet_isowned_core "struct usbnet *un"
 .Ft void
 .Fn usbnet_lock_rx "struct usbnet *un"
 .Ft void
@@ -79,18 +79,6 @@
 .Fn usbnet_isowned_tx "struct usbnet *un"
 .Ft int
 .Fn usbnet_init_rx_tx "struct usbnet *un" "unsigned rxflags" "unsigned txflags"
-.Ft void
-.Fn usbnet_lock_mii "struct usbnet *un"
-.Ft void
-.Fn usbnet_lock_mii_un_locked "struct usbnet *un"
-.Ft void
-.Fn usbnet_unlock_mii "struct usbnet *un"
-.Ft void
-.Fn usbnet_unlock_mii_un_locked "struct usbnet *un"
-.Ft kmutex_t *
-.Fn usbnet_mutex_mii "struct usbnet *un"
-.Ft void
-.Fn usbnet_isowned_mii "struct usbnet *un"
 .Ft int
 .Fn usbnet_miibus_readreg "device_t dev" "int phy" "int reg" "uint16_t *val"
 .Ft int
@@ -98,6 +86,10 @@
 .Ft void
 .Fn usbnet_miibus_statchg "struct ifnet *"
 .Ft void
+.Fn usbnet_busy "struct usbnet *un"
+.Ft void
+.Fn usbnet_unbusy "struct usbnet *un"
+.Ft void
 .Fn usbnet_enqueue "struct usbnet *un" "uint8_t *buf" "size_t buflen" "int csum_flags" "uint32_t csum_data" "int mbuf_flags"
 .Ft void
 .Fn usbnet_input "struct usbnet *un" "uint8_t *buf" "size_t buflen"
@@ -126,7 +118,7 @@ Rx and Tx chain handling
 .It
 Generic handlers or support for several struct ifnet callbacks
 .It
-MII bus locking
+Network stack locking protocol
 .It
 Interrupt handling
 .El
@@ -223,21 +215,16 @@ callback to turn off any chipset specifi
 .Pp
 For devices requiring MII handling there are callbacks for reading and
 writing registers, and for status change events.
-The framework provides an MII-specific lock per interface which will be
-held when calling these functions, and these locks should be used by
+The framework serializes MII access with the core lock, which will be
+held when calling these functions, and this lock should be used by
 internal code that also requires serialized access to registers with the
-.Fn usbnet_lock_mii ,
-.Fn usbnet_unlock_mii ,
-.Fn usbnet_lock_mii_un_locked ,
+.Fn usbnet_lock_core
 and
-.Fn usbnet_unlock_mii_un_locked
+.Fn usbnet_unlock_core
 functions.
-These functions handle device detach events safely, and as such take
-and release a reference on this device and use the usbnet lock for
-this.
-Sometimes the usbnet lock is already held and instead the
-.Dq un_locked
-versions should be used.
+The MII callbacks handle device detach events safely; a reference count
+is taken and released around calls to the callbacks as the MII callbacks
+usually block.
 .Pp
 As receive must handle the case of multiple packets in one buffer,
 the support is split between the driver and the framework.
@@ -285,55 +272,52 @@ Returns pointer to this
 Returns pointer to this
 .Fa un's
 device softc.
-.It Fn bool usbnet_havelink un
+.It Fn usbnet_havelink un
 Returns true if link is active.
-.It Fn bool usbnet_isdying un
+.It Fn usbnet_isdying un
 Returns true if device is dying (has been pulled or deactivated,
 pending detach.)
 .El
 .Pp
+Refrence counting functions for
+.Fa struct usbnet :
+.Pp
+.Bl -tag -width 4n
+.It Fn usbnet_busy un
+Increases the reference count on the driver instance, preventing
+detach from occurring while the driver is blocked accessing the
+device.
+Must be called with the core lock held.
+.It Fn usbnet_unbusy un
+Decreses the reference count on the driver instance.
+Once the final reference has been dropped, if a detach event
+is pending, it is allowed to proceed.
+Must be called with the core lock held.
+.El
+.Pp
 Lock handling functions for
 .Fa struct usbnet :
 .Pp
 .Bl -tag -width 4n -compact
-.It Fn usbnet_lock un
-.It Fn usbnet_unlock un
-.It Fn usbnet_isowned un
+.It Fn 

CVS commit: src/include

2020-03-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Mar 20 01:08:43 UTC 2020

Modified Files:
src/include: ctype.h stdio.h wchar.h

Log Message:
Fix visibility of various C99 features, esp. for C++11.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/include/ctype.h
cvs rdiff -u -r1.98 -r1.99 src/include/stdio.h
cvs rdiff -u -r1.43 -r1.44 src/include/wchar.h

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

Modified files:

Index: src/include/ctype.h
diff -u src/include/ctype.h:1.34 src/include/ctype.h:1.35
--- src/include/ctype.h:1.34	Sun Apr 28 19:39:56 2013
+++ src/include/ctype.h	Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctype.h,v 1.34 2013/04/28 19:39:56 joerg Exp $	*/
+/*	$NetBSD: ctype.h,v 1.35 2020/03/20 01:08:42 joerg Exp $	*/
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -86,8 +86,11 @@ int	_tolower(int);
 int	_toupper(int);
 #endif
 
-#if defined(_ISOC99_SOURCE) || (_POSIX_C_SOURCE - 0) > 200112L || \
-(_XOPEN_SOURCE - 0) > 600 || defined(_NETBSD_SOURCE)
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+!defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200112L || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || (_XOPEN_SOURCE - 0) > 600 || \
+ defined(_NETBSD_SOURCE))
 int	isblank(int);
 #endif
 __END_DECLS

Index: src/include/stdio.h
diff -u src/include/stdio.h:1.98 src/include/stdio.h:1.99
--- src/include/stdio.h:1.98	Fri Dec 13 20:25:16 2019
+++ src/include/stdio.h	Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdio.h,v 1.98 2019/12/13 20:25:16 mrg Exp $	*/
+/*	$NetBSD: stdio.h,v 1.99 2020/03/20 01:08:42 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -41,6 +41,13 @@
 #include 
 #include 
 
+#if (!defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE) && \
+!defined(_XOPEN_SOURCE)) || ((_POSIX_C_SOURCE - 0) >= 200809L || \
+ defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+ (__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE))
+#define __STDIO_C99_FEATURES
+#endif
+
 #ifdef	_BSD_SIZE_T_
 typedef	_BSD_SIZE_T_	size_t;
 #undef	_BSD_SIZE_T_
@@ -307,8 +314,8 @@ __END_DECLS
 /*
  * IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2
  */
-#if (_POSIX_C_SOURCE - 0) >= 199506L || (_XOPEN_SOURCE - 0) >= 500 || \
-defined(_REENTRANT) || defined(_NETBSD_SOURCE)
+#if defined(__STDIO_C99_FEATURES) || (_POSIX_C_SOURCE - 0) >= 199506L || \
+(_XOPEN_SOURCE - 0) >= 500 || defined(_REENTRANT)
 __BEGIN_DECLS
 void	flockfile(FILE *);
 int	ftrylockfile(FILE *);
@@ -318,7 +325,7 @@ int	getchar_unlocked(void);
 int	putc_unlocked(int, FILE *);
 int	putchar_unlocked(int);
 __END_DECLS
-#endif /* _POSIX_C_SOURCE >= 1995056 || _XOPEN_SOURCE >= 500 || ... */
+#endif /* C99 || _POSIX_C_SOURCE >= 1995056 || _XOPEN_SOURCE >= 500 || ... */
 
 /*
  * Functions defined in POSIX 1003.2 and XPG2 or later.
@@ -339,11 +346,9 @@ __END_DECLS
 /*
  * Functions defined in ISO XPG4.2, ISO C99, POSIX 1003.1-2001 or later.
  */
-#if ((__STDC_VERSION__ - 0) >= 199901L) || \
-((_POSIX_C_SOURCE - 0) >= 200112L) || \
+#if defined(__STDIO_C99_FEATURES) || (_POSIX_C_SOURCE - 0) >= 200112L || \
 (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
-((_XOPEN_SOURCE - 0) >= 500) || \
-defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+(_XOPEN_SOURCE - 0) >= 500
 __BEGIN_DECLS
 int	 snprintf(char * __restrict, size_t, const char * __restrict, ...)
 		__printflike(3, 4);
@@ -387,7 +392,7 @@ __END_DECLS
  * Functions defined in ISO C99.  Still put under _NETBSD_SOURCE due to
  * backward compatible.
  */
-#if defined(_ISOC99_SOURCE) || defined(_NETBSD_SOURCE)
+#if defined(__STDIO_C99_FEATURES)
 __BEGIN_DECLS
 int	 vscanf(const char * __restrict, __va_list)
 		__scanflike(1, 0);
@@ -397,7 +402,7 @@ int	 vsscanf(const char * __restrict, co
 __va_list)
 __scanflike(2, 0);
 __END_DECLS
-#endif /* _ISOC99_SOURCE || _NETBSD_SOURCE */
+#endif /* C99 */
 
 /*
  * Routines that are purely local.

Index: src/include/wchar.h
diff -u src/include/wchar.h:1.43 src/include/wchar.h:1.44
--- src/include/wchar.h:1.43	Fri Dec 28 13:11:46 2018
+++ src/include/wchar.h	Fri Mar 20 01:08:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wchar.h,v 1.43 2018/12/28 13:11:46 maya Exp $	*/
+/*	$NetBSD: wchar.h,v 1.44 2020/03/20 01:08:42 joerg Exp $	*/
 
 /*-
  * Copyright (c)1999 Citrus Project,
@@ -151,9 +151,9 @@ long int wcstol(const wchar_t * __restri
 	wchar_t ** __restrict, int);
 double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
 
-#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) > 199901L || \
-defined(_NETBSD_SOURCE) || \
-	(_POSIX_C_SOURCE - 0) >= 200112L || (_XOPEN_SOURCE - 0) >= 600
+#if defined(_ISOC99_SOURCE) || (__STDC_VERSION__ - 0) >= 199901L || \
+(__cplusplus - 0) >= 201103L || defined(_NETBSD_SOURCE) 

CVS commit: src/sys/sys

2020-03-19 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Mar 20 01:06:12 UTC 2020

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

Log Message:
Use __builtin_va_start for clang as well. This avoids a bug in the
warning engine for the compatibility alias.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/sys/stdarg.h

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

Modified files:

Index: src/sys/sys/stdarg.h
diff -u src/sys/sys/stdarg.h:1.4 src/sys/sys/stdarg.h:1.5
--- src/sys/sys/stdarg.h:1.4	Fri Aug 15 11:58:13 2014
+++ src/sys/sys/stdarg.h	Fri Mar 20 01:06:11 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: stdarg.h,v 1.4 2014/08/15 11:58:13 matt Exp $	*/
+/*	$NetBSD: stdarg.h,v 1.5 2020/03/20 01:06:11 joerg Exp $	*/
 
 /*-
  * Copyright (c) 1991, 1993
@@ -45,7 +45,7 @@
 #define	__builtin_va_end(a)		/* nothing */
 #define	__builtin_va_copy(d, s)		((d) = (s))
 #elif !(__GNUC_PREREQ__(4, 5) || \
-(__GNUC_PREREQ__(4, 4) && __GNUC_PATCHLEVEL__ > 2))
+(__GNUC_PREREQ__(4, 4) && __GNUC_PATCHLEVEL__ > 2) || defined(__clang__))
 #define __builtin_va_start(ap, last)__builtin_stdarg_start((ap), (last))
 #endif
 



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

2020-03-19 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Fri Mar 20 00:27:58 UTC 2020

Added Files:
src/sys/arch/arm/sociox: if_ave.c

Log Message:
Socionext AVE GbE driver for UniPhier SoC family.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sociox/if_ave.c

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

Added files:

Index: src/sys/arch/arm/sociox/if_ave.c
diff -u /dev/null src/sys/arch/arm/sociox/if_ave.c:1.1
--- /dev/null	Fri Mar 20 00:27:58 2020
+++ src/sys/arch/arm/sociox/if_ave.c	Fri Mar 20 00:27:58 2020
@@ -0,0 +1,1205 @@
+/*	$NetBSD: if_ave.c,v 1.1 2020/03/20 00:27:58 nisimura Exp $	*/
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Tohru Nishimura.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * Socionext Uniphier AVE GbE driver
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: if_ave.c,v 1.1 2020/03/20 00:27:58 nisimura Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define FDT_INTR_FLAGS	(0)	/* !MP_SAFE */
+
+#define AVEID		0x000		/* hardware ID */
+#define AVEHWVER	0x004		/* hardware version */
+#define AVEGR		0x008		/* chip global control */
+#define  GR_RXRST	(1U<<5)		/* RxFIFO reset */
+#define  GR_PHYRST	(1U<<4)		/* external PHY reset */
+#define  GR_GRST	(1U<<0)		/* full chip reset */
+#define AVECFG		0x00c		/* hw configuration */
+#define  CFG_FLE	(1U<<31)	/* filter function enable */
+#define  CFG_CKE	(1U<<30)	/* checksum enable */
+#define  CFG_MII	(1U<<27)	/* 1: MII/RMII, 0: RGMII */
+#define  CFG_IPFCKE	(1U<<24)	/* IP framgment csum enable */
+#define AVEGIMR		0x100		/* global interrupt mask */
+#define AVEGISR		0x104		/* global interrupt status */
+#define  GISR_PHY	(1U<<24)	/* PHY status change detected */
+#define  GISR_TXCI	(1U<<16)	/* transmission completed */
+#define  GISR_RXERR	(1U<<8)		/* Rx frame error detected */
+#define  GISR_RXOVF	(1U<<7)		/* Rx oveflow detected */
+#define  GISR_RXDROP	(1U<<6)		/* Rx has been dropped */
+#define  GISR_RXIT	(1U<<5)		/* receive itimer notify */
+#define AVETXC		0x200		/* transmit control */
+#define  TXC_FCE	(1U<<18)	/* enable Tx flow control */
+#define  TXC_SPD1000	(1U<<17)	/* use 1000Mbps */
+#define  TXC_SPD100	(1U<<16)	/* use 100Mbps */
+#define AVERXC		0x204		/* receive control */
+#define  RXC_EN		(1U<<30)	/* enable receive circuit */
+#define  RXC_USEFDX	(1U<<22)	/* use full-duplex */
+#define  RXC_FCE	(1U<<21)	/* enable Rx flow control */
+#define  RXC_AFE	(1U<<19)	/* use address filter (!promisc) */
+#define  RXC_DRPEN	(1U<<18)	/* drop receiving PAUSE frames */
+/* RXC 15:0 max frame length to accept */
+#define AVEMACL		0x208		/* MAC address lower */
+#define AVEMACH		0x20c		/* MAC address upper */
+#define AVEMDIOC	0x214		/* MDIO control */
+#define  MDIOC_RD	(1U<<3)		/* read op */
+#define  MDIOC_WR	(1U<<2)		/* write op */
+#define AVEMDADR	0x218		/* MDIO address -- 13:8 phy id */
+#define AVEMDWRD	0x21c		/* MDIO write data - 15:0 */
+#define AVEMDIOS	0x220		/* MDIO status */
+#define  MDIOS_BUSY	(1U<<0)		/* MDIO in progress */
+#define AVEMDRDD	0x224		/* MDIO read data */
+#define AVEDESCC	0x300		/* descriptor control */
+#define  DESCC_RD0	(1U<<3)		/* activate Rx0 descriptor to run */
+#define DESCC_RSTP	(1U<<2)		/* pause Rx descriptor */
+#define  DESCC_TD	(1U<<0)		/* activate Tx descriptor to run */
+	/* 31:16 status report to read */
+#define 

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

2020-03-19 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Mar 19 22:17:45 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: files.sociox sni_exiu.c

Log Message:
make sni_exiu.c fdt/ACPI dual attach device


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/sociox/files.sociox
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sociox/sni_exiu.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/sociox/files.sociox
diff -u src/sys/arch/arm/sociox/files.sociox:1.8 src/sys/arch/arm/sociox/files.sociox:1.9
--- src/sys/arch/arm/sociox/files.sociox:1.8	Thu Mar 19 20:53:53 2020
+++ src/sys/arch/arm/sociox/files.sociox	Thu Mar 19 22:17:45 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sociox,v 1.8 2020/03/19 20:53:53 nisimura Exp $
+#	$NetBSD: files.sociox,v 1.9 2020/03/19 22:17:45 nisimura Exp $
 #
 # Configuration info for Socionext Unifier/SC2A11
 #
@@ -35,5 +35,6 @@ file	arch/arm/sociox/sni_gpio.c		snigpio
 
 # Socionext EXIU external interrupt controller unit
 device	sniexiu
-attach	sniexiu at fdt
+attach	sniexiu at acpinodebus with sniexitu_acpi
+attach	sniexiu at fdt with sniexiu_fdt
 file	arch/arm/sociox/sni_exiu.c		sniexiu

Index: src/sys/arch/arm/sociox/sni_exiu.c
diff -u src/sys/arch/arm/sociox/sni_exiu.c:1.1 src/sys/arch/arm/sociox/sni_exiu.c:1.2
--- src/sys/arch/arm/sociox/sni_exiu.c:1.1	Wed Mar 18 08:51:08 2020
+++ src/sys/arch/arm/sociox/sni_exiu.c	Thu Mar 19 22:17:45 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sni_exiu.c,v 1.1 2020/03/18 08:51:08 nisimura Exp $	*/
+/*	$NetBSD: sni_exiu.c,v 1.2 2020/03/19 22:17:45 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.1 2020/03/18 08:51:08 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v 1.2 2020/03/19 22:17:45 nisimura Exp $");
 
 #include 
 #include 
@@ -45,9 +45,14 @@ __KERNEL_RCSID(0, "$NetBSD: sni_exiu.c,v
 #include 
 
 #include 
-
-static int sniexiu_match(device_t, struct cfdata *, void *);
-static void sniexiu_attach(device_t, device_t, void *);
+#include 
+#include 
+#include 
+
+static int sniexiu_fdt_match(device_t, struct cfdata *, void *);
+static void sniexiu_fdt_attach(device_t, device_t, void *);
+static int sniexiu_acpi_match(device_t, struct cfdata *, void *);
+static void sniexiu_acpi_attach(device_t, device_t, void *);
 
 struct sniexiu_softc {
 	device_t		sc_dev;
@@ -55,15 +60,22 @@ struct sniexiu_softc {
 	bus_space_handle_t	sc_ioh;
 	bus_addr_t		sc_iob;
 	bus_size_t		sc_ios;
+	kmutex_t		sc_lock;
+	void			*sc_ih;
 	int			sc_phandle;
 };
 
-CFATTACH_DECL_NEW(sniexiu, sizeof(struct sniexiu_softc),
-sniexiu_match, sniexiu_attach, NULL, NULL);
+CFATTACH_DECL_NEW(sniexiu_fdt, sizeof(struct sniexiu_softc),
+sniexiu_fdt_match, sniexiu_fdt_attach, NULL, NULL);
+
+CFATTACH_DECL_NEW(sniexiu_acpi, sizeof(struct sniexiu_softc),
+sniexiu_acpi_match, sniexiu_acpi_attach, NULL, NULL);
+
+static void sniexiu_attach_i(struct sniexiu_softc *);
+static int sniexiu_intr(void *);
 
-/* ARGSUSED */
 static int
-sniexiu_match(device_t parent, struct cfdata *match, void *aux)
+sniexiu_fdt_match(device_t parent, struct cfdata *match, void *aux)
 {
 	static const char * compatible[] = {
 		"socionext,synquacer-exiu",
@@ -74,9 +86,8 @@ sniexiu_match(device_t parent, struct cf
 	return of_match_compatible(faa->faa_phandle, compatible);
 }
 
-/* ARGSUSED */
 static void
-sniexiu_attach(device_t parent, device_t self, void *aux)
+sniexiu_fdt_attach(device_t parent, device_t self, void *aux)
 {
 	struct sniexiu_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
@@ -111,15 +122,111 @@ sniexiu_attach(device_t parent, device_t
 		return;
 	}
 
-	aprint_naive(": External IRQ controller\n");
-	aprint_normal(": External IRQ controller\n");
-
 	sc->sc_dev = self;
 	sc->sc_phandle = phandle;
 	sc->sc_iot = faa->faa_bst;
 	sc->sc_ioh = ioh;
 	sc->sc_iob = addr;
 	sc->sc_ios = size;
+	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_NONE);
 
+	sc->sc_ih = fdtbus_intr_establish(phandle,
+			0, IPL_NET, 0, sniexiu_intr, sc);
+	if (sc->sc_ih == NULL) {
+		aprint_error_dev(self, "couldn't establish interrupt\n");
+		goto fail;
+	}
+
+	sniexiu_attach_i(sc);
+	return;
+  fail:
+	bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_ios);
 	return;
 }
+
+static int
+sniexiu_acpi_match(device_t parent, struct cfdata *match, void *aux)
+{
+	static const char * compatible[] = {
+		"SCX0008",
+		NULL
+	};
+	struct acpi_attach_args *aa = aux;
+
+	if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
+		return 0;
+	return acpi_match_hid(aa->aa_node->ad_devinfo, compatible);
+}
+
+static void
+sniexiu_acpi_attach(device_t parent, device_t self, void *aux)
+{
+	struct sniexiu_softc * const sc = device_private(self);
+	struct acpi_attach_args *aa = aux;
+	bus_space_handle_t ioh;
+	struct acpi_resources res;
+	struct acpi_mem *mem;
+	

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

2020-03-19 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Thu Mar 19 20:53:53 UTC 2020

Modified Files:
src/sys/arch/arm/sociox: files.sociox sni_gpio.c

Log Message:
make sni_gpio.c fdt/ACPI dual attach device


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/sociox/files.sociox
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sociox/sni_gpio.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/sociox/files.sociox
diff -u src/sys/arch/arm/sociox/files.sociox:1.7 src/sys/arch/arm/sociox/files.sociox:1.8
--- src/sys/arch/arm/sociox/files.sociox:1.7	Wed Mar 18 08:49:51 2020
+++ src/sys/arch/arm/sociox/files.sociox	Thu Mar 19 20:53:53 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sociox,v 1.7 2020/03/18 08:49:51 nisimura Exp $
+#	$NetBSD: files.sociox,v 1.8 2020/03/19 20:53:53 nisimura Exp $
 #
 # Configuration info for Socionext Unifier/SC2A11
 #
@@ -6,31 +6,31 @@
 
 # SC2A11 SynQuacer NetSec GbE
 device	scx: ether, ifnet, arp, mii, bus_dma_generic
-attach	scx at fdt with scx_fdt
 attach	scx at acpinodebus with scx_acpi
+attach	scx at fdt with scx_fdt
 file	arch/arm/sociox/if_scx.c		scx
 
 # Unifier AVE GbE
 device	ave: ether, ifnet, arp, mii, bus_dma_generic
 attach	ave at fdt with ave_fdt
-attach	ave at acpinodebus with ave_acpi
 file	arch/arm/sociox/if_ave.c		ave
 
 # Socionext eMMC
 device	sniemmc: sdmmcbus
-attach	sniemmc at fdt with sniemmc_fdt
 attach	sniemmc at acpinodebus with sniemmc_acpi
+attach	sniemmc at fdt with sniemmc_fdt
 file	arch/arm/sociox/sni_emmc.c		sniemmc
 
 # Socionext I2C
 device	sniiic: i2cbus
-attach	sniiic at fdt with sniiic_fdt
 attach	sniiic at acpinodebus with sniiic_acpi
+attach	sniiic at fdt with sniiic_fdt
 file	arch/arm/sociox/sni_i2c.c		sniiic	needs-flag
 
 # Socionext GPIO
 device	snigpio: gpiobus
-attach	snigpio at fdt
+attach	snigpio at acpinodebus with snigpio_acpi
+attach	snigpio at fdt with snigpio_fdt
 file	arch/arm/sociox/sni_gpio.c		snigpio
 
 # Socionext EXIU external interrupt controller unit

Index: src/sys/arch/arm/sociox/sni_gpio.c
diff -u src/sys/arch/arm/sociox/sni_gpio.c:1.1 src/sys/arch/arm/sociox/sni_gpio.c:1.2
--- src/sys/arch/arm/sociox/sni_gpio.c:1.1	Wed Mar 18 08:51:08 2020
+++ src/sys/arch/arm/sociox/sni_gpio.c	Thu Mar 19 20:53:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sni_gpio.c,v 1.1 2020/03/18 08:51:08 nisimura Exp $	*/
+/*	$NetBSD: sni_gpio.c,v 1.2 2020/03/19 20:53:53 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.1 2020/03/18 08:51:08 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v 1.2 2020/03/19 20:53:53 nisimura Exp $");
 
 #include 
 #include 
@@ -49,9 +49,14 @@ __KERNEL_RCSID(0, "$NetBSD: sni_gpio.c,v
 
 #include 
 #include 
-
-static int snigpio_match(device_t, struct cfdata *, void *);
-static void snigpio_attach(device_t, device_t, void *);
+#include 
+#include 
+#include 
+
+static int snigpio_fdt_match(device_t, struct cfdata *, void *);
+static void snigpio_fdt_attach(device_t, device_t, void *);
+static int snigpio_acpi_match(device_t, struct cfdata *, void *);
+static void snigpio_acpi_attach(device_t, device_t, void *);
 
 struct snigpio_softc {
 	device_t		sc_dev;
@@ -66,11 +71,16 @@ struct snigpio_softc {
 	int			sc_phandle;
 };
 
-CFATTACH_DECL_NEW(snigpio, sizeof(struct snigpio_softc),
-snigpio_match, snigpio_attach, NULL, NULL);
+CFATTACH_DECL_NEW(snigpio_fdt, sizeof(struct snigpio_softc),
+snigpio_fdt_match, snigpio_fdt_attach, NULL, NULL);
+
+CFATTACH_DECL_NEW(snigpio_acpi, sizeof(struct snigpio_softc),
+snigpio_acpi_match, snigpio_acpi_attach, NULL, NULL);
+
+static void snigpio_attach_i(struct snigpio_softc *);
 
 static int
-snigpio_match(device_t parent, struct cfdata *match, void *aux)
+snigpio_fdt_match(device_t parent, struct cfdata *match, void *aux)
 {
 	static const char * compatible[] = {
 		"socionext,synquacer-gpio",
@@ -83,13 +93,12 @@ snigpio_match(device_t parent, struct cf
 }
 
 static void
-snigpio_attach(device_t parent, device_t self, void *aux)
+snigpio_fdt_attach(device_t parent, device_t self, void *aux)
 {
 	struct snigpio_softc * const sc = device_private(self);
 	struct fdt_attach_args * const faa = aux;
 	prop_dictionary_t dict = device_properties(self);
 	const int phandle = faa->faa_phandle;
-	struct gpiobus_attach_args gba;
 	bus_space_handle_t ioh;
 	bus_addr_t addr;
 	bus_size_t size;
@@ -113,15 +122,80 @@ snigpio_attach(device_t parent, device_t
 		return;
 	}
 
-	aprint_naive(": GPIO controller\n");
-	aprint_normal(": GPIO controller\n");
-
 	sc->sc_dev = self;
 	sc->sc_phandle = phandle;
 	sc->sc_iot = faa->faa_bst;
 	sc->sc_ioh = ioh;
 	sc->sc_iob = addr;
 	sc->sc_ios = size;
+
+	snigpio_attach_i(sc);
+
+	return;
+}
+
+static int
+snigpio_acpi_match(device_t parent, struct cfdata *match, void *aux)
+{
+	static const char * compatible[] 

CVS commit: src/sys/uvm

2020-03-19 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Mar 19 20:23:20 UTC 2020

Modified Files:
src/sys/uvm: uvm_meter.c

Log Message:
sysctl_vm_uvmexp2(): some counters were needlessly truncated.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/uvm/uvm_meter.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/uvm/uvm_meter.c
diff -u src/sys/uvm/uvm_meter.c:1.74 src/sys/uvm/uvm_meter.c:1.75
--- src/sys/uvm/uvm_meter.c:1.74	Wed Jan 15 17:55:45 2020
+++ src/sys/uvm/uvm_meter.c	Thu Mar 19 20:23:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_meter.c,v 1.74 2020/01/15 17:55:45 ad Exp $	*/
+/*	$NetBSD: uvm_meter.c,v 1.75 2020/03/19 20:23:19 ad Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.74 2020/01/15 17:55:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_meter.c,v 1.75 2020/03/19 20:23:19 ad Exp $");
 
 #include 
 #include 
@@ -180,12 +180,12 @@ sysctl_vm_uvmexp2(SYSCTLFN_ARGS)
 	u.poolpages = pool_totalpages();
 	u.countsyncone = cpu_count_get(CPU_COUNT_SYNC_ONE);
 	u.countsyncall = cpu_count_get(CPU_COUNT_SYNC_ALL);
-	u.anonunknown = (int)cpu_count_get(CPU_COUNT_ANONUNKNOWN);
-	u.anonclean = (int)cpu_count_get(CPU_COUNT_ANONCLEAN);
-	u.anondirty = (int)cpu_count_get(CPU_COUNT_ANONDIRTY);
-	u.fileunknown = (int)cpu_count_get(CPU_COUNT_FILEUNKNOWN);
-	u.fileclean = (int)cpu_count_get(CPU_COUNT_FILECLEAN);
-	u.filedirty = (int)cpu_count_get(CPU_COUNT_FILEDIRTY);
+	u.anonunknown = cpu_count_get(CPU_COUNT_ANONUNKNOWN);
+	u.anonclean = cpu_count_get(CPU_COUNT_ANONCLEAN);
+	u.anondirty = cpu_count_get(CPU_COUNT_ANONDIRTY);
+	u.fileunknown = cpu_count_get(CPU_COUNT_FILEUNKNOWN);
+	u.fileclean = cpu_count_get(CPU_COUNT_FILECLEAN);
+	u.filedirty = cpu_count_get(CPU_COUNT_FILEDIRTY);
 
 	node = *rnode;
 	node.sysctl_data = 



CVS commit: src/tests/dev/sysmon

2020-03-19 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Mar 19 20:10:49 UTC 2020

Modified Files:
src/tests/dev/sysmon: t_swsensor.sh

Log Message:
Mark the swsensor tests "expected failure" since the rump world doesn't
seem to handle the SYSCTL_SETUP stuff.  PR kern/55088


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/dev/sysmon/t_swsensor.sh

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

Modified files:

Index: src/tests/dev/sysmon/t_swsensor.sh
diff -u src/tests/dev/sysmon/t_swsensor.sh:1.9 src/tests/dev/sysmon/t_swsensor.sh:1.10
--- src/tests/dev/sysmon/t_swsensor.sh:1.9	Thu Apr 23 23:23:28 2015
+++ src/tests/dev/sysmon/t_swsensor.sh	Thu Mar 19 20:10:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_swsensor.sh,v 1.9 2015/04/23 23:23:28 pgoyette Exp $
+# $NetBSD: t_swsensor.sh,v 1.10 2020/03/19 20:10:49 pgoyette Exp $
 
 get_sensor_info() {
 	rump.envstat -x | \
@@ -145,6 +145,7 @@ common_body() {
 	# Step 3 - verify that changes in sensor value are seen
 	rump.sysctl -w hw.swsensor.cur_value=$(( $2 + 1 ))
 	if [ $( get_sensor_key cur-value ) -ne $(( $2 + 1 )) ] ; then
+		atf_expect_fail "PR kern/55088"
 		atf_fail "3: Value not updated"
 	fi
 



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

2020-03-19 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Mar 19 19:55:34 UTC 2020

Modified Files:
src/sys/arch/x86/acpi: acpi_cpu_md.c

Log Message:
PR kern/55080: current does not boot

Back out previous.  To be addressed differently.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/x86/acpi/acpi_cpu_md.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/x86/acpi/acpi_cpu_md.c
diff -u src/sys/arch/x86/acpi/acpi_cpu_md.c:1.82 src/sys/arch/x86/acpi/acpi_cpu_md.c:1.83
--- src/sys/arch/x86/acpi/acpi_cpu_md.c:1.82	Sat Mar 14 13:50:46 2020
+++ src/sys/arch/x86/acpi/acpi_cpu_md.c	Thu Mar 19 19:55:34 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.83 2020/03/19 19:55:34 ad Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen 
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.82 2020/03/14 13:50:46 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.83 2020/03/19 19:55:34 ad Exp $");
 
 #include 
 #include 
@@ -103,10 +103,8 @@ __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.
 
 #define FID_TO_VCO_FID(fidd)	(((fid) < 8) ? (8 + ((fid) << 1)) : (fid))
 
-#ifdef ACPICPU_ENABLE_C3
 static char	  native_idle_text[16];
 void		(*native_idle)(void) = NULL;
-#endif
 
 static int	 acpicpu_md_quirk_piix4(const struct pci_attach_args *);
 static void	 acpicpu_md_pstate_hwf_reset(void *, void *);
@@ -350,12 +348,6 @@ acpicpu_md_quirk_c1e(void)
 int
 acpicpu_md_cstate_start(struct acpicpu_softc *sc)
 {
-#ifdef ACPICPU_ENABLE_C3
-	/*
-	 * XXX There are performance problems with the ACPI idle loop, and
-	 * it does not enter deep sleep.  Once those are resolved it'll be
-	 * re-enabled.
-	 */
 	const size_t size = sizeof(native_idle_text);
 	struct acpicpu_cstate *cs;
 	bool ipi = false;
@@ -377,7 +369,6 @@ acpicpu_md_cstate_start(struct acpicpu_s
 	}
 
 	x86_cpu_idle_set(acpicpu_cstate_idle, "acpi", ipi);
-#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }
@@ -385,12 +376,6 @@ acpicpu_md_cstate_start(struct acpicpu_s
 int
 acpicpu_md_cstate_stop(void)
 {
-#ifdef ACPICPU_ENABLE_C3
-	/*
-	 * XXX There are performance problems with the ACPI idle loop, and
-	 * it does not enter deep sleep.  Once those are resolved it'll be
-	 * re-enabled.
-	 */
 	static char text[16];
 	void (*func)(void);
 	bool ipi;
@@ -408,7 +393,6 @@ acpicpu_md_cstate_stop(void)
 	 * out from the ACPI idle-loop before detachment.
 	 */
 	xc_barrier(0);
-#endif	/* ACPICPU_ENABLE_C3 */
 
 	return 0;
 }



CVS commit: [netbsd-9] src/doc

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:47:39 UTC 2020

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

Log Message:
Tickets #782 - #787


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/doc/CHANGES-9.1

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.1
diff -u src/doc/CHANGES-9.1:1.1.2.19 src/doc/CHANGES-9.1:1.1.2.20
--- src/doc/CHANGES-9.1:1.1.2.19	Mon Mar 16 11:11:46 2020
+++ src/doc/CHANGES-9.1	Thu Mar 19 19:47:39 2020
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.1,v 1.1.2.19 2020/03/16 11:11:46 sborrill Exp $
+# $NetBSD: CHANGES-9.1,v 1.1.2.20 2020/03/19 19:47:39 martin Exp $
 
 A complete list of changes from the NetBSD 9.0 release to the NetBSD 9.1
 release:
@@ -534,3 +534,72 @@ sys/arch/xen/xen/xennet_checksum.c		1.4
 	on same physical host as it seems Windows does some padding.
 	[jdolecek, ticket #781]
 
+sys/dev/pci/pci_subr.c1.220,1.221
+sys/dev/pci/pcireg.h1.149-1.151
+
+	Enhancements to pcictl(8) dump:
+	- Print Bridge Config Retry Enable bit and Retimer Presence
+	  Detect Supported bit.
+	- 10-bit Tag Requester/Completer.
+	- Add Data link Feature extended capability.
+	- Add Physical Layer 16.0 GT/s extended capability.
+	[msaitoh, ticket #782]
+
+etc/MAKEDEV.tmpl1.216
+
+	Create /dev/ipmi0 in `MAKEDEV all'.
+	[riastradh, ticket #783]
+
+sys/dev/pci/pcidevs1.1398-1.1402
+sys/dev/pci/pcidevs.h(regen)
+sys/dev/pci/pcidevs_data.h			(regen)
+
+	- Add Radeon HD4290  
+	- Add Farallon PN9000SX Ethernet.
+	- NVIDIA 0x036[0-7] are nForce MCP55 LPC Bridge.
+	- Add VIA VX900 chipset.	
+	- Add some GeForce devices.
+	[msaitoh, ticket #784]
+
+sys/net/if_media.h1.70
+
+	- Remove 50GBASE-LR10.
+	- Add the following medias:
+	  - 25GBASE-ACC
+	  - 100GBASE-ACC
+	  - 100GBASE-AOC
+	  - 100GBASE-FR
+	  - 100GBASE-LR
+	  - 200GBASE-ER4
+	  - 400GBASE-ER8
+	  - 400GBASE-FR4
+	  - 400GBASE-LR4
+	  - 400GBASE-SR4.2
+	  - 400GBASE-SR8
+	[msaitoh, ticket #785]
+
+sys/dev/mii/atphy.c			1.28-1.29 
+sys/dev/mii/miidevs			1.163		
+sys/dev/pci/if_nfe.c			1.77-1.78
+sys/dev/mii/miidevs.h			regen 
+sys/dev/mii/miidevs_data.h		regen 
+		
+	- 0x001374 is non-bitreversed value of Attansic OUI(0x00c82e) and
+	  Attansic/Atheros correctly uses ID1 and ID2 register, so delete all
+	  0x001374 related entries.			  
+	- Use unsigned to avoid undefined behavior in nfe_setmulti() and
+	  nfe_set_macaddr(). Found by kUBSan.
+	- Improve error check in mfe_miibus_{read,write}reg().
+	- Fix a bug that atphy(4) doesn't work with Attansic L2 rev. 1.
+	[msaitoh, ticket #786]
+
+sys/altq/altq_flowvalve.h			1.4
+sys/dist/pf/net/pfvar.h1.23
+sys/external/bsd/drm2/dist/drm/drm_drv.c	1.13
+sys/external/bsd/drm2/dist/include/drm/drmP.h	1.38
+sys/net/slcompress.h1.20
+sys/net/zlib.h	1.15
+
+	Fix kernel ctf type duplication.
+	[riastradh, ticket #787]
+



CVS commit: [netbsd-9] src/sys

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:41:10 UTC 2020

Modified Files:
src/sys/altq [netbsd-9]: altq_flowvalve.h
src/sys/dist/pf/net [netbsd-9]: pfvar.h
src/sys/external/bsd/drm2/dist/drm [netbsd-9]: drm_drv.c
src/sys/external/bsd/drm2/dist/include/drm [netbsd-9]: drmP.h
src/sys/net [netbsd-9]: slcompress.h zlib.h

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #787):

sys/altq/altq_flowvalve.h: revision 1.4
sys/net/zlib.h: revision 1.15
sys/dist/pf/net/pfvar.h: revision 1.23
sys/external/bsd/drm2/dist/include/drm/drmP.h: revision 1.38
sys/external/bsd/drm2/dist/drm/drm_drv.c: revision 1.13
sys/net/slcompress.h: revision 1.20

Need opt_inet.h for #ifdef INET, INET6.

Avoid duplicate definition of internal_state struct.

Avoid struct inode.

This is an fs-independent structure in Linux.  We don't actually use
it as such; it's just a dummy struct tag.  But we do have an actual
struct inode in ufs and in lfs, and using the same struct tag here
confuses ctf leading to four copies of pretty much every drm data
structure.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.146.1 src/sys/altq/altq_flowvalve.h
cvs rdiff -u -r1.22 -r1.22.32.1 src/sys/dist/pf/net/pfvar.h
cvs rdiff -u -r1.10 -r1.10.4.1 src/sys/external/bsd/drm2/dist/drm/drm_drv.c
cvs rdiff -u -r1.35.4.1 -r1.35.4.2 \
src/sys/external/bsd/drm2/dist/include/drm/drmP.h
cvs rdiff -u -r1.19 -r1.19.20.1 src/sys/net/slcompress.h
cvs rdiff -u -r1.14 -r1.14.68.1 src/sys/net/zlib.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/altq/altq_flowvalve.h
diff -u src/sys/altq/altq_flowvalve.h:1.3 src/sys/altq/altq_flowvalve.h:1.3.146.1
--- src/sys/altq/altq_flowvalve.h:1.3	Thu Oct 12 19:59:08 2006
+++ src/sys/altq/altq_flowvalve.h	Thu Mar 19 19:41:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: altq_flowvalve.h,v 1.3 2006/10/12 19:59:08 peter Exp $	*/
+/*	$NetBSD: altq_flowvalve.h,v 1.3.146.1 2020/03/19 19:41:10 martin Exp $	*/
 /*	$KAME: altq_flowvalve.h,v 1.5 2002/04/03 05:38:50 kjc Exp $	*/
 
 /*
@@ -32,6 +32,10 @@
 
 #ifdef _KERNEL
 
+#ifdef _KERNEL_OPT
+#include "opt_inet.h"
+#endif
+
 /* fv_flow structure to define a unique address pair */
 struct fv_flow {
 	int flow_af;		/* address family */

Index: src/sys/dist/pf/net/pfvar.h
diff -u src/sys/dist/pf/net/pfvar.h:1.22 src/sys/dist/pf/net/pfvar.h:1.22.32.1
--- src/sys/dist/pf/net/pfvar.h:1.22	Thu Jun  5 23:48:16 2014
+++ src/sys/dist/pf/net/pfvar.h	Thu Mar 19 19:41:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pfvar.h,v 1.22 2014/06/05 23:48:16 rmind Exp $	*/
+/*	$NetBSD: pfvar.h,v 1.22.32.1 2020/03/19 19:41:10 martin Exp $	*/
 /*	$OpenBSD: pfvar.h,v 1.254 2007/07/13 09:17:48 markus Exp $ */
 
 /*
@@ -34,6 +34,10 @@
 #ifndef _NET_PFVAR_H_
 #define _NET_PFVAR_H_
 
+#ifdef _KERNEL_OPT
+#include "opt_inet.h"
+#endif
+
 #include 
 #include 
 #include 

Index: src/sys/external/bsd/drm2/dist/drm/drm_drv.c
diff -u src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.10 src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.10.4.1
--- src/sys/external/bsd/drm2/dist/drm/drm_drv.c:1.10	Tue Aug 28 08:20:27 2018
+++ src/sys/external/bsd/drm2/dist/drm/drm_drv.c	Thu Mar 19 19:41:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drm_drv.c,v 1.10 2018/08/28 08:20:27 martin Exp $	*/
+/*	$NetBSD: drm_drv.c,v 1.10.4.1 2020/03/19 19:41:10 martin Exp $	*/
 
 /*
  * Created: Fri Jan 19 10:48:35 2001 by fa...@acm.org
@@ -29,7 +29,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.10 2018/08/28 08:20:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_drv.c,v 1.10.4.1 2020/03/19 19:41:10 martin Exp $");
 
 #include 
 #include 
@@ -541,16 +541,14 @@ EXPORT_SYMBOL(drm_unplug_dev);
 
 #ifdef __NetBSD__
 
-struct inode;
-
-static struct inode *
+static void *
 drm_fs_inode_new(void)
 {
 	return NULL;
 }
 
 static void
-drm_fs_inode_free(struct inode *inode)
+drm_fs_inode_free(void *inode)
 {
 	KASSERT(inode == NULL);
 }

Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h
diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.35.4.1 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.35.4.2
--- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.35.4.1	Wed Nov  6 09:48:31 2019
+++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h	Thu Mar 19 19:41:10 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: drmP.h,v 1.35.4.1 2019/11/06 09:48:31 martin Exp $	*/
+/*	$NetBSD: drmP.h,v 1.35.4.2 2020/03/19 19:41:10 martin Exp $	*/
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -821,7 +821,7 @@ struct drm_device {
 	struct drm_minor *primary;		/**< Primary node */
 	struct drm_minor *render;		/**< Render node */
 	atomic_t unplugged;			/**< Flag whether dev is dead */
-	struct inode *anon_inode;		/**< inode for private address-space */
+	void *anon_inode;		/**< inode for private address-space */
 	char *unique;

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

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:21:37 UTC 2020

Modified Files:
src/sys/dev/mii [netbsd-9]: atphy.c miidevs
src/sys/dev/pci [netbsd-9]: if_nfe.c

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

sys/dev/pci/if_nfe.c: revision 1.77
sys/dev/pci/if_nfe.c: revision 1.78
sys/dev/mii/atphy.c: revision 1.28
sys/dev/mii/atphy.c: revision 1.29
sys/dev/mii/miidevs: revision 1.166

  Use unsigned to avoid undefined behavior. Found by kUBSan.
0x001374 is non-bitreversed value of Attansic OUI(0x00c82e).
Attansic/Atheros correctly uses ID1 and ID2 register, so delete all 0x001374
related entries.

Improve error check:
- We check PHY register read error correctly (timeout and NFE_PHY_ERROR), so
   don't check NFE_PHY_DATA register's value with 0x or 0. At least,
   some registers may have 0.
- Check NFE_PHY_ERROR bit in nfe_miibus_writereg().
- Improve debug printf

Fix a bug that atphy(4) doesn't work with Attansic L2 rev. 1.
Reported by Rocky Hotas.

- On ASUS M2N-MX SE Plus (NVIDIA MCP61 with Attansic L2 rev. 1), changing
   debug port 0x29's value makes the next PHY read fail with error.  Read any
   register to ignore this problem if the PHY is Attansic L2 revision 1.
   I don't know if this problem is from L2 rev. 1 itself or from the
   combination because I have only one machine which has L2 rev. "1".
   At least, ASUS eee pc 900 (Attansic L2 rev. "2") has no this problem.
- Add comment. AR8021 document has no description about the power saving
   control register(debug port 0x29).
- Add comment. AR8031 document says the lower 14 bits are reserved and the
   default value is 0x36d0. Shouldn't we clear those bits?
- I have no document neither L1(F1) nor L2(F2), so I don't know whether the
   debug port access is correct or not.
Tested with the following machines:
- ASUS P5B SE, L1 rev. 5,age(4)
- ASUS K50IJ,  L1 rev. 9,ale(4)
- ASUS eee pc 900, L2 rev. 2,lii(4)
- ASUS M2N-MX SE Plus, L2 rev. 1,nfe(4)
- Intel DP55WB,82578(AR8021 rev. 2), wm(4)
- Dell inspiron 14z,   AR0835 rev. 9,alc(4)


To generate a diff of this commit:
cvs rdiff -u -r1.22.4.1 -r1.22.4.2 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.153.2.4 -r1.153.2.5 src/sys/dev/mii/miidevs
cvs rdiff -u -r1.71 -r1.71.2.1 src/sys/dev/pci/if_nfe.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/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.22.4.1 src/sys/dev/mii/atphy.c:1.22.4.2
--- src/sys/dev/mii/atphy.c:1.22.4.1	Thu Nov 21 14:00:49 2019
+++ src/sys/dev/mii/atphy.c	Thu Mar 19 19:21:37 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.22.4.1 2019/11/21 14:00:49 martin Exp $ */
+/*	$NetBSD: atphy.c,v 1.22.4.2 2020/03/19 19:21:37 martin Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.22.4.1 2019/11/21 14:00:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: atphy.c,v 1.22.4.2 2020/03/19 19:21:37 martin Exp $");
 
 #include 
 #include 
@@ -91,7 +91,6 @@ const struct mii_phy_funcs atphy_funcs =
 };
 
 static const struct mii_phydesc atphys[] = {
-	MII_PHY_DESC(ATHEROS, F1),
 	MII_PHY_DESC(ATTANSIC, L1),
 	MII_PHY_DESC(ATTANSIC, L2),
 	MII_PHY_DESC(ATTANSIC, AR8021),
@@ -358,10 +357,30 @@ atphy_reset(struct mii_softc *sc)
 	uint16_t reg;
 	int i;
 
-	/* Take PHY out of power down mode. */
+	/*
+	 * Take PHY out of power down mode.
+	 *
+	 * XXX AR8021 document has no description about the power saving
+	 * control register. Shouldn't we write it?
+	 */
 	PHY_WRITE(sc, 29, 0x29);
+	/*
+	 * XXX AR8031 document says the lower 14 bits are reserved and the
+	 * default value is 0x36d0. Shouldn't we clear those bits?
+	 * I have no document neither L1(F1) nor L2(F2).
+	 */
 	PHY_WRITE(sc, 30, 0);
 
+	if ((sc->mii_mpd_model == MII_MODEL_ATTANSIC_L2)
+	&& (sc->mii_mpd_rev == 1)) {
+		/*
+		 * On NVIDIA MCP61 with Attansic L2 rev. 1, changing debug
+		 * port 0x29's value makes the next PHY read fail with error.
+		 * This is observed on ASUS M2N-MX SE Plus. Read any register
+		 * to ignore this problem.
+		 */
+		(void)PHY_READ(sc, ATPHY_SCR, );
+	}
 	PHY_READ(sc, ATPHY_SCR, );
 	/* Enable automatic crossover. */
 	reg |= ATPHY_SCR_AUTO_X_MODE;

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.153.2.4 src/sys/dev/mii/miidevs:1.153.2.5
--- src/sys/dev/mii/miidevs:1.153.2.4	Mon Nov 25 16:53:29 2019
+++ src/sys/dev/mii/miidevs	Thu Mar 19 19:21:37 2020
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp $
+$NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -64,7 +64,6 @@ oui MICREL			0x0010a1	Micrel
 oui ALTIMA			0x0010a9	Altima Communications
 

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

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:23:14 UTC 2020

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

Log Message:
Regen (for ticket #786)


To generate a diff of this commit:
cvs rdiff -u -r1.151.2.5 -r1.151.2.6 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.139.2.5 -r1.139.2.6 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.151.2.5 src/sys/dev/mii/miidevs.h:1.151.2.6
--- src/sys/dev/mii/miidevs.h:1.151.2.5	Mon Nov 25 16:55:09 2019
+++ src/sys/dev/mii/miidevs.h	Thu Mar 19 19:23:14 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.151.2.5 2019/11/25 16:55:09 martin Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.151.2.6 2020/03/19 19:23:14 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp
  */
 
 /*-
@@ -71,7 +71,6 @@
 #define	MII_OUI_ALTIMA	0x0010a9	/* Altima Communications */
 #define	MII_OUI_ENABLESEMI	0x0010dd	/* Enable Semiconductor */
 #define	MII_OUI_SUNPLUS	0x001105	/* Sunplus Technology */
-#define	MII_OUI_ATHEROS	0x001374	/* Atheros */
 #define	MII_OUI_TERANETICS	0x0014a6	/* Teranetics */
 #define	MII_OUI_RALINK2	0x0017a5	/* Ralink Technology */
 #define	MII_OUI_AQUANTIA	0x0017b6	/* Aquantia Corporation */
@@ -168,13 +167,7 @@
 #define	MII_MODEL_xxAMLOGIC_GXL	0x
 #define	MII_STR_xxAMLOGIC_GXL	"Meson GXL internal PHY"
 
-/* Atheros PHYs */
-#define	MII_MODEL_ATHEROS_F1	0x0001
-#define	MII_STR_ATHEROS_F1	"F1 10/100/1000 PHY"
-#define	MII_MODEL_ATHEROS_F2	0x0002
-#define	MII_STR_ATHEROS_F2	"F2 10/100 PHY"
-
-/* Attansic PHYs */
+/* Attansic/Atheros PHYs */
 #define	MII_MODEL_ATTANSIC_L1	0x0001
 #define	MII_STR_ATTANSIC_L1	"L1 10/100/1000 PHY"
 #define	MII_MODEL_ATTANSIC_L2	0x0002

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.139.2.5 src/sys/dev/mii/miidevs_data.h:1.139.2.6
--- src/sys/dev/mii/miidevs_data.h:1.139.2.5	Mon Nov 25 16:55:09 2019
+++ src/sys/dev/mii/miidevs_data.h	Thu Mar 19 19:23:14 2020
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.139.2.5 2019/11/25 16:55:09 martin Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.139.2.6 2020/03/19 19:23:14 martin Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.153.2.4 2019/11/25 16:53:29 martin Exp
+ *	NetBSD: miidevs,v 1.153.2.5 2020/03/19 19:21:37 martin Exp
  */
 
 /*-
@@ -55,8 +55,6 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_ALTIMA, MII_MODEL_ALTIMA_Am79C874, MII_STR_ALTIMA_Am79C874 },
  { MII_OUI_AMLOGIC, MII_MODEL_AMLOGIC_GXL, MII_STR_AMLOGIC_GXL },
  { MII_OUI_xxAMLOGIC, MII_MODEL_xxAMLOGIC_GXL, MII_STR_xxAMLOGIC_GXL },
- { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F1, MII_STR_ATHEROS_F1 },
- { MII_OUI_ATHEROS, MII_MODEL_ATHEROS_F2, MII_STR_ATHEROS_F2 },
  { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L1, MII_STR_ATTANSIC_L1 },
  { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_L2, MII_STR_ATTANSIC_L2 },
  { MII_OUI_ATTANSIC, MII_MODEL_ATTANSIC_AR8021, MII_STR_ATTANSIC_AR8021 },



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

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:18:27 UTC 2020

Modified Files:
src/sys/net [netbsd-9]: if_media.h

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

sys/net/if_media.h: revision 1.70

- Remove 50GBASE-LR10.

- Add the following medias:
  - 25GBASE-ACC
  - 100GBASE-ACC
  - 100GBASE-AOC
  - 100GBASE-FR
  - 100GBASE-LR
  - 200GBASE-ER4
  - 400GBASE-ER8
  - 400GBASE-FR4
  - 400GBASE-LR4
  - 400GBASE-SR4.2
  - 400GBASE-SR8


To generate a diff of this commit:
cvs rdiff -u -r1.65.2.1 -r1.65.2.2 src/sys/net/if_media.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/net/if_media.h
diff -u src/sys/net/if_media.h:1.65.2.1 src/sys/net/if_media.h:1.65.2.2
--- src/sys/net/if_media.h:1.65.2.1	Tue Feb 25 18:40:43 2020
+++ src/sys/net/if_media.h	Thu Mar 19 19:18:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_media.h,v 1.65.2.1 2020/02/25 18:40:43 martin Exp $	*/
+/*	$NetBSD: if_media.h,v 1.65.2.2 2020/03/19 19:18:27 martin Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2000, 2001 The NetBSD Foundation, Inc.
@@ -262,6 +262,7 @@
 #define	IFM_25G_AOC	_IFM_EX(43)	/* 25G active optical cable */
 #define	IFM_25G_AUI	_IFM_EX(44)	/* 25G-AUI-C2C (chip to chip) */
 #define	IFM_25G_CR	_IFM_EX(45)	/* 25GBASE-CR (twinax) */
+#define	IFM_25G_ACC	_IFM_EX(46)	/* 25GBASE-ACC */
 #define	IFM_25G_CR_S	_IFM_EX(47)	/* 25GBASE-CR-S (CR short) */
 #define	IFM_25G_ER	_IFM_EX(48)	/* 25GBASE-ER */
 #define	IFM_25G_KR	_IFM_EX(49)	/* 25GBASE-KR */
@@ -286,8 +287,8 @@
 #define	IFM_50G_KR	_IFM_EX(68)	/* 50GBASE-KR */
 #define	IFM_50G_KR2	_IFM_EX(69)	/* 50GBASE-KR2 */
 #define	IFM_50G_LAUI2	_IFM_EX(70)	/* 50GLAUI-2 */
-#define	IFM_50G_LR	_IFM_EX(71)	/* 50GBASE-LR (2Km) */
-#define	IFM_50G_LR10	_IFM_EX(72)	/* 50GBASE-LR10 (10Km) */
+#define	IFM_50G_LR	_IFM_EX(71)	/* 50GBASE-LR */
+		 /* _IFM_EX(72) Not defined yet */
 #define	IFM_50G_SR	_IFM_EX(73)	/* 50GBASE-SR */
 #define	IFM_50G_SR2	_IFM_EX(74)	/* 50GBASE-SR2 */
 #define	IFM_56G_R4	_IFM_EX(75)	/* 56GBASE-R4 */
@@ -317,6 +318,17 @@
 #define	IFM_400G_KR4	_IFM_EX(99)	/* 400GBASE-KR4 */
 #define	IFM_400G_LR8	_IFM_EX(100)	/* 400GBASE-LR8 */
 #define	IFM_400G_SR16	_IFM_EX(101)	/* 400GBASE-SR16 */
+#define	IFM_100G_ACC	_IFM_EX(102)	/* 100GBASE-ACC */
+#define	IFM_100G_AOC	_IFM_EX(103)	/* 100GBASE-AOC */
+#define	IFM_100G_FR	_IFM_EX(104)	/* 100GBASE-FR */
+#define	IFM_100G_LR	_IFM_EX(105)	/* 100GBASE-LR */
+#define	IFM_200G_ER4	_IFM_EX(106)	/* 200GBASE-ER4 */
+#define	IFM_400G_ER8	_IFM_EX(107)	/* 400GBASE-ER8 */
+#define	IFM_400G_FR4	_IFM_EX(108)	/* 400GBASE-FR4 */
+#define	IFM_400G_LR4	_IFM_EX(109)	/* 400GBASE-LR4 */
+#define	IFM_400G_SR4_2	_IFM_EX(110)	/* 400GBASE-SR4.2 */
+#define	IFM_400G_SR8	_IFM_EX(111)	/* 400GBASE-SR8 */
+
 /* IFM_OMASK bits */
 #define	IFM_ETH_MASTER	0x0100	/* master mode (1000baseT) */
 #define	IFM_ETH_RXPAUSE	0x0200	/* receive PAUSE frames */
@@ -522,6 +534,7 @@ struct ifmedia_description {
 	{ IFM_ETHER | IFM_10G_SFI | IFM_FDX,	"10GBASE-SFI" },	\
 	{ IFM_ETHER | IFM_10G_ZR | IFM_FDX,	"10GBASE-ZR" },		\
 	{ IFM_ETHER | IFM_20G_KR2 | IFM_FDX,	"20GBASE-KR2" },	\
+	{ IFM_ETHER | IFM_25G_ACC | IFM_FDX,	"25GBASE-ACC" },	\
 	{ IFM_ETHER | IFM_25G_AOC | IFM_FDX,	"25GBASE-AOC" },	\
 	{ IFM_ETHER | IFM_25G_AUI | IFM_FDX,	"25G-AUI" },	\
 	{ IFM_ETHER | IFM_25G_CR | IFM_FDX,	"25GBASE-CR" },		\
@@ -550,18 +563,21 @@ struct ifmedia_description {
 	{ IFM_ETHER | IFM_50G_KR2 | IFM_FDX,	"50GBASE-KR2" },	\
 	{ IFM_ETHER | IFM_50G_LAUI2 | IFM_FDX,	"50GLAUI-2" },		\
 	{ IFM_ETHER | IFM_50G_LR | IFM_FDX,	"50GBASE-LR" },		\
-	{ IFM_ETHER | IFM_50G_LR10 | IFM_FDX,	"50GBASE-LR10" },	\
 	{ IFM_ETHER | IFM_50G_SR | IFM_FDX,	"50GBASE-SR" },		\
 	{ IFM_ETHER | IFM_50G_SR2 | IFM_FDX,	"50GBASE-SR2" },	\
 	{ IFM_ETHER | IFM_56G_R4 | IFM_FDX,	"56GBASE-R4" },		\
+	{ IFM_ETHER | IFM_100G_ACC | IFM_FDX,	"100GBASE-ACC" },	\
+	{ IFM_ETHER | IFM_100G_AOC | IFM_FDX,	"100GBASE-AOC" },	\
 	{ IFM_ETHER | IFM_100G_CR2 | IFM_FDX,	"100GBASE-CR2" },	\
 	{ IFM_ETHER | IFM_100G_CR4 | IFM_FDX,	"100GBASE-CR4" },	\
 	{ IFM_ETHER | IFM_100G_CR10 | IFM_FDX,	"100GBASE-CR10" },	\
 	{ IFM_ETHER | IFM_100G_DR | IFM_FDX,	"100GBASE-DR" },	\
 	{ IFM_ETHER | IFM_100G_ER4 | IFM_FDX,	"100GBASE-ER4" },	\
+	{ IFM_ETHER | IFM_100G_FR | IFM_FDX,	"100GBASE-FR" },	\
 	{ IFM_ETHER | IFM_100G_KP4 | IFM_FDX,	"100GBASE-KP4" },	\
 	{ IFM_ETHER | IFM_100G_KR2 | IFM_FDX,	"100GBASE-KR2" },	\
 	{ IFM_ETHER | IFM_100G_KR4 | IFM_FDX,	"100GBASE-KR4" },	\
+	{ IFM_ETHER | IFM_100G_LR | IFM_FDX,	"100GBASE-LR" },	\
 	{ IFM_ETHER | IFM_100G_LR4 | IFM_FDX,	"100GBASE-LR4" },	\
 	{ IFM_ETHER | IFM_100G_SR2 | IFM_FDX,	"100GBASE-SR2" },	\
 	{ IFM_ETHER | IFM_100G_SR4 | IFM_FDX,	"100GBASE-SR4" },	\
@@ -569,6 +585,7 @@ struct ifmedia_description {
 	{ IFM_ETHER | IFM_200G_CR2 | IFM_FDX,	"200GBASE-CR2" },	\
 	{ IFM_ETHER | IFM_200G_CR4 | IFM_FDX,	"200GBASE-CR4" },	\
 	{ IFM_ETHER | 

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

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:13:33 UTC 2020

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

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

sys/dev/pci/pcidevs: revision 1.1398
sys/dev/pci/pcidevs: revision 1.1399
sys/dev/pci/pcidevs: revision 1.1400
sys/dev/pci/pcidevs: revision 1.1401
sys/dev/pci/pcidevs: revision 1.1402

add a couple of GPUs i have:
product ATI RADEON_HD4290  0x9714  Radeon HD4290 Graphics
product NVIDIA GF_440  0x0de0  GeForce GT 440

Add Farallon PN9000SX Ethernet.

NVIDIA 0x036[0-7] are nForce MCP55 LPC Bridge.

Add device IDs of the VIA VX900 chipset.

Add some GeForce devices.


To generate a diff of this commit:
cvs rdiff -u -r1.1383.2.5 -r1.1383.2.6 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.5 src/sys/dev/pci/pcidevs:1.1383.2.6
--- src/sys/dev/pci/pcidevs:1.1383.2.5	Fri Jan 31 11:06:31 2020
+++ src/sys/dev/pci/pcidevs	Thu Mar 19 19:13:33 2020
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1383.2.5 2020/01/31 11:06:31 martin Exp $
+$NetBSD: pcidevs,v 1.1383.2.6 2020/03/19 19:13:33 martin Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1775,6 +1775,7 @@ product ATI RADEON_HD6480G_1	0x9648	Rade
 product ATI RADEON_HD6480G_2	0x9649	Radeon HD 6480G
 product ATI RADEON_HD6530D	0x964a	Radeon HD 6530D
 product ATI RADEON_HD4200	0x9712	Radeon HD4200 Mobility
+product ATI RADEON_HD4290	0x9714	Radeon HD4290 Graphics
 product ATI RADEON_HD4250	0x9715	Radeon HD4250 GPU (RS880)
 product ATI RADEON_HD6310	0x9802	Radeon HD6310 Graphics
 product ATI RADEON_HD6320	0x9806	Radeon HD6320 Graphics
@@ -2478,6 +2479,7 @@ product DEC DEFPA	0x000f	DEFPA
 product DEC 21041	0x0014	DC21041 (\"Tulip Plus\") Ethernet
 product DEC DGLPB	0x0016	DGLPB (\"OPPO\")
 product DEC 21142	0x0019	DC21142/21143 10/100 Ethernet
+product DEC PN9000SX	0x001a	Farallon PN9000SX Ethernet
 product DEC 21052	0x0021	DC21052 PCI-PCI Bridge
 product DEC 21150	0x0022	DC21150 PCI-PCI Bridge
 product DEC 21152	0x0024	DC21152 PCI-PCI Bridge
@@ -6495,9 +6497,14 @@ product NVIDIA	GF_FX5900XT	0x0332	GeForc
 product NVIDIA	GF_FX5950U	0x0333	GeForce FX 5950 Ultra
 product NVIDIA	QUADRO_FX_3000	0x0338	Quadro FX 3000
 product NVIDIA	GF_FX5700_LE	0x0343	GeForce FX 5700 LE
+product NVIDIA	MCP55_LPC1	0x0360	nForce MCP55 LPC Bridge
 product NVIDIA	MCP55_LPC2	0x0361	nForce MCP55 LPC Bridge
-product NVIDIA	MCP55_ISA	0x0362	nForce MCP55 PCI-ISA Bridge
-product NVIDIA	MCP55_LPC	0x0364	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC3	0x0362	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC4	0x0363	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC5	0x0364	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC6	0x0365	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC7	0x0366	nForce MCP55 LPC Bridge
+product NVIDIA	MCP55_LPC8	0x0367	nForce MCP55 LPC Bridge
 product NVIDIA	MCP55_SMB	0x0368	nForce MCP55 SMBus Controller
 product NVIDIA	MCP55_MEM	0x0369	nForce MCP55 Memory Controller
 product NVIDIA	MCP55_MEM2	0x036a	nForce MCP55 Memory Controller
@@ -6513,6 +6520,9 @@ product NVIDIA	MCP55_PCIE2	0x0378	nForce
 product NVIDIA  MCP55_SATA  0x037e  nForce MCP55 Serial ATA Controller
 product NVIDIA  MCP55_SATA2 0x037f  nForce MCP55 Serial ATA Controller
 product NVIDIA	GF_GO_7600	0x0398	GeForce Go 7600
+product NVIDIA	GF_6100_430	0x03d0	GeForce 6100 nForce 430
+product NVIDIA	GF_6100_405	0x03d1	GeForce 6100 nForce 405
+product NVIDIA	GF_7025_630A	0x03d6	GeForce 7025 nForce 630a
 product NVIDIA	MCP61_ISA	0x03e0  nForce MCP61 PCI-ISA Bridge
 product NVIDIA	MCP61_HDA	0x03e4	nForce MCP61 High Definition Audio Controller
 product NVIDIA	MCP61_LAN1	0x03e5	nForce MCP61 Gigabit Ethernet Controller
@@ -6664,6 +6674,7 @@ product NVIDIA	GEFORCE_210_HDA	0x0be3	Ge
 product NVIDIA	GF100_HDA	0x0be5	GF100 HD Audio
 product NVIDIA	GF108_HDA	0x0bea	GF108 HD Audio
 product NVIDIA	GF116_HDA	0x0bee	GF116 HD Audio
+product NVIDIA	GF_440		0x0de0	GeForce GT 440
 product NVIDIA	GF_GT640M	0x0fd2	GeForce GT 640M
 product NVIDIA	GT520		0x1040	GeForce GT 520
 product NVIDIA	GEFORCE_510	0x1042	GeForce 510
@@ -7736,12 +7747,14 @@ product VIATECH VT82C570MV	0x1006	VT82C5
 product VIATECH KT880_1		0x1269	KT880 CPU to PCI Bridge
 product VIATECH VT3351_HB_1351	0x1351	VT3351 Host Bridge
 product VIATECH P4M900_1	0x1364	CN896/P4M900 Host Bridge
+product VIATECH VX900_ERR	0x1410	VX900 Error Reporting
 product VIATECH VT82C586_IDE	0x1571	VT82C586 IDE Controller
 product VIATECH VT82C595_2	0x1595	VT82C595 (Apollo VP2) Host-PCI Bridge
 product VIATECH VT6105M_BOM	0x2006	VT6105M_BOM (Rhine III) 10/100 Ethernet
 product VIATECH KT880_2		0x2269	KT880 CPU to PCI Bridge
 product VIATECH VT3351_HB_2351	0x2351	VT3351 Host Bridge
 product VIATECH P4M900_2	0x2364	

CVS commit: [netbsd-9] src/etc

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:08:31 UTC 2020

Modified Files:
src/etc [netbsd-9]: MAKEDEV.tmpl

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #783):

etc/MAKEDEV.tmpl: revision 1.216

Create /dev/ipmi0 in `MAKEDEV all'.

Works on my machine with sysutils/ipmitool if the latter is built
with CONFIGURE_ARGS+= --enable-intf-open.


To generate a diff of this commit:
cvs rdiff -u -r1.205.2.2 -r1.205.2.3 src/etc/MAKEDEV.tmpl

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

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.205.2.2 src/etc/MAKEDEV.tmpl:1.205.2.3
--- src/etc/MAKEDEV.tmpl:1.205.2.2	Sun Nov 10 12:58:31 2019
+++ src/etc/MAKEDEV.tmpl	Thu Mar 19 19:08:31 2020
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#	$NetBSD: MAKEDEV.tmpl,v 1.205.2.2 2019/11/10 12:58:31 martin Exp $
+#	$NetBSD: MAKEDEV.tmpl,v 1.205.2.3 2020/03/19 19:08:31 martin Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -845,6 +845,7 @@ all)
 	makedev veriexec
 	makedev autofs
 	makedev fw0 fw1 fw2 fw3
+	makedev ipmi0
 	makedev local # do this last
 	;;
 



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

2020-03-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Mar 19 19:05:34 UTC 2020

Modified Files:
src/sys/dev/pci [netbsd-9]: pci_subr.c pcireg.h

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

sys/dev/pci/pcireg.h: revision 1.150
sys/dev/pci/pcireg.h: revision 1.151
sys/dev/pci/pci_subr.c: revision 1.220
sys/dev/pci/pci_subr.c: revision 1.221
sys/dev/pci/pcireg.h: revision 1.149

- Print Bridge Config Retry Enable bit and Retimer Presence Detect Supported
   bit.
- Avoid using magic number.

Add PCIe 4.0 stuff a little:
  - 10-bit Tag Requester/Completer.
  - Add Data link Feature extended capability.
  - Add Physical Layer 16.0 GT/s extended capability. Not decode yet.

  Remove unused shift and mask definitions.

  Add comment.


To generate a diff of this commit:
cvs rdiff -u -r1.215.2.2 -r1.215.2.3 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.147.4.1 -r1.147.4.2 src/sys/dev/pci/pcireg.h

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

Modified files:

Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.215.2.2 src/sys/dev/pci/pci_subr.c:1.215.2.3
--- src/sys/dev/pci/pci_subr.c:1.215.2.2	Tue Jan 21 15:15:23 2020
+++ src/sys/dev/pci/pci_subr.c	Thu Mar 19 19:05:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.215.2.2 2020/01/21 15:15:23 martin Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.215.2.3 2020/03/19 19:05:34 martin Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.215.2.2 2020/01/21 15:15:23 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.215.2.3 2020/03/19 19:05:34 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -1869,6 +1869,9 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	onoff("Enable No Snoop", reg, PCIE_DCSR_ENA_NO_SNOOP);
 	printf("  Max Read Request Size: %d byte\n",
 	128 << __SHIFTOUT(reg, PCIE_DCSR_MAX_READ_REQ));
+	if (pcie_devtype == PCIE_XCAP_TYPE_PCIE2PCI)
+		onoff("Bridge Config Retry Enable", reg,
+		PCIE_DCSR_BRDG_CFG_RETRY);
 
 	/* Device Status Register */
 	reg = regs[o2i(capoff + PCIE_DCSR)];
@@ -2162,6 +2165,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 		printf("Reserved\n");
 		break;
 	}
+	onoff("10-bit Tag Completer Supported", reg, PCIE_DCAP2_TBT_COMP);
+	onoff("10-bit Tag Requester Supported", reg, PCIE_DCAP2_TBT_REQ);
 	printf("  OBFF Supported: ");
 	switch (__SHIFTOUT(reg, PCIE_DCAP2_OBFF)) {
 	case 0x0:
@@ -2214,6 +2219,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 	onoff("LTR Mechanism Enabled", reg, PCIE_DCSR2_LTR_MEC);
 	onoff("Emergency Power Reduction Request", reg,
 	PCIE_DCSR2_EMGPWRRED_REQ);
+	onoff("10-bit Tag Requester Enabled", reg, PCIE_DCSR2_TBT_REQ);
 	printf("  OBFF: ");
 	switch (__SHIFTOUT(reg, PCIE_DCSR2_OBFF_EN)) {
 	case 0x0:
@@ -2254,6 +2260,8 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			pci_print_pcie_linkspeedvector(
 __SHIFTOUT(reg, PCIE_LCAP2_LOWSKPOS_RECSUPPSV));
 			printf("\n");
+			onoff("Retimer Presence Detect Supported", reg,
+			PCIE_LCAP2_RETIMERPD);
 			onoff("DRS Supported", reg, PCIE_LCAP2_DRS);
 			drs_supported = (reg & PCIE_LCAP2_DRS) ? true : false;
 		}
@@ -2273,7 +2281,7 @@ pci_conf_print_pcie_cap(const pcireg_t *
 			__SHIFTOUT(reg, PCIE_LCSR2_SEL_DEEMP));
 		printf("\n");
 		printf("  Transmit Margin: %u\n",
-		(unsigned int)(reg & PCIE_LCSR2_TX_MARGIN) >> 7);
+		(unsigned int)__SHIFTOUT(reg,  PCIE_LCSR2_TX_MARGIN));
 		onoff("Enter Modified Compliance", reg, PCIE_LCSR2_EN_MCOMP);
 		onoff("Compliance SOS", reg, PCIE_LCSR2_COMP_SOS);
 		printf("  Compliance Present/De-emphasis: ");
@@ -4160,6 +4168,24 @@ pci_conf_print_ptm_cap(const pcireg_t *r
 /* XXX pci_conf_print_rtr_cap */
 /* XXX pci_conf_print_desigvndsp_cap */
 /* XXX pci_conf_print_vf_resizbar_cap */
+
+static void
+pci_conf_print_dlf_cap(const pcireg_t *regs, int extcapoff)
+{
+	pcireg_t reg;
+
+	printf("\n  Data link Feature Register\n");
+	reg = regs[o2i(extcapoff + PCI_DLF_CAP)];
+	printf("Capability register: 0x%08x\n", reg);
+	onoff("Scaled Flow Control", reg, PCI_DLF_LFEAT_SCLFCTL);
+	onoff("DLF Exchange enable", reg, PCI_DLF_CAP_XCHG);
+
+	reg = regs[o2i(extcapoff + PCI_DLF_STAT)];
+	printf("Status register: 0x%08x\n", reg);
+	onoff("Scaled Flow Control", reg, PCI_DLF_LFEAT_SCLFCTL);
+	onoff("Remote DLF supported Valid", reg, PCI_DLF_STAT_RMTVALID);
+}
+
 /* XXX pci_conf_print_hierarchyid_cap */
 /* XXX pci_conf_print_npem_cap */
 
@@ -4246,8 +4272,8 @@ static struct {
 	  NULL },
 	{ PCI_EXTCAP_VF_RESIZBAR, "VF Resizable BARs",
 	  NULL },
-	{ 0x25, "unknown", NULL },
-	{ 0x26, "unknown", NULL },
+	{ PCI_EXTCAP_DLF, "Data link Feature", pci_conf_print_dlf_cap },
+	{ PCI_EXTCAP_PYSLAY_16GT, "Physical Layer 16.0 GT/s", NULL },
 	{ 0x27, "unknown", NULL },
 	{ PCI_EXTCAP_HIERARCHYID, "Hierarchy ID",
 

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

2020-03-19 Thread Andrew Doran
Module Name:src
Committed By:   ad
Date:   Thu Mar 19 18:58:14 UTC 2020

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
PR port-amd64/55083 (assertion "pmap->pm_stats.resident_count == PDP_SIZE" 
failed)

Reported-by: syzbot+2c1e17352173a60ee...@syzkaller.appspotmail.com

Don't screw up resident_count in failure path.


To generate a diff of this commit:
cvs rdiff -u -r1.377 -r1.378 src/sys/arch/x86/x86/pmap.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/x86/x86/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.377 src/sys/arch/x86/x86/pmap.c:1.378
--- src/sys/arch/x86/x86/pmap.c:1.377	Wed Mar 18 18:54:28 2020
+++ src/sys/arch/x86/x86/pmap.c	Thu Mar 19 18:58:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.377 2020/03/18 18:54:28 ad Exp $	*/
+/*	$NetBSD: pmap.c,v 1.378 2020/03/19 18:58:14 ad Exp $	*/
 
 /*
  * Copyright (c) 2008, 2010, 2016, 2017, 2019, 2020 The NetBSD Foundation, Inc.
@@ -130,7 +130,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.377 2020/03/18 18:54:28 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.378 2020/03/19 18:58:14 ad Exp $");
 
 #include "opt_user_ldt.h"
 #include "opt_lockdebug.h"
@@ -2229,11 +2229,11 @@ pmap_freepage(struct pmap *pmap, struct 
 {
 	int lidx;
 
-	KASSERT(ptp->wire_count == 1);
+	KASSERT(ptp->wire_count <= 1);
 	PMAP_CHECK_PP(VM_PAGE_TO_PP(ptp));
 
 	lidx = level - 1;
-	pmap_stats_update(pmap, -1, 0);
+	pmap_stats_update(pmap, -ptp->wire_count, 0);
 	if (pmap->pm_ptphint[lidx] == ptp)
 		pmap->pm_ptphint[lidx] = NULL;
 	ptp->wire_count = 0;
@@ -2450,7 +2450,6 @@ pmap_unget_ptp(struct pmap *pmap, struct
 			continue;
 		}
 		KASSERT(pt->pg[i]->wire_count == 0);
-		pt->pg[i]->wire_count = 1;
 		PMAP_CHECK_PP(VM_PAGE_TO_PP(pt->pg[i]));
 		pmap_freepage(pmap, pt->pg[i], i - 1);
 	}



CVS commit: src/sys/dev/ic

2020-03-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Mar 19 15:19:13 UTC 2020

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

Log Message:
Release the sc_intr_lock on error


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/ic/dwc_mmc.c

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

Modified files:

Index: src/sys/dev/ic/dwc_mmc.c
diff -u src/sys/dev/ic/dwc_mmc.c:1.22 src/sys/dev/ic/dwc_mmc.c:1.23
--- src/sys/dev/ic/dwc_mmc.c:1.22	Thu Jan 23 23:53:55 2020
+++ src/sys/dev/ic/dwc_mmc.c	Thu Mar 19 15:19:13 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: dwc_mmc.c,v 1.22 2020/01/23 23:53:55 jmcneill Exp $ */
+/* $NetBSD: dwc_mmc.c,v 1.23 2020/03/19 15:19:13 skrll Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.22 2020/01/23 23:53:55 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc_mmc.c,v 1.23 2020/03/19 15:19:13 skrll Exp $");
 
 #include 
 #include 
@@ -717,6 +717,7 @@ dwc_mmc_exec_command(sdmmc_chipset_handl
 		if (error != 0) {
 			cmd->c_error = error;
 			SET(cmd->c_flags, SCF_ITSDONE);
+			mutex_exit(>sc_intr_lock);
 			goto done;
 		}
 	}



CVS commit: src/sys/dev/ic

2020-03-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 19 14:10:56 UTC 2020

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

Log Message:
Don't bother with IFF_OACTIVE.  Just keep processing so long as
sc->xmit_busy is less than NTXBUF.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/dev/ic/i82586.c

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

Modified files:

Index: src/sys/dev/ic/i82586.c
diff -u src/sys/dev/ic/i82586.c:1.88 src/sys/dev/ic/i82586.c:1.89
--- src/sys/dev/ic/i82586.c:1.88	Wed Jan 29 14:49:44 2020
+++ src/sys/dev/ic/i82586.c	Thu Mar 19 14:10:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82586.c,v 1.88 2020/01/29 14:49:44 thorpej Exp $	*/
+/*	$NetBSD: i82586.c,v 1.89 2020/03/19 14:10:56 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -137,7 +137,7 @@ Mode of operation:
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.88 2020/01/29 14:49:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82586.c,v 1.89 2020/03/19 14:10:56 thorpej Exp $");
 
 
 #include 
@@ -663,7 +663,6 @@ i82586_tint(struct ie_softc *sc, int scb
 	int status;
 
 	ifp->if_timer = 0;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 #if I82586_DEBUG
 	if (sc->xmit_busy <= 0) {
@@ -1129,15 +1128,10 @@ i82586_start(struct ifnet *ifp)
 	u_short	len;
 	int	s;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
-	for (;;) {
-		if (sc->xmit_busy == NTXBUF) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
-
+	while (sc->xmit_busy < NTXBUF) {
 		head = sc->xchead;
 		xbase = sc->xbds;
 
@@ -1244,9 +1238,7 @@ i82586_reset(struct ie_softc *sc, int ha
 	if (hard)
 		printf("%s: reset\n", device_xname(sc->sc_dev));
 
-	/* Clear OACTIVE in case we're called from watchdog (frozen xmit). */
 	sc->sc_ethercom.ec_if.if_timer = 0;
-	sc->sc_ethercom.ec_if.if_flags &= ~IFF_OACTIVE;
 
 	/*
 	 * Stop i82586 dead in its tracks.
@@ -1657,7 +1649,6 @@ i82586_init(struct ifnet *ifp)
 		(sc->hwinit)(sc);
 
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	if (NTXBUF < 2)
 		sc->do_xmitnopchain = 0;



CVS commit: src/sys/arch/sun3/dev

2020-03-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 19 14:06:32 UTC 2020

Modified Files:
src/sys/arch/sun3/dev: if_ie.c

Log Message:
Don't bother with IFF_OACTIVE.  Just keep processing so long as
sc->xmit_busy is less than sc->ntxbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 src/sys/arch/sun3/dev/if_ie.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/sun3/dev/if_ie.c
diff -u src/sys/arch/sun3/dev/if_ie.c:1.71 src/sys/arch/sun3/dev/if_ie.c:1.72
--- src/sys/arch/sun3/dev/if_ie.c:1.71	Wed Jan 29 05:39:48 2020
+++ src/sys/arch/sun3/dev/if_ie.c	Thu Mar 19 14:06:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ie.c,v 1.71 2020/01/29 05:39:48 thorpej Exp $ */
+/*	$NetBSD: if_ie.c,v 1.72 2020/03/19 14:06:32 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
@@ -98,7 +98,7 @@
 */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.71 2020/01/29 05:39:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ie.c,v 1.72 2020/03/19 14:06:32 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -583,7 +583,6 @@ ietint(struct ie_softc *sc)
 	ifp = >sc_if;
 
 	ifp->if_timer = 0;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	status = sc->xmit_cmds[sc->xctail]->ie_xmit_status;
 
@@ -959,15 +958,10 @@ iestart(struct ifnet *ifp)
 	uint8_t *buffer;
 	uint16_t len;
 
-	if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
+	if ((ifp->if_flags & IFF_RUNNING) != IFF_RUNNING)
 		return;
 
-	for (;;) {
-		if (sc->xmit_busy == sc->ntxbuf) {
-			ifp->if_flags |= IFF_OACTIVE;
-			break;
-		}
-
+	while (sc->xmit_busy < sc->ntxbuf) {
 		IF_DEQUEUE(>if_snd, m0);
 		if (m0 == 0)
 			break;
@@ -1389,7 +1383,6 @@ ieinit(struct ie_softc *sc)
 
 	/* tell higher levels that we are here */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
 
 	sc->scb->ie_recv_list =
 	vtop16sw(sc, __UNVOLATILE(sc->rframes[0]));



CVS commit: src/sys/arch/sun2/dev

2020-03-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Mar 19 14:01:48 UTC 2020

Modified Files:
src/sys/arch/sun2/dev: if_ec.c

Log Message:
Replace manipulating IFF_OACTIVE with an internal "txbusy" field.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/sun2/dev/if_ec.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/sun2/dev/if_ec.c
diff -u src/sys/arch/sun2/dev/if_ec.c:1.35 src/sys/arch/sun2/dev/if_ec.c:1.36
--- src/sys/arch/sun2/dev/if_ec.c:1.35	Wed Jan 29 05:39:48 2020
+++ src/sys/arch/sun2/dev/if_ec.c	Thu Mar 19 14:01:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $	*/
+/*	$NetBSD: if_ec.c,v 1.36 2020/03/19 14:01:48 thorpej Exp $	*/
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.35 2020/01/29 05:39:48 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ec.c,v 1.36 2020/03/19 14:01:48 thorpej Exp $");
 
 #include "opt_inet.h"
 #include "opt_ns.h"
@@ -86,6 +86,7 @@ struct ec_softc {
 	bus_space_tag_t sc_iot;	/* bus space tag */
 	bus_space_handle_t sc_ioh;	/* bus space handle */
 
+	bool sc_txbusy;
 	u_char sc_jammed;	/* nonzero if the net is jammed */
 	u_char sc_colliding;	/* nonzero if the net is colliding */
 	uint32_t sc_backoff_seed;	/* seed for the backoff PRNG */
@@ -281,7 +282,7 @@ ec_init(struct ifnet *ifp)
 
 	/* Set flags appropriately. */
 	ifp->if_flags |= IFF_RUNNING;
-	ifp->if_flags &= ~IFF_OACTIVE;
+	sc->sc_txbusy = false;
 
 	/* Start output. */
 	ec_start(ifp);
@@ -305,7 +306,7 @@ ec_start(struct ifnet *ifp)
 	s = splnet();
 
 	/* Don't do anything if output is active. */
-	if ((ifp->if_flags & IFF_OACTIVE) != 0) {
+	if (sc->sc_txbusy) {
 		splx(s);
 		return;
 	}
@@ -334,7 +335,7 @@ ec_start(struct ifnet *ifp)
 	/* Enable the transmitter. */
 	ECREG_CSR_WR((ECREG_CSR_RD & EC_CSR_PA) |
 	EC_CSR_TBSW | EC_CSR_TINT | EC_CSR_JINT);
-	ifp->if_flags |= IFF_OACTIVE;
+	sc->sc_txbusy = true;
 
 	/* Done. */
 	splx(s);
@@ -413,7 +414,7 @@ ec_intr(void *arg)
 		retval++;
 	}
 	/* Check for a transmitted packet. */
-	if (ifp->if_flags & IFF_OACTIVE) {
+	if (sc->sc_txbusy) {
 
 		/* If we got a collision. */
 		if (ECREG_CSR_RD & EC_CSR_JAM) {
@@ -431,7 +432,7 @@ ec_intr(void *arg)
 			retval++;
 			if_statinc(ifp, if_opackets);
 			sc->sc_jammed = 0;
-			ifp->if_flags &= ~IFF_OACTIVE;
+			sc->sc_txbusy = false;
 			if_schedule_deferred_start(ifp);
 		}
 	} else {
@@ -635,7 +636,7 @@ ec_coll(struct ec_softc *sc)
 			device_xname(sc->sc_dev));
 		sc->sc_jammed = 1;
 		sc->sc_colliding = 0;
-		ifp->if_flags &= ~IFF_OACTIVE;
+		sc->sc_txbusy = false;
 		if_schedule_deferred_start(ifp);
 	} else {
 		jams = MAX(sc->sc_colliding, EC_BACKOFF_PRNG_COLL_MAX);



CVS commit: src/sys/arch/xen/xen

2020-03-19 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Mar 19 11:19:25 UTC 2020

Modified Files:
src/sys/arch/xen/xen: xennetback_xenbus.c

Log Message:
allow skipping IPv4 checksum on Tx


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/xen/xen/xennetback_xenbus.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/xen/xen/xennetback_xenbus.c
diff -u src/sys/arch/xen/xen/xennetback_xenbus.c:1.81 src/sys/arch/xen/xen/xennetback_xenbus.c:1.82
--- src/sys/arch/xen/xen/xennetback_xenbus.c:1.81	Wed Mar 18 19:26:15 2020
+++ src/sys/arch/xen/xen/xennetback_xenbus.c	Thu Mar 19 11:19:25 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: xennetback_xenbus.c,v 1.81 2020/03/18 19:26:15 jdolecek Exp $  */
+/*  $NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.81 2020/03/18 19:26:15 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.82 2020/03/19 11:19:25 jdolecek Exp $");
 
 #include "opt_xen.h"
 
@@ -304,7 +304,8 @@ xennetback_xenbus_create(struct xenbus_d
 	ifp->if_snd.ifq_maxlen =
 	uimax(ifqmaxlen, NET_TX_RING_SIZE * 2);
 	ifp->if_capabilities =
-		IFCAP_CSUM_UDPv4_Tx
+		IFCAP_CSUM_IPv4_Tx
+		| IFCAP_CSUM_UDPv4_Tx
 		| IFCAP_CSUM_TCPv4_Tx;
 	ifp->if_ioctl = xennetback_ifioctl;
 	ifp->if_start = xennetback_ifstart;
@@ -1049,7 +1050,7 @@ xennetback_ifsoftstart_transfer(void *ar
 			rxresp->offset = offset;
 			rxresp->status = m->m_pkthdr.len;
 			if ((m->m_pkthdr.csum_flags &
-			(M_CSUM_TCPv4 | M_CSUM_UDPv4)) != 0) {
+			(M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4)) != 0) {
 rxresp->flags = NETRXF_csum_blank;
 			} else {
 rxresp->flags = NETRXF_data_validated;
@@ -1358,7 +1359,7 @@ xennetback_ifsoftstart_copy(void *arg)
 			rxresp->offset = 0;
 			rxresp->status = m->m_pkthdr.len;
 			if ((m->m_pkthdr.csum_flags &
-			(M_CSUM_TCPv4 | M_CSUM_UDPv4)) != 0) {
+			(M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4)) != 0) {
 rxresp->flags = NETRXF_csum_blank;
 			} else {
 rxresp->flags = NETRXF_data_validated;



CVS commit: src/sys/arch/xen/xen

2020-03-19 Thread Jaromir Dolecek
Module Name:src
Committed By:   jdolecek
Date:   Thu Mar 19 10:53:43 UTC 2020

Modified Files:
src/sys/arch/xen/xen: if_xennet_xenbus.c xennet_checksum.c

Log Message:
add support for skipping IPv4 checksums


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/arch/xen/xen/if_xennet_xenbus.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/xen/xen/xennet_checksum.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/xen/xen/if_xennet_xenbus.c
diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.91 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.92
--- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.91	Wed Mar 18 19:23:13 2020
+++ src/sys/arch/xen/xen/if_xennet_xenbus.c	Thu Mar 19 10:53:43 2020
@@ -1,4 +1,4 @@
-/*  $NetBSD: if_xennet_xenbus.c,v 1.91 2020/03/18 19:23:13 jdolecek Exp $  */
+/*  $NetBSD: if_xennet_xenbus.c,v 1.92 2020/03/19 10:53:43 jdolecek Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -84,7 +84,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.91 2020/03/18 19:23:13 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.92 2020/03/19 10:53:43 jdolecek Exp $");
 
 #include "opt_xen.h"
 #include "opt_nfs_boot.h"
@@ -387,7 +387,8 @@ xennet_xenbus_attach(device_t parent, de
 	ifp->if_timer = 0;
 	ifp->if_snd.ifq_maxlen = uimax(ifqmaxlen, NET_TX_RING_SIZE * 2);
 	ifp->if_capabilities =
-		IFCAP_CSUM_UDPv4_Rx | IFCAP_CSUM_UDPv4_Tx
+		IFCAP_CSUM_IPv4_Rx | IFCAP_CSUM_IPv4_Tx
+		| IFCAP_CSUM_UDPv4_Rx | IFCAP_CSUM_UDPv4_Tx
 		| IFCAP_CSUM_TCPv4_Rx | IFCAP_CSUM_TCPv4_Tx;
 	IFQ_SET_READY(>if_snd);
 	if_attach(ifp);
@@ -1229,7 +1230,7 @@ xennet_softstart(void *arg)
 		}
 
 		if ((m->m_pkthdr.csum_flags &
-		(M_CSUM_TCPv4 | M_CSUM_UDPv4)) != 0) {
+		(M_CSUM_TCPv4 | M_CSUM_UDPv4 | M_CSUM_IPv4)) != 0) {
 			txflags = NETTXF_csum_blank;
 		} else {
 			txflags = NETTXF_data_validated;

Index: src/sys/arch/xen/xen/xennet_checksum.c
diff -u src/sys/arch/xen/xen/xennet_checksum.c:1.7 src/sys/arch/xen/xen/xennet_checksum.c:1.8
--- src/sys/arch/xen/xen/xennet_checksum.c:1.7	Wed Mar 18 19:23:13 2020
+++ src/sys/arch/xen/xen/xennet_checksum.c	Thu Mar 19 10:53:43 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: xennet_checksum.c,v 1.7 2020/03/18 19:23:13 jdolecek Exp $	*/
+/*	$NetBSD: xennet_checksum.c,v 1.8 2020/03/19 10:53:43 jdolecek Exp $	*/
 
 /*-
  * Copyright (c)2006 YAMAMOTO Takashi,
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.7 2020/03/18 19:23:13 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennet_checksum.c,v 1.8 2020/03/19 10:53:43 jdolecek Exp $");
 
 #include 
 #include 
@@ -126,15 +126,20 @@ xennet_checksum_fill(struct ifnet *ifp, 
 
 	switch (nxt) {
 	case IPPROTO_UDP:
-		m->m_pkthdr.csum_flags = M_CSUM_UDPv4;
+		m->m_pkthdr.csum_flags = M_CSUM_UDPv4 | M_CSUM_IPv4;
 		m->m_pkthdr.csum_data = offsetof(struct udphdr, uh_sum);
 		m->m_pkthdr.csum_data |= iphlen << 16;
 		break;
 	case IPPROTO_TCP:
-		m->m_pkthdr.csum_flags = M_CSUM_TCPv4;
+		m->m_pkthdr.csum_flags = M_CSUM_TCPv4 | M_CSUM_IPv4;
 		m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
 		m->m_pkthdr.csum_data |= iphlen << 16;
 		break;
+	case IPPROTO_ICMP:
+	case IPPROTO_IGMP:
+		m->m_pkthdr.csum_flags = M_CSUM_IPv4;
+		m->m_pkthdr.csum_data = iphlen << 16;
+		break;
 	default:
 	{
 		static struct timeval lasttime;
@@ -153,6 +158,14 @@ xennet_checksum_fill(struct ifnet *ifp, 
 		 */
 		sw_csum = m->m_pkthdr.csum_flags & ~ifp->if_csum_flags_rx;
 
+		/*
+		 * Always initialize the sum to 0!  Some HW assisted
+		 * checksumming requires this. in_undefer_cksum()
+		 * also needs it to be zero.
+		 */
+		if (m->m_pkthdr.csum_flags & M_CSUM_IPv4)
+			iph->ip_sum = 0;
+
 		if (sw_csum & (M_CSUM_IPv4|M_CSUM_UDPv4|M_CSUM_TCPv4)) {
 			in_undefer_cksum(m, ehlen,
 			sw_csum & (M_CSUM_IPv4|M_CSUM_UDPv4|M_CSUM_TCPv4));



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

2020-03-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Mar 19 08:33:04 UTC 2020

Modified Files:
src/sys/arch/arm/samsung: exynos_platform.c

Log Message:
Bring back EXYNOS5422_DISABLE_CA7_CLUSTER the bug is back


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/arm/samsung/exynos_platform.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/samsung/exynos_platform.c
diff -u src/sys/arch/arm/samsung/exynos_platform.c:1.27 src/sys/arch/arm/samsung/exynos_platform.c:1.28
--- src/sys/arch/arm/samsung/exynos_platform.c:1.27	Sat Feb 15 08:16:11 2020
+++ src/sys/arch/arm/samsung/exynos_platform.c	Thu Mar 19 08:33:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: exynos_platform.c,v 1.27 2020/02/15 08:16:11 skrll Exp $ */
+/* $NetBSD: exynos_platform.c,v 1.28 2020/03/19 08:33:04 skrll Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared D. McNeill 
@@ -35,7 +35,14 @@
 #include "ukbd.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.27 2020/02/15 08:16:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: exynos_platform.c,v 1.28 2020/03/19 08:33:04 skrll Exp $");
+
+
+/*
+ * Booting a CA7 core on Exynos5422 is currently broken, disable starting CA7 secondaries.
+ */
+#defineEXYNOS5422_DISABLE_CA7_CLUSTER
+
 
 #include 
 #include 
@@ -143,6 +150,11 @@ exynos5800_mpstart(void)
 		const u_int aff0 = __SHIFTOUT(mpidr, MPIDR_AFF0);
 		const u_int cpu = cluster * 4 + aff0;
 
+#if defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+		if (cluster == 1)
+			continue;
+#endif
+
 		val = bus_space_read_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_STATUS(cpu));
 		bus_space_write_4(bst, pmu_bsh, EXYNOS5800_PMU_CORE_CONFIG(cpu),
 		EXYNOS5800_PMU_CORE_POWER_EN);
@@ -327,6 +339,27 @@ exynos5_platform_bootstrap(void)
 
 	exynos_bootstrap(5);
 
+#if defined(MULTIPROCESSOR) && defined(EXYNOS5422_DISABLE_CA7_CLUSTER)
+	const struct of_compat_data *cd = of_search_compatible(OF_finddevice("/"), mp_compat_data);
+	if (cd && cd->data == (uintptr_t)exynos5800_mpstart) {
+		void *fdt_data = __UNCONST(fdtbus_get_data());
+		int cpu_off, cpus_off, len;
+
+		cpus_off = fdt_path_offset(fdt_data, "/cpus");
+		if (cpus_off < 0)
+			return;
+
+		fdt_for_each_subnode(cpu_off, fdt_data, cpus_off) {
+			const void *prop = fdt_getprop(fdt_data, cpu_off, "reg", );
+			if (len != 4)
+continue;
+			const uint32_t mpidr = be32dec(prop);
+			if (mpidr != cpu_mpidr_aff_read() && __SHIFTOUT(mpidr, MPIDR_AFF1) == 1)
+fdt_setprop_string(fdt_data, cpu_off, "status", "fail");
+		}
+	}
+#endif
+
 	arm_fdt_cpu_bootstrap();
 }
 



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:51:22 UTC 2020

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

Log Message:
Only set the IPv4 address in umb(4) if both MBIM_IPCONF_HAS_ADDRINFO and
MBIM_IPCONF_HAS_GWINFO are available. Configuring umb(4) without gateway
wont work the system needs a destination address for the interface.
Problem found by jsg@.
OK jsg@ deraadt@

>From OpenBSD.


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

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

Modified files:

Index: src/sys/dev/usb/if_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.16 src/sys/dev/usb/if_umb.c:1.17
--- src/sys/dev/usb/if_umb.c:1.16	Thu Mar 19 07:50:27 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:51:22 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.17 2020/03/19 07:51:22 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1714,7 +1714,8 @@ umb_decode_ip_configuration(struct umb_s
 	 * IPv4 configuration
 	 */
 	avail = le32toh(ic->ipv4_available);
-	if (avail & MBIM_IPCONF_HAS_ADDRINFO) {
+	if ((avail & (MBIM_IPCONF_HAS_ADDRINFO | MBIM_IPCONF_HAS_GWINFO)) ==
+	(MBIM_IPCONF_HAS_ADDRINFO | MBIM_IPCONF_HAS_GWINFO)) {
 		n = le32toh(ic->ipv4_naddr);
 		off = le32toh(ic->ipv4_addroffs);
 
@@ -1734,10 +1735,8 @@ umb_decode_ip_configuration(struct umb_s
 		sin = (struct sockaddr_in *)_dstaddr;
 		sin->sin_family = AF_INET;
 		sin->sin_len = sizeof(ifra.ifra_dstaddr);
-		if (avail & MBIM_IPCONF_HAS_GWINFO) {
-			off = le32toh(ic->ipv4_gwoffs);
-			sin->sin_addr.s_addr = *((uint32_t *)((char *)data + off));
-		}
+		off = le32toh(ic->ipv4_gwoffs);
+		sin->sin_addr.s_addr = *((uint32_t *)((char *)data + off));
 
 		sin = (struct sockaddr_in *)_mask;
 		sin->sin_family = AF_INET;



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:50:27 UTC 2020

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

Log Message:
turn the success paths of FCC registration into debug prints. The
(unlikely) failure path remains noisy.
discussed with claudio

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/if_umb.c

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

Modified files:

Index: src/sys/dev/usb/if_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.15 src/sys/dev/usb/if_umb.c:1.16
--- src/sys/dev/usb/if_umb.c:1.15	Thu Mar 19 07:49:29 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:50:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $ */
+/*	$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.16 2020/03/19 07:50:27 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2569,11 +2569,11 @@ umb_decode_qmi(struct umb_softc *sc, uin
 break;
 			case 0x555f:	/* Send FCC Authentication */
 if (val == 0)
-	log(LOG_INFO, "%s: send FCC "
+	DPRINTF("%s: send FCC "
 	"Authentication succeeded\n",
 	DEVNAM(sc));
 else if (val == 0x001a0001)
-	log(LOG_INFO, "%s: FCC Authentication "
+	DPRINTF("%s: FCC Authentication "
 	"not required\n", DEVNAM(sc));
 else
 	log(LOG_INFO, "%s: send FCC "



CVS commit: src/sys/dev/usb

2020-03-19 Thread Pierre Pronchery
Module Name:src
Committed By:   khorben
Date:   Thu Mar 19 07:49:29 UTC 2020

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

Log Message:
When there is no network around the state timeout fires over and over again.
Change the printf into a log and only under IFF_DEBUG to reduce dmesg spam.
Loudly requested by beck@ OK deraadt@

>From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/if_umb.c

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

Modified files:

Index: src/sys/dev/usb/if_umb.c
diff -u src/sys/dev/usb/if_umb.c:1.14 src/sys/dev/usb/if_umb.c:1.15
--- src/sys/dev/usb/if_umb.c:1.14	Sat Mar 14 02:35:33 2020
+++ src/sys/dev/usb/if_umb.c	Thu Mar 19 07:49:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $ */
+/*	$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $ */
 /*	$OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */
 
 /*
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.14 2020/03/14 02:35:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.15 2020/03/19 07:49:29 khorben Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -948,9 +948,12 @@ Static void
 umb_statechg_timeout(void *arg)
 {
 	struct umb_softc *sc = arg;
+	struct ifnet *ifp = GET_IFP(sc);
 
 	if (sc->sc_info.regstate != MBIM_REGSTATE_ROAMING || sc->sc_roaming)
-		printf("%s: state change timeout\n",DEVNAM(sc));
+		if (ifp->if_flags & IFF_DEBUG)
+			log(LOG_DEBUG, "%s: state change timeout\n",
+			DEVNAM(sc));
 	usb_add_task(sc->sc_udev, >sc_umb_task, USB_TASKQ_DRIVER);
 }
 



CVS commit: src/usr.bin/calendar/calendars

2020-03-19 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Mar 19 07:20:36 UTC 2020

Modified Files:
src/usr.bin/calendar/calendars: calendar.computer

Log Message:
Note the birthday of Symbolics.com


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/calendar/calendars/calendar.computer

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.computer
diff -u src/usr.bin/calendar/calendars/calendar.computer:1.11 src/usr.bin/calendar/calendars/calendar.computer:1.12
--- src/usr.bin/calendar/calendars/calendar.computer:1.11	Mon Feb 24 00:02:55 2020
+++ src/usr.bin/calendar/calendars/calendar.computer	Thu Mar 19 07:20:36 2020
@@ -23,6 +23,7 @@
 03/04	First Cray-1 shipped to Los Alamos, 1976
 03/09	"GOTO considered harmful" (E.J. Dijkstra) published in CACM, 1968
 03/14	LISP introduced, 1960
+03/15	Symbolics.com, the first .com domain registered, 1985 
 03/21	NetBSD project born, 1993
 03/28	DEC announces PDP-11, 1970
 03/31	Eckert-Mauchly Computer Corp. founded, Phila, 1946