CVS commit: src/sys/net/npf

2016-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 28 21:55:04 UTC 2016

Modified Files:
src/sys/net/npf: npf_impl.h npf_rproc.c npf_ruleset.c

Log Message:
export rprocs too so we don't lose them.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/net/npf/npf_impl.h
cvs rdiff -u -r1.14 -r1.15 src/sys/net/npf/npf_rproc.c
cvs rdiff -u -r1.43 -r1.44 src/sys/net/npf/npf_ruleset.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/npf/npf_impl.h
diff -u src/sys/net/npf/npf_impl.h:1.64 src/sys/net/npf/npf_impl.h:1.65
--- src/sys/net/npf/npf_impl.h:1.64	Mon Dec 26 18:05:06 2016
+++ src/sys/net/npf/npf_impl.h	Wed Dec 28 16:55:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_impl.h,v 1.64 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf_impl.h,v 1.65 2016/12/28 21:55:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009-2014 The NetBSD Foundation, Inc.
@@ -359,6 +359,7 @@ int		npf_rprocset_export(const npf_rproc
 npf_rproc_t *	npf_rproc_create(prop_dictionary_t);
 void		npf_rproc_acquire(npf_rproc_t *);
 void		npf_rproc_release(npf_rproc_t *);
+const char *	npf_rproc_getname(const npf_rproc_t *);
 bool		npf_rproc_run(npf_cache_t *, npf_rproc_t *, int *);
 
 /* State handling. */

Index: src/sys/net/npf/npf_rproc.c
diff -u src/sys/net/npf/npf_rproc.c:1.14 src/sys/net/npf/npf_rproc.c:1.15
--- src/sys/net/npf/npf_rproc.c:1.14	Mon Dec 26 18:05:06 2016
+++ src/sys/net/npf/npf_rproc.c	Wed Dec 28 16:55:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_rproc.c,v 1.14 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf_rproc.c,v 1.15 2016/12/28 21:55:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -311,6 +311,15 @@ npf_rproc_acquire(npf_rproc_t *rp)
 }
 
 /*
+ * npf_rproc_getname: return the name of the given rproc
+ */
+const char *
+npf_rproc_getname(const npf_rproc_t *rp)
+{
+	return rp->rp_name;
+}
+
+/*
  * npf_rproc_release: drop the reference count and destroy the rule
  * procedure on the last reference.
  */

Index: src/sys/net/npf/npf_ruleset.c
diff -u src/sys/net/npf/npf_ruleset.c:1.43 src/sys/net/npf/npf_ruleset.c:1.44
--- src/sys/net/npf/npf_ruleset.c:1.43	Mon Dec 26 18:05:06 2016
+++ src/sys/net/npf/npf_ruleset.c	Wed Dec 28 16:55:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_ruleset.c,v 1.43 2016/12/26 23:05:06 christos Exp $	*/
+/*	$NetBSD: npf_ruleset.c,v 1.44 2016/12/28 21:55:04 christos Exp $	*/
 
 /*-
  * Copyright (c) 2009-2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.43 2016/12/26 23:05:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_ruleset.c,v 1.44 2016/12/28 21:55:04 christos Exp $");
 
 #include 
 #include 
@@ -740,6 +740,14 @@ npf_rule_export(npf_t *npf, const npf_ru
 	if (rl->r_info) {
 		prop_dictionary_set(rldict, "info", rl->r_info);
 	}
+
+	npf_rproc_t *rp = npf_rule_getrproc(rl);
+	if (rp != NULL) {
+		prop_dictionary_set_cstring(rldict, "rproc",
+		npf_rproc_getname(rp));
+		npf_rproc_release(rp);
+	}
+
 	return 0;
 }
 



CVS commit: src/share/man/man2

2016-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Dec 28 21:19:06 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Bump date for siginfo(2) and document SI_LWP and SI_NOINFO as .Nx extension

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.14 src/share/man/man2/siginfo.2:1.15
--- src/share/man/man2/siginfo.2:1.14	Wed Dec 28 20:41:55 2016
+++ src/share/man/man2/siginfo.2	Wed Dec 28 21:19:06 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.14 2016/12/28 20:41:55 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.15 2016/12/28 21:19:06 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 27, 2016
+.Dd December 28, 2016
 .Dt SIGINFO 2
 .Os
 .Sh NAME
@@ -354,6 +354,14 @@ The
 .Nm
 type conforms to
 .St -xsh5 .
+.Pp
+Signals specifying
+.Dv SI_LWP
+or
+.Dv SI_NOINFO
+are
+.Nx
+extension.
 .Sh HISTORY
 The
 .Nm



CVS commit: src/share/man/man2

2016-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Dec 28 20:41:55 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document SI_MESGQ in siginfo(2)

SI_MESGQ
  The signal was generated because of the arrival of a message
  on an empty message queue.

This code was commented out since inception of this manual page (originally
located in siginfo(5)).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.13 src/share/man/man2/siginfo.2:1.14
--- src/share/man/man2/siginfo.2:1.13	Wed Dec 28 20:34:36 2016
+++ src/share/man/man2/siginfo.2	Wed Dec 28 20:41:55 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.13 2016/12/28 20:34:36 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.14 2016/12/28 20:41:55 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -141,11 +141,11 @@ on a normal write it will contain
 .Dv POLLOUT | POLLWRNORM ;
 on an out-of-band write it will contain
 .Dv POLLPRI | POLLWRBAND .
-.\" .It SI_MESGQ
-.\" The signal was generated because of the arrival of a message on an empty
-.\" message queue.
-.\" See
-.\" .Xr mq_notify 3 .
+.It SI_MESGQ
+The signal was generated because of the arrival of a message on an empty
+message queue.
+See
+.Xr mq_notify 3 .
 .It SI_LWP
 The signal was generated via
 .Xr _lwp_kill 2 .



CVS commit: src/share/man/man2

2016-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Dec 28 20:34:36 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document SI_QUEUE in siginfo(2)

SI_QUEUE
  The signal was generated via sigqueue(2).

This code was commented out since inception of this manual page (originally
located in siginfo(5)).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.12 src/share/man/man2/siginfo.2:1.13
--- src/share/man/man2/siginfo.2:1.12	Wed Dec 28 20:06:00 2016
+++ src/share/man/man2/siginfo.2	Wed Dec 28 20:34:36 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.12 2016/12/28 20:06:00 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.13 2016/12/28 20:34:36 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -79,27 +79,27 @@ The
 field contains the pid of the sending process and the
 .Fa si_uid
 field contains the user id of the sending process.
-.\" .It SI_QUEUE
-.\" The signal was generated via
-.\" .Xr sigqueue 3 .
-.\" The
-.\" .Nm
-.\" structure contains the following additional members:
-.\" .Bd -literal -offset indent
-.\" pid_t si_pid;
-.\" uid_t si_uid;
-.\" sigval_t si_value;
-.\" .Ed
-.\" .Pp
-.\" The
-.\" .Fa si_pid
-.\" field contains the pid of the sending process and the
-.\" .Fa si_uid
-.\" field contains the user id of the sending process.
-.\" Finally, the
-.\" .Fa si_value
-.\" field contains the value sent via
-.\" .Xr sigqueue 3 .
+.It SI_QUEUE
+The signal was generated via
+.Xr sigqueue 2 .
+The
+.Nm
+structure contains the following additional members:
+.Bd -literal -offset indent
+pid_t si_pid;
+uid_t si_uid;
+sigval_t si_value;
+.Ed
+.Pp
+The
+.Fa si_pid
+field contains the pid of the sending process and the
+.Fa si_uid
+field contains the user id of the sending process.
+Finally, the
+.Fa si_value
+field contains the value sent via
+.Xr sigqueue 2 .
 .It SI_TIMER
 The signal was generated because a timer set by
 .Xr timer_settime 2



CVS commit: src/share/man/man2

2016-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Dec 28 20:06:00 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document SI_LWP in siginfo(2)

SI_LWP
  The signal was generated via _lwp_kill(2).

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.11 src/share/man/man2/siginfo.2:1.12
--- src/share/man/man2/siginfo.2:1.11	Wed Dec 28 20:00:15 2016
+++ src/share/man/man2/siginfo.2	Wed Dec 28 20:06:00 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.11 2016/12/28 20:00:15 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.12 2016/12/28 20:06:00 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -146,6 +146,22 @@ on an out-of-band write it will contain
 .\" message queue.
 .\" See
 .\" .Xr mq_notify 3 .
+.It SI_LWP
+The signal was generated via
+.Xr _lwp_kill 2 .
+The
+.Nm
+structure contains the following additional members:
+.Bd -literal -offset indent
+pid_t si_pid;
+uid_t si_uid;
+.Ed
+.Pp
+The
+.Fa si_pid
+field contains the pid of the sending process and the
+.Fa si_uid
+field contains the user id of the sending process.
 .It SI_NOINFO
 The signal was generated without specifc info available.
 .El



CVS commit: src/share/man/man2

2016-12-28 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Dec 28 20:00:15 UTC 2016

Modified Files:
src/share/man/man2: siginfo.2

Log Message:
Document SI_NOINFO in siginfo(2)

SI_NOINFO
  The signal was generated without specifc info available.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/share/man/man2/siginfo.2

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/man2/siginfo.2
diff -u src/share/man/man2/siginfo.2:1.10 src/share/man/man2/siginfo.2:1.11
--- src/share/man/man2/siginfo.2:1.10	Tue Dec 27 01:44:06 2016
+++ src/share/man/man2/siginfo.2	Wed Dec 28 20:00:15 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: siginfo.2,v 1.10 2016/12/27 01:44:06 kamil Exp $
+.\"	$NetBSD: siginfo.2,v 1.11 2016/12/28 20:00:15 kamil Exp $
 .\"
 .\" Copyright (c) 2003 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -146,6 +146,8 @@ on an out-of-band write it will contain
 .\" message queue.
 .\" See
 .\" .Xr mq_notify 3 .
+.It SI_NOINFO
+The signal was generated without specifc info available.
 .El
 .Pp
 If



CVS commit: src/sys/external/bsd/ipf/netinet

2016-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 28 19:53:02 UTC 2016

Modified Files:
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c

Log Message:
use the proper hook function


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c

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

Modified files:

Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.20 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.21
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.20	Mon Dec 26 18:21:49 2016
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c	Wed Dec 28 14:53:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_fil_netbsd.c,v 1.20 2016/12/26 23:21:49 christos Exp $	*/
+/*	$NetBSD: ip_fil_netbsd.c,v 1.21 2016/12/28 19:53:02 christos Exp $	*/
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.20 2016/12/26 23:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.21 2016/12/28 19:53:02 christos Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c	2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -461,8 +461,8 @@ ipfattach(ipf_main_softc_t *softc)
 # if defined(PFIL_TYPE_IFNET) && defined(PFIL_IFNET)
 	if (ph_ifsync != NULL)
 #if (__NetBSD_Version__ >= 799000400)
