CVS commit: src/sys/dev/pci

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Apr  1 04:00:14 UTC 2020

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

Log Message:
insert missing ETHER_UNLOCK()


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/if_kse.c

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

Modified files:

Index: src/sys/dev/pci/if_kse.c
diff -u src/sys/dev/pci/if_kse.c:1.52 src/sys/dev/pci/if_kse.c:1.53
--- src/sys/dev/pci/if_kse.c:1.52	Wed Apr  1 00:07:04 2020
+++ src/sys/dev/pci/if_kse.c	Wed Apr  1 04:00:14 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kse.c,v 1.52 2020/04/01 00:07:04 nisimura Exp $	*/
+/*	$NetBSD: if_kse.c,v 1.53 2020/04/01 04:00:14 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.52 2020/04/01 00:07:04 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.53 2020/04/01 04:00:14 nisimura Exp $");
 
 #include 
 #include 
@@ -332,7 +332,7 @@ static void kse_watchdog(struct ifnet *)
 static int kse_init(struct ifnet *);
 static void kse_stop(struct ifnet *, int);
 static void kse_reset(struct kse_softc *);
-static void kse_set_filter(struct kse_softc *);
+static void kse_set_rcvfilt(struct kse_softc *);
 static int add_rxbuf(struct kse_softc *, int);
 static void rxdrain(struct kse_softc *);
 static int kse_intr(void *);
@@ -726,7 +726,7 @@ kse_ioctl(struct ifnet *ifp, u_long cmd,
 			 * Multicast list has changed; set the hardware filter
 			 * accordingly.
 			 */
-			kse_set_filter(sc);
+			kse_set_rcvfilt(sc);
 		}
 		break;
 	}
@@ -831,7 +831,7 @@ kse_init(struct ifnet *ifp)
 	}
 
 	/* accept multicast frame or run promisc mode */
-	kse_set_filter(sc);
+	kse_set_rcvfilt(sc);
 
 	/* set current media */
 	if (sc->sc_chip == 0x8841)
@@ -1085,7 +1085,7 @@ kse_start(struct ifnet *ifp)
 }
 
 static void
