CVS commit: src/tests/net/if_pppoe

2016-10-25 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 26 03:55:56 UTC 2016

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Fix error when wait_for_session_established() is called without argument.

>From Shoichi YAMAGUCHI, Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/net/if_pppoe/t_pppoe.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/if_pppoe/t_pppoe.sh
diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.7 src/tests/net/if_pppoe/t_pppoe.sh:1.8
--- src/tests/net/if_pppoe/t_pppoe.sh:1.7	Wed Oct 26 03:27:24 2016
+++ src/tests/net/if_pppoe/t_pppoe.sh	Wed Oct 26 03:55:56 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pppoe.sh,v 1.7 2016/10/26 03:27:24 knakahara Exp $
+#	$NetBSD: t_pppoe.sh,v 1.8 2016/10/26 03:55:56 knakahara Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -102,7 +102,7 @@ wait_for_session_established()
 		sleep 1
 	done
 
-	if [ $dontfail != "dontfail" ]; then
+	if [ "$dontfail" != "dontfail" ]; then
 		atf_fail "Couldn't connect to the server for $n seconds."
 	fi
 }
@@ -118,7 +118,7 @@ wait_for_disconnected()
 		sleep 1
 	done
 
-	if [ $dontfail != "dontfail" ]; then
+	if [ "$dontfail" != "dontfail" ]; then
 		atf_fail "Couldn't disconnect for $n seconds."
 	fi
 }



CVS commit: src/tests/net/if_pppoe

2016-10-25 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Wed Oct 26 03:27:24 UTC 2016

Modified Files:
src/tests/net/if_pppoe: t_pppoe.sh

Log Message:
Add new test cases(PAP and CHAP) for IPv6 PPPoE.

>From Shoichi YAMAGUCHI, Thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/net/if_pppoe/t_pppoe.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/if_pppoe/t_pppoe.sh
diff -u src/tests/net/if_pppoe/t_pppoe.sh:1.6 src/tests/net/if_pppoe/t_pppoe.sh:1.7
--- src/tests/net/if_pppoe/t_pppoe.sh:1.6	Wed Oct 19 00:19:13 2016
+++ src/tests/net/if_pppoe/t_pppoe.sh	Wed Oct 26 03:27:24 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: t_pppoe.sh,v 1.6 2016/10/19 00:19:13 ozaki-r Exp $
+#	$NetBSD: t_pppoe.sh,v 1.7 2016/10/26 03:27:24 knakahara Exp $
 #
 # Copyright (c) 2016 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -35,6 +35,8 @@ CLIENT=unix://commsock2
 
 SERVER_IP=10.3.3.1
 CLIENT_IP=10.3.3.3
+SERVER_IP6=fc00::1
+CLIENT_IP6=fc00::3
 AUTHNAME=foo...@baz.com
 SECRET=oink
 BUS=bus0