-		(void) pfil_add_hook((void *)ipf_pfilsync, NULL,
- PFIL_IFNET, ph_ifsync);
+		(void) pfil_add_ihook((void *)ipf_pfilsync, NULL,
+  PFIL_IFNET, ph_ifsync);
 #else
 		(void) pfil_add_hook((void *)ipf_pfilsync, NULL,
  PFIL_IFNET, ph_ifsync);



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 19:41:41 UTC 2016

Modified Files:
src/sys/dev/ic [nick-nhusb]: athn.c
src/sys/dev/usb [nick-nhusb]: if_athn_usb.c if_athn_usb.h

Log Message:
Various improvements

- override the method before calling athn_attach -> if_attach -> interface
  announce
- locking fixes for htc/wmi
- some MPificaton


To generate a diff of this commit:
cvs rdiff -u -r1.10.4.2 -r1.10.4.3 src/sys/dev/ic/athn.c
cvs rdiff -u -r1.6.8.17 -r1.6.8.18 src/sys/dev/usb/if_athn_usb.c
cvs rdiff -u -r1.2.16.4 -r1.2.16.5 src/sys/dev/usb/if_athn_usb.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/ic/athn.c
diff -u src/sys/dev/ic/athn.c:1.10.4.2 src/sys/dev/ic/athn.c:1.10.4.3
--- src/sys/dev/ic/athn.c:1.10.4.2	Sun May 29 08:44:21 2016
+++ src/sys/dev/ic/athn.c	Wed Dec 28 19:41:41 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: athn.c,v 1.10.4.2 2016/05/29 08:44:21 skrll Exp $	*/
+/*	$NetBSD: athn.c,v 1.10.4.3 2016/12/28 19:41:41 skrll Exp $	*/
 /*	$OpenBSD: athn.c,v 1.83 2014/07/22 13:12:11 mpi Exp $	*/
 
 /*-
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.10.4.2 2016/05/29 08:44:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: athn.c,v 1.10.4.3 2016/12/28 19:41:41 skrll Exp $");
 
 #ifndef _MODULE
 #include "athn_usb.h"		/* for NATHN_USB */
@@ -329,10 +329,14 @@ athn_attach(struct athn_softc *sc)
 
 	ifp->if_softc = sc;
 	ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-	ifp->if_init = athn_init;
-	ifp->if_ioctl = athn_ioctl;
-	ifp->if_start = athn_start;
-	ifp->if_watchdog = athn_watchdog;
+	if (!ifp->if_init)
+		ifp->if_init = athn_init;
+	if (!ifp->if_ioctl)
+		ifp->if_ioctl = athn_ioctl;
+	if (!ifp->if_start)
+		ifp->if_start = athn_start;
+	if (!ifp->if_watchdog)
+		ifp->if_watchdog = athn_watchdog;
 	IFQ_SET_READY(>if_snd);
 	memcpy(ifp->if_xname, device_xname(sc->sc_dev), IFNAMSIZ);
 

Index: src/sys/dev/usb/if_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.6.8.17 src/sys/dev/usb/if_athn_usb.c:1.6.8.18
--- src/sys/dev/usb/if_athn_usb.c:1.6.8.17	Wed Dec 28 19:36:03 2016
+++ src/sys/dev/usb/if_athn_usb.c	Wed Dec 28 19:41:41 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.6.8.17 2016/12/28 19:36:03 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.6.8.18 2016/12/28 19:41:41 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.17 2016/12/28 19:36:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.18 2016/12/28 19:41:41 skrll Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -144,7 +144,7 @@ Static void	athn_usb_rxeof(struct usbd_x
 		usbd_status);
 Static void	athn_usb_start(struct ifnet *);
 //Static void	athn_usb_start_locked(struct ifnet *);