-kse_set_filter(struct kse_softc *sc)
+kse_set_rcvfilt(struct kse_softc *sc)
 {
 	struct ether_multistep step;
 	struct ether_multi *enm;
@@ -1104,6 +1104,7 @@ kse_set_filter(struct kse_softc *sc)
 	ETHER_LOCK(ec);
 	if (ifp->if_flags & IFF_PROMISC) {
 		ec->ec_flags |= ETHER_F_ALLMULTI;
+		ETHER_UNLOCK(ec);
 		/* run promisc. mode */
 		sc->sc_rxc |= RXC_RA;
 		goto update;



CVS commit: src/sys/dev/pci

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Apr  1 04:00:14 UTC 2020

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

Log Message:
insert missing ETHER_UNLOCK()


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/pci/if_kse.c

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



CVS commit: src/sys/net

2020-03-31 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Apr  1 02:38:17 UTC 2020

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

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/net/route.c

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



CVS commit: src/sys/net

2020-03-31 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Apr  1 02:38:17 UTC 2020

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

Log Message:
Fix typo in comment.


To generate a diff of this commit:
cvs rdiff -u -r1.227 -r1.228 src/sys/net/route.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/route.c
diff -u src/sys/net/route.c:1.227 src/sys/net/route.c:1.228
--- src/sys/net/route.c:1.227	Sat Feb  1 12:54:50 2020
+++ src/sys/net/route.c	Wed Apr  1 02:38:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.227 2020/02/01 12:54:50 riastradh Exp $	*/
+/*	$NetBSD: route.c,v 1.228 2020/04/01 02:38:17 knakahara Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -97,7 +97,7 @@
 #endif
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.227 2020/02/01 12:54:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.228 2020/04/01 02:38:17 knakahara Exp $");
 
 #include 
 #ifdef RTFLUSH_DEBUG
@@ -185,7 +185,7 @@ static void	rt_timer_timer(void *);
  * from a rtcache
  * - struct route (rtcache) has struct psref, so we cannot obtain
  *   a reference twice on the same struct route
- *   - Befere destroying or updating a rtentry, we have to wait for
+ *   - Before destroying or updating a rtentry, we have to wait for
  * all references left (see below for details)
  *   - APIs
  * - An obtained rtentry via rtalloc1 or rtrequest* must be



CVS commit: src/sys/modules/examples

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  1 01:57:20 UTC 2020

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

Log Message:
Import a new example kernel module fopsmapper

fopsmapper - basic implementation of mmap with fileops fo_mmap

Submitted by Aditya Vardhan Padala.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/examples/Makefile
cvs rdiff -u -r1.12 -r1.13 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/fopsmapper/Makefile \
src/sys/modules/examples/fopsmapper/cmd_mapper.c \
src/sys/modules/examples/fopsmapper/fopsmapper.c

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

Modified files:

Index: src/sys/modules/examples/Makefile
diff -u src/sys/modules/examples/Makefile:1.8 src/sys/modules/examples/Makefile:1.9
--- src/sys/modules/examples/Makefile:1.8	Wed Feb  5 13:23:42 2020
+++ src/sys/modules/examples/Makefile	Wed Apr  1 01:57:20 2020
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.8 2020/02/05 13:23:42 kamil Exp $
+#	$NetBSD: Makefile,v 1.9 2020/04/01 01:57:20 kamil Exp $
 
 .include 
 
 SUBDIR+=	executor
+SUBDIR+=	fopsmapper		# Needs an additional helper program
 SUBDIR+=	hello
 #SUBDIR+=	luahello		# Nothing to build here, only text files
 SUBDIR+=	luareadhappy		# Needs an additional Lua script

Index: src/sys/modules/examples/README
diff -u src/sys/modules/examples/README:1.12 src/sys/modules/examples/README:1.13
--- src/sys/modules/examples/README:1.12	Fri Feb  7 19:22:21 2020
+++ src/sys/modules/examples/README	Wed Apr  1 01:57:20 2020
@@ -1,4 +1,4 @@
-	$NetBSD: README,v 1.12 2020/02/07 19:22:21 pgoyette Exp $
+	$NetBSD: README,v 1.13 2020/04/01 01:57:20 kamil Exp $
 
Kernel Developer's Manual
 
@@ -7,6 +7,7 @@ DESCRIPTION
 
  This directory contains the following example modules:
  * executor- basic implementation of callout and RUN_ONCE
+ * fopsmapper  - basic implementation of mmap with fileops fo_mmap
  * hello   - the simplest `hello world' module
  * luahello- the simplest `hello world' Lua module
  * luareadhappy- demonstrates calling Lua code from C
@@ -74,5 +75,8 @@ HISTORY
  The ping_block module first appeared in NetBSD 10.0 and was authored by
  Nisarg Joshi.
 
+ The fopsmapper module first appeared in NetBSD 10.0 and was authored by
+ Aditya Vardhan Padala.
+
 AUTHORS
  This document was written by Kamil Rytarowski.

Added files:

Index: src/sys/modules/examples/fopsmapper/Makefile
diff -u /dev/null src/sys/modules/examples/fopsmapper/Makefile:1.1
--- /dev/null	Wed Apr  1 01:57:20 2020
+++ src/sys/modules/examples/fopsmapper/Makefile	Wed Apr  1 01:57:20 2020
@@ -0,0 +1,6 @@
+#S?=/usr/src/sys
+
+KMOD= fopsmapper
+SRCS= fopsmapper.c
+
+.include 
Index: src/sys/modules/examples/fopsmapper/cmd_mapper.c
diff -u /dev/null src/sys/modules/examples/fopsmapper/cmd_mapper.c:1.1
--- /dev/null	Wed Apr  1 01:57:20 2020
+++ src/sys/modules/examples/fopsmapper/cmd_mapper.c	Wed Apr  1 01:57:20 2020
@@ -0,0 +1,64 @@
+/*	$NetBSD: cmd_mapper.c,v 1.1 2020/04/01 01:57:20 kamil Exp $	*/
+
+/*-
+ * Copyright (c) 2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * 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 
+__RCSID("$NetBSD");
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define _PATH_DEV_MAPPER "/dev/fopsmapper"
+
+int main(int argc, char **argv)
+{
+	int devfd;
+	char *map = NULL;
+
+	if ((devfd = open(_PATH_DEV_MAPPER, 

CVS commit: src/sys/modules/examples

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Apr  1 01:57:20 UTC 2020

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

Log Message:
Import a new example kernel module fopsmapper

fopsmapper - basic implementation of mmap with fileops fo_mmap

Submitted by Aditya Vardhan Padala.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/modules/examples/Makefile
cvs rdiff -u -r1.12 -r1.13 src/sys/modules/examples/README
cvs rdiff -u -r0 -r1.1 src/sys/modules/examples/fopsmapper/Makefile \
src/sys/modules/examples/fopsmapper/cmd_mapper.c \
src/sys/modules/examples/fopsmapper/fopsmapper.c

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



CVS commit: src/tests/net/mpls

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 01:51:02 UTC 2020

Modified Files:
src/tests/net/mpls: t_ldp_regen.sh

Log Message:
more cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/net/mpls/t_ldp_regen.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/net/mpls/t_ldp_regen.sh
diff -u src/tests/net/mpls/t_ldp_regen.sh:1.9 src/tests/net/mpls/t_ldp_regen.sh:1.10
--- src/tests/net/mpls/t_ldp_regen.sh:1.9	Tue Mar 31 21:49:26 2020
+++ src/tests/net/mpls/t_ldp_regen.sh	Tue Mar 31 21:51:02 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_ldp_regen.sh,v 1.9 2020/04/01 01:49:26 christos Exp $
+# $NetBSD: t_ldp_regen.sh,v 1.10 2020/04/01 01:51:02 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,15 +35,6 @@
 # Now: * R4 should install label IMPLNULL for that prefix
 #  * R3 should realloc the target label from IMPLNULL to something else
 
-export PATH=/sbin:/usr/sbin:/bin:/usr/bin
-
-RUMP_SERVER1=unix://./r1
-RUMP_SERVER2=unix://./r2
-RUMP_SERVER3=unix://./r3
-RUMP_SERVER4=unix://./r4
-
-RUMP_LIBS="-lrumpnet -lrumpnet_net -lrumpnet_netinet -lrumpnet_netinet6 \
-   -lrumpnet_netmpls -lrumpnet_shmif"
 LDP_FLAGS=""
 
 atf_test_case ldp_regen cleanup



CVS commit: src/tests/net/mpls

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 01:51:02 UTC 2020

Modified Files:
src/tests/net/mpls: t_ldp_regen.sh

Log Message:
more cleanup


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/tests/net/mpls/t_ldp_regen.sh

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



CVS commit: src/tests/net/mpls

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 01:49:26 UTC 2020

Modified Files:
src/tests/net/mpls: Makefile t_ldp_regen.sh t_mpls_fw.sh t_mpls_fw6.sh
t_mpls_fw64.sh t_rfc4182.sh
Added Files:
src/tests/net/mpls: mpls_common.sh

Log Message:
factor out common code and set the path.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/mpls/Makefile \
src/tests/net/mpls/t_mpls_fw.sh
cvs rdiff -u -r0 -r1.1 src/tests/net/mpls/mpls_common.sh
cvs rdiff -u -r1.8 -r1.9 src/tests/net/mpls/t_ldp_regen.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/mpls/t_mpls_fw6.sh \
src/tests/net/mpls/t_mpls_fw64.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/mpls/t_rfc4182.sh

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



CVS commit: src/tests/net/mpls

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 01:49:26 UTC 2020

Modified Files:
src/tests/net/mpls: Makefile t_ldp_regen.sh t_mpls_fw.sh t_mpls_fw6.sh
t_mpls_fw64.sh t_rfc4182.sh
Added Files:
src/tests/net/mpls: mpls_common.sh

Log Message:
factor out common code and set the path.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/mpls/Makefile \
src/tests/net/mpls/t_mpls_fw.sh
cvs rdiff -u -r0 -r1.1 src/tests/net/mpls/mpls_common.sh
cvs rdiff -u -r1.8 -r1.9 src/tests/net/mpls/t_ldp_regen.sh
cvs rdiff -u -r1.4 -r1.5 src/tests/net/mpls/t_mpls_fw6.sh \
src/tests/net/mpls/t_mpls_fw64.sh
cvs rdiff -u -r1.5 -r1.6 src/tests/net/mpls/t_rfc4182.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/net/mpls/Makefile
diff -u src/tests/net/mpls/Makefile:1.6 src/tests/net/mpls/Makefile:1.7
--- src/tests/net/mpls/Makefile:1.6	Wed May 27 14:13:14 2015
+++ src/tests/net/mpls/Makefile	Tue Mar 31 21:49:26 2020
@@ -1,10 +1,13 @@
-# $NetBSD: Makefile,v 1.6 2015/05/27 18:13:14 kefren Exp $
+# $NetBSD: Makefile,v 1.7 2020/04/01 01:49:26 christos Exp $
 #
 
 .include 
 
 TESTSDIR=	${TESTSBASE}/net/mpls
 
-TESTS_SH=	t_mpls_fw t_mpls_fw6 t_mpls_fw64 t_rfc4182 t_ldp_regen
+.for name in t_mpls_fw t_mpls_fw6 t_mpls_fw64 t_rfc4182 t_ldp_regen
+TESTS_SH+=  ${name}
+TESTS_SH_SRC_${name}= mpls_common.sh ${name}.sh
+.endfor
 
 .include 
Index: src/tests/net/mpls/t_mpls_fw.sh
diff -u src/tests/net/mpls/t_mpls_fw.sh:1.6 src/tests/net/mpls/t_mpls_fw.sh:1.7
--- src/tests/net/mpls/t_mpls_fw.sh:1.6	Mon May 13 13:55:09 2019
+++ src/tests/net/mpls/t_mpls_fw.sh	Tue Mar 31 21:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_mpls_fw.sh,v 1.6 2019/05/13 17:55:09 bad Exp $
+# $NetBSD: t_mpls_fw.sh,v 1.7 2020/04/01 01:49:26 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -36,15 +36,6 @@
 # Do the same for the reverse direction (R4 to R1)
 # ping from R1 to R4 right hand side interface
 
-
-RUMP_SERVER1=unix://./r1
-RUMP_SERVER2=unix://./r2
-RUMP_SERVER3=unix://./r3
-RUMP_SERVER4=unix://./r4
-
-RUMP_FLAGS="-lrumpnet -lrumpnet_net -lrumpnet_netinet	\
--lrumpnet_netmpls -lrumpnet_shmif"
-
 atf_test_case mplsfw4 cleanup
 mplsfw4_head()
 {
@@ -53,16 +44,6 @@ mplsfw4_head()
 	atf_set "require.progs" "rump_server"
 }
 
-startservers()
-{
-
-	ulimit -r 300
-	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER1}
-	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER2}
-	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER3}
-	atf_check -s exit:0 rump_server ${RUMP_FLAGS} ${RUMP_SERVER4}
-}
-
 configservers()
 {
 
@@ -133,19 +114,10 @@ doping()
 	unset RUMP_SERVER
 }
 
-docleanup()
-{
-
-	RUMP_SERVER=${RUMP_SERVER1} rump.halt
-	RUMP_SERVER=${RUMP_SERVER2} rump.halt
-	RUMP_SERVER=${RUMP_SERVER3} rump.halt
-	RUMP_SERVER=${RUMP_SERVER4} rump.halt
-}
-
 mplsfw4_body()
 {
 
-	startservers
+	dostart
 	configservers 3
 	doping
 }
@@ -168,7 +140,7 @@ mplsfw4_expl_head()
 mplsfw4_expl_body()
 {
 
-	startservers
+	dostart
 	configservers 0
 	doping
 }

Index: src/tests/net/mpls/t_ldp_regen.sh
diff -u src/tests/net/mpls/t_ldp_regen.sh:1.8 src/tests/net/mpls/t_ldp_regen.sh:1.9
--- src/tests/net/mpls/t_ldp_regen.sh:1.8	Mon May 13 13:55:09 2019
+++ src/tests/net/mpls/t_ldp_regen.sh	Tue Mar 31 21:49:26 2020
@@ -1,4 +1,4 @@
-# $NetBSD: t_ldp_regen.sh,v 1.8 2019/05/13 17:55:09 bad Exp $
+# $NetBSD: t_ldp_regen.sh,v 1.9 2020/04/01 01:49:26 christos Exp $
 #
 # Copyright (c) 2013 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,6 +35,7 @@
 # Now: * R4 should install label IMPLNULL for that prefix
 #  * R3 should realloc the target label from IMPLNULL to something else
 
+export PATH=/sbin:/usr/sbin:/bin:/usr/bin
 
 RUMP_SERVER1=unix://./r1
 RUMP_SERVER2=unix://./r2
@@ -68,15 +69,7 @@ newaddr_and_ping() {
 		rump.ping -n -o -w 5 10.0.5.1
 }
 
-create_servers() {
-
-	# allows us to run as normal user
-	ulimit -r 400
-
-	atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER1}
-	atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER2}
-	atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER3}
-	atf_check -s exit:0 rump_server ${RUMP_LIBS} ${RUMP_SERVER4}
+configservers() {
 
 	# LDP HIJACK
 	export RUMPHIJACK=path=/rump,socket=all,sysctl=yes
@@ -153,21 +146,14 @@ wait_ldp_ok() {
 		rump.ping -o -w 60 10.0.4.1
 }
 
-docleanup() {
-
-	RUMP_SERVER=${RUMP_SERVER1} rump.halt
-	RUMP_SERVER=${RUMP_SERVER2} rump.halt
-	RUMP_SERVER=${RUMP_SERVER3} rump.halt
-	RUMP_SERVER=${RUMP_SERVER4} rump.halt
-}
-
 ldp_regen_body() {
 
 if sysctl machdep.cpu_brand 2>/dev/null | grep QEMU >/dev/null 2>&1
 	then
 	atf_skip "unreliable under qemu, skip until PR kern/43997 fixed"
 	fi
-	create_servers
+	dostart
+	configservers
 	wait_ldp_ok
 	newaddr_and_ping
 }

Index: src/tests/net/mpls/t_mpls_fw6.sh

CVS commit: src/tests/net

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 00:49:04 UTC 2020

Modified Files:
src/tests/net: net_common.sh

Log Message:
Enforce a standard path


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/tests/net/net_common.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/net/net_common.sh
diff -u src/tests/net/net_common.sh:1.40 src/tests/net/net_common.sh:1.41
--- src/tests/net/net_common.sh:1.40	Mon Mar 30 09:01:39 2020
+++ src/tests/net/net_common.sh	Tue Mar 31 20:49:04 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: net_common.sh,v 1.40 2020/03/30 13:01:39 christos Exp $
+#	$NetBSD: net_common.sh,v 1.41 2020/04/01 00:49:04 christos Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -29,6 +29,8 @@
 # Common utility functions for tests/net
 #
 
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
 HIJACKING="env LD_PRELOAD=/usr/lib/librumphijack.so \
 RUMPHIJACK=path=/rump,socket=all:nolocal,sysctl=yes"
 ONEDAYISH="(23h5[0-9]m|1d0h0m)[0-9]+s ?"



CVS commit: src/tests/net

2020-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Apr  1 00:49:04 UTC 2020

Modified Files:
src/tests/net: net_common.sh

Log Message:
Enforce a standard path


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/tests/net/net_common.sh

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



CVS commit: src/sys/dev/pci

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Apr  1 00:07:04 UTC 2020

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

Log Message:
switch to use ETHER_F_ALLMULTI flag


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_kse.c

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

Modified files:

Index: src/sys/dev/pci/if_kse.c
diff -u src/sys/dev/pci/if_kse.c:1.51 src/sys/dev/pci/if_kse.c:1.52
--- src/sys/dev/pci/if_kse.c:1.51	Tue Mar 24 04:00:26 2020
+++ src/sys/dev/pci/if_kse.c	Wed Apr  1 00:07:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_kse.c,v 1.51 2020/03/24 04:00:26 nisimura Exp $	*/
+/*	$NetBSD: if_kse.c,v 1.52 2020/04/01 00:07:04 nisimura Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.51 2020/03/24 04:00:26 nisimura Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_kse.c,v 1.52 2020/04/01 00:07:04 nisimura Exp $");
 
 #include 
 #include 
@@ -1096,18 +1096,19 @@ kse_set_filter(struct kse_softc *sc)
 
 	sc->sc_rxc &= ~(RXC_MHTE | RXC_RM | RXC_RA);
 
-	if (ifp->if_flags & IFF_PROMISC) {
-		ifp->if_flags |= IFF_ALLMULTI;
-		goto update;
-	}
-	ifp->if_flags &= ~IFF_ALLMULTI;
-
 	/* clear perfect match filter and prepare mcast hash table */
 	for (i = 0; i < 16; i++)
 		 CSR_WRITE_4(sc, MAAH0 + i*8, 0);
 	crc = mchash[0] = mchash[1] = 0;
 
 	ETHER_LOCK(ec);
+	if (ifp->if_flags & IFF_PROMISC) {
+		ec->ec_flags |= ETHER_F_ALLMULTI;
+		/* run promisc. mode */
+		sc->sc_rxc |= RXC_RA;
+		goto update;
+	}
+	ec->ec_flags &= ~ETHER_F_ALLMULTI;
 	ETHER_FIRST_MULTI(step, ec, enm);
 	i = 0;
 	while (enm != NULL) {
@@ -1120,8 +1121,10 @@ kse_set_filter(struct kse_softc *sc)
 			 * ranges is for IP multicast routing, for which the
 			 * range is big enough to require all bits set.)
 			 */
+			ec->ec_flags |= ETHER_F_ALLMULTI;
 			ETHER_UNLOCK(ec);
-			ifp->if_flags |= IFF_ALLMULTI;
+			/* accept all multicast */
+			sc->sc_rxc |= RXC_RM;
 			goto update;
 		}
 #if KSE_MCASTDEBUG == 1
@@ -1150,14 +1153,8 @@ kse_set_filter(struct kse_softc *sc)
 		sc->sc_rxc |= RXC_MHTE;
 	CSR_WRITE_4(sc, MTR0, mchash[0]);
 	CSR_WRITE_4(sc, MTR1, mchash[1]);
-	return;
-
  update:
 	/* With RA or RM, MHTE/MTR0/MTR1 are never consulted. */
-	if (ifp->if_flags & IFF_PROMISC)
-		sc->sc_rxc |= RXC_RA;
-	else
-		sc->sc_rxc |= RXC_RM;
 	return;
 }
 