@@ -44,6 +46,12 @@ DEBUG=false
 
 setup()
 {
+	inet=true
+
+	if [ $# -ne 0 ]; then
+		eval $@
+	fi
+
 	atf_check -s exit:0 ${server} $SERVER
 	atf_check -s exit:0 ${server} $CLIENT
 
@@ -53,7 +61,8 @@ setup()
 	atf_check -s exit:0 rump.ifconfig shmif0 up
 
 	atf_check -s exit:0 rump.ifconfig pppoe0 create
-	atf_check -s exit:0 rump.ifconfig pppoe0 inet $SERVER_IP $CLIENT_IP down
+	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
+	inet $SERVER_IP $CLIENT_IP down
 	atf_check -s exit:0 rump.ifconfig pppoe0 link0
 
 	$DEBUG && rump.ifconfig
@@ -68,7 +77,8 @@ setup()
 	atf_check -s exit:0 rump.ifconfig shmif0 up
 
 	atf_check -s exit:0 rump.ifconfig pppoe0 create
-	atf_check -s exit:0 rump.ifconfig pppoe0 inet 0.0.0.0 0.0.0.1 down
+	$inet && atf_check -s exit:0 rump.ifconfig pppoe0 \
+	inet 0.0.0.0 0.0.0.1 down
 
 	atf_check -s exit:0 -x "$HIJACKING pppoectl -e shmif0 pppoe0"
 	unset RUMP_SERVER
@@ -97,6 +107,22 @@ wait_for_session_established()
 	fi
 }
 
+wait_for_disconnected()
+{
+	local dontfail=$1
+	local n=$WAITTIME
+
+	for i in $(seq $n); do
+		$HIJACKING pppoectl -d pppoe0 | grep -q "state = session"
+		[ $? -eq 0 ] || return
+		sleep 1
+	done
+
+	if [ $dontfail != "dontfail" ]; then
+		atf_fail "Couldn't disconnect for $n seconds."
+	fi
+}
+
 run_test()
 {
 	local auth=$1
@@ -220,8 +246,155 @@ pppoe_chap_cleanup()
 	cleanup
 }
 
+run_test6()
+{
+	local auth=$1
+	setup "inet=false"
+
+	# As pppoe client doesn't support rechallenge yet.
+	local server_optparam=""
+	if [ $auth = "chap" ]; then
+		server_optparam="norechallenge"
+	fi
+
+	export RUMP_SERVER=$SERVER
+	local setup_serverparam="pppoectl pppoe0 hisauthproto=$auth \
+'hisauthname=$AUTHNAME' \
+'hisauthsecret=$SECRET' \
+'myauthproto=none' \
+$server_optparam"
+	atf_check -s exit:0 -x "$HIJACKING $setup_serverparam"
+	atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $SERVER_IP6/64 down
+	atf_check -s exit:0 rump.ifconfig pppoe0 up
+	unset RUMP_SERVER
+
+	export RUMP_SERVER=$CLIENT
+	local setup_clientparam="pppoectl pppoe0 myauthproto=$auth \
+'myauthname=$AUTHNAME' \
+'myauthsecret=$SECRET' \
+'hisauthproto=none'"
+	atf_check -s exit:0 -x "$HIJACKING $setup_clientparam"
+	atf_check -s exit:0 rump.ifconfig pppoe0 inet6 $CLIENT_IP6/64 down
+	atf_check -s exit:0 rump.ifconfig pppoe0 up
+	$DEBUG && rump.ifconfig
+	wait_for_session_established
+	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
+	export RUMP_SERVER=$SERVER
+	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
+	export RUMP_SERVER=$CLIENT
+	atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
+	unset RUMP_SERVER
+
+	# test for disconnection from server
+	export RUMP_SERVER=$SERVER
+	session_id=`$HIJACKING pppoectl -d pppoe0 | grep state`
+	atf_check -s exit:0 rump.ifconfig pppoe0 down
+	wait_for_disconnected
+	export RUMP_SERVER=$CLIENT
+	wait_for_disconnected
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	rump.ping6 -c 1 -w $TIMEOUT $SERVER_IP6
+	atf_check -s exit:0 -o not-match:"$session_id" -x "$HIJACKING pppoectl -d pppoe0"
+	unset RUMP_SERVER
+
+	# test for recoonecting
+	export RUMP_SERVER=$SERVER
+	atf_check -s exit:0 rump.ifconfig pppoe0 up
+	wait_for_session_established
+	atf_check -s exit:0 rump.ifconfig -w 10
+	$DEBUG && $HIJACKING pppoectl -d pppoe0
+	$DEBUG && rump.ifconfig pppoe0
+	export RUMP_SERVER=$CLIENT
+	atf_check -s exit:0 -o ignore rump.ifconfig -w 10
+	atf_check -s exit:0 -o ignore rump.ping6 -c 1 -X $TIMEOUT $SERVER_IP6
+	unset RUMP_SERVER
+
+	# test for disconnection from client
+	export RUMP_SERVER=$CLIENT
+	atf_check -s exit:0 rump.ifconfig pppoe0 down
+	wait_for_disconnected
+
+	export RUMP_SERVER=$SERVER
+	$DEBUG && $HIJACKING pppoectl -d pppoe0
+	wait_for_disconnected
+	atf_check -s not-exit:0 -o ignore -e ignore \
+	rump.ping6 -c 1 -X $TIMEOUT 

CVS commit: src/sys/sys

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct 26 01:16:06 UTC 2016

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

Log Message:
Also update the version number in the comment!


To generate a diff of this commit:
cvs rdiff -u -r1.507 -r1.508 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.507 src/sys/sys/param.h:1.508
--- src/sys/sys/param.h:1.507	Tue Oct 25 21:50:15 2016
+++ src/sys/sys/param.h	Wed Oct 26 01:16:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.507 2016/10/25 21:50:15 pgoyette Exp $	*/
+/*	$NetBSD: param.h,v 1.508 2016/10/26 01:16:06 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799004100	/* NetBSD 7.99.40 */
+#define	__NetBSD_Version__	799004100	/* NetBSD 7.99.41 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/sys/dev

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Wed Oct 26 01:03:23 UTC 2016

Modified Files:
src/sys/dev: devlist2h.awk
src/sys/dev/hdaudio: Makefile.hdaudiodevs
src/sys/dev/pci: Makefile.pcidevs
src/sys/dev/usb: Makefile.usbdevs

Log Message:
Update the devlist2h.awk script to track the maximum lengths of vendor
and product strings, and report the max values at end of the run.

Update the Makefiles.{pci,usb,hdaudio}devs to point users at the places
which might need to be updated if the maximum lengths get larger.

Since this commit makes no changes to the generated files, we don't
need to regenerate them now.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/devlist2h.awk
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hdaudio/Makefile.hdaudiodevs
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/Makefile.pcidevs
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/Makefile.usbdevs

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/devlist2h.awk
diff -u src/sys/dev/devlist2h.awk:1.1 src/sys/dev/devlist2h.awk:1.2
--- src/sys/dev/devlist2h.awk:1.1	Sun Sep 21 14:30:22 2014
+++ src/sys/dev/devlist2h.awk	Wed Oct 26 01:03:23 2016
@@ -1,5 +1,5 @@
 #! /usr/bin/awk -f
-#	$NetBSD: devlist2h.awk,v 1.1 2014/09/21 14:30:22 christos Exp $
+#	$NetBSD: devlist2h.awk,v 1.2 2016/10/26 01:03:23 pgoyette Exp $
 #
 # Copyright (c) 1995, 1996 Christopher G. Demetriou
 # All rights reserved.
@@ -31,6 +31,7 @@
 #
 NR == 1 {
 	nproducts = nvendors = blanklines = 0
+	vendormaxlen = productmaxlen = 0
 	nchars = 1
 	dfile= FILENAME "_data.h"
 	hfile= FILENAME ".h"
@@ -117,6 +118,10 @@ NF > 0 && $1 == "vendor" {
 		printf(" */") > hfile
 	printf("\n") > hfile
 
+	if (length($2) > vendormaxlen) {
+		vendormaxlen = length($2)
+	}
+
 	next
 }
 NF > 0 && $1 == "product" {
@@ -131,7 +136,7 @@ NF > 0 && $1 == "product" {
 	i=4; f = 5;
 
 	# comments
-	ocomment = oparen = 0
+	productlen = ocomment = oparen = 0
 	if (f <= NF) {
 		printf("\t\t/* ") > hfile
 		ocomment = 1;
@@ -161,6 +166,7 @@ NF > 0 && $1 == "product" {
 			wordlist[nwords, 3] = nchars;
 			nchars = nchars + l + 1;
 		}
+		productlen += words[$f, 2] + 1;
 		wordlist[words[$f, 1], 2]++;
 		products[nproducts, i] = words[$f, 1];
 		printf("%s", $f) > hfile
@@ -174,6 +180,10 @@ NF > 0 && $1 == "product" {
 		printf(" */") > hfile
 	printf("\n") > hfile
 
+	if (productlen > productmaxlen) {
+		productmaxlen = productlen;
+	}
+
 	next
 }
 {
@@ -240,6 +250,11 @@ END {
 
 	printf("\n") > dfile
 
+	printf("Maximum vendor string length:  %d\n", vendormaxlen + 1)
+	printf("Maximum product string length: %d\n", productmaxlen + 1)
+	printf("\nEnsure that device-specific values are sufficiently large");
+	printf("\ncheck Makefile.%s for details).\n", FILENAME);
+
 	close(dfile)
 	close(hfile)
 }

Index: src/sys/dev/hdaudio/Makefile.hdaudiodevs
diff -u src/sys/dev/hdaudio/Makefile.hdaudiodevs:1.2 src/sys/dev/hdaudio/Makefile.hdaudiodevs:1.3
--- src/sys/dev/hdaudio/Makefile.hdaudiodevs:1.2	Sat May 30 14:10:01 2015
+++ src/sys/dev/hdaudio/Makefile.hdaudiodevs	Wed Oct 26 01:03:23 2016
@@ -1,11 +1,16 @@
-#	$NetBSD: Makefile.hdaudiodevs,v 1.2 2015/05/30 14:10:01 jmcneill Exp $
+#	$NetBSD: Makefile.hdaudiodevs,v 1.3 2016/10/26 01:03:23 pgoyette Exp $
 #
 # As per t...@netbsd.org, the proper procedure is
 #
 # 1.) Change "src/sys/dev/hdaudio/hdaudiodevs".
 # 2.) Commit "src/sys/dev/hdaudio/hdaudiodevs".
 # 3.) Execute "make -f Makefile.hdaudiodevs" in "src/sys/dev/hdaudio".
-# 4.) Commit "src/sys/dev/hdaudio/hdaudiodevs.h" and "src/sys/dev/hdaudio/hdaudiodevs_data.h".
+# 4.) Ensure that the value of MAX_AUDIO_DEV_LEN is at least as large as
+# the values reported.  If necessary, update "src/sys/sys/audioio.h"
+# and bump the kernel version in "src/sys/sys/param/h".
+# 5.) Commit "src/sys/dev/hdaudio/hdaudiodevs.h" and
+# "src/sys/dev/hdaudio/hdaudiodevs_data.h"; if you changed them, also
+# commit "src/sys/sys/audioio.h" and "src/sys/sys/param/h".
 
 .include 
 

Index: src/sys/dev/pci/Makefile.pcidevs
diff -u src/sys/dev/pci/Makefile.pcidevs:1.6 src/sys/dev/pci/Makefile.pcidevs:1.7
--- src/sys/dev/pci/Makefile.pcidevs:1.6	Sun Sep 21 14:30:22 2014
+++ src/sys/dev/pci/Makefile.pcidevs	Wed Oct 26 01:03:23 2016
@@ -1,11 +1,17 @@
-#	$NetBSD: Makefile.pcidevs,v 1.6 2014/09/21 14:30:22 christos Exp $
+#	$NetBSD: Makefile.pcidevs,v 1.7 2016/10/26 01:03:23 pgoyette Exp $
 #
 # As per t...@netbsd.org, the proper procedure is
 #
 # 1.) Change "src/sys/dev/pci/pcidevs".
 # 2.) Commit "src/sys/dev/pci/pcidevs".
 # 3.) Execute "make -f Makefile.pcidevs" in "src/sys/dev/pci".
-# 4.) Commit "src/sys/dev/pci/pcidevs.h" and "src/sys/dev/pci/pcidevs_data.h".
+# 4.) Ensure that the values of PCI_VENDORSTR_LEN and PCI_PRODUCTSTR_LEN
+# are at least as large as the values reported.  If necessary, update
+# the values in "src/sys/dev/pci/pci_verbose.h" and 

CVS commit: src/sys/sys

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct 25 21:50:15 UTC 2016

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

Log Message:
Bump kernel version for changes to pciverbose.  Thanks mrg@ for
reminding me.

Welcome to 7.99.41!


To generate a diff of this commit:
cvs rdiff -u -r1.506 -r1.507 src/sys/sys/param.h

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

Modified files:

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.506 src/sys/sys/param.h:1.507
--- src/sys/sys/param.h:1.506	Thu Oct 20 08:18:16 2016
+++ src/sys/sys/param.h	Tue Oct 25 21:50:15 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.506 2016/10/20 08:18:16 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.507 2016/10/25 21:50:15 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	799004000	/* NetBSD 7.99.40 */
+#define	__NetBSD_Version__	799004100	/* NetBSD 7.99.40 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



CVS commit: src/etc

2016-10-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Oct 25 17:16:34 UTC 2016

Modified Files:
src/etc: inetd.conf

Log Message:
mention that -a valid does not work, requested by felix.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/etc/inetd.conf

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

Modified files:

Index: src/etc/inetd.conf
diff -u src/etc/inetd.conf:1.58 src/etc/inetd.conf:1.59
--- src/etc/inetd.conf:1.58	Mon Oct 15 22:47:14 2007
+++ src/etc/inetd.conf	Tue Oct 25 13:16:34 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: inetd.conf,v 1.58 2007/10/16 02:47:14 tls Exp $
+#	$NetBSD: inetd.conf,v 1.59 2016/10/25 17:16:34 christos Exp $
 #
 # Internet server configuration database
 #
@@ -8,6 +8,8 @@
 #http		stream	tcp6	nowait:600	_httpd	/usr/libexec/httpd	httpd /var/www
 #ftp		stream	tcp	nowait	root	/usr/libexec/ftpd	ftpd -ll
 #ftp		stream	tcp6	nowait	root	/usr/libexec/ftpd	ftpd -ll
+# Note: "-a valid" does not work for older telnet clients that do not support
+# authentication
 #telnet		stream	tcp	nowait	root	/usr/libexec/telnetd	telnetd -a valid
 #telnet		stream	tcp6	nowait	root	/usr/libexec/telnetd	telnetd -a valid
 #shell		stream	tcp	nowait	root	/usr/libexec/rshd	rshd -L



CVS commit: src/bin/sh

2016-10-25 Thread Abhinav Upadhyay
Module Name:src
Committed By:   abhinav
Date:   Tue Oct 25 13:01:59 UTC 2016

Modified Files:
src/bin/sh: TOUR

Log Message:
Fix grammar in couple of sentences.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/bin/sh/TOUR

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

Modified files:

Index: src/bin/sh/TOUR
diff -u src/bin/sh/TOUR:1.10 src/bin/sh/TOUR:1.11
--- src/bin/sh/TOUR:1.10	Sat Nov 15 17:01:38 2008
+++ src/bin/sh/TOUR	Tue Oct 25 13:01:59 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: TOUR,v 1.10 2008/11/15 17:01:38 snj Exp $
+#	$NetBSD: TOUR,v 1.11 2016/10/25 13:01:59 abhinav Exp $
 #	@(#)TOUR	8.1 (Berkeley) 5/31/93
 
 NOTE -- This is the original TOUR paper distributed with ash and
@@ -119,7 +119,7 @@ operations, but grow the stack if you ru
 We now start a top-down look at the code:
 
 MAIN.C:  The main routine performs some initialization, executes
-the user's profile if necessary, and calls cmdloop.  Cmdloop is
+the user's profile if necessary, and calls cmdloop.  Cmdloop
 repeatedly parses and executes commands.
 
 OPTIONS.C:  This file contains the option processing code.  It is
@@ -212,7 +212,7 @@ EXECUTION:  Command execution is handled
 eval.c The top level routines.
 redir.cCode to handle redirection of input and output.
 jobs.c Code to handle forking, waiting, and job control.
-exec.c Code to to path searches and the actual exec sys call.
+exec.c Code to do path searches and the actual exec sys call.
 expand.c   Code to evaluate arguments.
 var.c  Maintains the variable symbol table.  Called from expand.c.
 



CVS commit: src/sys/dev/hdaudio

2016-10-25 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Tue Oct 25 09:15:55 UTC 2016

Modified Files:
src/sys/dev/hdaudio: hdafg.c

Log Message:
Replace numeric magic-number constant with something a bit more meaningful.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/hdaudio/hdafg.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/hdaudio/hdafg.c
diff -u src/sys/dev/hdaudio/hdafg.c:1.9 src/sys/dev/hdaudio/hdafg.c:1.10
--- src/sys/dev/hdaudio/hdafg.c:1.9	Sun Nov 15 23:03:50 2015
+++ src/sys/dev/hdaudio/hdafg.c	Tue Oct 25 09:15:55 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd 
@@ -60,7 +60,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.9 2015/11/15 23:03:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10 2016/10/25 09:15:55 pgoyette Exp $");
 
 #include 
 #include 
@@ -3663,7 +3663,7 @@ hdafg_attach(device_t parent, device_t s
 	struct hdafg_softc *sc = device_private(self);
 	audio_params_t defparams;
 	prop_dictionary_t args = opaque;
-	char vendor[16], product[16];
+	char vendor[MAX_AUDIO_DEV_LEN], product[MAX_AUDIO_DEV_LEN];
 	uint64_t fgptr = 0;
 	uint32_t astype = 0;
 	uint8_t nid = 0;



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-10-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 25 07:32:25 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ucom.c

Log Message:
Misc whitespace changes.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.108.2.22 -r1.108.2.23 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.108.2.22 src/sys/dev/usb/ucom.c:1.108.2.23
--- src/sys/dev/usb/ucom.c:1.108.2.22	Tue Oct 25 07:25:05 2016
+++ src/sys/dev/usb/ucom.c	Tue Oct 25 07:32:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.108.2.22 2016/10/25 07:25:05 skrll Exp $	*/
+/*	$NetBSD: ucom.c,v 1.108.2.23 2016/10/25 07:32:25 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.22 2016/10/25 07:25:05 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.23 2016/10/25 07:32:25 skrll Exp $");
 
 #include 
 #include 
@@ -230,7 +230,7 @@ static int	ucom_to_tiocm(struct ucom_sof
 
 static void	ucom_submit_write(struct ucom_softc *, struct ucom_buffer *);
 static void	ucom_write_status(struct ucom_softc *, struct ucom_buffer *,
-			usbd_status);
+		usbd_status);
 
 static void	ucomwritecb(struct usbd_xfer *, void *, usbd_status);
 static void	ucom_read_complete(struct ucom_softc *);
@@ -416,7 +416,7 @@ ucom_detach(device_t self, int flags)
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
 
 	DPRINTF("sc=%p flags=%d tp=%p", sc, flags, tp, 0);
-	DPRINTF("... pipe=%d,%d",sc->sc_bulkin_no, sc->sc_bulkout_no, 0, 0);
+	DPRINTF("... pipe=%d,%d", sc->sc_bulkin_no, sc->sc_bulkout_no, 0, 0);
 
 	mutex_enter(>sc_lock);
 	sc->sc_dying = true;
@@ -768,9 +768,10 @@ ucomread(dev_t dev, struct uio *uio, int
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
+
 	error = ((*tp->t_linesw->l_read)(tp, uio, flag));
-	mutex_enter(>sc_lock);
 
+	mutex_enter(>sc_lock);
 	if (--sc->sc_refcnt < 0)
 		usb_detach_broadcast(sc->sc_dev, >sc_detachcv);
 	mutex_exit(>sc_lock);
@@ -797,7 +798,9 @@ ucomwrite(dev_t dev, struct uio *uio, in
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
+
 	error = ((*tp->t_linesw->l_write)(tp, uio, flag));
+
 	mutex_enter(>sc_lock);
 	if (--sc->sc_refcnt < 0)
 		usb_detach_broadcast(sc->sc_dev, >sc_detachcv);
@@ -825,7 +828,9 @@ ucompoll(dev_t dev, int events, struct l
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
+
 	revents = ((*tp->t_linesw->l_poll)(tp, events, l));
+
 	mutex_enter(>sc_lock);
 	if (--sc->sc_refcnt < 0)
 		usb_detach_broadcast(sc->sc_dev, >sc_detachcv);
@@ -859,17 +864,20 @@ ucomioctl(dev_t dev, u_long cmd, void *d
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
+
 	error = ucom_do_ioctl(sc, cmd, data, flag, l);
+
 	mutex_enter(>sc_lock);
 	if (--sc->sc_refcnt < 0)
 		usb_detach_broadcast(sc->sc_dev, >sc_detachcv);
 	mutex_exit(>sc_lock);
+
 	return error;
 }
 
 static int
-ucom_do_ioctl(struct ucom_softc *sc, u_long cmd, void *data,
-	  int flag, struct lwp *l)
+ucom_do_ioctl(struct ucom_softc *sc, u_long cmd, void *data, int flag,
+struct lwp *l)
 {
 	struct tty *tp = sc->sc_tty;
 	int error;
@@ -888,7 +896,7 @@ ucom_do_ioctl(struct ucom_softc *sc, u_l
 
 	if (sc->sc_methods->ucom_ioctl != NULL) {
 		error = sc->sc_methods->ucom_ioctl(sc->sc_parent,
-			sc->sc_portno, cmd, data, flag, l->l_proc);
+		sc->sc_portno, cmd, data, flag, l->l_proc);
 		if (error != EPASSTHROUGH)
 			return error;
 	}



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-10-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 25 07:25:05 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ucom.c

Log Message:
Conver sc_dying to a bool.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.108.2.21 -r1.108.2.22 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.108.2.21 src/sys/dev/usb/ucom.c:1.108.2.22
--- src/sys/dev/usb/ucom.c:1.108.2.21	Tue Oct 25 07:23:32 2016
+++ src/sys/dev/usb/ucom.c	Tue Oct 25 07:25:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.108.2.21 2016/10/25 07:23:32 skrll Exp $	*/
+/*	$NetBSD: ucom.c,v 1.108.2.22 2016/10/25 07:25:05 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.21 2016/10/25 07:23:32 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.22 2016/10/25 07:25:05 skrll Exp $");
 
 #include 
 #include 
@@ -180,7 +180,7 @@ struct ucom_softc {
 	u_char			sc_opening;	/* lock during open */
 	u_char			sc_closing;	/* lock during close */
 	int			sc_refcnt;
-	u_char			sc_dying;	/* disconnecting */
+	bool			sc_dying;	/* disconnecting */
 
 	struct pps_state	sc_pps_state;	/* pps state */
 
@@ -290,7 +290,7 @@ ucom_attach(device_t parent, device_t se
 	sc->sc_opening = 0;
 	sc->sc_closing = 0;
 	sc->sc_refcnt = 0;
-	sc->sc_dying = 0;
+	sc->sc_dying = false;
 
 	sc->sc_si = softint_establish(SOFTINT_USB, ucom_softintr, sc);
 	mutex_init(>sc_lock, MUTEX_DEFAULT, IPL_SOFTUSB);
@@ -419,7 +419,7 @@ ucom_detach(device_t self, int flags)
 	DPRINTF("... pipe=%d,%d",sc->sc_bulkin_no, sc->sc_bulkout_no, 0, 0);
 
 	mutex_enter(>sc_lock);
-	sc->sc_dying = 1;
+	sc->sc_dying = true;
 	mutex_exit(>sc_lock);
 
 	pmf_device_deregister(self);
@@ -505,7 +505,7 @@ ucom_activate(device_t self, enum devact
 	switch (act) {
 	case DVACT_DEACTIVATE:
 		mutex_enter(>sc_lock);
-		sc->sc_dying = 1;
+		sc->sc_dying = true;
 		mutex_exit(>sc_lock);
 		return 0;
 	default:



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-10-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 25 07:23:32 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ucom.c

Log Message:
Formatting.  No functional change.


To generate a diff of this commit:
cvs rdiff -u -r1.108.2.20 -r1.108.2.21 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.108.2.20 src/sys/dev/usb/ucom.c:1.108.2.21
--- src/sys/dev/usb/ucom.c:1.108.2.20	Tue Oct 25 07:20:11 2016
+++ src/sys/dev/usb/ucom.c	Tue Oct 25 07:23:32 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.108.2.20 2016/10/25 07:20:11 skrll Exp $	*/
+/*	$NetBSD: ucom.c,v 1.108.2.21 2016/10/25 07:23:32 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.20 2016/10/25 07:20:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.21 2016/10/25 07:23:32 skrll Exp $");
 
 #include 
 #include 
@@ -138,12 +138,11 @@ struct ucom_buffer {
 struct ucom_softc {
 	device_t		sc_dev;		/* base device */
 
-	struct usbd_device *	sc_udev;	/* USB device */
-
-	struct usbd_interface *	sc_iface;	/* data interface */
+	struct usbd_device	*sc_udev;	/* USB device */
+	struct usbd_interface	*sc_iface;	/* data interface */
 
 	int			sc_bulkin_no;	/* bulk in endpoint address */
-	struct usbd_pipe *	sc_bulkin_pipe;	/* bulk in pipe */
+	struct usbd_pipe	*sc_bulkin_pipe;	/* bulk in pipe */
 	u_int			sc_ibufsize;	/* read buffer size */
 	u_int			sc_ibufsizepad;	/* read buffer size padded */
 	struct ucom_buffer	sc_ibuff[UCOM_IN_BUFFS];
@@ -151,7 +150,7 @@ struct ucom_softc {
 	SIMPLEQ_HEAD(, ucom_buffer) sc_ibuff_full;
 
 	int			sc_bulkout_no;	/* bulk out endpoint address */
-	struct usbd_pipe *	sc_bulkout_pipe;/* bulk out pipe */
+	struct usbd_pipe	*sc_bulkout_pipe;/* bulk out pipe */
 	u_int			sc_obufsize;	/* write buffer size */
 	u_int			sc_opkthdrlen;	/* header length of */
 	struct ucom_buffer	sc_obuff[UCOM_OUT_BUFFS];



CVS commit: [nick-nhusb] src/sys/dev/usb

2016-10-25 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Oct 25 07:20:11 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: ucom.c

Log Message:
Style


To generate a diff of this commit:
cvs rdiff -u -r1.108.2.19 -r1.108.2.20 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.108.2.19 src/sys/dev/usb/ucom.c:1.108.2.20
--- src/sys/dev/usb/ucom.c:1.108.2.19	Wed Oct 12 14:40:03 2016
+++ src/sys/dev/usb/ucom.c	Tue Oct 25 07:20:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.108.2.19 2016/10/12 14:40:03 skrll Exp $	*/
+/*	$NetBSD: ucom.c,v 1.108.2.20 2016/10/25 07:20:11 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.19 2016/10/12 14:40:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ucom.c,v 1.108.2.20 2016/10/25 07:20:11 skrll Exp $");
 
 #include 
 #include 
@@ -257,7 +257,6 @@ ucom_attach(device_t parent, device_t se
 {
 	struct ucom_softc *sc = device_private(self);
 	struct ucom_attach_args *ucaa = aux;
-	struct tty *tp;
 
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
 
@@ -368,7 +367,7 @@ ucom_attach(device_t parent, device_t se
 		SIMPLEQ_INSERT_TAIL(>sc_obuff_free, ub, ub_link);
 	}
 
-	tp = tty_alloc();
+	struct tty *tp = tty_alloc();
 	tp->t_oproc = ucomstart;
 	tp->t_param = ucomparam;
 	tp->t_hwiflow = ucomhwiflow;
@@ -540,7 +539,6 @@ ucomopen(dev_t dev, int flag, int mode, 
 	int unit = UCOMUNIT(dev);
 	struct ucom_softc *sc = device_lookup_private(_cd, unit);
 	struct ucom_buffer *ub;
-	struct tty *tp;
 	int error;
 
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
@@ -559,7 +557,7 @@ ucomopen(dev_t dev, int flag, int mode, 
 		return ENXIO;
 	}
 
-	tp = sc->sc_tty;
+	struct tty *tp = sc->sc_tty;
 
 	DPRINTF("unit=%d, tp=%p", unit, tp, 0, 0);
 
@@ -702,7 +700,6 @@ int
 ucomclose(dev_t dev, int flag, int mode, struct lwp *l)
 {
 	struct ucom_softc *sc = device_lookup_private(_cd, UCOMUNIT(dev));
-	struct tty *tp;
 
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
 
@@ -712,7 +709,7 @@ ucomclose(dev_t dev, int flag, int mode,
 		return 0;
 
 	mutex_enter(>sc_lock);
-	tp = sc->sc_tty;
+	struct tty *tp = sc->sc_tty;
 
 	while (sc->sc_closing)
 		cv_wait(>sc_opencv, >sc_lock);
@@ -755,7 +752,6 @@ int
 ucomread(dev_t dev, struct uio *uio, int flag)
 {
 	struct ucom_softc *sc = device_lookup_private(_cd, UCOMUNIT(dev));
-	struct tty *tp;
 	int error;
 
 	UCOMHIST_FUNC(); UCOMHIST_CALLED();
@@ -769,7 +765,7 @@ ucomread(dev_t dev, struct uio *uio, int
 		return EIO;
 	}
 
-	tp = sc->sc_tty;
+	struct tty *tp = sc->sc_tty;
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
@@ -787,7 +783,6 @@ int
 ucomwrite(dev_t dev, struct uio *uio, int flag)
 {
 	struct ucom_softc *sc = device_lookup_private(_cd, UCOMUNIT(dev));
-	struct tty *tp;
 	int error;
 
 	if (sc == NULL)
@@ -799,7 +794,7 @@ ucomwrite(dev_t dev, struct uio *uio, in
 		return EIO;
 	}
 
-	tp = sc->sc_tty;
+	struct tty *tp = sc->sc_tty;
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
@@ -816,7 +811,6 @@ int
 ucompoll(dev_t dev, int events, struct lwp *l)
 {
 	struct ucom_softc *sc;
-	struct tty *tp;
 	int revents;
 
 	sc = device_lookup_private(_cd, UCOMUNIT(dev));
@@ -828,7 +822,7 @@ ucompoll(dev_t dev, int events, struct l
 		mutex_exit(>sc_lock);
 		return POLLHUP;
 	}
-	tp = sc->sc_tty;
+	struct tty *tp = sc->sc_tty;
 
 	sc->sc_refcnt++;
 	mutex_exit(>sc_lock);
@@ -1356,10 +1350,9 @@ static void
 ucom_softintr(void *arg)
 {
 	struct ucom_softc *sc = arg;
-	struct tty *tp = sc->sc_tty;
-	struct ucom_buffer *ub;
 
 	mutex_enter(>sc_lock);
+	struct tty *tp = sc->sc_tty;
 	mutex_enter(_lock);
 	if (!ISSET(tp->t_state, TS_ISOPEN)) {
 		mutex_exit(_lock);
@@ -1368,7 +1361,7 @@ ucom_softintr(void *arg)
 	}
 	mutex_exit(_lock);
 
-	ub = SIMPLEQ_FIRST(>sc_obuff_full);
+	struct ucom_buffer *ub = SIMPLEQ_FIRST(>sc_obuff_full);
 
 	if (ub != NULL && ub->ub_index == 0)
 		ucom_submit_write(sc, ub);