CVS commit: src/sys

2016-09-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 10 03:26:10 UTC 2016

Modified Files:
src/sys/modules/tun: Makefile
Added Files:
src/sys/modules/tun: tun.c
Removed Files:
src/sys/net: tun.c

Log Message:
Move tun.c into the module's own directory, since it is specific to the
module subsystem.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/modules/tun/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/tun/tun.c
cvs rdiff -u -r1.1 -r0 src/sys/net/tun.c

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

Modified files:

Index: src/sys/modules/tun/Makefile
diff -u src/sys/modules/tun/Makefile:1.1 src/sys/modules/tun/Makefile:1.2
--- src/sys/modules/tun/Makefile:1.1	Sat Sep 10 02:20:10 2016
+++ src/sys/modules/tun/Makefile	Sat Sep 10 03:26:10 2016
@@ -1,9 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2016/09/10 02:20:10 pgoyette Exp $
+# $NetBSD: Makefile,v 1.2 2016/09/10 03:26:10 pgoyette Exp $
 
 .include "../Makefile.inc"
 
-.PATH:  ${S}/net
-
 KMOD=		tun
 SRCS=		tun.c
 

Added files:

Index: src/sys/modules/tun/tun.c
diff -u /dev/null src/sys/modules/tun/tun.c:1.1
--- /dev/null	Sat Sep 10 03:26:10 2016
+++ src/sys/modules/tun/tun.c	Sat Sep 10 03:26:10 2016
@@ -0,0 +1,51 @@
+/*	$NetBSD: tun.c,v 1.1 2016/09/10 03:26:10 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: tun.c,v 1.1 2016/09/10 03:26:10 pgoyette Exp $");
+
+#include 
+#include 
+
+MODULE(MODULE_CLASS_DRIVER, tun, "if_tun");
+
+static int
+tun_modcmd(modcmd_t cmd, void *arg)  
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: src/distrib/sets/lists/modules

2016-09-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 10 02:20:41 UTC 2016

Modified Files:
src/distrib/sets/lists/modules: mi

Log Message:
Update sets for new dummy "tun" module.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/distrib/sets/lists/modules/mi

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

Modified files:

Index: src/distrib/sets/lists/modules/mi
diff -u src/distrib/sets/lists/modules/mi:1.93 src/distrib/sets/lists/modules/mi:1.94
--- src/distrib/sets/lists/modules/mi:1.93	Sun Aug  7 14:28:11 2016
+++ src/distrib/sets/lists/modules/mi	Sat Sep 10 02:20:41 2016
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.93 2016/08/07 14:28:11 christos Exp $
+# $NetBSD: mi,v 1.94 2016/09/10 02:20:41 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -294,6 +294,8 @@
 ./@MODULEDIR@/tmpfs/tmpfs.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/tprofbase-kernel-modules	kmod
 ./@MODULEDIR@/tprof/tprof.kmod			base-kernel-modules	kmod
+./@MODULEDIR@/tunbase-kernel-modules	kmod
+./@MODULEDIR@/tun/tun.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/uatpbase-kernel-modules	kmod
 ./@MODULEDIR@/uatp/uatp.kmod			base-kernel-modules	kmod
 ./@MODULEDIR@/udfbase-kernel-modules	kmod



CVS commit: src/sys

2016-09-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Sep 10 02:20:11 UTC 2016

Modified Files:
src/sys/modules: Makefile
Added Files:
src/sys/modules/tun: Makefile
src/sys/net: tun.c

Log Message:
Add a dummy "tun" module, whose only job is to trigger an autoload of
required module "if_tun".  This allows access to /dev/tunN to autload
the require interface module.

XXX There's might be a better place/name for net/tun.c


To generate a diff of this commit:
cvs rdiff -u -r1.175 -r1.176 src/sys/modules/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/modules/tun/Makefile
cvs rdiff -u -r0 -r1.1 src/sys/net/tun.c

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

Modified files:

Index: src/sys/modules/Makefile
diff -u src/sys/modules/Makefile:1.175 src/sys/modules/Makefile:1.176
--- src/sys/modules/Makefile:1.175	Sun Aug  7 14:27:38 2016
+++ src/sys/modules/Makefile	Sat Sep 10 02:20:10 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.175 2016/08/07 14:27:38 christos Exp $
+#	$NetBSD: Makefile,v 1.176 2016/09/10 02:20:10 pgoyette Exp $
 
 .include 
 
@@ -61,7 +61,7 @@ SUBDIR+=	if_smsc
 SUBDIR+=	if_srt
 SUBDIR+=	if_stf
 SUBDIR+=	if_strip
-SUBDIR+=	if_tun
+SUBDIR+=	if_tun tun
 SUBDIR+=	if_vlan
 SUBDIR+=	iic
 SUBDIR+=	ipl

Added files:

Index: src/sys/modules/tun/Makefile
diff -u /dev/null src/sys/modules/tun/Makefile:1.1
--- /dev/null	Sat Sep 10 02:20:11 2016
+++ src/sys/modules/tun/Makefile	Sat Sep 10 02:20:10 2016
@@ -0,0 +1,10 @@
+# $NetBSD: Makefile,v 1.1 2016/09/10 02:20:10 pgoyette Exp $
+
+.include "../Makefile.inc"
+
+.PATH:  ${S}/net
+
+KMOD=		tun
+SRCS=		tun.c
+
+.include 

Index: src/sys/net/tun.c
diff -u /dev/null src/sys/net/tun.c:1.1
--- /dev/null	Sat Sep 10 02:20:11 2016
+++ src/sys/net/tun.c	Sat Sep 10 02:20:11 2016
@@ -0,0 +1,51 @@
+/*	$NetBSD: tun.c,v 1.1 2016/09/10 02:20:11 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2016 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Paul Goyette
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: tun.c,v 1.1 2016/09/10 02:20:11 pgoyette Exp $");
+
+#include 
+#include 
+
+MODULE(MODULE_CLASS_DRIVER, tun, "if_tun");
+
+static int
+tun_modcmd(modcmd_t cmd, void *arg)  
+{
+
+	switch (cmd) {
+	case MODULE_CMD_INIT:
+	case MODULE_CMD_FINI:
+		return 0;
+	default:
+		return ENOTTY;
+	}
+}



CVS commit: xsrc/external/mit/xf86-video-r128/dist/src

2016-09-09 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Sep  9 22:40:01 UTC 2016

Modified Files:
xsrc/external/mit/xf86-video-r128/dist/src: r128_exa.c

Log Message:
- implement UploadToScreen() using host blits
- implement DownloadFromScreen() with memcpy() but sync the engine first
- call exaMarkSync() when needed
- don't set EXA_OFFSCREEN_ALIGN_POT unless we actually do xrender acceleration


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c

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

Modified files:

Index: xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c
diff -u xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.1.1.1 xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.2
--- xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c:1.1.1.1	Sun Jun  2 08:24:19 2013
+++ xsrc/external/mit/xf86-video-r128/dist/src/r128_exa.c	Fri Sep  9 22:40:01 2016
@@ -230,6 +230,7 @@ R128Solid(PixmapPtr pPixmap, int x1, int
 R128WaitForFifo(pScrn, 2);
 OUTREG(R128_DST_Y_X,  (y1 << 16) | x1);
 OUTREG(R128_DST_WIDTH_HEIGHT, ((x2-x1) << 16) | (y2-y1));
+exaMarkSync(pScreen);
 }
 
 #define R128DoneSolid R128Done
@@ -317,6 +318,7 @@ R128Copy(PixmapPtr pDstPixmap, int srcX,
 OUTREG(R128_SRC_Y_X,  (srcY << 16) | srcX);
 OUTREG(R128_DST_Y_X,  (dstY << 16) | dstX);
 OUTREG(R128_DST_HEIGHT_WIDTH, (height << 16) | width);
+exaMarkSync(pScreen);
 }
 
 #define R128DoneCopy R128Done
@@ -410,6 +412,131 @@ R128CCESync(ScreenPtr pScreen, int marke
 
 #endif
 
+/*
+ * Memcpy-based UTS.
+ */
+static Bool
+R128UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
+char *src, int src_pitch)
+{
+ScrnInfoPtr pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+R128InfoPtr	info  = R128PTR(pScrn);
+char	*dst= info->FB + exaGetPixmapOffset(pDst);
+int		dst_pitch  = exaGetPixmapPitch(pDst);
+int		bpp= pDst->drawable.bitsPerPixel;
+int		cpp= (bpp + 7) >> 3;
+int		wBytes = w * cpp;
+
+dst += (x * cpp) + (y * dst_pitch);
+
+R128WaitForIdle(pScrn);
+
+while (h--) {
+	memcpy(dst, src, wBytes);
+	src += src_pitch;
+	dst += dst_pitch;
+}
+
+return TRUE;
+}
+
+/*
+ * Hostblit-based UTS.
+ * this assumes 32bit pixels
+ */
+static Bool
+R128UploadToScreenHW(PixmapPtr pDst, int x, int y, int w, int h,
+char *src, int src_pitch)
+{
+ScrnInfoPtr	pScrn = xf86Screens[pDst->drawable.pScreen->myNum];
+R128InfoPtr	info  = R128PTR(pScrn);
+uint32_t	dst_pitch_offset, datatype;
+int		cnt, line, px;
+unsigned char *R128MMIO = info->MMIO;
+int		bpp = pDst->drawable.bitsPerPixel;
+uint32_t	*s;
+
+if (!R128GetDatatypeBpp(bpp, )) {
+R128TRACE(("R128GetDatatypeBpp failed\n"));
+	return FALSE;
+}
+
+if (!R128GetPixmapOffsetPitch(pDst, _pitch_offset)) {
+R128TRACE(("R128GetPixmapOffsetPitch dest failed\n"));
+	return FALSE;
+}
+
+info->state_2d.in_use = TRUE;
+info->state_2d.dp_gui_master_cntl = (R128_GMC_DST_PITCH_OFFSET_CNTL |
+	  R128_GMC_BRUSH_NONE |
+	  (datatype >> 8) |
+	  R128_GMC_SRC_DATATYPE_COLOR |
+	  R128_ROP3_S |
+	  R128_DP_SRC_SOURCE_HOST_DATA |
+	  R128_GMC_CLR_CMP_CNTL_DIS);
+info->state_2d.dp_cntl = R128_DST_X_LEFT_TO_RIGHT |
+ R128_DST_Y_TOP_TO_BOTTOM;
+info->state_2d.dp_write_mask = 0x;
+info->state_2d.dst_pitch_offset = dst_pitch_offset;
+info->state_2d.default_sc_bottom_right = R128_DEFAULT_SC_RIGHT_MAX |
+ R128_DEFAULT_SC_BOTTOM_MAX;
+Emit2DState(pScrn);
+
+R128WaitForFifo(pScrn, 3);
+OUTREG(R128_SRC_Y_X, 0);
+OUTREG(R128_DST_Y_X, (y << 16) | x);
+OUTREG(R128_DST_HEIGHT_WIDTH, (h << 16) | w);
+
+R128WaitForFifo(pScrn, 32);
+cnt = 0;
+
+for (line = 0; line < h; line++) {
+	s = (void *)src;
+	for (px = 0; px < w; px++) {
+	OUTREG(R128_HOST_DATA0, cpu_to_le32(*s));
+	s++;
+	cnt++;
+	if (cnt > 31) {
+		R128WaitForFifo(pScrn, 32);
+		cnt = 0;
+	}
+	}
+	src += src_pitch;
+}
+info->state_2d.in_use = FALSE;
+exaMarkSync(pDst->drawable.pScreen);
+return TRUE;
+}
+
+/*
+ * Memcpy-based DFS.
+ */
+static Bool
+R128DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h,
+char *dst, int dst_pitch)
+{
+ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum];
+R128InfoPtr   info  = R128PTR(pScrn);
+char  *src= info->FB + exaGetPixmapOffset(pSrc);
+intsrc_pitch  = exaGetPixmapPitch(pSrc);
+
+int bpp= pSrc->drawable.bitsPerPixel;
+int cpp= (bpp + 7) >> 3;
+int wBytes = w * cpp;
+
+src += (x * cpp) + (y * src_pitch);
+
+R128WaitForIdle(pScrn);
+
+while (h--) {
+	memcpy(dst, src, wBytes);
+	src += 

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

2016-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 21:10:56 UTC 2016

Modified Files:
src/sys/arch/amd64/conf: MODULAR

Log Message:
let sppp be loaded dynamically.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/amd64/conf/MODULAR

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/amd64/conf/MODULAR
diff -u src/sys/arch/amd64/conf/MODULAR:1.4 src/sys/arch/amd64/conf/MODULAR:1.5
--- src/sys/arch/amd64/conf/MODULAR:1.4	Sun Aug  7 10:28:55 2016
+++ src/sys/arch/amd64/conf/MODULAR	Fri Sep  9 17:10:56 2016
@@ -1,4 +1,4 @@
-# $NetBSD: MODULAR,v 1.4 2016/08/07 14:28:55 christos Exp $
+# $NetBSD: MODULAR,v 1.5 2016/09/09 21:10:56 christos Exp $
 #
 # Try to exclude all the drivers in GENERIC that have been modularized
 # XXX: incomplete
@@ -84,6 +84,8 @@ options 	MODULAR_DEFAULT_AUTOLOAD
 -no alc*	at pci?
 -no ath*	at pci?
 
+-no select sppp			# Synchronous-Point-to-Point Protocol
+
 -no pseudo-device 	crypto			# /dev/crypto device
 -no pseudo-device	swcrypto		# software crypto implementation
 



CVS commit: src/sys/conf

2016-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 21:10:01 UTC 2016

Modified Files:
src/sys/conf: files

Log Message:
sppp is not a pseudo-device


To generate a diff of this commit:
cvs rdiff -u -r1.1163 -r1.1164 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1163 src/sys/conf/files:1.1164
--- src/sys/conf/files:1.1163	Fri Aug 19 14:08:50 2016
+++ src/sys/conf/files	Fri Sep  9 17:10:01 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1163 2016/08/19 18:08:50 maxv Exp $
+#	$NetBSD: files,v 1.1164 2016/09/09 21:10:01 christos Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20150846
@@ -1409,7 +1409,6 @@ defpseudo loop:		ifnet
 defpseudo sl:		ifnet
 defpseudo ppp:		ifnet, bpf_filter
 defpseudo pppoe:	ifnet, ether, sppp
-defpseudo sppp:		ifnet
 defpseudo tun:		ifnet
 defpseudo vlan:		ifnet, ether
 defpseudo bridge:	ifnet, ether



CVS commit: src/usr.bin/config

2016-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 21:09:11 UTC 2016

Modified Files:
src/usr.bin/config: defs.h files.c sem.c

Log Message:
Make attribute deselection work:
- when deselecting attributes, remove files that depend on them
- when deselecting attributes, remove devices that depend on them


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/usr.bin/config/defs.h
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/config/files.c
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/config/sem.c

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

Modified files:

Index: src/usr.bin/config/defs.h
diff -u src/usr.bin/config/defs.h:1.97 src/usr.bin/config/defs.h:1.98
--- src/usr.bin/config/defs.h:1.97	Sun Aug  7 17:11:55 2016
+++ src/usr.bin/config/defs.h	Fri Sep  9 17:09:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.97 2016/08/07 21:11:55 christos Exp $	*/
+/*	$NetBSD: defs.h,v 1.98 2016/09/09 21:09:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -190,7 +190,8 @@ struct attr {
 #define	a_weight	a_m.m_weight
 
 	/* "interface attribute" */
-	int	a_iattr;		/* true => allows children */
+	uint8_t	a_iattr;		/* true => allows children */
+	uint8_t a_deselected;		/* deselected */	
 	struct	loclist *a_locs;	/* locators required */
 	int	a_loclen;		/* length of above list */
 	struct	nvlist *a_devs;		/* children */

Index: src/usr.bin/config/files.c
diff -u src/usr.bin/config/files.c:1.35 src/usr.bin/config/files.c:1.36
--- src/usr.bin/config/files.c:1.35	Fri Sep  4 17:32:54 2015
+++ src/usr.bin/config/files.c	Fri Sep  9 17:09:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: files.c,v 1.35 2015/09/04 21:32:54 uebayasi Exp $	*/
+/*	$NetBSD: files.c,v 1.36 2016/09/09 21:09:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: files.c,v 1.35 2015/09/04 21:32:54 uebayasi Exp $");
+__RCSID("$NetBSD: files.c,v 1.36 2016/09/09 21:09:11 christos Exp $");
 
 #include 
 #include 
@@ -335,6 +335,11 @@ fixfiles(void)
 			if (!sel)
 continue;
 		}
+		if (fi->fi_attr && fi->fi_attr->a_deselected) {
+			CFGDBG(5, "file `%s' deselected because attr `%s' was",
+			fi->fi_path, fi->fi_attr->a_name);
+			continue;
+		}
 
 		/* We like this file.  Make sure it generates a unique .o. */
 		if (ht_insert(basetab, fi->fi_base, fi)) {

Index: src/usr.bin/config/sem.c
diff -u src/usr.bin/config/sem.c:1.75 src/usr.bin/config/sem.c:1.76
--- src/usr.bin/config/sem.c:1.75	Sun Aug  7 06:37:24 2016
+++ src/usr.bin/config/sem.c	Fri Sep  9 17:09:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: sem.c,v 1.75 2016/08/07 10:37:24 christos Exp $	*/
+/*	$NetBSD: sem.c,v 1.76 2016/09/09 21:09:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1992, 1993
@@ -45,7 +45,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: sem.c,v 1.75 2016/08/07 10:37:24 christos Exp $");
+__RCSID("$NetBSD: sem.c,v 1.76 2016/09/09 21:09:11 christos Exp $");
 
 #include 
 #include 
@@ -95,6 +95,45 @@ static devmajor_t dev2major(struct devba
 extern const char *yyfile;
 extern int vflag;
 
+#define V_ATTRIBUTE	0
+#define V_DEVICE	1
+struct vtype {
+	int type;
+	struct attr *attr;
+	void *value;
+};
+
+static struct nvlist *
+makedevstack(struct devbase *d)
+{
+	struct devi *firsti, *i;
+	struct nvlist *stack = NULL;
+
+	for (firsti = d->d_ihead; firsti != NULL; firsti = firsti->i_bsame)
+		for (i = firsti; i != NULL; i = i->i_alias)
+			stack = newnv(NULL, NULL, i, 0, stack);
+	return stack;
+}
+
+static void
+devcleanup(struct nvlist *stack)
+{
+	struct nvlist *nv;
+	for (nv = stack; nv != NULL; nv = nv->nv_next)
+		remove_devi(nv->nv_ptr);
+	nvfreel(stack);
+}
+
+static void *
+addvalue(int type, struct attr *a, void *value)
+{
+	struct vtype *vt = emalloc(sizeof(*vt));
+	vt->type = type;
+	vt->attr = a;
+	vt->value = value;
+	return vt;
+}
+
 void
 initsem(void)
 {
@@ -308,7 +347,8 @@ defattr(const char *name, struct loclist
 			"attribute", name, dep->a_name);
 			return (1);
 		}
-		(void)ht_insert2(attrdeptab, name, dep->a_name, NULL);
+		(void)ht_insert2(attrdeptab, name, dep->a_name,
+		addvalue(V_ATTRIBUTE, a, dep));
 		CFGDBG(2, "attr `%s' depends on attr `%s'", name, dep->a_name);
 	}
 
@@ -536,7 +576,8 @@ defdev(struct devbase *dev, struct locli
 		 * Implicit attribute definition for device dependencies.
 		 */
 		refattr(al->al_this->a_name);
-		(void)ht_insert2(attrdeptab, dev->d_name, al->al_this->a_name, NULL);
+		(void)ht_insert2(attrdeptab, dev->d_name, al->al_this->a_name, 
+			addvalue(V_DEVICE, al->al_this, dev));
 		CFGDBG(2, "device `%s' depends on attr `%s'", dev->d_name,
 		al->al_this->a_name);
 	}
@@ -1563,9 +1604,7 @@ out:
 		}
 	}
 