-Static void	athn_usb_stop(struct ifnet *);
+Static void	athn_usb_stop(struct ifnet *, int disable);
 Static void	athn_usb_stop_locked(struct ifnet *);
 Static void	athn_usb_swba(struct athn_usb_softc *);
 Static int	athn_usb_switch_chan(struct athn_softc *,
@@ -157,7 +157,6 @@ Static void	athn_usb_txeof(struct usbd_x
 Static void	athn_usb_updateslot(struct ifnet *);
 Static void	athn_usb_updateslot_cb(struct athn_usb_softc *, void *);
 Static void	athn_usb_wait_async(struct athn_usb_softc *);
-Static int	athn_usb_wait_cmd(struct athn_usb_softc *);
 Static int	athn_usb_wait_msg(struct athn_usb_softc *);
 Static void	athn_usb_watchdog(struct ifnet *);
 Static int	athn_usb_wmi_xcmd(struct athn_usb_softc *, uint16_t, void *,
@@ -274,6 +273,9 @@ athn_usb_attach(device_t parent, device_
 
 	mutex_init(>usc_lock, MUTEX_DEFAULT, IPL_NONE);
 
+	cv_init(>usc_wmi_cv, "athnwmi");
+	cv_init(>usc_htc_cv, "athnhtc");
+
 	cv_init(>usc_cmd_cv, "athncmd");
 	mutex_init(>usc_cmd_mtx, MUTEX_DEFAULT, IPL_SOFTUSB);
 	cv_init(>usc_msg_cv, "athnmsg");
@@ -337,6 +339,8 @@ athn_usb_attach(device_t parent, device_
 	cv_destroy(>usc_cmd_cv);
 	cv_destroy(>usc_msg_cv);
 
+	cv_destroy(>usc_wmi_cv);
+	cv_destroy(>usc_htc_cv);
 	mutex_destroy(>usc_lock);
 
 	mutex_destroy(>usc_cmd_mtx);
@@ -385,7 +389,7 @@ athn_usb_attachhook(device_t arg)
 	struct ieee80211com *ic = >sc_ic;
 	struct ifnet *ifp = >sc_if;
 	size_t i;
-	int s, error;
+	int error;
 
 	if (usc->usc_dying)
 		return;
@@ -406,24 +410,24 @@ athn_usb_attachhook(device_t arg)
 		return;
 
 	/* We're now ready to attach the bus agnostic driver. */
-	s = splnet();
 	ic->ic_ifp = ifp;
 	ic->ic_updateslot = athn_usb_updateslot;
 	sc->sc_max_aid = AR_USB_MAX_STA;  /* Firmware is limited to 8 STA */
 	sc->sc_media_change = athn_usb_media_change;
-	error = athn_attach(sc);
-	if (error != 0) {
-		splx(s);
-		return;
-	}
-	usc->usc_athn_attached = 1;
 
 	/* Override some operations for USB. */
 	ifp->if_init = athn_usb_init;
+	ifp->if_stop = athn_usb_stop;
 	ifp->if_ioctl = athn_usb_ioctl;
 	ifp->if_start = 

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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 19:36:03 UTC 2016

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

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6.8.16 -r1.6.8.17 src/sys/dev/usb/if_athn_usb.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_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.6.8.16 src/sys/dev/usb/if_athn_usb.c:1.6.8.17
--- src/sys/dev/usb/if_athn_usb.c:1.6.8.16	Wed Dec 28 19:29:03 2016
+++ src/sys/dev/usb/if_athn_usb.c	Wed Dec 28 19:36:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.6.8.16 2016/12/28 19:29:03 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.6.8.17 2016/12/28 19:36:03 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.16 2016/12/28 19:29:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.17 2016/12/28 19:36:03 skrll Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -1144,7 +1144,7 @@ athn_usb_htc_connect_svc(struct athn_usb
 Static int
 athn_usb_wait_msg(struct athn_usb_softc *usc)
 {
- 	DPRINTFN(DBG_FN, usc, "\n");
+	DPRINTFN(DBG_FN, usc, "\n");
 
 	KASSERT(mutex_owned(>usc_msg_mtx));
 



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 19:29:03 UTC 2016

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

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.6.8.15 -r1.6.8.16 src/sys/dev/usb/if_athn_usb.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_athn_usb.c
diff -u src/sys/dev/usb/if_athn_usb.c:1.6.8.15 src/sys/dev/usb/if_athn_usb.c:1.6.8.16
--- src/sys/dev/usb/if_athn_usb.c:1.6.8.15	Sat Dec 17 15:30:34 2016
+++ src/sys/dev/usb/if_athn_usb.c	Wed Dec 28 19:29:03 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_usb.c,v 1.6.8.15 2016/12/17 15:30:34 skrll Exp $	*/
+/*	$NetBSD: if_athn_usb.c,v 1.6.8.16 2016/12/28 19:29:03 skrll Exp $	*/
 /*	$OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.15 2016/12/17 15:30:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.6.8.16 2016/12/28 19:29:03 skrll Exp $");
 
 #ifdef	_KERNEL_OPT
 #include "opt_inet.h"
@@ -273,7 +273,7 @@ athn_usb_attach(device_t parent, device_
 	sc->sc_ops.write_barrier = athn_usb_write_barrier;
 
 	mutex_init(>usc_lock, MUTEX_DEFAULT, IPL_NONE);
-	
+
 	cv_init(>usc_cmd_cv, "athncmd");
 	mutex_init(>usc_cmd_mtx, MUTEX_DEFAULT, IPL_SOFTUSB);
 	cv_init(>usc_msg_cv, "athnmsg");
@@ -324,7 +324,7 @@ athn_usb_attach(device_t parent, device_
 	return;
 
  fail:
- 
+
 	/* Free Tx/Rx buffers. */
 	athn_usb_abort_pipes(usc);
 	athn_usb_free_tx_list(usc);
@@ -2697,7 +2697,7 @@ athn_usb_init(struct ifnet *ifp)
 
 	return ret;
 }
-  
+
 Static int
 athn_usb_init_locked(struct ifnet *ifp)
 {



CVS commit: src/sys/arch/sparc64

2016-12-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Dec 28 19:16:25 UTC 2016

Modified Files:
src/sys/arch/sparc64/include: ctlreg.h
src/sys/arch/sparc64/sparc64: cpu.c pmap.c

Log Message:
Rename the "flush" macro to "sparc_flush_icache", the former is way too
generic for a macro name.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/sparc64/include/ctlreg.h
cvs rdiff -u -r1.128 -r1.129 src/sys/arch/sparc64/sparc64/cpu.c
cvs rdiff -u -r1.305 -r1.306 src/sys/arch/sparc64/sparc64/pmap.c

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

Modified files:

Index: src/sys/arch/sparc64/include/ctlreg.h
diff -u src/sys/arch/sparc64/include/ctlreg.h:1.63 src/sys/arch/sparc64/include/ctlreg.h:1.64
--- src/sys/arch/sparc64/include/ctlreg.h:1.63	Wed Feb  3 20:33:52 2016
+++ src/sys/arch/sparc64/include/ctlreg.h	Wed Dec 28 19:16:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctlreg.h,v 1.63 2016/02/03 20:33:52 palle Exp $ */
+/*	$NetBSD: ctlreg.h,v 1.64 2016/12/28 19:16:25 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -865,8 +865,9 @@ SPARC64_ST_DEF64(stxa, uint64_t)
 
 
 
-/* flush address from data cache */
-#define	flush(loc) __asm volatile("flush %0" : : "r" ((__uintptr_t)(loc)))
+/* flush address from cache */
+#define	sparc_flush_icache(loc) __asm \
+	volatile("flush %0" : : "r" ((__uintptr_t)(loc)))
 
 /*
  * SPARC V9 memory barrier instructions.

Index: src/sys/arch/sparc64/sparc64/cpu.c
diff -u src/sys/arch/sparc64/sparc64/cpu.c:1.128 src/sys/arch/sparc64/sparc64/cpu.c:1.129
--- src/sys/arch/sparc64/sparc64/cpu.c:1.128	Sun Apr 17 14:32:03 2016
+++ src/sys/arch/sparc64/sparc64/cpu.c	Wed Dec 28 19:16:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.128 2016/04/17 14:32:03 martin Exp $ */
+/*	$NetBSD: cpu.c,v 1.129 2016/12/28 19:16:25 martin Exp $ */
 
 /*
  * Copyright (c) 1996
@@ -52,7 +52,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.128 2016/04/17 14:32:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.129 2016/12/28 19:16:25 martin Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -720,8 +720,9 @@ cpu_hatch(void)
 	char *v = (char*)CPUINFO_VA;
 	int i;
 
+	/* XXX - why flush the icache here? but should be harmless */
 	for (i = 0; i < 4*PAGE_SIZE; i += sizeof(long))
-		flush(v + i);
+		sparc_flush_icache(v + i);
 
 	cpu_pmap_init(curcpu());
 	CPUSET_ADD(cpus_active, cpu_number());

Index: src/sys/arch/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.305 src/sys/arch/sparc64/sparc64/pmap.c:1.306
--- src/sys/arch/sparc64/sparc64/pmap.c:1.305	Thu Dec 22 14:47:59 2016
+++ src/sys/arch/sparc64/sparc64/pmap.c	Wed Dec 28 19:16:25 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.305 2016/12/22 14:47:59 cherry Exp $	*/
+/*	$NetBSD: pmap.c,v 1.306 2016/12/28 19:16:25 martin Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.305 2016/12/22 14:47:59 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.306 2016/12/28 19:16:25 martin Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -576,7 +576,7 @@ pmap_mp_init(void)
 	}
 
 	for (i = 0; i < PAGE_SIZE; i += sizeof(long))
-		flush(v + i);
+		sparc_flush_icache(v + i);
 
 	cpu_spinup_trampoline = (vaddr_t)v;
 }



CVS commit: src/external/bsd/top/dist

2016-12-28 Thread Leonardo Taccari
Module Name:src
Committed By:   leot
Date:   Wed Dec 28 18:16:30 UTC 2016

Modified Files:
src/external/bsd/top/dist: top.1.in

Log Message:
Document the `p' command in "interactive mode" that filters processes by pid.
While here add date to the `.TH' macro 3rd argument.

Reviewed by and thanks to 


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/top/dist/top.1.in

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

Modified files:

Index: src/external/bsd/top/dist/top.1.in
diff -u src/external/bsd/top/dist/top.1.in:1.8 src/external/bsd/top/dist/top.1.in:1.9
--- src/external/bsd/top/dist/top.1.in:1.8	Sat Jan 23 22:10:44 2016
+++ src/external/bsd/top/dist/top.1.in	Wed Dec 28 18:16:30 2016
@@ -4,7 +4,7 @@
 .nr D @DEFAULT_DELAY@
 .nr L @HAVE_GETOPT_LONG@
 .nr K @ENABLE_KILL@
-.TH TOP 1 Local
+.TH TOP 1 "December 28, 2016"
 .UC 4
 .SH NAME
 top \- display and update information about the top cpu processes
@@ -301,6 +301,11 @@ but usually include:  \*(lqcpu\*(rq, \*(
 .B P
 Sort by CPU usage.  Shorthand for \*(lqo cpu\*(rq.
 .TP
+.B p
+Display only process with the specified pid (prompt for process id).
+If the pid specified is simply \*(lq-1\*(rq, then all processes are
+displayed.
+.TP
 .B q
 Quit
 .IR top.



CVS commit: xsrc/external/mit/xorg-server/dist/exa

2016-12-28 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Dec 28 15:37:59 UTC 2016

Modified Files:
xsrc/external/mit/xorg-server/dist/exa: exa_glyphs.c

Log Message:
back out previous - can be worked around elsewhere


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c

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

Modified files:

Index: xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c
diff -u xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c:1.2 xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c:1.3
--- xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c:1.2	Thu Dec 22 21:31:08 2016
+++ xsrc/external/mit/xorg-server/dist/exa/exa_glyphs.c	Wed Dec 28 15:37:59 2016
@@ -726,7 +726,7 @@ exaGlyphs(CARD8 op,
   serverClient, );
 if (!pMask ||
 (!component_alpha && pExaScr->info->CheckComposite &&
- !(*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, pMask, NULL)))
+ !(*pExaScr->info->CheckComposite) (PictOpAdd, pSrc, NULL, pMask)))
 {
 PictFormatPtr argbFormat;
 



CVS commit: src/sys/modules/npf

2016-12-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Dec 28 13:50:55 UTC 2016

Modified Files:
src/sys/modules/npf: Makefile

Log Message:
oops forgot to commit this one.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/modules/npf/Makefile

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/npf/Makefile
diff -u src/sys/modules/npf/Makefile:1.19 src/sys/modules/npf/Makefile:1.20
--- src/sys/modules/npf/Makefile:1.19	Thu Dec  8 21:41:09 2016
+++ src/sys/modules/npf/Makefile	Wed Dec 28 08:50:55 2016
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.19 2016/12/09 02:41:09 christos Exp $
+# $NetBSD: Makefile,v 1.20 2016/12/28 13:50:55 christos Exp $
 #
 # Public Domain.
 #
@@ -13,7 +13,7 @@ SRCS=		npf.c npf_alg.c npf_conf.c npf_ct
 SRCS+=		npf_bpf.c npf_if.c npf_inet.c npf_mbuf.c npf_nat.c
 SRCS+=		npf_ruleset.c npf_conn.c npf_conndb.c npf_rproc.c
 SRCS+=		npf_state.c npf_state_tcp.c npf_tableset.c
-SRCS+=		lpm.c npf_sendpkt.c npf_worker.c
+SRCS+=		lpm.c npf_sendpkt.c npf_worker.c npf_os.c
 
 CPPFLAGS+=	-DINET6
 



CVS commit: src/share/man/man9

2016-12-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Dec 28 11:44:58 UTC 2016

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

Log Message:
Use more macros.


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

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

Modified files:

Index: src/share/man/man9/ethersubr.9
diff -u src/share/man/man9/ethersubr.9:1.26 src/share/man/man9/ethersubr.9:1.27
--- src/share/man/man9/ethersubr.9:1.26	Wed Dec 28 07:26:24 2016
+++ src/share/man/man9/ethersubr.9	Wed Dec 28 11:44:58 2016
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ethersubr.9,v 1.26 2016/12/28 07:26:24 ozaki-r Exp $
+.\"	$NetBSD: ethersubr.9,v 1.27 2016/12/28 11:44:58 wiz Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -97,7 +97,9 @@ there.
 Drivers can initialize the link level address by themselves by calling
 the function with
 .Fa lla
-as NULL and calling
+as
+.Dv NULL
+and calling
 .Fn if_set_sadl .
 .Pp
 This function must be called from the driver's attach function.
@@ -193,4 +195,5 @@ Rewritten to attach to the new ARP syste
 .Sh AUTHORS
 UCB CSRG (original implementation)
 .Pp
-Ignatios Souvatzis (support for new ARP system)
+.An Ignatios Souvatzis
+(support for new ARP system)



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

2016-12-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 28 10:52:30 UTC 2016

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
PR port-powerpc/51368: powerpc FPU emulation fails for single precision
floating point arithmetic

For single precision instruction, calculate first in double precision,
and then round it. With this fix, single precision arithmetic gets sane
on ibm4xx and booke.

Taken from FreeBSD commit r258250:
  https://svnweb.freebsd.org/base?view=revision=258250

Ok matt and simonb.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.18 src/sys/arch/powerpc/fpu/fpu_emu.c:1.19
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.18	Thu Dec 15 11:32:03 2016
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Wed Dec 28 10:52:30 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.18 2016/12/15 11:32:03 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.19 2016/12/28 10:52:30 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.18 2016/12/15 11:32:03 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.19 2016/12/28 10:52:30 rin Exp $");
 
 #include "opt_ddb.h"
 
@@ -626,9 +626,11 @@ fpu_execute(struct trapframe *tf, struct
 			rb = instr.i_a.i_frb;
 			rc = instr.i_a.i_frc;
 
-			type = FTYPE_SNG;
-			if (instr.i_any.i_opcd & 0x4)
-type = FTYPE_DBL;
+			/*
+			 * All arithmetic operations work on registers, which
+			 * are stored as doubles.
+			 */
+			type = FTYPE_DBL;
 			switch ((unsigned int)instr.i_a.i_xo) {
 			case	OPC59_FDIVS:
 FPU_EMU_EVCNT_INCR(fdiv);
@@ -745,6 +747,13 @@ fpu_execute(struct trapframe *tf, struct
 return (NOTFPU);
 break;
 			}
+
+			/* If the instruction was single precision, round */
+			if (!(instr.i_any.i_opcd & 0x4)) {
+fpu_implode(fe, fp, FTYPE_SNG, 
+	(u_int *)>fpreg[rt]);
+fpu_explode(fe, fp = >fe_f1, FTYPE_SNG, rt);
+			}
 		}
 	} else {
 		return (NOTFPU);



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 10:44:27 UTC 2016

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

Log Message:
Set device transfer status to USBD_IN_PROGRESS if start methods succeeds


To generate a diff of this commit:
cvs rdiff -u -r1.254.2.83 -r1.254.2.84 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.254.2.83 src/sys/dev/usb/ohci.c:1.254.2.84
--- src/sys/dev/usb/ohci.c:1.254.2.83	Tue Dec 27 08:33:08 2016
+++ src/sys/dev/usb/ohci.c	Wed Dec 28 10:44:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.254.2.83 2016/12/27 08:33:08 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.254.2.84 2016/12/28 10:44:27 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.83 2016/12/27 08:33:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.84 2016/12/28 10:44:27 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2960,6 +2960,7 @@ ohci_device_ctrl_start(struct usbd_xfer 
 
 	DPRINTF("done", 0, 0, 0, 0);
 
+	xfer->ux_status = USBD_IN_PROGRESS;
 	mutex_exit(>sc_lock);
 
 	return USBD_IN_PROGRESS;
@@ -3171,6 +3172,8 @@ ohci_device_bulk_start(struct usbd_xfer 
 		callout_reset(>ux_callout, mstohz(xfer->ux_timeout),
 			ohci_timeout, xfer);
 	}
+
+	xfer->ux_status = USBD_IN_PROGRESS;
 	mutex_exit(>sc_lock);
 
 	return USBD_IN_PROGRESS;
@@ -3359,6 +3362,7 @@ ohci_device_intr_start(struct usbd_xfer 
 	usb_syncmem(>dma, sed->offs, sizeof(sed->ed),
 	BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
+	xfer->ux_status = USBD_IN_PROGRESS;
 	mutex_exit(>sc_lock);
 
 	return USBD_IN_PROGRESS;



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 10:42:59 UTC 2016

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

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.234.2.107 -r1.234.2.108 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.234.2.107 src/sys/dev/usb/ehci.c:1.234.2.108
--- src/sys/dev/usb/ehci.c:1.234.2.107	Tue Dec 27 10:37:52 2016
+++ src/sys/dev/usb/ehci.c	Wed Dec 28 10:42:59 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.234.2.107 2016/12/27 10:37:52 skrll Exp $ */
+/*	$NetBSD: ehci.c,v 1.234.2.108 2016/12/28 10:42:59 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.107 2016/12/27 10:37:52 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.234.2.108 2016/12/28 10:42:59 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -4490,7 +4490,6 @@ ehci_device_fs_isoc_transfer(struct usbd
 
 	ehci_add_intr_list(sc, exfer);
 	xfer->ux_status = USBD_IN_PROGRESS;
-
 	mutex_exit(>sc_lock);
 
 	return USBD_IN_PROGRESS;
@@ -4884,7 +4883,6 @@ ehci_device_isoc_transfer(struct usbd_xf
 
 	ehci_add_intr_list(sc, exfer);
 	xfer->ux_status = USBD_IN_PROGRESS;
-
 	mutex_exit(>sc_lock);
 
 	return USBD_IN_PROGRESS;



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

2016-12-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 28 10:30:04 UTC 2016

Modified Files:
src/sys/arch/powerpc/fpu: fpu_explode.c

Log Message:
- add missing default from FreeBSD
- remove duplicate panic pointed out by matt


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/powerpc/fpu/fpu_explode.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_explode.c
diff -u src/sys/arch/powerpc/fpu/fpu_explode.c:1.6 src/sys/arch/powerpc/fpu/fpu_explode.c:1.7
--- src/sys/arch/powerpc/fpu/fpu_explode.c:1.6	Sun Dec 11 12:18:42 2005
+++ src/sys/arch/powerpc/fpu/fpu_explode.c	Wed Dec 28 10:30:04 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_explode.c,v 1.6 2005/12/11 12:18:42 christos Exp $ */
+/*	$NetBSD: fpu_explode.c,v 1.7 2016/12/28 10:30:04 rin Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -46,7 +46,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.6 2005/12/11 12:18:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_explode.c,v 1.7 2016/12/28 10:30:04 rin Exp $");
 
 #include 
 #include 
@@ -235,7 +235,7 @@ fpu_explode(struct fpemu *fe, struct fpn
 		s = fpu_dtof(fp, s, space[1]);
 		break;
 
-		panic("fpu_explode");
+	default:
 		panic("fpu_explode: invalid type %d", type);
 	}
 



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 10:25:06 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: uhci.c uhcivar.h

Log Message:
Improve transfer abort


To generate a diff of this commit:
cvs rdiff -u -r1.264.4.78 -r1.264.4.79 src/sys/dev/usb/uhci.c
cvs rdiff -u -r1.52.14.18 -r1.52.14.19 src/sys/dev/usb/uhcivar.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/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.264.4.78 src/sys/dev/usb/uhci.c:1.264.4.79
--- src/sys/dev/usb/uhci.c:1.264.4.78	Mon Dec  5 10:55:18 2016
+++ src/sys/dev/usb/uhci.c	Wed Dec 28 10:25:06 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.264.4.78 2016/12/05 10:55:18 skrll Exp $	*/
+/*	$NetBSD: uhci.c,v 1.264.4.79 2016/12/28 10:25:06 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.78 2016/12/05 10:55:18 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.264.4.79 2016/12/28 10:25:06 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -574,8 +574,6 @@ uhci_init(uhci_softc_t *sc)
 
 	callout_init(>sc_poll_handle, CALLOUT_MPSAFE);
 
-	cv_init(>sc_softwake_cv, "uhciab");
-
 	/* Set up the bus struct. */
 	sc->sc_bus.ub_methods = _bus_methods;
 	sc->sc_bus.ub_pipesize = sizeof(struct uhci_pipe);
@@ -639,8 +637,6 @@ uhci_detach(struct uhci_softc *sc, int f
 	callout_halt(>sc_poll_handle, NULL);
 	callout_destroy(>sc_poll_handle);
 
-	cv_destroy(>sc_softwake_cv);
-
 	mutex_destroy(>sc_lock);
 	mutex_destroy(>sc_intr_lock);
 
@@ -1422,11 +1418,6 @@ uhci_softintr(void *v)
 		DPRINTF("ux %p", ux, 0, 0, 0);
 		usb_transfer_complete(>ux_xfer);
 	}
-
-	if (sc->sc_softwake) {
-		sc->sc_softwake = 0;
-		cv_broadcast(>sc_softwake_cv);
-	}
 }
 
 /* Check for an interrupt. */
@@ -1482,8 +1473,6 @@ uhci_check_intr(uhci_softc_t *sc, struct
 	if (!(status & UHCI_TD_ACTIVE)) {
  done:
 		DPRINTFN(12, "ux=%p done", ux, 0, 0, 0);
-
-		callout_stop(>ux_callout);
 		uhci_idone(ux, cqp);
 		return;
 	}
@@ -1554,18 +1543,30 @@ uhci_check_intr(uhci_softc_t *sc, struct
 void
 uhci_idone(struct uhci_xfer *ux, ux_completeq_t *cqp)
 {
+	UHCIHIST_FUNC(); UHCIHIST_CALLED();
 	struct usbd_xfer *xfer = >ux_xfer;
 	uhci_softc_t *sc __diagused = UHCI_XFER2SC(xfer);
 	struct uhci_pipe *upipe = UHCI_PIPE2UPIPE(xfer->ux_pipe);
 	uhci_soft_td_t *std;
 	uint32_t status = 0, nstatus;
+	bool polling = sc->sc_bus.ub_usepolling;
 	int actlen;
 
 	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(>sc_lock));
 
-	UHCIHIST_FUNC(); UHCIHIST_CALLED();
 	DPRINTFN(12, "ux=%p", ux, 0, 0, 0);
 
+	/*
+	 * Make sure the timeout handler didn't run or ran to the end
+	 * and set the transfer status.
+	 */
+	callout_halt(>ux_callout, polling ? NULL : >sc_lock);
+	if (xfer->ux_status == USBD_CANCELLED ||
+	xfer->ux_status == USBD_TIMEOUT) {
+ 		DPRINTF("aborted xfer=%p", xfer, 0, 0, 0);
+		return;
+	}
+
 #ifdef DIAGNOSTIC
 #ifdef UHCI_DEBUG
 	if (ux->ux_isdone) {
@@ -1699,26 +1700,32 @@ uhci_idone(struct uhci_xfer *ux, ux_comp
 void
 uhci_timeout(void *addr)
 {
+	UHCIHIST_FUNC(); UHCIHIST_CALLED();
 	struct usbd_xfer *xfer = addr;
-	struct uhci_xfer *uxfer = UHCI_XFER2UXFER(xfer);
 	uhci_softc_t *sc = UHCI_XFER2SC(xfer);
+	bool timeout = false;
 
-	UHCIHIST_FUNC(); UHCIHIST_CALLED();
-
-	DPRINTF("uxfer %p", uxfer, 0, 0, 0);
+	DPRINTF("xfer %p", xfer, 0, 0, 0);
 
+	mutex_enter(>sc_lock);
 	if (sc->sc_dying) {
-		mutex_enter(>sc_lock);
-		uhci_abort_xfer(xfer, USBD_TIMEOUT);
 		mutex_exit(>sc_lock);
 		return;
 	}
+	if (xfer->ux_status != USBD_CANCELLED) {
+		xfer->ux_status = USBD_TIMEOUT;
+		timeout = true;
+	}
+	mutex_exit(>sc_lock);
 
-	/* Execute the abort in a process context. */
-	usb_init_task(>ux_aborttask, uhci_timeout_task, xfer,
-	USB_TASKQ_MPSAFE);
-	usb_add_task(uxfer->ux_xfer.ux_pipe->up_dev, >ux_aborttask,
-	USB_TASKQ_HC);
+	if (timeout) {
+		struct usbd_device *dev = xfer->ux_pipe->up_dev;
+
+		/* Execute the abort in a process context. */
+		usb_init_task(>ux_aborttask, uhci_timeout_task, xfer,
+		USB_TASKQ_MPSAFE);
+		usb_add_task(dev, >ux_aborttask, USB_TASKQ_HC);
+	}
 }
 
 void
@@ -1732,6 +1739,7 @@ uhci_timeout_task(void *addr)
 	DPRINTF("xfer=%p", xfer, 0, 0, 0);
 
 	mutex_enter(>sc_lock);
+	KASSERT(xfer->ux_status == USBD_TIMEOUT);
 	uhci_abort_xfer(xfer, USBD_TIMEOUT);
 	mutex_exit(>sc_lock);
 }
@@ -2323,16 +2331,18 @@ uhci_device_bulk_abort(struct usbd_xfer 
 }
 
 /*
- * Abort a device request.
- * If this routine is called at splusb() it guarantees that the request
- * will be removed from the hardware scheduling and that the callback
- * for it will be called with USBD_CANCELLED status.
+ * Cancel or timeout a device request.  We have two cases to deal with
+ *
+ * 1) A driver wants to stop scheduled or inflight transfers
+ * 2) A transfer has timed out
+ *
  * It's impossible to guarantee 

CVS commit: src/sys/dev/ic

2016-12-28 Thread Nathanial Sloss
Module Name:src
Committed By:   nat
Date:   Wed Dec 28 10:04:53 UTC 2016

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

Log Message:
Add slinear encoding.  Tested by flxd@

Addresses PR kern/51703: audio fails to attach if hardware can't do CD
quality.

Autoconfiguration of hw paramaters to be done later.  For now it is
possibile to set 8 bits precision 8000 Hz 1 channel via sysctls.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/am7930.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/am7930.c
diff -u src/sys/dev/ic/am7930.c:1.52 src/sys/dev/ic/am7930.c:1.53
--- src/sys/dev/ic/am7930.c:1.52	Sat Dec 20 23:36:21 2014
+++ src/sys/dev/ic/am7930.c	Wed Dec 28 10:04:53 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: am7930.c,v 1.52 2014/12/20 23:36:21 jklos Exp $	*/
+/*	$NetBSD: am7930.c,v 1.53 2016/12/28 10:04:53 nat Exp $	*/
 
 /*
  * Copyright (c) 1995 Rolf Grossmann
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.52 2014/12/20 23:36:21 jklos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1.53 2016/12/28 10:04:53 nat Exp $");
 
 #include "audio.h"
 #if NAUDIO > 0
@@ -53,6 +53,7 @@ __KERNEL_RCSID(0, "$NetBSD: am7930.c,v 1
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -229,7 +230,8 @@ am7930_set_params(void *addr, int setmod
 	sc = addr;
 	if ((usemode & AUMODE_PLAY) == AUMODE_PLAY) {
 		if (p->sample_rate < 7500 || p->sample_rate > 8500 ||
-			p->encoding != AUDIO_ENCODING_ULAW ||
+			(p->encoding != AUDIO_ENCODING_ULAW &&
+			 p->encoding != AUDIO_ENCODING_SLINEAR) ||
 			p->precision != 8 ||
 			p->channels != 1)
 return EINVAL;
@@ -243,7 +245,8 @@ am7930_set_params(void *addr, int setmod
 	}
 	if ((usemode & AUMODE_RECORD) == AUMODE_RECORD) {
 		if (r->sample_rate < 7500 || r->sample_rate > 8500 ||
-			r->encoding != AUDIO_ENCODING_ULAW ||
+			(r->encoding != AUDIO_ENCODING_ULAW &&
+			 r->encoding != AUDIO_ENCODING_SLINEAR) ||
 			r->precision != 8 ||
 			r->channels != 1)
 return EINVAL;
@@ -256,6 +259,14 @@ am7930_set_params(void *addr, int setmod
 		}
 	}
 
+	if (p->encoding == AUDIO_ENCODING_SLINEAR ||
+	r->encoding == AUDIO_ENCODING_SLINEAR) {
+		hw.encoding = AUDIO_ENCODING_ULAW;
+		pfil->req_size = rfil->req_size = 0;
+		pfil->append(rfil, mulaw_to_linear8, );
+		rfil->append(pfil, linear8_to_mulaw, );
+	}
+
 	return 0;
 }
 
@@ -269,6 +280,12 @@ am7930_query_encoding(void *addr, struct
 		fp->precision = 8;
 		fp->flags = 0;
 		break;
+	case 1:
+		strcpy(fp->name, AudioEslinear);
+		fp->encoding = AUDIO_ENCODING_SLINEAR;
+		fp->precision = 8;
+		fp->flags = AUDIO_ENCODINGFLAG_EMULATED;
+		break;
 	default:
 		return EINVAL;
 		/*NOTREACHED*/



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 09:45:16 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_aue.c if_axen.c if_cdce.c if_cue.c
if_smsc.c if_udav.c if_urndis.c

Log Message:
Destroy all mutexes on detach


To generate a diff of this commit:
cvs rdiff -u -r1.132.4.15 -r1.132.4.16 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.3.6.13 -r1.3.6.14 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.38.14.10 -r1.38.14.11 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.68.4.13 -r1.68.4.14 src/sys/dev/usb/if_cue.c
cvs rdiff -u -r1.22.2.17 -r1.22.2.18 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.43.4.12 -r1.43.4.13 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.9.4.12 -r1.9.4.13 src/sys/dev/usb/if_urndis.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_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.132.4.15 src/sys/dev/usb/if_aue.c:1.132.4.16
--- src/sys/dev/usb/if_aue.c:1.132.4.15	Mon Dec 12 13:17:56 2016
+++ src/sys/dev/usb/if_aue.c	Wed Dec 28 09:45:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.132.4.15 2016/12/12 13:17:56 skrll Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.132.4.16 2016/12/28 09:45:16 skrll Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.132.4.15 2016/12/12 13:17:56 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.132.4.16 2016/12/28 09:45:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -933,6 +933,9 @@ aue_detach(device_t self, int flags)
 	usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->aue_udev, sc->aue_dev);
 
 	mutex_destroy(>aue_mii_lock);
+	mutex_destroy(>aue_lock);
+	mutex_destroy(>aue_txlock);
+	mutex_destroy(>aue_rxlock);
 #if 0
 	mutex_destroy(>wkmtx);
 #endif

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.3.6.13 src/sys/dev/usb/if_axen.c:1.3.6.14
--- src/sys/dev/usb/if_axen.c:1.3.6.13	Mon Dec 12 13:15:39 2016
+++ src/sys/dev/usb/if_axen.c	Wed Dec 28 09:45:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.3.6.13 2016/12/12 13:15:39 skrll Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.3.6.14 2016/12/28 09:45:16 skrll Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.3.6.13 2016/12/12 13:15:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.3.6.14 2016/12/28 09:45:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -874,6 +874,10 @@ axen_detach(device_t self, int flags)
 
 	rw_destroy(>axen_mii_lock);
 
+	mutex_destroy(>axen_txlock);
+	mutex_destroy(>axen_rxlock);
+	mutex_destroy(>axen_lock);
+
 	return 0;
 }
 

Index: src/sys/dev/usb/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.38.14.10 src/sys/dev/usb/if_cdce.c:1.38.14.11
--- src/sys/dev/usb/if_cdce.c:1.38.14.10	Mon Dec 12 13:15:39 2016
+++ src/sys/dev/usb/if_cdce.c	Wed Dec 28 09:45:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.38.14.10 2016/12/12 13:15:39 skrll Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.38.14.11 2016/12/28 09:45:16 skrll Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul 
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.38.14.10 2016/12/12 13:15:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.38.14.11 2016/12/28 09:45:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -332,6 +332,10 @@ cdce_detach(device_t self, int flags)
 
 	if_detach(ifp);
 
+	mutex_destroy(>cdce_rxlock);
+	mutex_destroy(>cdce_txlock);
+	mutex_destroy(>cdce_lock);
+
 	sc->cdce_attached = 0;
 	splx(s);
 

Index: src/sys/dev/usb/if_cue.c
diff -u src/sys/dev/usb/if_cue.c:1.68.4.13 src/sys/dev/usb/if_cue.c:1.68.4.14
--- src/sys/dev/usb/if_cue.c:1.68.4.13	Mon Dec 12 13:15:39 2016
+++ src/sys/dev/usb/if_cue.c	Wed Dec 28 09:45:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cue.c,v 1.68.4.13 2016/12/12 13:15:39 skrll Exp $	*/
+/*	$NetBSD: if_cue.c,v 1.68.4.14 2016/12/28 09:45:16 skrll Exp $	*/
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
  *	Bill Paul .  All rights reserved.
@@ -56,7 +56,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.68.4.13 2016/12/12 13:15:39 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cue.c,v 1.68.4.14 2016/12/28 09:45:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -613,6 +613,10 @@ cue_detach(device_t self, int flags)
 		aprint_debug_dev(self, "detach has active endpoints\n");
 #endif
 
+	mutex_destroy(>cue_rxlock);
+	mutex_destroy(>cue_txlock);
+	mutex_destroy(>cue_lock);
+
 	sc->cue_attached = 0;
 	splx(s);
 

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.22.2.17 src/sys/dev/usb/if_smsc.c:1.22.2.18
--- src/sys/dev/usb/if_smsc.c:1.22.2.17	Wed Dec 28 07:44:26 2016
+++ src/sys/dev/usb/if_smsc.c	Wed Dec 28 09:45:16 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.22.2.17 

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

2016-12-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 28 09:36:02 UTC 2016

Modified Files:
src/sys/arch/powerpc/ibm4xx: trap_subr.S

Log Message:
PR port-powerpc/51367: kernel panic for powerpc/ibm4xx with "option DDB"

Stop using ddbstk/ipkdbstk to make nested traps possible, which avoids
kernel panics reported in the PR.

Suggested and approved by matt.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/ibm4xx/trap_subr.S

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

Modified files:

Index: src/sys/arch/powerpc/ibm4xx/trap_subr.S
diff -u src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.25 src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.26
--- src/sys/arch/powerpc/ibm4xx/trap_subr.S:1.25	Mon Dec 26 20:28:00 2016
+++ src/sys/arch/powerpc/ibm4xx/trap_subr.S	Wed Dec 28 09:36:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap_subr.S,v 1.25 2016/12/26 20:28:00 rin Exp $	*/
+/*	$NetBSD: trap_subr.S,v 1.26 2016/12/28 09:36:02 rin Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -191,20 +191,9 @@ _C_LABEL(extsize) = .-_C_LABEL(extint)
 /*
  * In case of DDB we want a separate trap catcher for it
  */
-	.lcomm	ddbstk,INTSTK,16	/* ddb stack */
-
 	.globl	_C_LABEL(ddblow),_C_LABEL(ddbsize)
 _C_LABEL(ddblow):
-	mtsprg1	%r1			/* save SP */
-	GET_CPUINFO(%r1)
-	stmw	%r28,CI_DDBSAVE(%r1)	/* free r28-r31 */
-	mflr	%r28			/* save LR */
-	mfcr	%r29			/* save CR */
-	mfsrr0	%r30
-	mfsrr1	%r31
-	stmw	%r30,(CI_DDBSAVE+CPUSAVE_SRR0)(%r1)	/* save srr0/srr1 */
-	lis	%r1,ddbstk+INTSTK-CALLFRAMELEN@ha	/* get new SP */
-	addi	%r1,%r1,ddbstk+INTSTK-CALLFRAMELEN@l
+	ACCESS_PROLOG(CI_DDBSAVE)
 	bla	ddbtrap
 _C_LABEL(ddbsize) = .-_C_LABEL(ddblow)
 #endif	/* DDB || KGDB */
@@ -213,21 +202,9 @@ _C_LABEL(ddbsize) = .-_C_LABEL(ddblow)
 /*
  * In case of IPKDB we want a separate trap catcher for it
  */
-
-	.lcomm	ipkdbstk,INTSTK,16	/* ipkdb stack */
-
 	.globl	_C_LABEL(ipkdblow),_C_LABEL(ipkdbsize)
 _C_LABEL(ipkdblow):
-	mtsprg1	%r1			/* save SP */
-	GET_CPUINFO(%r1)
-	stmw	%r28,CI_IPKDBSAVE(%r1)	/* free r28-r31 */
-	mflr	%r28			/* save LR */
-	mfcr	%r29			/* save CR */
-	mfsrr0	%r30
-	mfsrr1	%r31
-	stmw	%r30,(CI_IPKDBSAVE+CPUSAVE_SRR0)(%r1)	/* save srr0/srr1 */
-	lis	%r1,ipkdbstk+INTSTK-CALLFRAMELEN@ha	/* get new SP */
-	addi	%r1,%r1,ipkdbstk+INTSTK-CALLFRAMELEN@l
+	ACCESS_PROLOG(CI_IPKDBSAVE)
 	bla	ipkdbtrap
 _C_LABEL(ipkdbsize) = .-_C_LABEL(ipkdblow)
 #endif	/* IPKDB */



CVS commit: src/sys/dev/pci/ixgbe

2016-12-28 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Dec 28 09:29:35 UTC 2016

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

Log Message:
 Fix a bug that hw.ixgN.wol_enable=0 doesn't work correctly. Clear the WUC
and WUFC register if wol_enable is 0. ixgbe_setup_low_power_mode() calls
ixgbe_stop() and it resets the chip. The reset change WUC and WUFC registers to
the default, so clearing WUC and WUFC should be done after ixgbe_stop().


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/dev/pci/ixgbe/ixgbe.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/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.57 src/sys/dev/pci/ixgbe/ixgbe.c:1.58
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.57	Wed Dec 28 07:05:11 2016
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Wed Dec 28 09:29:35 2016
@@ -59,7 +59,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/
-/*$NetBSD: ixgbe.c,v 1.57 2016/12/28 07:05:11 msaitoh Exp $*/
+/*$NetBSD: ixgbe.c,v 1.58 2016/12/28 09:29:35 msaitoh Exp $*/
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -4157,12 +4157,27 @@ ixgbe_setup_low_power_mode(struct adapte
 
 	KASSERT(mutex_owned(>core_mtx));
 
-	if (!hw->wol_enabled)
-		ixgbe_set_phy_power(hw, FALSE);
-
 	/* Limit power management flow to X550EM baseT */
 	if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T
 	&& hw->phy.ops.enter_lplu) {
+		/* X550EM baseT adapters need a special LPLU flow */
+		hw->phy.reset_disable = true;
+		ixgbe_stop(adapter);
+		error = hw->phy.ops.enter_lplu(hw);
+		if (error)
+			device_printf(dev,
+			"Error entering LPLU: %d\n", error);
+		hw->phy.reset_disable = false;
+	} else {
+		/* Just stop for other adapters */
+		ixgbe_stop(adapter);
+	}
+
+	if (!hw->wol_enabled) {
+		ixgbe_set_phy_power(hw, FALSE);
+		IXGBE_WRITE_REG(hw, IXGBE_WUFC, 0);
+		IXGBE_WRITE_REG(hw, IXGBE_WUC, 0);
+	} else {
 		/* Turn off support for APM wakeup. (Using ACPI instead) */
 		IXGBE_WRITE_REG(hw, IXGBE_GRC,
 		IXGBE_READ_REG(hw, IXGBE_GRC) & ~(u32)2);
@@ -4183,17 +4198,6 @@ ixgbe_setup_low_power_mode(struct adapte
 		IXGBE_WRITE_REG(hw, IXGBE_WUC,
 		IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN);
 
-		/* X550EM baseT adapters need a special LPLU flow */
-		hw->phy.reset_disable = true;
-		ixgbe_stop(adapter);
-		error = hw->phy.ops.enter_lplu(hw);
-		if (error)
-			device_printf(dev,
-			"Error entering LPLU: %d\n", error);
-		hw->phy.reset_disable = false;
-	} else {
-		/* Just stop for other adapters */
-		ixgbe_stop(adapter);
 	}
 
 	return error;



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

2016-12-28 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 28 08:57:20 UTC 2016

Modified Files:
src/distrib/sets/lists/comp: ad.mips

Log Message:
Add missing "compat" qualifier to fix build with MKCOMPAT=no for mips64-e[bl].
Also, add "softfloat" to /usr/lib/{64,o32}/libc_fp_pic.a.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/comp/ad.mips

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/ad.mips
diff -u src/distrib/sets/lists/comp/ad.mips:1.67 src/distrib/sets/lists/comp/ad.mips:1.68
--- src/distrib/sets/lists/comp/ad.mips:1.67	Wed Dec 14 12:59:51 2016
+++ src/distrib/sets/lists/comp/ad.mips	Wed Dec 28 08:57:20 2016
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.67 2016/12/14 12:59:51 kre Exp $
+# $NetBSD: ad.mips,v 1.68 2016/12/28 08:57:20 rin Exp $
 -./usr/lib/64/libgomp.a
 -./usr/lib/64/libgomp.so
 -./usr/lib/64/libgomp.so.1
@@ -7,12 +7,12 @@
 -./usr/lib/64/libgomp_pic.a
 ./usr/bin/elf2aoutcomp-obsolete		obsolete
 ./usr/bin/elf2ecoffcomp-sysutil-bin
-./usr/include/g++/bits/mips32			comp-c-include		arch64
-./usr/include/g++/bits/mips32/c++config.h	comp-c-include		arch64,gcc
-./usr/include/g++/bits/mips64			comp-c-include		arch64
-./usr/include/g++/bits/mips64/c++config.h	comp-c-include		arch64,gcc
-./usr/include/g++/bits/mipso32			comp-c-include		arch64
-./usr/include/g++/bits/mipso32/c++config.h	comp-c-include		arch64,gcc
+./usr/include/g++/bits/mips32			comp-c-include		compat,arch64
+./usr/include/g++/bits/mips32/c++config.h	comp-c-include		compat,arch64,gcc
+./usr/include/g++/bits/mips64			comp-c-include		compat,arch64
+./usr/include/g++/bits/mips64/c++config.h	comp-c-include		compat,arch64,gcc
+./usr/include/g++/bits/mipso32			comp-c-include		compat,arch64
+./usr/include/g++/bits/mipso32/c++config.h	comp-c-include		compat,arch64,gcc
 ./usr/include/gcc-4.8/loongson.h		comp-c-include		gcccmds,gcc=48
 ./usr/include/gcc-4.8/tgmath.h			comp-c-include		gcccmds,gcc=48
 ./usr/include/gcc-5/loongson.h			comp-c-include		gcccmds,gcc=53
@@ -78,15 +78,15 @@
 ./usr/include/mips/varargs.h			comp-obsolete		obsolete
 ./usr/include/mips/vmparam.h			comp-c-include
 ./usr/include/mips/wchar_limits.h		comp-c-include
-./usr/lib/64/libc_fp.acomp-c-lib		softfloat,arch64
-./usr/lib/64/libc_fp_p.a			comp-c-lib		profile,softfloat,arch64
-./usr/lib/64/libc_fp_pic.a			comp-c-piclib		picinstall,compat,arch64
+./usr/lib/64/libc_fp.acomp-c-lib		softfloat,compat,arch64
+./usr/lib/64/libc_fp_p.a			comp-c-lib		profile,softfloat,compat,arch64
+./usr/lib/64/libc_fp_pic.a			comp-c-piclib		softfloat,picinstall,compat,arch64
 ./usr/lib/libc_fp.acomp-c-lib		softfloat,arch64
 ./usr/lib/libc_fp_p.acomp-c-lib		profile,softfloat,arch64
 ./usr/lib/libc_fp_pic.acomp-c-piclib		softfloat,picinstall,arch64
-./usr/lib/o32/libc_fp.acomp-c-lib		softfloat,arch64
-./usr/lib/o32/libc_fp_p.a			comp-c-lib		profile,softfloat,arch64
-./usr/lib/o32/libc_fp_pic.a			comp-c-piclib		picinstall,compat,arch64
+./usr/lib/o32/libc_fp.acomp-c-lib		softfloat,compat,arch64
+./usr/lib/o32/libc_fp_p.a			comp-c-lib		profile,softfloat,compat,arch64
+./usr/lib/o32/libc_fp_pic.a			comp-c-piclib		softfloat,picinstall,compat,arch64
 ./usr/libdata/ldscripts/elf32btsmip.x		comp-util-bin		binutils,arch64
 ./usr/libdata/ldscripts/elf32btsmip.xbn		comp-util-bin		binutils,arch64
 ./usr/libdata/ldscripts/elf32btsmip.xc		comp-util-bin		binutils,arch64



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 08:55:20 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_urndisreg.h

Log Message:
Missed commit in MPification


To generate a diff of this commit:
cvs rdiff -u -r1.1.32.3 -r1.1.32.4 src/sys/dev/usb/if_urndisreg.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/if_urndisreg.h
diff -u src/sys/dev/usb/if_urndisreg.h:1.1.32.3 src/sys/dev/usb/if_urndisreg.h:1.1.32.4
--- src/sys/dev/usb/if_urndisreg.h:1.1.32.3	Mon Dec  5 10:55:18 2016
+++ src/sys/dev/usb/if_urndisreg.h	Wed Dec 28 08:55:20 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urndisreg.h,v 1.1.32.3 2016/12/05 10:55:18 skrll Exp $ */
+/*	$NetBSD: if_urndisreg.h,v 1.1.32.4 2016/12/28 08:55:20 skrll Exp $ */
 /*	$OpenBSD: if_urndisreg.h,v 1.14 2010/07/08 18:22:01 ckuethe Exp $ */
 
 /*
@@ -42,6 +42,10 @@ struct urndis_cdata {
 struct urndis_softc {
 	device_t			sc_dev;
 
+	kmutex_t			urndis_lock;
+	kmutex_t			urndis_txlock;
+	kmutex_t			urndis_rxlock;
+
 	charsc_attached;
 	intsc_dying;
 	struct ethercom			sc_ec;
@@ -63,6 +67,8 @@ struct urndis_softc {
 	struct usbd_pipe *		sc_bulkout_pipe;
 
 	struct urndis_cdata		sc_data;
+
+	struct if_percpuq *		urndis_ipq;
 };
 
 #define RNDIS_STATUS_BUFFER_OVERFLOW 	0x8005L



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

2016-12-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Dec 28 08:53:56 UTC 2016

Modified Files:
src/sys/dev/usb [nick-nhusb]: if_smscvar.h

Log Message:
Missed commit


To generate a diff of this commit:
cvs rdiff -u -r1.3.4.4 -r1.3.4.5 src/sys/dev/usb/if_smscvar.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/if_smscvar.h
diff -u src/sys/dev/usb/if_smscvar.h:1.3.4.4 src/sys/dev/usb/if_smscvar.h:1.3.4.5
--- src/sys/dev/usb/if_smscvar.h:1.3.4.4	Fri Jul 15 08:50:59 2016
+++ src/sys/dev/usb/if_smscvar.h	Wed Dec 28 08:53:56 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smscvar.h,v 1.3.4.4 2016/07/15 08:50:59 skrll Exp $	*/
+/*	$NetBSD: if_smscvar.h,v 1.3.4.5 2016/12/28 08:53:56 skrll Exp $	*/
 
 /*	$OpenBSD: if_smscreg.h,v 1.2 2012/09/27 12:38:11 jsg Exp $	*/
 /*-
@@ -56,6 +56,7 @@ struct smsc_softc {
 	device_t		sc_dev;
 	struct usbd_device *	sc_udev;
 	bool			sc_dying;
+	bool			sc_stopping;
 
 	uint8_t			sc_enaddr[ETHER_ADDR_LEN];
 	struct ethercom		sc_ec;