CVS commit: src/sys/dev/pci

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Wed Apr  1 00:07:04 UTC 2020

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

Log Message:
switch to use ETHER_F_ALLMULTI flag


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/dev/pci/if_kse.c

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



CVS commit: src/sys/dev/usb

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Mar 31 23:26:32 UTC 2020

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

Log Message:
iron out multicast filter logic and pick better name for its work


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_mos.c

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



CVS commit: src/sys/dev/usb

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Mar 31 23:26:32 UTC 2020

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

Log Message:
iron out multicast filter logic and pick better name for its work


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/usb/if_mos.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_mos.c
diff -u src/sys/dev/usb/if_mos.c:1.5 src/sys/dev/usb/if_mos.c:1.6
--- src/sys/dev/usb/if_mos.c:1.5	Sun Mar 15 23:04:50 2020
+++ src/sys/dev/usb/if_mos.c	Tue Mar 31 23:26:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mos.c,v 1.5 2020/03/15 23:04:50 thorpej Exp $	*/
+/*	$NetBSD: if_mos.c,v 1.6 2020/03/31 23:26:32 nisimura Exp $	*/
 /*	$OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $	*/
 
 /*
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.5 2020/03/15 23:04:50 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.6 2020/03/31 23:26:32 nisimura Exp $");
 
 #include 
 
@@ -454,14 +454,14 @@ mos_uno_mii_statchg(struct ifnet *ifp)
 }
 
 static void
-mos_setiff_locked(struct usbnet *un)
+mos_rcvfilt_locked(struct usbnet *un)
 {
 	struct ifnet		*ifp = usbnet_ifp(un);
 	struct ethercom		*ec = usbnet_ec(un);
 	struct ether_multi	*enm;
 	struct ether_multistep	step;
-	u_int32_t		h = 0;
-	u_int8_t		rxmode, hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+	u_int32_t h = 0;
+	u_int8_t rxmode, mchash[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
 
 	if (usbnet_isdying(un))
 		return;
@@ -471,40 +471,39 @@ mos_setiff_locked(struct usbnet *un)
 
 	ETHER_LOCK(ec);
 	if (ifp->if_flags & IFF_PROMISC) {
-allmulti:
 		ec->ec_flags |= ETHER_F_ALLMULTI;
-		rxmode |= MOS_CTL_ALLMULTI;
-		if (ifp->if_flags & IFF_PROMISC)
-			rxmode |= MOS_CTL_RX_PROMISC;
-	} else {
-		/* now program new ones */
-		ec->ec_flags &= ~ETHER_F_ALLMULTI;
-
-		ETHER_FIRST_MULTI(step, ec, enm);
-		while (enm != NULL) {
-			if (memcmp(enm->enm_addrlo, enm->enm_addrhi,
-			ETHER_ADDR_LEN)) {
-memset(hashtbl, 0, sizeof(hashtbl));
-goto allmulti;
-			}
-			h = ether_crc32_be(enm->enm_addrlo,
-			ETHER_ADDR_LEN) >> 26;
-			hashtbl[h / 8] |= 1 << (h % 8);
-
-			ETHER_NEXT_MULTI(step, enm);
+		ETHER_UNLOCK(ec);
+		/* run promisc. mode */
+		rxmode |= MOS_CTL_ALLMULTI; /* ??? */
+		rxmode |= MOS_CTL_RX_PROMISC;
+		goto update;
+	}
+	ec->ec_flags &= ~ETHER_F_ALLMULTI;
+	ETHER_FIRST_MULTI(step, ec, enm);
+	while (enm != NULL) {
+		if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) {
+			ec->ec_flags |= ETHER_F_ALLMULTI;
+			ETHER_UNLOCK(ec);
+			memset(mchash, 0, sizeof(mchash)); /* correct ??? */
+			/* accept all mulicast frame */
+			rxmode |= MOS_CTL_ALLMULTI;
+			goto update;
 		}