-	for (nv = stack; nv != NULL; nv = nv->nv_next)
-		remove_devi(nv->nv_ptr);
-	nvfreel(stack);
+	devcleanup(stack);
 }
 
 void
@@ -1573,7 +1612,7 @@ deldev(const char *name, int nowarn)
 {
 	size_t l;
 	struct devi *firsti, *i;
-	struct nvlist *nv, *stack = NULL;
+	struct 

CVS commit: src/sys/net

2016-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 12:41:14 UTC 2016

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

Log Message:
PR/51464: Shoichi YAMAGUCHI: chap authenticator of pppoe does not work


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

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

Modified files:

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.147 src/sys/net/if_spppsubr.c:1.148
--- src/sys/net/if_spppsubr.c:1.147	Sat Aug  6 18:03:45 2016
+++ src/sys/net/if_spppsubr.c	Fri Sep  9 08:41:14 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.147 2016/08/06 22:03:45 pgoyette Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.148 2016/09/09 12:41:14 christos Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.147 2016/08/06 22:03:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.148 2016/09/09 12:41:14 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -4054,20 +4054,20 @@ sppp_chap_input(struct sppp *sp, struct 
 			sppp_print_bytes(value, value_len);
 			addlog(">\n");
 		}
-		if (value_len != sizeof(sp->myauth.challenge)) {
+		if (value_len != sizeof(sp->hisauth.challenge)) {
 			if (debug)
 log(LOG_DEBUG,
 "%s: chap bad hash value length: "
-"%d bytes, should be %ld\n",
+"%d bytes, should be %zu\n",
 ifp->if_xname, value_len,
-(long) sizeof(sp->myauth.challenge));
+sizeof(sp->hisauth.challenge));
 			goto chap_failure;
 		}
 
 		MD5Init();
 		MD5Update(, >ident, 1);
 		MD5Update(, sp->hisauth.secret, sp->hisauth.secret_len);
-		MD5Update(, sp->myauth.challenge, sizeof(sp->myauth.challenge));
+		MD5Update(, sp->hisauth.challenge, sizeof(sp->hisauth.challenge));
 		MD5Final(digest, );
 
 #define FAILMSG "Failed..."
@@ -4130,7 +4130,7 @@ sppp_chap_init(struct sppp *sp)
 static void
 sppp_chap_open(struct sppp *sp)
 {
-	if (sp->myauth.proto == PPP_CHAP &&
+	if (sp->hisauth.proto == PPP_CHAP &&
 	(sp->lcp.opts & (1 << LCP_OPT_AUTH_PROTO)) != 0) {
 		/* we are authenticator for CHAP, start it */
 		chap.scr(sp);
@@ -4265,24 +4265,22 @@ sppp_chap_scr(struct sppp *sp)
 	uint32_t *ch;
 	u_char clen = 4 * sizeof(uint32_t);
 
-	if (sp->myauth.name == NULL) {
+	if (sp->hisauth.name == NULL) {
 	/* can't do anything useful */
-	printf("%s: chap starting without my name being set\n",
+	printf("%s: chap starting without his name being set\n",
 		sp->pp_if.if_xname);
 	return;
 	}
 
 	/* Compute random challenge. */
-	ch = (uint32_t *)sp->myauth.challenge;
+	ch = (uint32_t *)sp->hisauth.challenge;
 	cprng_strong(kern_cprng, ch, clen, 0);
 
 	sp->confid[IDX_CHAP] = ++sp->pp_seq[IDX_CHAP];
 
 	sppp_auth_send(, sp, CHAP_CHALLENGE, sp->confid[IDX_CHAP],
 		   sizeof clen, (const char *),
-		   sizeof(sp->myauth.challenge), sp->myauth.challenge,
-		   sp->myauth.name_len,
-		   sp->myauth.name,
+		   sizeof(sp->hisauth.challenge), sp->hisauth.challenge,
 		   0);
 }
 



CVS commit: [netbsd-7-nhusb] src/sys/external/bsd/common/include/linux

2016-09-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Sep  9 12:14:47 UTC 2016

Added Files:
src/sys/external/bsd/common/include/linux [netbsd-7-nhusb]: err.h
workqueue.h

Log Message:
Add moved files


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.6.2 src/sys/external/bsd/common/include/linux/err.h \
src/sys/external/bsd/common/include/linux/workqueue.h

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

Added files:

Index: src/sys/external/bsd/common/include/linux/err.h
diff -u /dev/null src/sys/external/bsd/common/include/linux/err.h:1.1.6.2
--- /dev/null	Fri Sep  9 12:14:47 2016
+++ src/sys/external/bsd/common/include/linux/err.h	Fri Sep  9 12:14:46 2016
@@ -0,0 +1,87 @@
+/*	$NetBSD: err.h,v 1.1.6.2 2016/09/09 12:14:46 skrll Exp $	*/
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * 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.
+ */
+
+#ifndef _LINUX_ERR_H_
+#define _LINUX_ERR_H_
+
+/* XXX Linux uses long and int inconsistently here.  Hope this works out.  */
+
+#include 
+#include 
+#include 
+
+#define	MAX_ERRNO	ELAST
+
+static inline bool
+IS_ERR_VALUE(uintptr_t n)
+{
+	return (n >= (uintptr_t)-MAX_ERRNO);
+}
+
+static inline void *
+ERR_PTR(long error)
+{
+	KASSERT(error < 0);
+	return (void *)(intptr_t)error;
+}
+
+static inline long
+PTR_ERR(const void *ptr)
+{
+	KASSERT(ptr == (void *)(intptr_t)(long)(intptr_t)ptr); /* XXX Hurk!  */
+	return (long)(intptr_t)ptr;
+}
+
+static inline bool
+IS_ERR(const void *ptr)
+{
+	return IS_ERR_VALUE((uintptr_t)ptr);
+}
+
+static inline bool
+IS_ERR_OR_NULL(const void *ptr)
+{
+	return ((ptr == NULL) || IS_ERR(ptr));
+}
+
+static inline void *
+ERR_CAST(void *ptr)		/* XXX Linux declares with const.  */
+{
+	return ptr;
+}
+
+static inline long
+PTR_RET(const void *ptr)
+{
+	return (IS_ERR(ptr)? PTR_ERR(ptr) : 0);
+}
+
+#endif  /* _LINUX_ERR_H_ */
Index: src/sys/external/bsd/common/include/linux/workqueue.h
diff -u /dev/null src/sys/external/bsd/common/include/linux/workqueue.h:1.1.6.2
--- /dev/null	Fri Sep  9 12:14:47 2016
+++ src/sys/external/bsd/common/include/linux/workqueue.h	Fri Sep  9 12:14:46 2016
@@ -0,0 +1,120 @@
+/*	$NetBSD: workqueue.h,v 1.1.6.2 2016/09/09 12:14:46 skrll Exp $	*/
+
+/*-
+ * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Taylor R. Campbell.
+ *
+ * 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 

CVS commit: src/sys/dev/mii

2016-09-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Sep  9 06:34:10 UTC 2016

Modified Files:
src/sys/dev/mii: inbmphyreg.h

Log Message:
 HV_OEM_BITS is not page 0 but page 768.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/mii/inbmphyreg.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/inbmphyreg.h
diff -u src/sys/dev/mii/inbmphyreg.h:1.3 src/sys/dev/mii/inbmphyreg.h:1.4
--- src/sys/dev/mii/inbmphyreg.h:1.3	Fri May 20 06:06:59 2011
+++ src/sys/dev/mii/inbmphyreg.h	Fri Sep  9 06:34:10 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: inbmphyreg.h,v 1.3 2011/05/20 06:06:59 msaitoh Exp $	*/
+/*	$NetBSD: inbmphyreg.h,v 1.4 2016/09/09 06:34:10 msaitoh Exp $	*/
 /***
 Copyright (c) 2001-2005, Intel Corporation 
 All rights reserved.
@@ -84,14 +84,14 @@ POSSIBILITY OF SUCH DAMAGE.
 #define	I82577_ADDR_REG		16
 #define	I82577_CFG_REG		22
 
-#define HV_OEM_BITS		BME1000_REG(0, 25)
+#define HV_INTC_FC_PAGE_START	768
+#define	BM_PORT_CTRL_PAGE	769
+
+#define HV_OEM_BITS		BME1000_REG(768, 25)
 #define HV_OEM_BITS_LPLU	(1 << 2)
 #define HV_OEM_BITS_A1KDIS	(1 << 6)
 #define HV_OEM_BITS_ANEGNOW	(1 << 10)
 
-#define HV_INTC_FC_PAGE_START	768
-#define	BM_PORT_CTRL_PAGE	769
-
 #define	HV_KMRN_MODE_CTRL	BME1000_REG(BM_PORT_CTRL_PAGE, 16)
 #define	HV_KMRN_MDIO_SLOW	0x0400