+		h = ether_crc32_be(enm->enm_addrlo, ETHER_ADDR_LEN);
+		/* 3(31:29) and 3(28:26) sampling to have uint8_t[8] */
+		mchash[h >> 29] |= 1 << ((h >> 26) % 8);
+		ETHER_NEXT_MULTI(step, enm);
 	}
 	ETHER_UNLOCK(ec);
-
+	/* MOS receive filter is always on */
+ update:
 	/* 
 	 * The datasheet claims broadcast frames were always accepted
 	 * regardless of filter settings. But the hardware seems to
 	 * filter broadcast frames, so pass them explicitly.
 	 */
-	h = ether_crc32_be(etherbroadcastaddr, ETHER_ADDR_LEN) >> 26;
-	hashtbl[h / 8] |= 1 << (h % 8);
-
-	mos_write_mcast(un, hashtbl);
+	mchash[7] |= 0x80;
+	mos_write_mcast(un, mchash);
 	mos_reg_write_1(un, MOS_CTL, rxmode);
 }
 
@@ -745,7 +744,7 @@ mos_init_locked(struct ifnet *ifp)
 	mos_reg_write_1(un, MOS_IPG1, ipgs[1]);
 
 	/* Program promiscuous mode and multicast filters. */
-	mos_setiff_locked(un);
+	mos_rcvfilt_locked(un);
 
 	/* Enable receiver and transmitter, bridge controls speed/duplex mode */
 	rxmode = mos_reg_read_1(un, MOS_CTL);
@@ -781,7 +780,7 @@ mos_uno_ioctl(struct ifnet *ifp, u_long 
 	switch (cmd) {
 	case SIOCADDMULTI:
 	case SIOCDELMULTI:
-		mos_setiff_locked(un);
+		mos_rcvfilt_locked(un);
 		break;
 	default:
 		break;



CVS commit: src/sys/dev/pckbport

2020-03-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Mar 31 19:08:19 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Maintain the left/right buttons when up/down are remapped

Reported on current-users by MandacarĂº Cascavel


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pckbport/synaptics.c

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



CVS commit: src/sys/dev/pckbport

2020-03-31 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Tue Mar 31 19:08:19 UTC 2020

Modified Files:
src/sys/dev/pckbport: synaptics.c

Log Message:
synaptics: Maintain the left/right buttons when up/down are remapped

Reported on current-users by MandacarĂº Cascavel


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/dev/pckbport/synaptics.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/pckbport/synaptics.c
diff -u src/sys/dev/pckbport/synaptics.c:1.63 src/sys/dev/pckbport/synaptics.c:1.64
--- src/sys/dev/pckbport/synaptics.c:1.63	Fri Mar 27 11:10:07 2020
+++ src/sys/dev/pckbport/synaptics.c	Tue Mar 31 19:08:19 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $	*/
+/*	$NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $	*/
 
 /*
  * Copyright (c) 2005, Steve C. Woodford
@@ -48,7 +48,7 @@
 #include "opt_pms.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.63 2020/03/27 11:10:07 nia Exp $");
+__KERNEL_RCSID(0, "$NetBSD: synaptics.c,v 1.64 2020/03/31 19:08:19 nia Exp $");
 
 #include 
 #include 
@@ -1110,8 +1110,8 @@ pms_synaptics_parse(struct pms_softc *ps
 			break;
 		case 3:
 			/* Do left/right button emulation using up/down buttons */
-			sp.sp_left = sp.sp_up;
-			sp.sp_right = sp.sp_down;
+			sp.sp_left = sp.sp_left | sp.sp_up;
+			sp.sp_right = sp.sp_right | sp.sp_down;
 			sp.sp_up = sp.sp_down = 0;
 			break;
 		default:



CVS commit: src/include

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Mar 31 16:50:31 UTC 2020

Modified Files:
src/include: unistd.h

Log Message:
Add getsid(2) to the XOPEN namespace (again)


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/include/unistd.h

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



CVS commit: src/include

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Mar 31 16:50:31 UTC 2020

Modified Files:
src/include: unistd.h

Log Message:
Add getsid(2) to the XOPEN namespace (again)


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.156 src/include/unistd.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/unistd.h
diff -u src/include/unistd.h:1.155 src/include/unistd.h:1.156
--- src/include/unistd.h:1.155	Tue Mar 31 16:49:06 2020
+++ src/include/unistd.h	Tue Mar 31 16:50:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.155 2020/03/31 16:49:06 kamil Exp $	*/
+/*	$NetBSD: unistd.h,v 1.156 2020/03/31 16:50:31 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -236,7 +236,8 @@ __aconst char *crypt(const char *, const
 int	 encrypt(char *, int);
 char	*getpass(const char *);
 #endif
-#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
+#if defined(_XOPEN_SOURCE) || (_POSIX_C_SOURCE - 0) >= 200809L || \
+defined(_NETBSD_SOURCE)
 pid_t	 getsid(pid_t);
 #endif
 



CVS commit: src/include

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Mar 31 16:49:06 UTC 2020

Modified Files:
src/include: unistd.h

Log Message:
Expose getsid(2) to POSIX >= 2008


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/include/unistd.h

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



CVS commit: src/include

2020-03-31 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Mar 31 16:49:06 UTC 2020

Modified Files:
src/include: unistd.h

Log Message:
Expose getsid(2) to POSIX >= 2008


To generate a diff of this commit:
cvs rdiff -u -r1.154 -r1.155 src/include/unistd.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/unistd.h
diff -u src/include/unistd.h:1.154 src/include/unistd.h:1.155
--- src/include/unistd.h:1.154	Sun Sep 15 23:41:41 2019
+++ src/include/unistd.h	Tue Mar 31 16:49:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: unistd.h,v 1.154 2019/09/15 23:41:41 christos Exp $	*/
+/*	$NetBSD: unistd.h,v 1.155 2020/03/31 16:49:06 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -235,6 +235,8 @@ int	 nice(int);
 __aconst char *crypt(const char *, const char *);
 int	 encrypt(char *, int);
 char	*getpass(const char *);
+#endif
+#if (_POSIX_C_SOURCE - 0) >= 200809L || defined(_NETBSD_SOURCE)
 pid_t	 getsid(pid_t);
 #endif
 



CVS commit: src/sys/dev/usb

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:34:25 UTC 2020

Modified Files:
src/sys/dev/usb: vhci.c vhci.h

Log Message:
Publish the request/response structures too.


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

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



CVS commit: src/sys/dev/usb

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:34:25 UTC 2020

Modified Files:
src/sys/dev/usb: vhci.c vhci.h

Log Message:
Publish the request/response structures too.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/vhci.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/vhci.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/usb/vhci.c
diff -u src/sys/dev/usb/vhci.c:1.15 src/sys/dev/usb/vhci.c:1.16
--- src/sys/dev/usb/vhci.c:1.15	Tue Mar 31 16:28:28 2020
+++ src/sys/dev/usb/vhci.c	Tue Mar 31 16:34:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $ */
+/*	$NetBSD: vhci.c,v 1.16 2020/03/31 16:34:25 maxv Exp $ */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.16 2020/03/31 16:34:25 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -174,19 +174,6 @@ static const struct usbd_pipe_methods vh
  * ++
  */
 
-typedef struct {
-	int type;
-#define VHCI_REQ_CTRL	0
-
-	union {
-		usb_device_request_t ctrl;
-	} u;
-} vhci_request_t;
-
-typedef struct {
-	size_t size;
-} vhci_response_t;
-
 struct vhci_xfer;
 
 typedef struct vhci_packet {

Index: src/sys/dev/usb/vhci.h
diff -u src/sys/dev/usb/vhci.h:1.1 src/sys/dev/usb/vhci.h:1.2
--- src/sys/dev/usb/vhci.h:1.1	Tue Mar 31 16:28:28 2020
+++ src/sys/dev/usb/vhci.h	Tue Mar 31 16:34:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vhci.h,v 1.1 2020/03/31 16:28:28 maxv Exp $ */
+/*	$NetBSD: vhci.h,v 1.2 2020/03/31 16:34:25 maxv Exp $ */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -29,6 +29,19 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+typedef struct {
+	int type;
+#define VHCI_REQ_CTRL	0
+
+	union {
+		usb_device_request_t ctrl;
+	} u;
+} vhci_request_t;
+
+typedef struct {
+	size_t size;
+} vhci_response_t;
+
 struct vhci_ioc_get_info {
 	/* General. */
 	size_t nports;



CVS commit: src

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:28:29 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/dev/usb: Makefile vhci.c
Added Files:
src/sys/dev/usb: vhci.h

Log Message:
Put the ioctl definitions in a header, and install it.


To generate a diff of this commit:
cvs rdiff -u -r1.2316 -r1.2317 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/vhci.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/vhci.h

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



CVS commit: src

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:28:29 UTC 2020

Modified Files:
src/distrib/sets/lists/comp: mi
src/sys/dev/usb: Makefile vhci.c
Added Files:
src/sys/dev/usb: vhci.h

Log Message:
Put the ioctl definitions in a header, and install it.


To generate a diff of this commit:
cvs rdiff -u -r1.2316 -r1.2317 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/Makefile
cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/vhci.c
cvs rdiff -u -r0 -r1.1 src/sys/dev/usb/vhci.h

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/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2316 src/distrib/sets/lists/comp/mi:1.2317
--- src/distrib/sets/lists/comp/mi:1.2316	Wed Mar 25 18:45:42 2020
+++ src/distrib/sets/lists/comp/mi	Tue Mar 31 16:28:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2316 2020/03/25 18:45:42 kre Exp $
+#	$NetBSD: mi,v 1.2317 2020/03/31 16:28:28 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -762,6 +762,7 @@
 ./usr/include/dev/usb/usbdevs.h			comp-obsolete		obsolete
 ./usr/include/dev/usb/usbhid.h			comp-c-include
 ./usr/include/dev/usb/utoppy.h			comp-c-include
+./usr/include/dev/usb/vhci.h			comp-c-include
 ./usr/include/dev/vinum/request.h		comp-obsolete		obsolete
 ./usr/include/dev/vinum/statetexts.h		comp-obsolete		obsolete
 ./usr/include/dev/vinum/vinumext.h		comp-obsolete		obsolete

Index: src/sys/dev/usb/Makefile
diff -u src/sys/dev/usb/Makefile:1.11 src/sys/dev/usb/Makefile:1.12
--- src/sys/dev/usb/Makefile:1.11	Wed Jan 29 21:52:16 2020
+++ src/sys/dev/usb/Makefile	Tue Mar 31 16:28:28 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2020/01/29 21:52:16 mlelstv Exp $
+#	$NetBSD: Makefile,v 1.12 2020/03/31 16:28:28 maxv Exp $
 
 # use 'make -f Makefile.usbdevs' to make usbdevs.h and usbdevs_data.h
 # _after_ you committed usbdevs. See comment in Makefile.usbdevs
@@ -6,6 +6,6 @@
 INCSDIR= /usr/include/dev/usb
 
 # Only install includes which are used by userland
-INCS=	if_umbreg.h mbim.h ukyopon.h usb.h usbhid.h utoppy.h
+INCS=	if_umbreg.h mbim.h ukyopon.h usb.h usbhid.h utoppy.h vhci.h
 
 .include 

Index: src/sys/dev/usb/vhci.c
diff -u src/sys/dev/usb/vhci.c:1.14 src/sys/dev/usb/vhci.c:1.15
--- src/sys/dev/usb/vhci.c:1.14	Tue Mar 31 16:17:32 2020
+++ src/sys/dev/usb/vhci.c	Tue Mar 31 16:28:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $ */
+/*	$NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $ */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.15 2020/03/31 16:28:28 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -61,6 +61,7 @@ __KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.1
 #include 
 
 #include 
+#include 
 
 #ifdef VHCI_DEBUG
 #define DPRINTF(fmt, ...)	printf(fmt, __VA_ARGS__)
@@ -816,32 +817,6 @@ vhci_root_intr_done(struct usbd_xfer *xf
 
 /* -- */
 
-struct vhci_ioc_get_info {
-	/* General. */
-	size_t nports;
-
-	/* Current port. */
-	u_int port;
-	int status;
-
-	/* Current addr. */
-	uint8_t addr;
-};
-
-struct vhci_ioc_set_port {
-	u_int port;
-};
-
-struct vhci_ioc_set_addr {
-	uint8_t addr;
-};
-
-#define VHCI_IOC_GET_INFO	_IOR('V', 0, struct vhci_ioc_get_info)
-#define VHCI_IOC_SET_PORT	_IOW('V', 1, struct vhci_ioc_set_port)
-#define VHCI_IOC_SET_ADDR	_IOW('V', 2, struct vhci_ioc_set_addr)
-#define VHCI_IOC_USB_ATTACH	_IO ('V', 10)
-#define VHCI_IOC_USB_DETACH	_IO ('V', 11)
-
 static int
 vhci_usb_attach(vhci_fd_t *vfd)
 {

Added files:

Index: src/sys/dev/usb/vhci.h
diff -u /dev/null src/sys/dev/usb/vhci.h:1.1
--- /dev/null	Tue Mar 31 16:28:29 2020
+++ src/sys/dev/usb/vhci.h	Tue Mar 31 16:28:28 2020
@@ -0,0 +1,56 @@
+/*	$NetBSD: vhci.h,v 1.1 2020/03/31 16:28:28 maxv Exp $ */
+
+/*
+ * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Maxime Villard.
+ *
+ * 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 

CVS commit: src/sys/dev/usb

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:17:32 UTC 2020

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

Log Message:
Allow short transfers. We introduce a third packet, in the U->H list, that
contains a vhci_response_t, which indicates the size.


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

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



CVS commit: src/sys/dev/usb

2020-03-31 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Tue Mar 31 16:17:32 UTC 2020

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

Log Message:
Allow short transfers. We introduce a third packet, in the U->H list, that
contains a vhci_response_t, which indicates the size.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/dev/usb/vhci.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/vhci.c
diff -u src/sys/dev/usb/vhci.c:1.13 src/sys/dev/usb/vhci.c:1.14
--- src/sys/dev/usb/vhci.c:1.13	Sun Mar 29 09:46:14 2020
+++ src/sys/dev/usb/vhci.c	Tue Mar 31 16:17:32 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vhci.c,v 1.13 2020/03/29 09:46:14 maxv Exp $ */
+/*	$NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $ */
 
 /*
  * Copyright (c) 2019-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.13 2020/03/29 09:46:14 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vhci.c,v 1.14 2020/03/31 16:17:32 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -182,6 +182,10 @@ typedef struct {
 	} u;
 } vhci_request_t;
 
+typedef struct {
+	size_t size;
+} vhci_response_t;
+
 struct vhci_xfer;
 
 typedef struct vhci_packet {
@@ -192,6 +196,13 @@ typedef struct vhci_packet {
 	bool utoh;
 	uint8_t addr;
 
+	/* Type. */
+	struct {
+		bool req:1;
+		bool res:1;
+		bool dat:1;
+	} type;
+
 	/* Exposed for FD operations. */
 	uint8_t *buf;
 	size_t size;
@@ -229,6 +240,7 @@ typedef struct vhci_xfer {
 
 	/* Header storage. */
 	vhci_request_t reqbuf;
+	vhci_response_t resbuf;
 
 	/* Used for G/C. */
 	TAILQ_ENTRY(vhci_xfer) freelist;
@@ -276,8 +288,8 @@ vhci_pkt_ctrl_create(vhci_port_t *port, 
 uint8_t addr)
 {
 	vhci_xfer_t *vxfer = (vhci_xfer_t *)xfer;
-	vhci_packet_list_t *reqlist, *datlist;
-	vhci_packet_t *req, *dat = NULL;
+	vhci_packet_list_t *reqlist, *reslist, *datlist = NULL;
+	vhci_packet_t *req, *res = NULL, *dat = NULL;
 	size_t npkts = 0;
 
 	/* Request packet. */
@@ -286,6 +298,7 @@ vhci_pkt_ctrl_create(vhci_port_t *port, 
 	req->vxfer = vxfer;
 	req->utoh = false;
 	req->addr = addr;
+	req->type.req = true;
 	req->buf = (uint8_t *)>reqbuf;
 	req->size = sizeof(vxfer->reqbuf);
 	req->cursor = 0;
@@ -297,6 +310,20 @@ vhci_pkt_ctrl_create(vhci_port_t *port, 
 	memcpy(>reqbuf.u.ctrl, >ux_request,
 	sizeof(xfer->ux_request));
 
+	/* Response packet. */
+	if (utoh && (xfer->ux_length > 0)) {
+		reslist = >endpoints[addr].usb_to_host;
+		res = kmem_zalloc(sizeof(*res), KM_SLEEP);
+		res->vxfer = vxfer;
+		res->utoh = true;
+		res->addr = addr;
+		res->type.res = true;
+		res->buf = (uint8_t *)>resbuf;
+		res->size = sizeof(vxfer->resbuf);
+		res->cursor = 0;
+		npkts++;
+	}
+
 	/* Data packet. */
 	if (xfer->ux_length > 0) {
 		if (utoh) {
@@ -308,6 +335,7 @@ vhci_pkt_ctrl_create(vhci_port_t *port, 
 		dat->vxfer = vxfer;
 		dat->utoh = utoh;
 		dat->addr = addr;
+		dat->type.dat = true;
 		dat->buf = xfer->ux_buf;
 		dat->size = xfer->ux_length;
 		dat->cursor = 0;
@@ -319,12 +347,16 @@ vhci_pkt_ctrl_create(vhci_port_t *port, 
 	vxfer->npkts = npkts;
 	TAILQ_INIT(>pkts);
 	TAILQ_INSERT_TAIL(>pkts, req, xferlist);
+	if (res != NULL)
+		TAILQ_INSERT_TAIL(>pkts, res, xferlist);
 	if (dat != NULL)
 		TAILQ_INSERT_TAIL(>pkts, dat, xferlist);
 
 	/* Insert in the port. */
 	KASSERT(mutex_owned(>lock));
 	TAILQ_INSERT_TAIL(reqlist, req, portlist);
+	if (res != NULL)
+		TAILQ_INSERT_TAIL(reslist, res, portlist);
 	if (dat != NULL)
 		TAILQ_INSERT_TAIL(datlist, dat, portlist);
 }
@@ -1084,6 +1116,7 @@ vhci_fd_read(struct file *fp, off_t *off
 	TAILQ_FOREACH_SAFE(pkt, pktlist, portlist, nxt) {
 		vxfer = pkt->vxfer;
 		buf = pkt->buf + pkt->cursor;
+
 		KASSERT(pkt->size >= pkt->cursor);
 		size = uimin(uio->uio_resid, pkt->size - pkt->cursor);
 
@@ -1138,7 +1171,7 @@ vhci_fd_write(struct file *fp, off_t *of
 	vhci_port_t *port;
 	int error = 0;
 	uint8_t *buf;
-	size_t size;
+	size_t pktsize, size;
 
 	if (uio->uio_resid == 0)
 		return 0;
@@ -1157,8 +1190,13 @@ vhci_fd_write(struct file *fp, off_t *of
 	TAILQ_FOREACH_SAFE(pkt, pktlist, portlist, nxt) {
 		vxfer = pkt->vxfer;
 		buf = pkt->buf + pkt->cursor;
-		KASSERT(pkt->size >= pkt->cursor);
-		size = uimin(uio->uio_resid, pkt->size - pkt->cursor);
+
+		pktsize = pkt->size;
+		if (pkt->type.dat)
+			pktsize = ulmin(vxfer->resbuf.size, pktsize);
+
+		KASSERT(pktsize >= pkt->cursor);
+		size = uimin(uio->uio_resid, pktsize - pkt->cursor);
 
 		KASSERT(vxfer->xfer.ux_status == USBD_IN_PROGRESS);
 
@@ -1170,7 +1208,7 @@ vhci_fd_write(struct file *fp, off_t *of
 
 		pkt->cursor += size;
 
-		if (pkt->cursor == pkt->size) {
+		if (pkt->cursor == pktsize) {
 			vhci_pkt_destroy(sc, pkt);
 			if (vxfer->npkts == 0) {
 TAILQ_INSERT_TAIL(, vxfer, freelist);
@@ -1189,7 +1227,7 @@ out:
 		TAILQ_REMOVE(, vxfer, freelist);
 
 		mutex_enter(>sc_lock);
-		xfer->ux_actlen = xfer->ux_length;
+		

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

2020-03-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar 31 14:39:44 UTC 2020

Added Files:
src/sys/arch/arm/broadcom: bcm2835_bscvar.h

Log Message:
Add bcm2835_bscvar.h


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_bscvar.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/arch/arm/broadcom/bcm2835_bscvar.h
diff -u /dev/null src/sys/arch/arm/broadcom/bcm2835_bscvar.h:1.1
--- /dev/null	Tue Mar 31 14:39:44 2020
+++ src/sys/arch/arm/broadcom/bcm2835_bscvar.h	Tue Mar 31 14:39:44 2020
@@ -0,0 +1,100 @@
+/*	$NetBSD: bcm2835_bscvar.h,v 1.1 2020/03/31 14:39:44 jmcneill Exp $	*/
+
+/*
+ * Copyright (c) 2019 Jason R. Thorpe
+ * Copyright (c) 2012 Jonathan A. Kollasch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT HOLDER 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 _BCM2835_BSCVAR_H
+#define _BCM2835_BSCVAR_H
+
+#include 
+
+typedef enum {
+	BSC_EXEC_STATE_IDLE		= 0,
+	BSC_EXEC_STATE_SEND_ADDR	= 1,
+	BSC_EXEC_STATE_SEND_CMD		= 2,
+	BSC_EXEC_STATE_SEND_DATA	= 3,
+	BSC_EXEC_STATE_RECV_DATA	= 4,
+	BSC_EXEC_STATE_DONE		= 5,
+	BSC_EXEC_STATE_ERROR		= 6,
+} bsc_exec_state_t;
+
+#define	BSC_EXEC_STATE_SENDING(sc)	\
+	((sc)->sc_exec_state >= BSC_EXEC_STATE_SEND_ADDR && \
+	(sc)->sc_exec_state <= BSC_EXEC_STATE_SEND_DATA)
+
+#define	BSC_EXEC_STATE_RECEIVING(sc)	\
+	((sc)->sc_exec_state == BSC_EXEC_STATE_RECV_DATA)
+
+struct bsciic_softc {
+	device_t sc_dev;
+	bus_space_tag_t sc_iot;
+	bus_space_handle_t sc_ioh;
+	struct i2c_controller sc_i2c;
+	void *sc_inth;
+
+	struct clk *sc_clk;
+	u_int sc_frequency;
+	u_int sc_clkrate;
+
+	kmutex_t sc_intr_lock;
+	kcondvar_t sc_intr_wait;
+
+	struct {
+		i2c_op_t op;
+		i2c_addr_t addr;
+		const void *cmdbuf;
+		size_t cmdlen;
+		void *databuf;
+		size_t datalen;
+		int flags;
+	} sc_exec;
+
+	/*
+	 * Everything below here protected by the i2c controller lock
+	 * /and/ sc_intr_lock (if we're using interrupts).
+	 */
+
+	bsc_exec_state_t sc_exec_state;
+
+	uint8_t *sc_buf;
+	size_t sc_bufpos;
+	size_t sc_buflen;
+
+	uint32_t sc_c_bits;
+	bool sc_expecting_interrupt;
+};
+
+void bsciic_attach(struct bsciic_softc *);
+
+int  bsciic_acquire_bus(void *, int);
+void bsciic_release_bus(void *, int);
+int  bsciic_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
+		 void *, size_t, int);
+
+int bsciic_intr(void *);
+
+#endif /* !_BCM2835_BSCVAR_H */



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

2020-03-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar 31 14:39:44 UTC 2020

Added Files:
src/sys/arch/arm/broadcom: bcm2835_bscvar.h

Log Message:
Add bcm2835_bscvar.h


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_bscvar.h

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



CVS commit: src/doc

2020-03-31 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Mar 31 13:53:44 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
New OpenSSL


To generate a diff of this commit:
cvs rdiff -u -r1.1704 -r1.1705 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.1704 src/doc/3RDPARTY:1.1705
--- src/doc/3RDPARTY:1.1704	Sat Mar 28 19:50:40 2020
+++ src/doc/3RDPARTY	Tue Mar 31 13:53:44 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1704 2020/03/28 19:50:40 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1705 2020/03/31 13:53:44 sevan Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1088,11 +1088,11 @@ markus is very cooperative about it):
 
 Package:	OpenSSL
 Version:	1.0.2o/1.1.1e
-Current Vers:	1.0.2t/1.1.1e
+Current Vers:	1.0.2t/1.1.1f
 Maintainer:	The OpenSSL Project
 Archive Site:	ftp://ftp.openssl.org/source/
 Home Page:	http://www.openssl.org/
-Date:		2020-03-21
+Date:		2020-03-31
 Mailing List:	openssl-annou...@openssl.org
 Responsible:	christos, mjf, tls, riastradh, spz
 License:	OpenSSL and SSLeay license (both BSD-like)



CVS commit: src/doc

2020-03-31 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Tue Mar 31 13:53:44 UTC 2020

Modified Files:
src/doc: 3RDPARTY

Log Message:
New OpenSSL


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

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



CVS commit: src/usr.bin/infocmp

2020-03-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Mar 31 12:44:15 UTC 2020

Modified Files:
src/usr.bin/infocmp: infocmp.c

Log Message:
infocmp: don't crash when a terminfo description does not have an alias


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

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



CVS commit: src/usr.bin/infocmp

2020-03-31 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Mar 31 12:44:15 UTC 2020

Modified Files:
src/usr.bin/infocmp: infocmp.c

Log Message:
infocmp: don't crash when a terminfo description does not have an alias


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/infocmp/infocmp.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/infocmp/infocmp.c
diff -u src/usr.bin/infocmp/infocmp.c:1.16 src/usr.bin/infocmp/infocmp.c:1.17
--- src/usr.bin/infocmp/infocmp.c:1.16	Mon Mar 30 00:22:18 2020
+++ src/usr.bin/infocmp/infocmp.c	Tue Mar 31 12:44:15 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: infocmp.c,v 1.16 2020/03/30 00:22:18 roy Exp $ */
+/* $NetBSD: infocmp.c,v 1.17 2020/03/31 12:44:15 roy Exp $ */
 
 /*
  * Copyright (c) 2009, 2010, 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: infocmp.c,v 1.16 2020/03/30 00:22:18 roy Exp $");
+__RCSID("$NetBSD: infocmp.c,v 1.17 2020/03/31 12:44:15 roy Exp $");
 
 #include 
 
@@ -715,8 +715,6 @@ main(int argc, char **argv)
 		use_terms(t, argc - optind, argv + optind);
 
 	if ((optind + 1 != argc && nflag == 0) || uflag != 0) {
-		char *alias, *aliascpy, *delim;
-
 		if (uflag == 0)
 			printf("# Reconstructed from %s\n",
 			 _ti_database == NULL ?
@@ -726,24 +724,28 @@ main(int argc, char **argv)
 		if (term != NULL)
 			*term = '\0';
 		printf("%s", t->name);
-		alias = aliascpy = estrdup(t->_alias);
-		while (alias != NULL && *alias != '\0') {
-			putchar('|');
-			delim = strchr(alias, TERMINFO_VDELIM);
-			if (delim != NULL)
-*delim++ = '\0';
-			printf("%s", alias);
-			if (delim != NULL) {
-while (*delim != '\0' && *delim != '|')
-	delim++;
-if (*delim == '\0')
+		if (t->_alias != NULL) {
+			char *alias, *aliascpy, *delim;
+
+			alias = aliascpy = estrdup(t->_alias);
+			while (alias != NULL && *alias != '\0') {
+putchar('|');
+delim = strchr(alias, TERMINFO_VDELIM);
+if (delim != NULL)
+	*delim++ = '\0';
+printf("%s", alias);
+if (delim != NULL) {
+	while (*delim != '\0' && *delim != '|')
+		delim++;
+	if (*delim == '\0')
+		alias = NULL;
+	else
+		alias = delim + 1;
+} else
 	alias = NULL;
-else
-	alias = delim + 1;
-			} else
-alias = NULL;
+			}
+			free(aliascpy);
 		}
-		free(aliascpy);
 		if (t->desc != NULL && *t->desc != '\0')
 			printf("|%s", t->desc);
 		printf(",\n");



CVS commit: src/sys/arch

2020-03-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar 31 12:23:17 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c files.bcm2835
src/sys/arch/evbarm/conf: GENERIC64
Added Files:
src/sys/arch/arm/broadcom: bcm2835_bsc_acpi.c bcm2835_bsc_fdt.c

Log Message:
Add ACPI support.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm2835_bsc.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_bsc_acpi.c \
src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/evbarm/conf/GENERIC64

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



CVS commit: src/sys/arch

2020-03-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Mar 31 12:23:17 UTC 2020

Modified Files:
src/sys/arch/arm/broadcom: bcm2835_bsc.c files.bcm2835
src/sys/arch/evbarm/conf: GENERIC64
Added Files:
src/sys/arch/arm/broadcom: bcm2835_bsc_acpi.c bcm2835_bsc_fdt.c

Log Message:
Add ACPI support.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/broadcom/bcm2835_bsc.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/broadcom/bcm2835_bsc_acpi.c \
src/sys/arch/arm/broadcom/bcm2835_bsc_fdt.c
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/arm/broadcom/files.bcm2835
cvs rdiff -u -r1.148 -r1.149 src/sys/arch/evbarm/conf/GENERIC64

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/broadcom/bcm2835_bsc.c
diff -u src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.14 src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.15
--- src/sys/arch/arm/broadcom/bcm2835_bsc.c:1.14	Sun Dec 22 23:24:56 2019
+++ src/sys/arch/arm/broadcom/bcm2835_bsc.c	Tue Mar 31 12:23:17 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm2835_bsc.c,v 1.14 2019/12/22 23:24:56 thorpej Exp $	*/
+/*	$NetBSD: bcm2835_bsc.c,v 1.15 2020/03/31 12:23:17 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2019 Jason R. Thorpe
@@ -28,7 +28,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.14 2019/12/22 23:24:56 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.15 2020/03/31 12:23:17 jmcneill Exp $");
 
 #include 
 #include 
@@ -42,64 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.
 
 #include 
 #include 
-
-#include 
-
-typedef enum {
-	BSC_EXEC_STATE_IDLE		= 0,
-	BSC_EXEC_STATE_SEND_ADDR	= 1,
-	BSC_EXEC_STATE_SEND_CMD		= 2,
-	BSC_EXEC_STATE_SEND_DATA	= 3,
-	BSC_EXEC_STATE_RECV_DATA	= 4,
-	BSC_EXEC_STATE_DONE		= 5,
-	BSC_EXEC_STATE_ERROR		= 6,
-} bsc_exec_state_t;
-
-#define	BSC_EXEC_STATE_SENDING(sc)	\
-	((sc)->sc_exec_state >= BSC_EXEC_STATE_SEND_ADDR && \
-	 (sc)->sc_exec_state <= BSC_EXEC_STATE_SEND_DATA)
-
-#define	BSC_EXEC_STATE_RECEIVING(sc)	\
-	((sc)->sc_exec_state == BSC_EXEC_STATE_RECV_DATA)
-
-struct bsciic_softc {
-	device_t sc_dev;
-	bus_space_tag_t sc_iot;
-	bus_space_handle_t sc_ioh;
-	struct i2c_controller sc_i2c;
-	void *sc_inth;
-
-	struct clk *sc_clk;
-	u_int sc_frequency;
-	u_int sc_clkrate;
-
-	kmutex_t sc_intr_lock;
-	kcondvar_t sc_intr_wait;
-
-	struct {
-		i2c_op_t op;
-		i2c_addr_t addr;
-		const void *cmdbuf;
-		size_t cmdlen;
-		void *databuf;
-		size_t datalen;
-		int flags;
-	} sc_exec;
-
-	/*
-	 * Everything below here protected by the i2c controller lock
-	 * /and/ sc_intr_lock (if we're using interrupts).
-	 */
-
-	bsc_exec_state_t sc_exec_state;
-
-	uint8_t *sc_buf;
-	size_t sc_bufpos;
-	size_t sc_buflen;
-
-	uint32_t sc_c_bits;
-	bool sc_expecting_interrupt;
-};
+#include 
 
 static void	bsciic_exec_func_idle(struct bsciic_softc * const);
 static void	bsciic_exec_func_send_addr(struct bsciic_softc * const);
@@ -143,84 +86,13 @@ const struct {
 	},
 };
 
-static int bsciic_match(device_t, cfdata_t, void *);
-static void bsciic_attach(device_t, device_t, void *);
-
-static int  bsciic_acquire_bus(void *, int);
-static void bsciic_release_bus(void *, int);
-static int  bsciic_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
-			void *, size_t, int);
-
-static int bsciic_intr(void *);
-
 int	bsciic_debug = 0;
 
-CFATTACH_DECL_NEW(bsciic, sizeof(struct bsciic_softc),
-bsciic_match, bsciic_attach, NULL, NULL);
-
-static int
-bsciic_match(device_t parent, cfdata_t match, void *aux)
+void
+bsciic_attach(struct bsciic_softc *sc)
 {
-	const char * const compatible[] = { "brcm,bcm2835-i2c", NULL };
-	struct fdt_attach_args * const faa = aux;
-
-	return of_match_compatible(faa->faa_phandle, compatible);
-}
-
-static void
-bsciic_attach(device_t parent, device_t self, void *aux)
-{
-	struct bsciic_softc * const sc = device_private(self);
-	struct fdt_attach_args * const faa = aux;
-	const int phandle = faa->faa_phandle;
-	prop_dictionary_t prop = device_properties(self);
-	bool disable = false;
-
-	bus_addr_t addr;
-	bus_size_t size;
-
-	sc->sc_dev = self;
-	sc->sc_iot = faa->faa_bst;
-
-	int error = fdtbus_get_reg(phandle, 0, , );
-	if (error) {
-		aprint_error(": unable to get device registers\n");
-		return;
-	}
-
-	prop_dictionary_get_bool(prop, "disable", );
-	if (disable) {
-		aprint_naive(": disabled\n");
-		aprint_normal(": disabled\n");
-		return;
-	}
-
-	/* Enable clock */
-	sc->sc_clk = fdtbus_clock_get_index(phandle, 0);
-	if (sc->sc_clk == NULL) {
-		aprint_error(": couldn't acquire clock\n");
-		return;
-	}
-
-	if (clk_enable(sc->sc_clk) != 0) {
-		aprint_error(": failed to enable clock\n");
-		return;
-	}
-
-	sc->sc_frequency = clk_get_rate(sc->sc_clk);
-
-	if (of_getprop_uint32(phandle, "clock-frequency",
-	>sc_clkrate) != 0) {
-		sc->sc_clkrate = 10;
-	}
-
-	if (bus_space_map(sc->sc_iot, addr, size, 0, >sc_ioh)) {
-		aprint_error(": unable to map 

CVS commit: src/sys/dev/ic

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Mar 31 07:50:43 UTC 2020

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

Log Message:
fix negated loop condition. make break when reset.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/dm9000.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/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.25 src/sys/dev/ic/dm9000.c:1.26
--- src/sys/dev/ic/dm9000.c:1.25	Tue Mar 31 02:47:34 2020
+++ src/sys/dev/ic/dm9000.c	Tue Mar 31 07:50:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dm9000.c,v 1.25 2020/03/31 02:47:34 nisimura Exp $	*/
+/*	$NetBSD: dm9000.c,v 1.26 2020/03/31 07:50:42 nisimura Exp $	*/
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -484,7 +484,7 @@ mii_statchg(struct ifnet *ifp)
 	nsr = dme_read(sc, DM9000_NSR);
 	spd = Mbps[!!(nsr & DM9000_NSR_SPEED)];
 	/* speed/duplexity available also in reg 0x11 of internal PHY */
-#if 1
+#if 0
 	if (nsr & DM9000_NSR_LINKST)
 		printf("link up,spd%d", spd);
 	else
@@ -727,15 +727,16 @@ dme_receive(struct ifnet *ifp)
 if_statinc(ifp, if_collisions);
 continue;
 			}
-			/* pick and forward the this frame to ifq */
+			/* pick and forward this frame to ifq */
 			if_percpuq_enqueue(ifp->if_percpuq, m);
 		} else if (avail != 00) {
 			/* Should this be logged somehow? */
 			printf("%s: Resetting chip\n",
 			   device_xname(sc->sc_dev));
 			dme_reset(sc);
+			break;
 		}
-	} while (avail != 01);
+	} while (avail == 01);
 	/* frame receieved successfully */
 }
 



CVS commit: src/sys/dev/ic

2020-03-31 Thread Tohru Nishimura
Module Name:src
Committed By:   nisimura
Date:   Tue Mar 31 07:50:43 UTC 2020

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

Log Message:
fix negated loop condition. make break when reset.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/ic/dm9000.c

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



CVS commit: src/share/man/man4

2020-03-31 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Mar 31 07:08:59 UTC 2020

Modified Files:
src/share/man/man4: puc.4

Log Message:
add missing netmos devices

- NetMos NM9900 PCIe (pucdata.c r1.106)
- NetMos NM9912 PCIe (pucdata.c r1.104)
- NetMos NM9855 PCIe (pucdata.c r1.49)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/share/man/man4/puc.4

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



CVS commit: src/share/man/man4

2020-03-31 Thread Ryo Shimizu
Module Name:src
Committed By:   ryo
Date:   Tue Mar 31 07:08:59 UTC 2020

Modified Files:
src/share/man/man4: puc.4

Log Message:
add missing netmos devices

- NetMos NM9900 PCIe (pucdata.c r1.106)
- NetMos NM9912 PCIe (pucdata.c r1.104)
- NetMos NM9855 PCIe (pucdata.c r1.49)


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/share/man/man4/puc.4

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

Modified files:

Index: src/share/man/man4/puc.4
diff -u src/share/man/man4/puc.4:1.41 src/share/man/man4/puc.4:1.42
--- src/share/man/man4/puc.4:1.41	Sun Jul  8 20:29:08 2018
+++ src/share/man/man4/puc.4	Tue Mar 31 07:08:59 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: puc.4,v 1.41 2018/07/08 20:29:08 jnemeth Exp $
+.\" $NetBSD: puc.4,v 1.42 2020/03/31 07:08:59 ryo Exp $
 .\"
 .\" Copyright (c) 1998 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <>
 .\"
-.Dd July 8, 2018
+.Dd March 31, 2020
 .Dt PUC 4
 .Os
 .Sh NAME
@@ -122,9 +122,12 @@ The driver currently supports the follow
 .It Tn "NetMos NM9815 Dual 1284 (dual parallel)"
 .It Tn "NetMos NM9835 series (up to dual serial and single parallel)"
 .It Tn "NetMos NM9845 series (up to 6 serial and 1 parallel)"
+.It Tn "NetMos NM9855 series (up to 4 serial and 1 parallel)"
 .It Tn "NetMos NM9865 series (up to 4 serial and 2 parallel)"
+.It Tn "NetMos NM9900 PCIe (4 port serial)"
 .It Tn "NetMos NM9901 PCIe (1 serial or 1 parallel)"
 .It Tn "NetMos NM9904 PCIe (4 port serial)"
+.It Tn "NetMos NM9912 PCIe (2 serial or 1 parallel)"
 .It Tn "NetMos NM9922 PCIe (2 port serial)"
 .It Tn "Oxford Semiconductor OX16PCI952 (dual serial and single parallel)"
 .It Tn "Oxford Semiconductor OX16PCI954 (4 port serial)"