CVS commit: src/sys/netipsec

2018-05-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May 10 05:15:14 UTC 2018

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
Replace dumb code by M_VERIFY_PACKET. In fact, perhaps we should not even
call M_VERIFY_PACKET here, there is no particular reason for this place to
be more wrong than the rest.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/netipsec/ipsec.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/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.162 src/sys/netipsec/ipsec.c:1.163
--- src/sys/netipsec/ipsec.c:1.162	Thu May 10 05:08:53 2018
+++ src/sys/netipsec/ipsec.c	Thu May 10 05:15:14 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.163 2018/05/10 05:15:14 maxv Exp $ */
 /* $FreeBSD: ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.163 2018/05/10 05:15:14 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -814,29 +814,10 @@ ipsec_setspidx(struct mbuf *m, struct se
 	struct ip *ip = NULL;
 	struct ip ipbuf;
 	u_int v;
-	struct mbuf *n;
-	int len;
 	int error;
 
 	KASSERT(m != NULL);
-
-	/*
-	 * validate m->m_pkthdr.len.  we see incorrect length if we
-	 * mistakenly call this function with inconsistent mbuf chain
-	 * (like 4.4BSD tcp/udp processing).
-	 *
-	 * XXX XXX XXX: We should remove this.
-	 */
-	len = 0;
-	for (n = m; n; n = n->m_next)
-		len += n->m_len;
-	if (m->m_pkthdr.len != len) {
-		KEYDEBUG_PRINTF(KEYDEBUG_IPSEC_DUMP,
-		"total of m_len(%d) != pkthdr.len(%d), ignored.\n",
-		len, m->m_pkthdr.len);
-		KASSERTMSG(0, "impossible");
-		return EINVAL;
-	}
+	M_VERIFY_PACKET(m);
 
 	if (m->m_pkthdr.len < sizeof(struct ip)) {
 		KEYDEBUG_PRINTF(KEYDEBUG_IPSEC_DUMP,



CVS commit: src/sys/netipsec

2018-05-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May 10 05:15:14 UTC 2018

Modified Files:
src/sys/netipsec: ipsec.c

Log Message:
Replace dumb code by M_VERIFY_PACKET. In fact, perhaps we should not even
call M_VERIFY_PACKET here, there is no particular reason for this place to
be more wrong than the rest.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/netipsec/ipsec.c

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



CVS commit: src/sys

2018-05-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May 10 05:08:53 UTC 2018

Modified Files:
src/sys/netinet: ip_input.c
src/sys/netipsec: ipsec.c ipsec.h
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Rename ipsec4_forward -> ipsec_mtu, and switch to void.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.161 -r1.162 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.80 -r1.81 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.34 -r1.35 src/sys/rump/librump/rumpnet/net_stub.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/netinet/ip_input.c
diff -u src/sys/netinet/ip_input.c:1.381 src/sys/netinet/ip_input.c:1.382
--- src/sys/netinet/ip_input.c:1.381	Thu Apr 26 19:22:17 2018
+++ src/sys/netinet/ip_input.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_input.c,v 1.381 2018/04/26 19:22:17 maxv Exp $	*/
+/*	$NetBSD: ip_input.c,v 1.382 2018/05/10 05:08:53 maxv Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.381 2018/04/26 19:22:17 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.382 2018/05/10 05:08:53 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1468,7 +1468,7 @@ error:
 		}
 #ifdef IPSEC
 		if (ipsec_used)
-			(void)ipsec4_forward(mcopy, );
+			ipsec_mtu(mcopy, );
 #endif
 		IP_STATINC(IP_STAT_CANTFRAG);
 		break;

Index: src/sys/netipsec/ipsec.c
diff -u src/sys/netipsec/ipsec.c:1.161 src/sys/netipsec/ipsec.c:1.162
--- src/sys/netipsec/ipsec.c:1.161	Sun Apr 29 11:51:08 2018
+++ src/sys/netipsec/ipsec.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ipsec.c,v 1.161 2018/04/29 11:51:08 maxv Exp $ */
+/* $NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 maxv Exp $ */
 /* $FreeBSD: ipsec.c,v 1.2.2.2 2003/07/01 01:38:13 sam Exp $ */
 /* $KAME: ipsec.c,v 1.103 2001/05/24 07:14:18 sakane Exp $ */
 
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.161 2018/04/29 11:51:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ipsec.c,v 1.162 2018/05/10 05:08:53 maxv Exp $");
 
 /*
  * IPsec controller part.
@@ -737,8 +737,8 @@ ipsec4_input(struct mbuf *m, int flags)
  *
  * XXX: And what if the MTU goes negative?
  */
-int
-ipsec4_forward(struct mbuf *m, int *destmtu)
+void
+ipsec_mtu(struct mbuf *m, int *destmtu)
 {
 	struct secpolicy *sp;
 	size_t ipsechdr;
@@ -747,14 +747,14 @@ ipsec4_forward(struct mbuf *m, int *dest
 	sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING,
 	);
 	if (sp == NULL) {
-		return EINVAL;
+		return;
 	}
 
 	/* Count IPsec header size. */
 	ipsechdr = ipsec_sp_hdrsiz(sp, m);
 
 	/*
-	 * Find the correct route for outer IPv4 header, compute tunnel MTU.
+	 * Find the correct route for outer IP header, compute tunnel MTU.
 	 */
 	if (sp->req) {
 		struct secasvar *sav;
@@ -776,7 +776,6 @@ ipsec4_forward(struct mbuf *m, int *dest
 		}
 	}
 	KEY_SP_UNREF();
-	return 0;
 }
 
 static int

Index: src/sys/netipsec/ipsec.h
diff -u src/sys/netipsec/ipsec.h:1.80 src/sys/netipsec/ipsec.h:1.81
--- src/sys/netipsec/ipsec.h:1.80	Tue May  1 08:34:08 2018
+++ src/sys/netipsec/ipsec.h	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipsec.h,v 1.80 2018/05/01 08:34:08 maxv Exp $	*/
+/*	$NetBSD: ipsec.h,v 1.81 2018/05/10 05:08:53 maxv Exp $	*/
 /*	$FreeBSD: ipsec.h,v 1.2.4.2 2004/02/14 22:23:23 bms Exp $	*/
 /*	$KAME: ipsec.h,v 1.53 2001/11/20 08:32:38 itojun Exp $	*/
 
@@ -257,7 +257,8 @@ void ipsec_invalpcbcacheall(void);
 struct inpcb;
 int ipsec4_output(struct mbuf *, struct inpcb *, int, u_long *, bool *, bool *);
 int ipsec4_input(struct mbuf *, int);
-int ipsec4_forward(struct mbuf *, int *);
+
+void ipsec_mtu(struct mbuf *, int *);
 
 struct inpcb;
 int ipsec_init_pcbpolicy(struct socket *so, struct inpcbpolicy **);

Index: src/sys/rump/librump/rumpnet/net_stub.c
diff -u src/sys/rump/librump/rumpnet/net_stub.c:1.34 src/sys/rump/librump/rumpnet/net_stub.c:1.35
--- src/sys/rump/librump/rumpnet/net_stub.c:1.34	Sat May  5 23:42:00 2018
+++ src/sys/rump/librump/rumpnet/net_stub.c	Thu May 10 05:08:53 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: net_stub.c,v 1.34 2018/05/05 23:42:00 christos Exp $	*/
+/*	$NetBSD: net_stub.c,v 1.35 2018/05/10 05:08:53 maxv Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.34 2018/05/05 23:42:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: net_stub.c,v 1.35 2018/05/10 05:08:53 maxv Exp $");
 
 #include 
 #include 
@@ -97,12 +97,12 @@ __weak_alias(esp4_ctlinput,rumpnet_stub)
 __weak_alias(esp6_ctlinput,rumpnet_stub);
 __weak_alias(ipsec4_output,rumpnet_stub);
 __weak_alias(ipsec4_common_input,rumpnet_stub);
-__weak_alias(ipsec4_forward,rumpnet_stub);
 __weak_alias(ipsec4_input,rumpnet_stub);
 

CVS commit: src/sys

2018-05-09 Thread Maxime Villard
Module Name:src
Committed By:   maxv
Date:   Thu May 10 05:08:53 UTC 2018

Modified Files:
src/sys/netinet: ip_input.c
src/sys/netipsec: ipsec.c ipsec.h
src/sys/rump/librump/rumpnet: net_stub.c

Log Message:
Rename ipsec4_forward -> ipsec_mtu, and switch to void.


To generate a diff of this commit:
cvs rdiff -u -r1.381 -r1.382 src/sys/netinet/ip_input.c
cvs rdiff -u -r1.161 -r1.162 src/sys/netipsec/ipsec.c
cvs rdiff -u -r1.80 -r1.81 src/sys/netipsec/ipsec.h
cvs rdiff -u -r1.34 -r1.35 src/sys/rump/librump/rumpnet/net_stub.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/pci

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:43:42 UTC 2018

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

Log Message:
 KNF. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.578 -r1.579 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.578 src/sys/dev/pci/if_wm.c:1.579
--- src/sys/dev/pci/if_wm.c:1.578	Tue May  8 11:36:39 2018
+++ src/sys/dev/pci/if_wm.c	Thu May 10 03:43:42 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.578 2018/05/08 11:36:39 msaitoh Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.579 2018/05/10 03:43:42 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.578 2018/05/08 11:36:39 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.579 2018/05/10 03:43:42 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -301,14 +301,14 @@ struct wm_softc;
 	struct evcnt qname##_ev_##evname;
 
 #define WM_Q_EVCNT_ATTACH(qname, evname, q, qnum, xname, evtype)	\
-	do{\
+	do {\
 		snprintf((q)->qname##_##evname##_evcnt_name,		\
 		sizeof((q)->qname##_##evname##_evcnt_name),		\
 		"%s%02d%s", #qname, (qnum), #evname);		\
 		evcnt_attach_dynamic(&(q)->qname##_ev_##evname,		\
 		(evtype), NULL, (xname),\
 		(q)->qname##_##evname##_evcnt_name);		\
-	}while(0)
+	} while (0)
 
 #define WM_Q_MISC_EVCNT_ATTACH(qname, evname, q, qnum, xname)		\
 	WM_Q_EVCNT_ATTACH(qname, evname, q, qnum, xname, EVCNT_TYPE_MISC)
@@ -2203,7 +2203,7 @@ alloc_retry:
 		/* SPI */
 		sc->sc_flags |= WM_F_EEPROM_SPI;
 		wm_nvm_set_addrbits_size_eecd(sc);
-		if((sc->sc_type == WM_T_80003)
+		if ((sc->sc_type == WM_T_80003)
 		|| (sc->sc_nvm_wordsize < (1 << 15))) {
 			sc->nvm.read = wm_nvm_read_eerd;
 			/* Don't use WM_F_LOCK_EECD because we use EERD */
@@ -4905,7 +4905,7 @@ wm_init_rss(struct wm_softc *sc)
 		int qid, reta_ent;
 
 		qid  = i % sc->sc_nqueues;
-		switch(sc->sc_type) {
+		switch (sc->sc_type) {
 		case WM_T_82574:
 			reta_ent = __SHIFTIN(qid,
 			RETA_ENT_QINDEX_MASK_82574);
@@ -4964,7 +4964,7 @@ wm_adjust_qnum(struct wm_softc *sc, int 
 		return;
 	}
 
-	switch(sc->sc_type) {
+	switch (sc->sc_type) {
 	case WM_T_82572:
 		hw_ntxqueues = 2;
 		hw_nrxqueues = 2;
@@ -5237,7 +5237,7 @@ wm_unset_stopping_flags(struct wm_softc 
 	/*
 	 * must unset stopping flags in ascending order.
 	 */
-	for(i = 0; i < sc->sc_nqueues; i++) {
+	for (i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_txqueue *txq = >sc_queue[i].wmq_txq;
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
 
@@ -5265,7 +5265,7 @@ wm_set_stopping_flags(struct wm_softc *s
 	/*
 	 * must set stopping flags in ascending order.
 	 */
-	for(i = 0; i < sc->sc_nqueues; i++) {
+	for (i = 0; i < sc->sc_nqueues; i++) {
 		struct wm_rxqueue *rxq = >sc_queue[i].wmq_rxq;
 		struct wm_txqueue *txq = >sc_queue[i].wmq_txq;
 
@@ -9148,7 +9148,7 @@ wm_linkintr_msix(void *arg)
 	if (sc->sc_core_stopping)
 		goto out;
 
-	if((reg & ICR_LSC) != 0) {
+	if ((reg & ICR_LSC) != 0) {
 		WM_EVCNT_INCR(>sc_ev_linkintr);
 		wm_linkintr(sc, ICR_LSC);
 	}
@@ -11630,10 +11630,10 @@ wm_sfp_get_media_type(struct wm_softc *s
 
 	if ((val & (SFF_SFP_ETH_FLAGS_1000SX | SFF_SFP_ETH_FLAGS_1000LX)) != 0)
 		mediatype = WM_MEDIATYPE_SERDES;
-	else if ((val & SFF_SFP_ETH_FLAGS_1000T) != 0){
+	else if ((val & SFF_SFP_ETH_FLAGS_1000T) != 0) {
 		sc->sc_flags |= WM_F_SGMII;
 		mediatype = WM_MEDIATYPE_COPPER;
-	} else if ((val & SFF_SFP_ETH_FLAGS_100FX) != 0){
+	} else if ((val & SFF_SFP_ETH_FLAGS_100FX) != 0) {
 		sc->sc_flags |= WM_F_SGMII;
 		mediatype = WM_MEDIATYPE_SERDES;
 	}



CVS commit: src/sys/dev/pci

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:43:42 UTC 2018

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

Log Message:
 KNF. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.578 -r1.579 src/sys/dev/pci/if_wm.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/pci

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:41:00 UTC 2018

Modified Files:
src/sys/dev/pci: ehci_pci.c uhci_pci.c

Log Message:
 KNF. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/uhci_pci.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/pci

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:41:00 UTC 2018

Modified Files:
src/sys/dev/pci: ehci_pci.c uhci_pci.c

Log Message:
 KNF. No binary change.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/pci/uhci_pci.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/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.66 src/sys/dev/pci/ehci_pci.c:1.67
--- src/sys/dev/pci/ehci_pci.c:1.66	Mon Apr  9 16:21:10 2018
+++ src/sys/dev/pci/ehci_pci.c	Thu May 10 03:41:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.66 2018/04/09 16:21:10 jakllsch Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.67 2018/05/10 03:41:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.66 2018/04/09 16:21:10 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_pci.c,v 1.67 2018/05/10 03:41:00 msaitoh Exp $");
 
 #include 
 #include 
@@ -191,7 +191,7 @@ ehci_pci_attach(device_t parent, device_
 	}
 	aprint_normal_dev(self, "interrupting at %s\n", intrstr);
 
-	switch(pci_conf_read(pc, tag, PCI_USBREV) & PCI_USBREV_MASK) {
+	switch (pci_conf_read(pc, tag, PCI_USBREV) & PCI_USBREV_MASK) {
 	case PCI_USBREV_PRE_1_0:
 	case PCI_USBREV_1_0:
 	case PCI_USBREV_1_1:

Index: src/sys/dev/pci/uhci_pci.c
diff -u src/sys/dev/pci/uhci_pci.c:1.62 src/sys/dev/pci/uhci_pci.c:1.63
--- src/sys/dev/pci/uhci_pci.c:1.62	Mon Apr  9 16:21:10 2018
+++ src/sys/dev/pci/uhci_pci.c	Thu May 10 03:41:00 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci_pci.c,v 1.62 2018/04/09 16:21:10 jakllsch Exp $	*/
+/*	$NetBSD: uhci_pci.c,v 1.63 2018/05/10 03:41:00 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.62 2018/04/09 16:21:10 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci_pci.c,v 1.63 2018/05/10 03:41:00 msaitoh Exp $");
 
 #include "ehci.h"
 
@@ -154,7 +154,7 @@ uhci_pci_attach(device_t parent, device_
 	bus_space_read_2(sc->sc.iot, sc->sc.ioh, UHCI_STS));
 	splx(s);
 
-	switch(pci_conf_read(pc, tag, PCI_USBREV) & PCI_USBREV_MASK) {
+	switch (pci_conf_read(pc, tag, PCI_USBREV) & PCI_USBREV_MASK) {
 	case PCI_USBREV_PRE_1_0:
 		sc->sc.sc_bus.ub_revision = USBREV_PRE_1_0;
 		break;



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

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:15:28 UTC 2018

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

Log Message:
Count some register correctly:
- QPRDC register is only for 82599 and newer.
- Count IXGBE_QPRDC, PX{ON,OFF}{T,R}XC[NT].


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 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.150 src/sys/dev/pci/ixgbe/ixgbe.c:1.151
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.150	Tue May  8 09:45:54 2018
+++ src/sys/dev/pci/ixgbe/ixgbe.c	Thu May 10 03:15:28 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.150 2018/05/08 09:45:54 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.151 2018/05/10 03:15:28 msaitoh Exp $ */
 
 /**
 
@@ -1558,16 +1558,24 @@ ixgbe_update_stats_counters(struct adapt
 	if (hw->mac.type == ixgbe_mac_X550)
 		stats->mbsdc.ev_count += IXGBE_READ_REG(hw, IXGBE_MBSDC);
 
+	/* 16 registers */
 	for (int i = 0; i < __arraycount(stats->qprc); i++) {
 		int j = i % adapter->num_queues;
+
 		stats->qprc[j].ev_count += IXGBE_READ_REG(hw, IXGBE_QPRC(i));
 		stats->qptc[j].ev_count += IXGBE_READ_REG(hw, IXGBE_QPTC(i));
-		stats->qprdc[j].ev_count += IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
+		if (hw->mac.type >= ixgbe_mac_82599EB) {
+			stats->qprdc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_QPRDC(i));
+		}
 	}
+
+	/* 8 registers */
 	for (int i = 0; i < __arraycount(stats->mpc); i++) {
 		uint32_t mp;
 		int j = i % adapter->num_queues;
 
+		/* MPC */
 		mp = IXGBE_READ_REG(hw, IXGBE_MPC(i));
 		/* global total per queue */
 		stats->mpc[j].ev_count += mp;
@@ -1577,7 +1585,24 @@ ixgbe_update_stats_counters(struct adapt
 		if (hw->mac.type == ixgbe_mac_82598EB)
 			stats->rnbc[j].ev_count
 			+= IXGBE_READ_REG(hw, IXGBE_RNBC(i));
-		
+
+		stats->pxontxc[j].ev_count
+		+= IXGBE_READ_REG(hw, IXGBE_PXONTXC(i));
+		stats->pxofftxc[j].ev_count
+		+= IXGBE_READ_REG(hw, IXGBE_PXOFFTXC(i));
+		if (hw->mac.type >= ixgbe_mac_82599EB) {
+			stats->pxonrxc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_PXONRXCNT(i));
+			stats->pxoffrxc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_PXOFFRXCNT(i));
+			stats->pxon2offc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_PXON2OFFCNT(i));
+		} else {
+			stats->pxonrxc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_PXONRXC(i));
+			stats->pxoffrxc[j].ev_count
+			+= IXGBE_READ_REG(hw, IXGBE_PXOFFRXC(i));
+		}
 	}
 	stats->mpctotal.ev_count += total_missed_rx;
 
@@ -1828,8 +1853,10 @@ ixgbe_add_hw_stats(struct adapter *adapt
 			evcnt_attach_dynamic(>pxoffrxc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
 			"pxoffrxc");
-			evcnt_attach_dynamic(>pxon2offc[i],
-			EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+evcnt_attach_dynamic(>pxon2offc[i],
+EVCNT_TYPE_MISC, NULL,
+adapter->queues[i].evnamebuf,
 			"pxon2offc");
 		}
 		if (i < __arraycount(stats->qprc)) {
@@ -1845,9 +1872,10 @@ ixgbe_add_hw_stats(struct adapter *adapt
 			evcnt_attach_dynamic(>qbtc[i],
 			EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
 			"qbtc");
-			evcnt_attach_dynamic(>qprdc[i],
-			EVCNT_TYPE_MISC, NULL, adapter->queues[i].evnamebuf,
-			"qprdc");
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+evcnt_attach_dynamic(>qprdc[i],
+EVCNT_TYPE_MISC, NULL,
+adapter->queues[i].evnamebuf, "qprdc");
 		}
 
 		evcnt_attach_dynamic(>rx_packets, EVCNT_TYPE_MISC,
@@ -2036,14 +2064,16 @@ ixgbe_clear_evcnt(struct adapter *adapte
 			stats->pxonrxc[i].ev_count = 0;
 			stats->pxofftxc[i].ev_count = 0;
 			stats->pxoffrxc[i].ev_count = 0;
-			stats->pxon2offc[i].ev_count = 0;
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+stats->pxon2offc[i].ev_count = 0;
 		}
 		if (i < __arraycount(stats->qprc)) {
 			stats->qprc[i].ev_count = 0;
 			stats->qptc[i].ev_count = 0;
 			stats->qbrc[i].ev_count = 0;
 			stats->qbtc[i].ev_count = 0;
-			stats->qprdc[i].ev_count = 0;
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+stats->qprdc[i].ev_count = 0;
 		}
 
 		rxr->rx_packets.ev_count = 0;
@@ -3474,14 +3504,16 @@ ixgbe_detach(device_t dev, int flags)
 			evcnt_detach(>pxonrxc[i]);
 			evcnt_detach(>pxofftxc[i]);
 			evcnt_detach(>pxoffrxc[i]);
-			evcnt_detach(>pxon2offc[i]);
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+evcnt_detach(>pxon2offc[i]);
 		}
 		if (i < __arraycount(stats->qprc)) {
 			evcnt_detach(>qprc[i]);
 			evcnt_detach(>qptc[i]);
 			evcnt_detach(>qbrc[i]);
 			evcnt_detach(>qbtc[i]);
-			evcnt_detach(>qprdc[i]);
+			if (hw->mac.type >= ixgbe_mac_82599EB)
+evcnt_detach(>qprdc[i]);
 		}
 
 		evcnt_detach(>rx_packets);



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

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 03:15:28 UTC 2018

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

Log Message:
Count some register correctly:
- QPRDC register is only for 82599 and newer.
- Count IXGBE_QPRDC, PX{ON,OFF}{T,R}XC[NT].


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.151 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.



CVS commit: src/sys/dev/mii

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 02:50:00 UTC 2018

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/mii/miidevs_data.h

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

Modified files:

Index: src/sys/dev/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.129 src/sys/dev/mii/miidevs.h:1.130
--- src/sys/dev/mii/miidevs.h:1.129	Mon Jul  3 08:29:22 2017
+++ src/sys/dev/mii/miidevs.h	Thu May 10 02:50:00 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.129 2017/07/03 08:29:22 msaitoh Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.130 2018/05/10 02:50:00 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.126 2017/07/03 08:29:03 msaitoh Exp
+ *	NetBSD: miidevs,v 1.127 2018/05/10 02:49:41 msaitoh Exp
  */
 
 /*-
@@ -332,6 +332,8 @@
 #define	MII_STR_INTEL_I82579	"i82579 10/100/1000 media interface"
 #define	MII_MODEL_INTEL_I217	0x000a
 #define	MII_STR_INTEL_I217	"i217 10/100/1000 media interface"
+#define	MII_MODEL_INTEL_X540	0x0020
+#define	MII_STR_INTEL_X540	"X540 100M/1G/10G media interface"
 #define	MII_MODEL_INTEL_X550	0x0022
 #define	MII_STR_INTEL_X550	"X550 100M/1G/10G media interface"
 #define	MII_MODEL_INTEL_X557	0x0024

Index: src/sys/dev/mii/miidevs_data.h
diff -u src/sys/dev/mii/miidevs_data.h:1.117 src/sys/dev/mii/miidevs_data.h:1.118
--- src/sys/dev/mii/miidevs_data.h:1.117	Mon Jul  3 08:29:22 2017
+++ src/sys/dev/mii/miidevs_data.h	Thu May 10 02:50:00 2018
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs_data.h,v 1.117 2017/07/03 08:29:22 msaitoh Exp $	*/
+/*	$NetBSD: miidevs_data.h,v 1.118 2018/05/10 02:50:00 msaitoh Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.126 2017/07/03 08:29:03 msaitoh Exp
+ *	NetBSD: miidevs,v 1.127 2018/05/10 02:49:41 msaitoh Exp
  */
 
 /*-
@@ -130,6 +130,7 @@ struct mii_knowndev mii_knowndevs[] = {
  { MII_OUI_INTEL, MII_MODEL_INTEL_I82577, MII_STR_INTEL_I82577 },
  { MII_OUI_INTEL, MII_MODEL_INTEL_I82579, MII_STR_INTEL_I82579 },
  { MII_OUI_INTEL, MII_MODEL_INTEL_I217, MII_STR_INTEL_I217 },
+ { MII_OUI_INTEL, MII_MODEL_INTEL_X540, MII_STR_INTEL_X540 },
  { MII_OUI_INTEL, MII_MODEL_INTEL_X550, MII_STR_INTEL_X550 },
  { MII_OUI_INTEL, MII_MODEL_INTEL_X557, MII_STR_INTEL_X557 },
  { MII_OUI_INTEL, MII_MODEL_INTEL_I82580, MII_STR_INTEL_I82580 },



CVS commit: src/sys/dev/mii

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 02:50:00 UTC 2018

Modified Files:
src/sys/dev/mii: miidevs.h miidevs_data.h

Log Message:
 Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.117 -r1.118 src/sys/dev/mii/miidevs_data.h

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



CVS commit: src/sys/dev/mii

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 02:49:41 UTC 2018

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Intel X540 internal PHY.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/mii/miidevs

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



CVS commit: src/sys/dev/mii

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Thu May 10 02:49:41 UTC 2018

Modified Files:
src/sys/dev/mii: miidevs

Log Message:
 Add Intel X540 internal PHY.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/dev/mii/miidevs

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

Modified files:

Index: src/sys/dev/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.126 src/sys/dev/mii/miidevs:1.127
--- src/sys/dev/mii/miidevs:1.126	Mon Jul  3 08:29:03 2017
+++ src/sys/dev/mii/miidevs	Thu May 10 02:49:41 2018
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.126 2017/07/03 08:29:03 msaitoh Exp $
+$NetBSD: miidevs,v 1.127 2018/05/10 02:49:41 msaitoh Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -232,6 +232,7 @@ model yyINTEL I82566		0x0039 i82566 10/1
 model INTEL I82577		0x0005 i82577 10/100/1000 media interface
 model INTEL I82579		0x0009 i82579 10/100/1000 media interface
 model INTEL I217		0x000a i217 10/100/1000 media interface
+model INTEL X540		0x0020 X540 100M/1G/10G media interface
 model INTEL X550		0x0022 X550 100M/1G/10G media interface
 model INTEL X557		0x0024 X557 100M/1G/10G media interface
 model INTEL I82580		0x003a 82580 10/100/1000 media interface



CVS commit: src/sys/compat/netbsd32

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 10 02:36:26 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.24 -r1.25 src/sys/compat/netbsd32/netbsd32_systrace_args.c

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



CVS commit: src/sys/compat/netbsd32

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 10 02:36:08 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_20.c
netbsd32_conv.h netbsd32_socket.c syscalls.master

Log Message:
add {send,recv}mmsg


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/netbsd32_socket.c
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/syscalls.master

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



CVS commit: src/sys/compat/netbsd32

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 10 02:36:08 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_compat_20.c
netbsd32_conv.h netbsd32_socket.c syscalls.master

Log Message:
add {send,recv}mmsg


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.118 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.36 -r1.37 src/sys/compat/netbsd32/netbsd32_compat_20.c
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_conv.h
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/netbsd32/netbsd32_socket.c
cvs rdiff -u -r1.120 -r1.121 src/sys/compat/netbsd32/syscalls.master

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

Modified files:

Index: src/sys/compat/netbsd32/netbsd32.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.117 src/sys/compat/netbsd32/netbsd32.h:1.118
--- src/sys/compat/netbsd32/netbsd32.h:1.117	Sat Apr 14 00:04:39 2018
+++ src/sys/compat/netbsd32/netbsd32.h	Wed May  9 22:36:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.117 2018/04/14 04:04:39 mrg Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.118 2018/05/10 02:36:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008, 2015 Matthew R. Green
@@ -715,6 +715,12 @@ struct netbsd32_omsghdr {
 	int		 msg_accrightslen;
 };
 
+typedef netbsd32_pointer_t netbsd32_mmsghdrp_t;
+struct netbsd32_mmsghdr {
+	struct netbsd32_msghdr msg_hdr;
+	unsigned int msg_len;
+};
+
 /* from  */
 typedef netbsd32_pointer_t netbsd32_stat12p_t;
 struct netbsd32_stat12 {		/* NetBSD-1.2 stat struct */

Index: src/sys/compat/netbsd32/netbsd32_compat_20.c
diff -u src/sys/compat/netbsd32/netbsd32_compat_20.c:1.36 src/sys/compat/netbsd32/netbsd32_compat_20.c:1.37
--- src/sys/compat/netbsd32/netbsd32_compat_20.c:1.36	Thu Apr 13 05:46:59 2017
+++ src/sys/compat/netbsd32/netbsd32_compat_20.c	Wed May  9 22:36:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_compat_20.c,v 1.36 2017/04/13 09:46:59 hannken Exp $	*/
+/*	$NetBSD: netbsd32_compat_20.c,v 1.37 2018/05/10 02:36:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.36 2017/04/13 09:46:59 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_compat_20.c,v 1.37 2018/05/10 02:36:07 christos Exp $");
 
 #include 
 #include 
@@ -36,6 +36,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_com
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/sys/compat/netbsd32/netbsd32_conv.h
diff -u src/sys/compat/netbsd32/netbsd32_conv.h:1.34 src/sys/compat/netbsd32/netbsd32_conv.h:1.35
--- src/sys/compat/netbsd32/netbsd32_conv.h:1.34	Thu Apr 19 17:50:08 2018
+++ src/sys/compat/netbsd32/netbsd32_conv.h	Wed May  9 22:36:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_conv.h,v 1.34 2018/04/19 21:50:08 christos Exp $	*/
+/*	$NetBSD: netbsd32_conv.h,v 1.35 2018/05/10 02:36:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -289,6 +289,22 @@ netbsd32_from_msghdr(struct netbsd32_msg
 }
 
 static __inline void
+netbsd32_to_mmsghdr(const struct netbsd32_mmsghdr *mmsg32,
+struct mmsghdr *mmsg)
+{
+netbsd32_to_msghdr(>msg_hdr, >msg_hdr);
+mmsg->msg_len = mmsg32->msg_len;
+}
+
+static __inline void
+netbsd32_from_mmsghdr(struct netbsd32_mmsghdr *mmsg32,
+const struct mmsghdr *mmsg)
+{
+netbsd32_from_msghdr(>msg_hdr, >msg_hdr);
+mmsg32->msg_len = mmsg->msg_len;
+}
+
+static __inline void
 netbsd32_from_statvfs(const struct statvfs *sbp, struct netbsd32_statvfs *sb32p)
 {
 	sb32p->f_flag = sbp->f_flag;

Index: src/sys/compat/netbsd32/netbsd32_socket.c
diff -u src/sys/compat/netbsd32/netbsd32_socket.c:1.45 src/sys/compat/netbsd32/netbsd32_socket.c:1.46
--- src/sys/compat/netbsd32/netbsd32_socket.c:1.45	Thu May  3 17:43:33 2018
+++ src/sys/compat/netbsd32/netbsd32_socket.c	Wed May  9 22:36:07 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_socket.c,v 1.45 2018/05/03 21:43:33 christos Exp $	*/
+/*	$NetBSD: netbsd32_socket.c,v 1.46 2018/05/10 02:36:07 christos Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.45 2018/05/03 21:43:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_socket.c,v 1.46 2018/05/10 02:36:07 christos Exp $");
 
 #include 
 #include 
@@ -159,6 +159,62 @@ copyout32_msg_control(struct lwp *l, str
 	return error;
 }
 
+static int
+msg_recv_copyin(struct lwp *l, const struct netbsd32_msghdr *msg32,
+struct msghdr *msg, struct iovec *aiov)
+{
+	int error;
+	size_t iovsz;
+	struct iovec *iov = aiov;
+
+	iovsz = msg32->msg_iovlen * sizeof(struct iovec);
+	if (msg32->msg_iovlen > UIO_SMALLIOV) {
+		if (msg32->msg_iovlen > IOV_MAX)
+			return EMSGSIZE;
+		iov = kmem_alloc(iovsz, KM_SLEEP);
+	}
+
+	error = netbsd32_to_iovecin(NETBSD32PTR64(msg32->msg_iov), iov,
+	msg32->msg_iovlen);
+	if (error)
+		goto out;
+
+	

CVS commit: src/sys/compat/netbsd32

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 10 02:36:26 UTC 2018

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_syscalls_autoload.c netbsd32_sysent.c
netbsd32_systrace_args.c

Log Message:
regen


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.132 -r1.133 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.c
cvs rdiff -u -r1.13 -r1.14 \
src/sys/compat/netbsd32/netbsd32_syscalls_autoload.c
cvs rdiff -u -r1.24 -r1.25 src/sys/compat/netbsd32/netbsd32_systrace_args.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/compat/netbsd32/netbsd32_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.134 src/sys/compat/netbsd32/netbsd32_syscall.h:1.135
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.134	Sat Jan  6 11:41:23 2018
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Wed May  9 22:36:26 2018
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.134 2018/01/06 16:41:23 kamil Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.135 2018/05/10 02:36:26 christos Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.117 2017/12/19 08:48:19 kamil Exp
+ * created from	NetBSD: syscalls.master,v 1.121 2018/05/10 02:36:07 christos Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
@@ -1241,6 +1241,12 @@
 /* syscall: "netbsd32_posix_spawn" ret: "int" args: "netbsd32_pid_tp" "const netbsd32_charp" "const netbsd32_posix_spawn_file_actionsp" "const netbsd32_posix_spawnattrp" "netbsd32_charpp" "netbsd32_charpp" */
 #define	NETBSD32_SYS_netbsd32_posix_spawn	474
 
+/* syscall: "netbsd32_recvmmsg" ret: "int" args: "int" "netbsd32_mmsghdrp_t" "unsigned int" "unsigned int" "netbsd32_timespecp_t" */
+#define	NETBSD32_SYS_netbsd32_recvmmsg	475
+
+/* syscall: "netbsd32_sendmmsg" ret: "int" args: "int" "netbsd32_mmsghdrp_t" "unsigned int" "unsigned int" */
+#define	NETBSD32_SYS_netbsd32_sendmmsg	476
+
 /* syscall: "netbsd32_clock_nanosleep" ret: "int" args: "netbsd32_clockid_t" "int" "const netbsd32_timespecp_t" "netbsd32_timespecp_t" */
 #define	NETBSD32_SYS_netbsd32_clock_nanosleep	477
 
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.134 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.135
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.134	Sat Jan  6 11:41:23 2018
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Wed May  9 22:36:26 2018
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.134 2018/01/06 16:41:23 kamil Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.135 2018/05/10 02:36:26 christos Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.117 2017/12/19 08:48:19 kamil Exp
+ * created from	NetBSD: syscalls.master,v 1.121 2018/05/10 02:36:07 christos Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -2542,6 +2542,23 @@ struct netbsd32_posix_spawn_args {
 };
 check_syscall_args(netbsd32_posix_spawn)
 
+struct netbsd32_recvmmsg_args {
+	syscallarg(int) s;
+	syscallarg(netbsd32_mmsghdrp_t) mmsg;
+	syscallarg(unsigned int) vlen;
+	syscallarg(unsigned int) flags;
+	syscallarg(netbsd32_timespecp_t) timeout;
+};
+check_syscall_args(netbsd32_recvmmsg)
+
+struct netbsd32_sendmmsg_args {
+	syscallarg(int) s;
+	syscallarg(netbsd32_mmsghdrp_t) mmsg;
+	syscallarg(unsigned int) vlen;
+	syscallarg(unsigned int) flags;
+};
+check_syscall_args(netbsd32_sendmmsg)
+
 struct netbsd32_clock_nanosleep_args {
 	syscallarg(netbsd32_clockid_t) clock_id;
 	syscallarg(int) flags;
@@ -3400,6 +3417,10 @@ int	netbsd32___quotactl(struct lwp *, co
 
 int	netbsd32_posix_spawn(struct lwp *, const struct netbsd32_posix_spawn_args *, register_t *);
 
+int	netbsd32_recvmmsg(struct lwp *, const struct netbsd32_recvmmsg_args *, register_t *);
+
+int	netbsd32_sendmmsg(struct lwp *, const struct netbsd32_sendmmsg_args *, register_t *);
+
 int	netbsd32_clock_nanosleep(struct lwp *, const struct netbsd32_clock_nanosleep_args *, register_t *);
 
 int	netbsd32lwp_park60(struct lwp *, const struct netbsd32lwp_park60_args *, register_t *);

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.132 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.133
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.132	Sat Jan  6 11:41:23 2018
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Wed May  9 22:36:26 2018
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.132 2018/01/06 16:41:23 kamil Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.133 2018/05/10 02:36:26 christos Exp $ */
 

CVS commit: src/sys/compat

2018-05-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May 10 01:32:24 UTC 2018

Modified Files:
src/sys/compat/linux/common: linux_socket.c
src/sys/compat/linux32/common: linux32_socket.c

Log Message:
Fix pserialize enter/exit pairs in linux_getifconf and linux32_getifconf

Tested by using a small linux program that uses ioctl(SIOCGIFCONF).
Probably fix PR kern/53259 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux32/common/linux32_socket.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/compat/linux/common/linux_socket.c
diff -u src/sys/compat/linux/common/linux_socket.c:1.141 src/sys/compat/linux/common/linux_socket.c:1.142
--- src/sys/compat/linux/common/linux_socket.c:1.141	Thu May  3 21:43:33 2018
+++ src/sys/compat/linux/common/linux_socket.c	Thu May 10 01:32:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $	*/
+/*	$NetBSD: linux_socket.c,v 1.142 2018/05/10 01:32:24 ozaki-r Exp $	*/
 
 /*-
  * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.141 2018/05/03 21:43:33 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.142 2018/05/10 01:32:24 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1183,7 +1183,7 @@ linux_getifconf(struct lwp *l, register_
 			ifa_release(ifa, _ifa);
 		}
 
-		s = pserialize_read_enter();
+		KASSERT(pserialize_in_read_section());
 		if_release(ifp, );
 	}
 	pserialize_read_exit(s);

Index: src/sys/compat/linux32/common/linux32_socket.c
diff -u src/sys/compat/linux32/common/linux32_socket.c:1.28 src/sys/compat/linux32/common/linux32_socket.c:1.29
--- src/sys/compat/linux32/common/linux32_socket.c:1.28	Wed Nov 22 10:19:14 2017
+++ src/sys/compat/linux32/common/linux32_socket.c	Thu May 10 01:32:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux32_socket.c,v 1.28 2017/11/22 10:19:14 ozaki-r Exp $ */
+/*	$NetBSD: linux32_socket.c,v 1.29 2018/05/10 01:32:24 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -33,7 +33,7 @@
 
 #include 
 
-__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.28 2017/11/22 10:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_socket.c,v 1.29 2018/05/10 01:32:24 ozaki-r Exp $");
 
 #include 
 #include 
@@ -478,7 +478,7 @@ linux32_getifconf(struct lwp *l, registe
 			ifa_release(ifa, _ifa);
 		}
 
-		s = pserialize_read_enter();
+		KASSERT(pserialize_in_read_section());
 		if_release(ifp, );
 	}
 	pserialize_read_exit(s);



CVS commit: src/sys/compat

2018-05-09 Thread Ryota Ozaki
Module Name:src
Committed By:   ozaki-r
Date:   Thu May 10 01:32:24 UTC 2018

Modified Files:
src/sys/compat/linux/common: linux_socket.c
src/sys/compat/linux32/common: linux32_socket.c

Log Message:
Fix pserialize enter/exit pairs in linux_getifconf and linux32_getifconf

Tested by using a small linux program that uses ioctl(SIOCGIFCONF).
Probably fix PR kern/53259 as well.


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/sys/compat/linux/common/linux_socket.c
cvs rdiff -u -r1.28 -r1.29 src/sys/compat/linux32/common/linux32_socket.c

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:30:56 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c

Log Message:
Enable HP PA output


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun50i_a64_acodec.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.1 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.2
--- src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.1	Thu May 10 00:00:21 2018
+++ src/sys/arch/arm/sunxi/sun50i_a64_acodec.c	Thu May 10 00:30:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_acodec.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_acodec.c,v 1.2 2018/05/10 00:30:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2018 Jared McNeill 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.2 2018/05/10 00:30:56 jmcneill Exp $");
 
 #include 
 #include 
@@ -215,9 +215,10 @@ a64_acodec_trigger_output(void *priv, vo
 {
 	struct a64_acodec_softc * const sc = priv;
 
-	/* Enable DAC analog l/r channels and output mixer */
+	/* Enable DAC analog l/r channels, HP PA, and output mixer */
 	a64_acodec_pr_set_clear(sc, A64_MIX_DAC_CTRL,
-	A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN, 0);
+	A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN |
+	A64_RHPPAMUTE | A64_LHPPAMUTE, 0);
 	/* Unmute DAC l/r channels to output mixer */
 	a64_acodec_pr_set_clear(sc, A64_OL_MIX_CTRL,
 	A64_LMIXMUTE_LDAC, 0);
@@ -250,9 +251,10 @@ a64_acodec_halt_output(void *priv)
 	0, A64_LMIXMUTE_LDAC);
 	a64_acodec_pr_set_clear(sc, A64_OR_MIX_CTRL,
 	0, A64_RMIXMUTE_RDAC);
-	/* Disable DAC analog l/r channels and output mixer */
+	/* Disable DAC analog l/r channels, HP PA, and output mixer */
 	a64_acodec_pr_set_clear(sc, A64_MIX_DAC_CTRL,
-	0, A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN);
+	0, A64_DACAREN | A64_DACALEN | A64_RMIXEN | A64_LMIXEN |
+	A64_RHPPAMUTE | A64_LHPPAMUTE);
 
 	return 0;
 }



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:30:56 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c

Log Message:
Enable HP PA output


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:07:08 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun6i_dma.c

Log Message:
32-bit build fix


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun6i_dma.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun6i_dma.c
diff -u src/sys/arch/arm/sunxi/sun6i_dma.c:1.4 src/sys/arch/arm/sunxi/sun6i_dma.c:1.5
--- src/sys/arch/arm/sunxi/sun6i_dma.c:1.4	Wed May  9 17:17:33 2018
+++ src/sys/arch/arm/sunxi/sun6i_dma.c	Thu May 10 00:07:08 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun6i_dma.c,v 1.4 2018/05/09 17:17:33 jmcneill Exp $ */
+/* $NetBSD: sun6i_dma.c,v 1.5 2018/05/10 00:07:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.4 2018/05/09 17:17:33 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.5 2018/05/10 00:07:08 jmcneill Exp $");
 
 #include 
 #include 
@@ -396,7 +396,7 @@ sun6idma_attach(device_t parent, device_
 		return;
 	}
 
-	conf = of_search_compatible(phandle, compat_data)->data;
+	conf = (void *)of_search_compatible(phandle, compat_data)->data;
 
 	sc->sc_nchan = conf->num_channels;
 	sc->sc_chan = kmem_alloc(sizeof(*sc->sc_chan) * sc->sc_nchan, KM_SLEEP);



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:07:08 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun6i_dma.c

Log Message:
32-bit build fix


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/arm/sunxi/sun6i_dma.c

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:04:46 UTC 2018

Modified Files:
src/sys/arch/arm/dts: sun50i-a64.dtsi

Log Message:
Add audio codec nodes


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/dts/sun50i-a64.dtsi

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:04:46 UTC 2018

Modified Files:
src/sys/arch/arm/dts: sun50i-a64.dtsi

Log Message:
Add audio codec nodes


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/dts/sun50i-a64.dtsi

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/dts/sun50i-a64.dtsi
diff -u src/sys/arch/arm/dts/sun50i-a64.dtsi:1.7 src/sys/arch/arm/dts/sun50i-a64.dtsi:1.8
--- src/sys/arch/arm/dts/sun50i-a64.dtsi:1.7	Sun May  6 10:43:32 2018
+++ src/sys/arch/arm/dts/sun50i-a64.dtsi	Thu May 10 00:04:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i-a64.dtsi,v 1.7 2018/05/06 10:43:32 jmcneill Exp $ */
+/* $NetBSD: sun50i-a64.dtsi,v 1.8 2018/05/10 00:04:46 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -40,6 +40,28 @@
 		};
 	};
 
+	sound: sound {
+		compatible = "simple-audio-card";
+		simple-audio-card,name = "SUN50I Audio Card";
+		simple-audio-card,format = "i2s";
+		simple-audio-card,frame-master = <>;
+		simple-audio-card,bitclock-master = <>;
+		simple-audio-card,mclk-fs = <512>;
+		simple-audio-card,aux-devs = <_analog>;
+		simple-audio-card,routing =
+"Left DAC", "AIF1 Slot 0 Left",
+"Right DAC", "AIF1 Slot 0 Right";
+		status = "disabled";
+
+		cpudai: simple-audio-card,cpu {
+			sound-dai = <>;
+		};
+
+		link_codec: simple-audio-card,codec {
+			sound-dai = <>;
+		};
+	};
+
 	soc {
 		pwm: pwm@1c21400 {
 			compatible = "allwinner,sun50i-a64-pwm";
@@ -49,6 +71,30 @@
 			status = "disabled";
 		};
 
+		dai: dai@1c22c00 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-acodec-i2s";
+			reg = <0x01c22c00 0x200>;
+			interrupts = ;
+			clocks = < CLK_BUS_CODEC>, < CLK_AC_DIG>;
+			clock-names = "apb", "mod";
+			resets = < RST_BUS_CODEC>;
+			reset-names = "rst";
+			dmas = < 15>, < 15>;
+			dma-names = "rx", "tx";
+			status = "disabled";
+		};
+
+		codec: codec@1c22e00 {
+			#sound-dai-cells = <0>;
+			compatible = "allwinner,sun50i-a64-codec";
+			reg = <0x01c22e00 0x600>;
+			interrupts = ;
+			clocks = < CLK_BUS_CODEC>, < CLK_AC_DIG>;
+			clock-names = "bus", "mod";
+			status = "disabled";
+		};
+
 		rtp: rtp@1c25000 {
 			compatible = "allwinner,sun50i-a64-ts";
 			reg = <0x01c25000 0x400>;
@@ -58,6 +104,12 @@
 			resets = < RST_BUS_THS>;
 			#thermal-sensor-cells = <0>;
 		};
+
+		codec_analog: codec-analog@1f015c0 {
+			compatible = "allwinner,sun50i-a64-codec-analog";
+			reg = <0x01f015c0 0x4>;
+			status = "disabled";
+		};
 	};
 };
 



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:05:01 UTC 2018

Modified Files:
src/sys/arch/arm/dts: sun50i-a64-pinebook.dts

Log Message:
Enable audio codec


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/dts/sun50i-a64-pinebook.dts

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



CVS commit: src/sys/dev/fdt

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 23:59:05 UTC 2018

Modified Files:
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: ausoc.c fdt_dai.c

Log Message:
Add SoC sound driver based on "simple-audio-card" DT binding spec.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/ausoc.c src/sys/dev/fdt/fdt_dai.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/fdt/files.fdt

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/fdt/fdtvar.h
diff -u src/sys/dev/fdt/fdtvar.h:1.30 src/sys/dev/fdt/fdtvar.h:1.31
--- src/sys/dev/fdt/fdtvar.h:1.30	Sun May  6 10:33:21 2018
+++ src/sys/dev/fdt/fdtvar.h	Wed May  9 23:59:05 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: fdtvar.h,v 1.30 2018/05/06 10:33:21 jmcneill Exp $ */
+/* $NetBSD: fdtvar.h,v 1.31 2018/05/09 23:59:05 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015 Jared D. McNeill 
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -121,6 +122,10 @@ struct fdtbus_reset_controller_func {
 	int	(*reset_deassert)(device_t, void *);
 };
 
+struct fdtbus_dai_controller_func {
+	audio_dai_tag_t (*get_tag)(device_t, const void *, size_t);
+};
+
 struct fdtbus_dma_controller;
 
 struct fdtbus_dma {
@@ -233,6 +238,8 @@ int		fdtbus_register_clock_controller(de
 		const struct fdtbus_clock_controller_func *);
 int		fdtbus_register_reset_controller(device_t, int,
 		const struct fdtbus_reset_controller_func *);
+int		fdtbus_register_dai_controller(device_t, int,
+		const struct fdtbus_dai_controller_func *);
 int		fdtbus_register_dma_controller(device_t, int,
 		const struct fdtbus_dma_controller_func *);
 int		fdtbus_register_power_controller(device_t, int,
@@ -264,6 +271,8 @@ int		fdtbus_gpio_read(struct fdtbus_gpio
 void		fdtbus_gpio_write(struct fdtbus_gpio_pin *, int);
 int		fdtbus_gpio_read_raw(struct fdtbus_gpio_pin *);
 void		fdtbus_gpio_write_raw(struct fdtbus_gpio_pin *, int);
+audio_dai_tag_t	fdtbus_dai_acquire(int, const char *);
+audio_dai_tag_t	fdtbus_dai_acquire_index(int, const char *, int);
 pwm_tag_t	fdtbus_pwm_acquire(int, const char *);
 pwm_tag_t	fdtbus_pwm_acquire_index(int, const char *, int);
 void		fdtbus_pinctrl_configure(void);

Index: src/sys/dev/fdt/files.fdt
diff -u src/sys/dev/fdt/files.fdt:1.25 src/sys/dev/fdt/files.fdt:1.26
--- src/sys/dev/fdt/files.fdt:1.25	Sun May  6 10:33:21 2018
+++ src/sys/dev/fdt/files.fdt	Wed May  9 23:59:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.25 2018/05/06 10:33:21 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.26 2018/05/09 23:59:05 jmcneill Exp $
 
 include	"external/bsd/libfdt/conf/files.libfdt"
 
@@ -47,6 +47,7 @@ file	dev/fdt/panel_fdt.c			fdt_panel
 file	dev/fdt/fdt_openfirm.c			fdtbus
 file	dev/fdt/fdt_subr.c			fdtbus
 file	dev/fdt/fdt_clock.c			fdtbus
+file	dev/fdt/fdt_dai.c			fdtbus
 file	dev/fdt/fdt_dma.c			fdtbus
 file	dev/fdt/fdt_gpio.c			fdtbus
 file	dev/fdt/fdt_i2c.c			fdtbus
@@ -72,6 +73,10 @@ device	pwmbacklight
 attach	pwmbacklight at fdt
 file	dev/fdt/pwm_backlight.c			pwmbacklight
 
+device	ausoc: audiobus
+attach	ausoc at fdt
+file	dev/fdt/ausoc.causoc
+
 define	fdt_display_timing
 file	dev/fdt/display_timing.c		fdt_display_timing
 

Added files:

Index: src/sys/dev/fdt/ausoc.c
diff -u /dev/null src/sys/dev/fdt/ausoc.c:1.1
--- /dev/null	Wed May  9 23:59:05 2018
+++ src/sys/dev/fdt/ausoc.c	Wed May  9 23:59:05 2018
@@ -0,0 +1,619 @@
+/* $NetBSD: ausoc.c,v 1.1 2018/05/09 23:59:05 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * 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 AUTHOR ``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 AUTHOR 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

CVS commit: src/sys/dev/fdt

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 23:59:05 UTC 2018

Modified Files:
src/sys/dev/fdt: fdtvar.h files.fdt
Added Files:
src/sys/dev/fdt: ausoc.c fdt_dai.c

Log Message:
Add SoC sound driver based on "simple-audio-card" DT binding spec.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/fdt/ausoc.c src/sys/dev/fdt/fdt_dai.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/fdt/fdtvar.h
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/fdt/files.fdt

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:05:23 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 SUNXI

Log Message:
Add ausoc, sun8icodec, a64codec, sunxii2s


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbarm/conf/SUNXI

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:02:10 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
whitespace fix


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.13 src/sys/arch/evbarm/conf/GENERIC64:1.14
--- src/sys/arch/evbarm/conf/GENERIC64:1.13	Sun May  6 10:36:06 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Thu May 10 00:02:10 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.13 2018/05/06 10:36:06 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.14 2018/05/10 00:02:10 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -214,7 +214,7 @@ seeprom*	at iic?
 as3722pmic*	at iic?
 as3722reg*	at as3722pmic?
 axppmic*	at iic?			# X-Powers AXP Power Management IC
-axpreg*	at 	axppmic?
+axpreg*		at axppmic?
 max77620pmic*	at iic?
 pcf8563rtc*	at iic?			# PCF8563 RTC
 tcagpio*	at iic?



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:05:01 UTC 2018

Modified Files:
src/sys/arch/arm/dts: sun50i-a64-pinebook.dts

Log Message:
Enable audio codec


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/arm/dts/sun50i-a64-pinebook.dts

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/dts/sun50i-a64-pinebook.dts
diff -u src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.8 src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.9
--- src/sys/arch/arm/dts/sun50i-a64-pinebook.dts:1.8	Sun May  6 10:43:52 2018
+++ src/sys/arch/arm/dts/sun50i-a64-pinebook.dts	Thu May 10 00:05:01 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i-a64-pinebook.dts,v 1.8 2018/05/06 10:43:52 jmcneill Exp $ */
+/* $NetBSD: sun50i-a64-pinebook.dts,v 1.9 2018/05/10 00:05:01 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -163,3 +163,20 @@
 };
 
 #include "axp803.dtsi"
+
+ {
+	allwinner,pa-gpios = < 7 7 GPIO_ACTIVE_HIGH>;	/* PH7 */
+	status = "okay";
+};
+
+_analog {
+	status = "okay";
+};
+
+ {
+	status = "okay";
+};
+
+ {
+	status = "okay";
+};



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:05:23 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64 SUNXI

Log Message:
Add ausoc, sun8icodec, a64codec, sunxii2s


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/evbarm/conf/GENERIC64
cvs rdiff -u -r1.72 -r1.73 src/sys/arch/evbarm/conf/SUNXI

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/evbarm/conf/GENERIC64
diff -u src/sys/arch/evbarm/conf/GENERIC64:1.14 src/sys/arch/evbarm/conf/GENERIC64:1.15
--- src/sys/arch/evbarm/conf/GENERIC64:1.14	Thu May 10 00:02:10 2018
+++ src/sys/arch/evbarm/conf/GENERIC64	Thu May 10 00:05:22 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: GENERIC64,v 1.14 2018/05/10 00:02:10 jmcneill Exp $
+#	$NetBSD: GENERIC64,v 1.15 2018/05/10 00:05:22 jmcneill Exp $
 #
 #	GENERIC ARM (aarch64) kernel
 #
@@ -256,8 +256,12 @@ options 	HDAUDIOVERBOSE
 options 	HDAUDIO_32BIT_ACCESS
 options 	HDAUDIO_ENABLE_HDMI
 options 	HDAUDIO_ENABLE_DISPLAYPORT
+ausoc*		at fdt?			# Simple SoC audio card
 sunxicodec*	at fdt?			# Allwinner audio codec
+sun8icodec*	at fdt?			# Allwinner audio codec (sun8i/sun50i)
 h3codec*	at fdt?			# Allwinner H3 audio codec (analog part)
+a64acodec*	at fdt?			# Allwinner A64 audio codec (analog part)
+sunxii2s*	at fdt?			# Allwinner I2S/PCM
 audio*		at audiobus?
 
 spkr*		at audio?		# PC speaker (synthesized)

Index: src/sys/arch/evbarm/conf/SUNXI
diff -u src/sys/arch/evbarm/conf/SUNXI:1.72 src/sys/arch/evbarm/conf/SUNXI:1.73
--- src/sys/arch/evbarm/conf/SUNXI:1.72	Sun May  6 10:36:06 2018
+++ src/sys/arch/evbarm/conf/SUNXI	Thu May 10 00:05:22 2018
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: SUNXI,v 1.72 2018/05/06 10:36:06 jmcneill Exp $
+#	$NetBSD: SUNXI,v 1.73 2018/05/10 00:05:22 jmcneill Exp $
 #
 #	Allwinner sunxi family
 #
@@ -277,8 +277,12 @@ pwmbacklight*	at fdt?			# PWM Backlight 
 sunxithermal*	at fdt?			# Thermal sensor controller
 
 # Audio
+ausoc*		at fdt?			# Simple SoC audio card
 sunxicodec*	at fdt?			# Audio codec
+sun8icodec*	at fdt?			# Audio codec (sun8i/sun50i)
 h3codec*	at fdt?			# H3 audio codec (analog part)
+a64acodec*	at fdt?			# A64 audio codec (analog part)
+sunxii2s*	at fdt?			# I2S/PCM
 audio*		at audiobus?
 spkr*		at audio?
 



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:00:21 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Added Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c sun8i_codec.c sunxi_i2s.c

Log Message:
Add support for Allwinner A64 audio codec.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c \
src/sys/arch/arm/sunxi/sun8i_codec.c src/sys/arch/arm/sunxi/sunxi_i2s.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/files.sunxi
diff -u src/sys/arch/arm/sunxi/files.sunxi:1.54 src/sys/arch/arm/sunxi/files.sunxi:1.55
--- src/sys/arch/arm/sunxi/files.sunxi:1.54	Sun May  6 10:34:34 2018
+++ src/sys/arch/arm/sunxi/files.sunxi	Thu May 10 00:00:21 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: files.sunxi,v 1.54 2018/05/06 10:34:34 jmcneill Exp $
+#	$NetBSD: files.sunxi,v 1.55 2018/05/10 00:00:21 jmcneill Exp $
 #
 # Configuration info for Allwinner sunxi family SoCs
 #
@@ -208,11 +208,26 @@ file	arch/arm/sunxi/sunxi_codec.c		sunxi
 file	arch/arm/sunxi/sun4i_a10_codec.c	sunxi_codec
 file	arch/arm/sunxi/sun6i_a31_codec.c	sunxi_codec
 
+# Audio codec (sun8i)
+device	sun8icodec
+attach	sun8icodec at fdt with sun8i_codec
+file	arch/arm/sunxi/sun8i_codec.c		sun8i_codec
+
 # H3 Audio codec (analog part)
 device	h3codec
 attach	h3codec at fdt with h3_codec
 file	arch/arm/sunxi/sun8i_h3_codec.c		h3_codec needs-flag
 
+# A64 Audio codec (analog part)
+device	a64acodec
+attach	a64acodec at fdt with a64_acodec
+file	arch/arm/sunxi/sun50i_a64_acodec.c	a64_acodec
+
+# I2S/PCM controller
+device	sunxii2s: auconv, mulaw, aurateconv
+attach	sunxii2s at fdt with sunxi_i2s
+file	arch/arm/sunxi/sunxi_i2s.c		sunxi_i2s
+
 # Display controller
 attach	genfb at fdt with simplefb
 file	dev/fdt/simplefb.c			simplefb

Added files:

Index: src/sys/arch/arm/sunxi/sun50i_a64_acodec.c
diff -u /dev/null src/sys/arch/arm/sunxi/sun50i_a64_acodec.c:1.1
--- /dev/null	Thu May 10 00:00:21 2018
+++ src/sys/arch/arm/sunxi/sun50i_a64_acodec.c	Thu May 10 00:00:21 2018
@@ -0,0 +1,483 @@
+/* $NetBSD: sun50i_a64_acodec.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * 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 AUTHOR ``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 AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__KERNEL_RCSID(0, "$NetBSD: sun50i_a64_acodec.c,v 1.1 2018/05/10 00:00:21 jmcneill Exp $");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define	A64_PR_CFG		0x00
+#define	 A64_AC_PR_RST		__BIT(28)
+#define	 A64_AC_PR_RW		__BIT(24)
+#define	 A64_AC_PR_ADDR		__BITS(20,16)
+#define	 A64_ACDA_PR_WDAT	__BITS(15,8)
+#define	 A64_ACDA_PR_RDAT	__BITS(7,0)
+
+#define	A64_HP_CTRL		0x00
+#define	 A64_HPPA_EN		__BIT(6)
+#define	 A64_HPVOL		__BITS(5,0)
+#define	A64_OL_MIX_CTRL		0x01
+#define	 A64_LMIXMUTE_LDAC	__BIT(1)
+#define	A64_OR_MIX_CTRL		0x02
+#define	 A64_RMIXMUTE_RDAC	__BIT(1)
+#define	A64_LINEOUT_CTRL0	0x05
+#define	 A64_LINEOUT_LEFT_EN	__BIT(7)
+#define	 A64_LINEOUT_RIGHT_EN	__BIT(6)
+#define	A64_LINEOUT_CTRL1	0x06
+#define	 A64_LINEOUT_VOL	__BITS(4,0)
+#define	A64_MIC1_CTRL		0x07
+#define	 A64_MIC1G		__BITS(6,4)
+#define	 A64_MIC1AMPEN		__BIT(3)
+#define	 A64_MIC1BOOST		__BITS(2,0)
+#define	A64_MIC2_CTRL		0x08
+#define	 A64_MIC2_SEL		__BIT(7)
+#define	 A64_MIC2G		__BITS(6,4)
+#define	 A64_MIC2AMPEN		__BIT(3)
+#define	 A64_MIC2BOOST		__BITS(2,0)
+#define	A64_LINEIN_CTRL		0x09
+#define	 A64_LINEING		__BITS(6,4)
+#define	A64_MIX_DAC_CTRL	0x0a
+#define	 A64_DACAREN		__BIT(7)
+#define	 A64_DACALEN		__BIT(6)
+#define	 A64_RMIXEN		

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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:02:10 UTC 2018

Modified Files:
src/sys/arch/evbarm/conf: GENERIC64

Log Message:
whitespace fix


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 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/arm/sunxi

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 10 00:00:21 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: files.sunxi
Added Files:
src/sys/arch/arm/sunxi: sun50i_a64_acodec.c sun8i_codec.c sunxi_i2s.c

Log Message:
Add support for Allwinner A64 audio codec.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/arm/sunxi/files.sunxi
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/sunxi/sun50i_a64_acodec.c \
src/sys/arch/arm/sunxi/sun8i_codec.c src/sys/arch/arm/sunxi/sunxi_i2s.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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 23:57:58 UTC 2018

Added Files:
src/sys/dev: audio_dai.h

Log Message:
Add APIs for digital audio interface drivers


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/audio_dai.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/dev/audio_dai.h
diff -u /dev/null src/sys/dev/audio_dai.h:1.1
--- /dev/null	Wed May  9 23:57:58 2018
+++ src/sys/dev/audio_dai.h	Wed May  9 23:57:58 2018
@@ -0,0 +1,283 @@
+/* $NetBSD: audio_dai.h,v 1.1 2018/05/09 23:57:58 jmcneill Exp $ */
+
+/*-
+ * Copyright (c) 2018 Jared McNeill 
+ * 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 AUTHOR ``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 AUTHOR 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 _DEV_AUDIO_DAI_H
+#define _DEV_AUDIO_DAI_H
+
+#include 
+
+#define	AUDIO_DAI_FORMAT_MASK		__BITS(3,0)
+#define	AUDIO_DAI_FORMAT_I2S		0
+#define	AUDIO_DAI_FORMAT_RJ		1
+#define	AUDIO_DAI_FORMAT_LJ		2
+#define	AUDIO_DAI_FORMAT_DSPA		3
+#define	AUDIO_DAI_FORMAT_DSPB		4
+#define	AUDIO_DAI_FORMAT_AC97		5
+#define	AUDIO_DAI_FORMAT_PDM		6
+
+#define	AUDIO_DAI_POLARITY_MASK		__BITS(5,4)
+#define	AUDIO_DAI_POLARITY_NB_NF	0
+#define	AUDIO_DAI_POLARITY_NB_IF	1
+#define	AUDIO_DAI_POLARITY_IB_NF	2
+#define	AUDIO_DAI_POLARITY_IB_IF	3
+#define	AUDIO_DAI_POLARITY_F(n)		(((n) & 0x1) != 0)
+#define	AUDIO_DAI_POLARITY_B(n)		(((n) & 0x2) != 0)
+
+#define	AUDIO_DAI_CLOCK_MASK		__BITS(9,8)
+#define	AUDIO_DAI_CLOCK_CBM_CFM		0
+#define	AUDIO_DAI_CLOCK_CBS_CFM		1
+#define	AUDIO_DAI_CLOCK_CBM_CFS		2
+#define	AUDIO_DAI_CLOCK_CBS_CFS		3
+
+#define	AUDIO_DAI_CLOCK_IN		0
+#define	AUDIO_DAI_CLOCK_OUT		1
+
+typedef struct audio_dai_device {
+	int	(*dai_set_sysclk)(struct audio_dai_device *, u_int, int);
+	int	(*dai_set_format)(struct audio_dai_device *, u_int);
+
+	const struct audio_hw_if *dai_hw_if;		/* audio driver callbacks */
+
+	device_t 		dai_dev;		/* device */
+	void			*dai_priv;		/* driver private data */
+} *audio_dai_tag_t;
+
+static inline device_t
+audio_dai_device(audio_dai_tag_t dai)
+{
+	return dai->dai_dev;
+}
+
+static inline void *
+audio_dai_private(audio_dai_tag_t dai)
+{
+	return dai->dai_priv;
+}
+
+static inline int
+audio_dai_set_sysclk(audio_dai_tag_t dai, u_int rate, int dir)
+{
+	if (!dai->dai_set_sysclk)
+		return 0;
+
+	return dai->dai_set_sysclk(dai, rate, dir);
+}
+
+static inline int
+audio_dai_set_format(audio_dai_tag_t dai, u_int format)
+{
+	if (!dai->dai_set_format)
+		return 0;
+
+	return dai->dai_set_format(dai, format);
+}
+
+static inline int
+audio_dai_open(audio_dai_tag_t dai, int flags)
+{
+	if (!dai->dai_hw_if->open)
+		return 0;
+	return dai->dai_hw_if->open(dai->dai_priv, flags);
+}
+
+static inline void
+audio_dai_close(audio_dai_tag_t dai)
+{
+	if (!dai->dai_hw_if->close)
+		return;
+	dai->dai_hw_if->close(dai->dai_priv);
+}
+
+static inline int
+audio_dai_drain(audio_dai_tag_t dai)
+{
+	if (!dai->dai_hw_if->drain)
+		return 0;
+	return dai->dai_hw_if->drain(dai->dai_priv);
+}
+
+static inline int
+audio_dai_query_encoding(audio_dai_tag_t dai, audio_encoding_t *ae)
+{
+	if (!dai->dai_hw_if->query_encoding)
+		return 0;
+	return dai->dai_hw_if->query_encoding(dai->dai_priv, ae);
+}
+
+static inline int
+audio_dai_set_params(audio_dai_tag_t dai, int setmode, int usemode,
+audio_params_t *play, audio_params_t *rec,
+stream_filter_list_t *pfil, stream_filter_list_t *rfil)
+{
+	if (!dai->dai_hw_if->set_params)
+		return 0;
+	return dai->dai_hw_if->set_params(dai->dai_priv, setmode,
+	usemode, play, rec, pfil, rfil);
+}
+
+static inline int
+audio_dai_round_blocksize(audio_dai_tag_t dai, int bs, int mode,
+const audio_params_t *params)
+{
+	if 

CVS commit: src/sys/dev

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 23:57:58 UTC 2018

Added Files:
src/sys/dev: audio_dai.h

Log Message:
Add APIs for digital audio interface drivers


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/dev/audio_dai.h

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



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2018-05-09 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Wed May  9 23:34:25 UTC 2018

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3

Log Message:
Add a description of netpgp_unsetvar and netpgp_list_keys_json.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3
diff -u src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.25 src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.26
--- src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3:1.25	Wed May  9 07:59:38 2018
+++ src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3	Wed May  9 23:34:25 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: libnetpgp.3,v 1.25 2018/05/09 07:59:38 wiz Exp $
+.\" $NetBSD: libnetpgp.3,v 1.26 2018/05/09 23:34:25 sevan Exp $
 .\"
 .\" Copyright (c) 2009,2010 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 May 9, 2018
+.Dd May 10, 2018
 .Dt LIBNETPGP 3
 .Os
 .Sh NAME
@@ -204,6 +204,8 @@ member of the
 structure.
 These are set using the
 .Fn netpgp_setvar
+function and unset using the
+.Fn netpgp_unsetvar
 function.
 If no public key ring file is set, initial values will be taken from those
 in the
@@ -228,6 +230,9 @@ function returns 1 on success, 0 on fail
 To list all the keys in a keyring, the
 .Fn netpgp_list_keys
 function is used.
+To list all the keys in a keyring as a JSON encoded string, the
+.Fn netpgp_list_keys_json
+function is used.
 The signature subkey fields can also be displayed
 using this function.
 .Pp



CVS commit: src/crypto/external/bsd/netpgp/dist/src/lib

2018-05-09 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Wed May  9 23:34:25 UTC 2018

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/lib: libnetpgp.3

Log Message:
Add a description of netpgp_unsetvar and netpgp_list_keys_json.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/crypto/external/bsd/netpgp/dist/src/lib/libnetpgp.3

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



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 22:24:01 UTC 2018

Modified Files:
src/share/mk: bsd.README

Log Message:
Document that EXTERNAL_TOOLCHAIN should be used together with HAVE_GCC
or HAVE_LLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/share/mk/bsd.README

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

Modified files:

Index: src/share/mk/bsd.README
diff -u src/share/mk/bsd.README:1.370 src/share/mk/bsd.README:1.371
--- src/share/mk/bsd.README:1.370	Sun Apr  1 04:35:02 2018
+++ src/share/mk/bsd.README	Wed May  9 22:24:01 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.370 2018/04/01 04:35:02 ryo Exp $
+#	$NetBSD: bsd.README,v 1.371 2018/05/09 22:24:01 joerg Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -790,6 +790,9 @@ EXTERNAL_TOOLCHAIN
 		compiler may not be able to build the library components of
 		the in-tree compiler.
 
+		This variable should be used in conjunction with an appropiate
+		HAVE_GCC or HAVE_LLVM setting to control the compiler flags.
+
 		NOTE: This variable is not yet used in as many places as
 		it should be.  Expect the exact semantics of this variable
 		to change in the short term as parts of the cross-compile



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 22:24:01 UTC 2018

Modified Files:
src/share/mk: bsd.README

Log Message:
Document that EXTERNAL_TOOLCHAIN should be used together with HAVE_GCC
or HAVE_LLVM.


To generate a diff of this commit:
cvs rdiff -u -r1.370 -r1.371 src/share/mk/bsd.README

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



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 21:26:59 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Don't assume that EXTERNAL_TOOLCHAIN is gcc. HAVE_GCC can and should be
defined appropiately if it is an external GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.1060 -r1.1061 src/share/mk/bsd.own.mk

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



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 21:26:59 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Don't assume that EXTERNAL_TOOLCHAIN is gcc. HAVE_GCC can and should be
defined appropiately if it is an external GCC.


To generate a diff of this commit:
cvs rdiff -u -r1.1060 -r1.1061 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1060 src/share/mk/bsd.own.mk:1.1061
--- src/share/mk/bsd.own.mk:1.1060	Wed May  9 13:19:27 2018
+++ src/share/mk/bsd.own.mk	Wed May  9 21:26:59 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1060 2018/05/09 13:19:27 joerg Exp $
+#	$NetBSD: bsd.own.mk,v 1.1061 2018/05/09 21:26:59 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -583,7 +583,7 @@ TOOL_CXX.false=		false
 TOOL_FC.false=		false
 TOOL_OBJC.false=	false
 
-AVAILABLE_COMPILER?=	${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} ${EXTERNAL_TOOLCHAIN:Dgcc} false
+AVAILABLE_COMPILER?=	${HAVE_PCC:Dpcc} ${HAVE_LLVM:Dclang} ${HAVE_GCC:Dgcc} false
 
 .for _t in CC CPP CXX FC OBJC
 ACTIVE_${_t}=	${AVAILABLE_COMPILER:@.c.@ ${ !defined(UNSUPPORTED_COMPILER.${.c.}) && defined(TOOL_${_t}.${.c.}) :? ${.c.} : }@:[1]}



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 20:23:35 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8

Log Message:
With the change to use getpass_r the 128 byte passphrase limit no
longer applies, so update the BUGS section here to reflect that change.
The limit now is 1023 whichever method is used to fetch the passphrase.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/cgdconfig/cgdconfig.8

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.8
diff -u src/sbin/cgdconfig/cgdconfig.8:1.39 src/sbin/cgdconfig/cgdconfig.8:1.40
--- src/sbin/cgdconfig/cgdconfig.8:1.39	Wed May  9 18:11:56 2018
+++ src/sbin/cgdconfig/cgdconfig.8	Wed May  9 20:23:35 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgdconfig.8,v 1.39 2018/05/09 18:11:56 alnsn Exp $
+.\" $NetBSD: cgdconfig.8,v 1.40 2018/05/09 20:23:35 kre Exp $
 .\"
 .\" Copyright (c) 2002, The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -449,14 +449,4 @@ The
 utility appeared in
 .Nx 2.0 .
 .Sh BUGS
-Since
-.Nm
-without
-.Fl p
-uses
-.Xr getpass 3
-to read in the passphrase,
-it is limited to sysconf(_SC_PASS_MAX) (128) characters.
-With
-.Fl p
-the limit is 1023 characters.
+Pass phrases are limited to 1023 bytes.



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 20:23:35 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8

Log Message:
With the change to use getpass_r the 128 byte passphrase limit no
longer applies, so update the BUGS section here to reflect that change.
The limit now is 1023 whichever method is used to fetch the passphrase.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sbin/cgdconfig/cgdconfig.8

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



CVS commit: src/sys

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 19:55:35 UTC 2018

Modified Files:
src/sys/kern: kern_resource.c
src/sys/sys: param.h proc.h

Log Message:
Cause a process's user and system times to become non-decreasing.

This alters the invented values (ie: statistically calculated)
that are returned - for small values, the values are likely going to
be different than they were, but that's largely nonsense anyway
(except that the sum of utime & stime does equal cpu time consumed
by the process).   Once the values get large enough to be meaningful
the difference made by this change will be in the noise, and irrelevant.

This needs a couple of additions to struct proc, so we are now into 8.99.17


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/kern/kern_resource.c
cvs rdiff -u -r1.561 -r1.562 src/sys/sys/param.h
cvs rdiff -u -r1.347 -r1.348 src/sys/sys/proc.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/kern/kern_resource.c
diff -u src/sys/kern/kern_resource.c:1.179 src/sys/kern/kern_resource.c:1.180
--- src/sys/kern/kern_resource.c:1.179	Tue May  8 19:34:54 2018
+++ src/sys/kern/kern_resource.c	Wed May  9 19:55:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_resource.c,v 1.179 2018/05/08 19:34:54 christos Exp $	*/
+/*	$NetBSD: kern_resource.c,v 1.180 2018/05/09 19:55:35 kre Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.179 2018/05/08 19:34:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_resource.c,v 1.180 2018/05/09 19:55:35 kre Exp $");
 
 #include 
 #include 
@@ -533,16 +533,41 @@ calcru(struct proc *p, struct timeval *u
 		st = (u * st) / tot;
 		ut = (u * ut) / tot;
 	}
+
+	/*
+	 * Try to avoid lying to the users (too much)
+	 *
+	 * Of course, user/sys time are based on sampling (ie: statistics)
+	 * so that would be impossible, but convincing the mark
+	 * that we have used less ?time this call than we had
+	 * last time, is beyond reasonable...  (the con fails!)
+	 *
+	 * Note that since actual used time cannot decrease, either
+	 * utime or stime (or both) must be greater now than last time
+	 * (or both the same) - if one seems to have decreased, hold
+	 * it constant and steal the necessary bump from the other
+	 * which must have increased.
+	 */
+	if (p->p_xutime > ut) {
+		st -= p->p_xutime - ut;
+		ut = p->p_xutime;
+	} else if (p->p_xstime > st) {
+		ut -= p->p_xstime - st;
+		st = p->p_xstime;
+	}
+
 	if (sp != NULL) {
+		p->p_xstime = st;
 		sp->tv_sec = st / 100;
 		sp->tv_usec = st % 100;
 	}
 	if (up != NULL) {
+		p->p_xutime = ut;
 		up->tv_sec = ut / 100;
 		up->tv_usec = ut % 100;
 	}
 	if (ip != NULL) {
-		if (it != 0)
+		if (it != 0)		/* it != 0 --> tot != 0 */
 			it = (u * it) / tot;
 		ip->tv_sec = it / 100;
 		ip->tv_usec = it % 100;

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.561 src/sys/sys/param.h:1.562
--- src/sys/sys/param.h:1.561	Sun May  6 13:40:52 2018
+++ src/sys/sys/param.h	Wed May  9 19:55:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.561 2018/05/06 13:40:52 kamil Exp $	*/
+/*	$NetBSD: param.h,v 1.562 2018/05/09 19:55:35 kre Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	899001600	/* NetBSD 8.99.16 */
+#define	__NetBSD_Version__	899001700	/* NetBSD 8.99.17 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)

Index: src/sys/sys/proc.h
diff -u src/sys/sys/proc.h:1.347 src/sys/sys/proc.h:1.348
--- src/sys/sys/proc.h:1.347	Sun May  6 13:40:52 2018
+++ src/sys/sys/proc.h	Wed May  9 19:55:35 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.347 2018/05/06 13:40:52 kamil Exp $	*/
+/*	$NetBSD: proc.h,v 1.348 2018/05/09 19:55:35 kre Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -293,6 +293,8 @@ struct proc {
 	u_quad_t 	p_uticks;	/* t: Statclock hits in user mode */
 	u_quad_t 	p_sticks;	/* t: Statclock hits in system mode */
 	u_quad_t 	p_iticks;	/* t: Statclock hits processing intr */
+	uint64_t	p_xutime;	/* p: utime exposed to userspace */
+	uint64_t	p_xstime;	/* p: stime exposed to userspace */
 
 	int		p_traceflag;	/* k: Kernel trace points */
 	void		*p_tracep;	/* k: Trace private data */



CVS commit: src/sys

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 19:55:35 UTC 2018

Modified Files:
src/sys/kern: kern_resource.c
src/sys/sys: param.h proc.h

Log Message:
Cause a process's user and system times to become non-decreasing.

This alters the invented values (ie: statistically calculated)
that are returned - for small values, the values are likely going to
be different than they were, but that's largely nonsense anyway
(except that the sum of utime & stime does equal cpu time consumed
by the process).   Once the values get large enough to be meaningful
the difference made by this change will be in the noise, and irrelevant.

This needs a couple of additions to struct proc, so we are now into 8.99.17


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/kern/kern_resource.c
cvs rdiff -u -r1.561 -r1.562 src/sys/sys/param.h
cvs rdiff -u -r1.347 -r1.348 src/sys/sys/proc.h

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



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 19:38:46 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
use explicit_memset(3)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.47 src/sbin/cgdconfig/cgdconfig.c:1.48
--- src/sbin/cgdconfig/cgdconfig.c:1.47	Wed May  9 18:18:11 2018
+++ src/sbin/cgdconfig/cgdconfig.c	Wed May  9 19:38:46 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.47 2018/05/09 18:18:11 alnsn Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.48 2018/05/09 19:38:46 alnsn Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.47 2018/05/09 18:18:11 alnsn Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.48 2018/05/09 19:38:46 alnsn Exp $");
 #endif
 
 #include 
@@ -412,7 +412,7 @@ maybe_getpass(char *prompt)
 		err(EXIT_FAILURE, "failed to read passphrase");
 
 	pass = estrdup(p);
-	memset(buf, 0, sizeof(buf));
+	explicit_memset(buf, 0, sizeof(buf));
 
 	return pass;
 }
@@ -448,7 +448,7 @@ getkey_pkcs5_pbkdf2(const char *target, 
 
 	ret = bits_new(tmp, keylen);
 	kg->kg_key = bits_dup(ret);
-	memset(passp, 0, strlen(passp));
+	explicit_memset(passp, 0, strlen(passp));
 	free(passp);
 	free(tmp);
 	return ret;



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 19:38:46 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
use explicit_memset(3)


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sbin/cgdconfig/cgdconfig.c

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 19:38:40 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_ccu.c

Log Message:
Fix locations of bus gates


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 19:38:40 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun50i_a64_ccu.c

Log Message:
Fix locations of bus gates


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun50i_a64_ccu.c
diff -u src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.5 src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.6
--- src/sys/arch/arm/sunxi/sun50i_a64_ccu.c:1.5	Tue May  8 22:07:02 2018
+++ src/sys/arch/arm/sunxi/sun50i_a64_ccu.c	Wed May  9 19:38:40 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun50i_a64_ccu.c,v 1.5 2018/05/08 22:07:02 jmcneill Exp $ */
+/* $NetBSD: sun50i_a64_ccu.c,v 1.6 2018/05/09 19:38:40 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2017 Jared McNeill 
@@ -28,7 +28,7 @@
 
 #include 
 
-__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.5 2018/05/08 22:07:02 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun50i_a64_ccu.c,v 1.6 2018/05/09 19:38:40 jmcneill Exp $");
 
 #include 
 #include 
@@ -285,40 +285,39 @@ static struct sunxi_ccu_clk sun50i_a64_c
 	SUNXI_CCU_GATE(A64_CLK_BUS_SPINLOCK, "bus-spinlock", "ahb1",
 	BUS_CLK_GATING_REG1, 22),
 
-	SUNXI_CCU_GATE(A64_CLK_BUS_THS, "bus-ths", "apb1",
-	BUS_CLK_GATING_REG2, 8),
-
 	SUNXI_CCU_GATE(A64_CLK_BUS_CODEC, "bus-codec", "apb1",
-	BUS_CLK_GATING_REG3, 0),
+	BUS_CLK_GATING_REG2, 0),
 	SUNXI_CCU_GATE(A64_CLK_BUS_SPDIF, "bus-spdif", "apb1",
-	BUS_CLK_GATING_REG3, 1),
+	BUS_CLK_GATING_REG2, 1),
 	SUNXI_CCU_GATE(A64_CLK_BUS_PIO, "bus-pio", "apb1",
-	BUS_CLK_GATING_REG3, 5),
+	BUS_CLK_GATING_REG2, 5),
+	SUNXI_CCU_GATE(A64_CLK_BUS_THS, "bus-ths", "apb1",
+	BUS_CLK_GATING_REG2, 8),
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2S0, "bus-i2s0", "apb1",
-	BUS_CLK_GATING_REG3, 12),
+	BUS_CLK_GATING_REG2, 12),
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2S1, "bus-i2s1", "apb1",
-	BUS_CLK_GATING_REG3, 13),
+	BUS_CLK_GATING_REG2, 13),
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2S2, "bus-i2s2", "apb1",
-	BUS_CLK_GATING_REG3, 14),
+	BUS_CLK_GATING_REG2, 14),
 
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2C0, "bus-i2c0", "apb2",
-	BUS_CLK_GATING_REG4, 0),
+	BUS_CLK_GATING_REG3, 0),
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2C1, "bus-i2c1", "apb2",
-	BUS_CLK_GATING_REG4, 1),
+	BUS_CLK_GATING_REG3, 1),
 	SUNXI_CCU_GATE(A64_CLK_BUS_I2C2, "bus-i2c2", "apb2",
-	BUS_CLK_GATING_REG4, 2),
+	BUS_CLK_GATING_REG3, 2),
 	SUNXI_CCU_GATE(A64_CLK_BUS_SCR, "bus-scr", "apb2",
-	BUS_CLK_GATING_REG4, 5),
+	BUS_CLK_GATING_REG3, 5),
 	SUNXI_CCU_GATE(A64_CLK_BUS_UART0, "bus-uart0", "apb2",
-	BUS_CLK_GATING_REG4, 16),
+	BUS_CLK_GATING_REG3, 16),
 	SUNXI_CCU_GATE(A64_CLK_BUS_UART1, "bus-uart1", "apb2",
-	BUS_CLK_GATING_REG4, 17),
+	BUS_CLK_GATING_REG3, 17),
 	SUNXI_CCU_GATE(A64_CLK_BUS_UART2, "bus-uart2", "apb2",
-	BUS_CLK_GATING_REG4, 18),
+	BUS_CLK_GATING_REG3, 18),
 	SUNXI_CCU_GATE(A64_CLK_BUS_UART3, "bus-uart3", "apb2",
-	BUS_CLK_GATING_REG4, 19),
+	BUS_CLK_GATING_REG3, 19),
 	SUNXI_CCU_GATE(A64_CLK_BUS_UART4, "bus-uart4", "apb2",
-	BUS_CLK_GATING_REG4, 20),
+	BUS_CLK_GATING_REG3, 20),
 
 	SUNXI_CCU_GATE(A64_CLK_USB_PHY0, "usb-phy0", "hosc",
 	USBPHY_CFG_REG, 8),



Re: CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
matthew green wrote:
> "Alexander Nasonov" writes:
> > XXX Using memset for wiping isn't a good idea because memset is likely
> > optimised away by gcc. This should be revisited.
> 
> use explicit_memset(3)?

Yes, we should change memsets of sensitive buffers to explicit_memset
but we also should inspect code for any missing memsets.

-- 
Alex


re: CVS commit: src/sbin/cgdconfig

2018-05-09 Thread matthew green
"Alexander Nasonov" writes:
> Module Name:  src
> Committed By: alnsn
> Date: Wed May  9 18:11:56 UTC 2018
> 
> Modified Files:
>   src/sbin/cgdconfig: cgdconfig.8 cgdconfig.c
> 
> Log Message:
> Add '-e' option (echo the passphrase) and wipe the passphrase after use.
> 

> XXX Using memset for wiping isn't a good idea because memset is likely
> optimised away by gcc. This should be revisited.

use explicit_memset(3)?


.mrg.


CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 18:18:11 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
Missed one change when doing a manual merge of my patch with kre's commit.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.46 src/sbin/cgdconfig/cgdconfig.c:1.47
--- src/sbin/cgdconfig/cgdconfig.c:1.46	Wed May  9 18:11:56 2018
+++ src/sbin/cgdconfig/cgdconfig.c	Wed May  9 18:18:11 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.46 2018/05/09 18:11:56 alnsn Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.47 2018/05/09 18:18:11 alnsn Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.46 2018/05/09 18:11:56 alnsn Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.47 2018/05/09 18:18:11 alnsn Exp $");
 #endif
 
 #include 
@@ -599,7 +599,9 @@ configure(int argc, char **argv, struct 
 	 * a password.
 	 */
 
-	for (kg = p->keygen; pflag == PFLAG_GETPASS && kg; kg = kg->next)
+	for (kg = p->keygen;
+	(pflag & PFLAG_GETPASS_MASK) && kg;
+	kg = kg->next)
 		if ((kg->kg_method == KEYGEN_PKCS5_PBKDF2_SHA1) ||
 		(kg->kg_method == KEYGEN_PKCS5_PBKDF2_OLD )) {
 			loop = 1;



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 18:18:11 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
Missed one change when doing a manual merge of my patch with kre's commit.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sbin/cgdconfig/cgdconfig.c

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



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 18:11:56 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8 cgdconfig.c

Log Message:
Add '-e' option (echo the passphrase) and wipe the passphrase after use.

XXX Using memset for wiping isn't a good idea because memset is likely
optimised away by gcc. This should be revisited.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sbin/cgdconfig/cgdconfig.8
cvs rdiff -u -r1.45 -r1.46 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.8
diff -u src/sbin/cgdconfig/cgdconfig.8:1.38 src/sbin/cgdconfig/cgdconfig.8:1.39
--- src/sbin/cgdconfig/cgdconfig.8:1.38	Wed May  9 17:35:03 2018
+++ src/sbin/cgdconfig/cgdconfig.8	Wed May  9 18:11:56 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgdconfig.8,v 1.38 2018/05/09 17:35:03 wiz Exp $
+.\" $NetBSD: cgdconfig.8,v 1.39 2018/05/09 18:11:56 alnsn Exp $
 .\"
 .\" Copyright (c) 2002, The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -35,17 +35,17 @@
 .Nd configuration utility for the cryptographic disk driver
 .Sh SYNOPSIS
 .Nm
-.Op Fl npv
+.Op Fl enpv
 .Op Fl V Ar vmeth
 .Ar cgd dev
 .Op Ar paramsfile
 .Nm
 .Fl C
-.Op Fl npv
+.Op Fl enpv
 .Op Fl f Ar configfile
 .Nm
 .Fl G
-.Op Fl npv
+.Op Fl enpv
 .Op Fl i Ar ivmeth
 .Op Fl k Ar kgmeth
 .Op Fl o Ar outfile
@@ -89,6 +89,8 @@ The options are as follows:
 .Bl -tag -width configfile
 .It Fl C
 Configure all the devices listed in the cgd configuration file.
+.It Fl e
+Echo the passphase.
 .It Fl f Ar configfile
 Specify the configuration file explicitly, rather than using the default
 configuration file

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.45 src/sbin/cgdconfig/cgdconfig.c:1.46
--- src/sbin/cgdconfig/cgdconfig.c:1.45	Wed May  9 14:27:41 2018
+++ src/sbin/cgdconfig/cgdconfig.c	Wed May  9 18:11:56 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.46 2018/05/09 18:11:56 alnsn Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.46 2018/05/09 18:11:56 alnsn Exp $");
 #endif
 
 #include 
@@ -89,8 +89,10 @@ int	nflag = 0;
 
 /* if pflag is set to PFLAG_STDIN read from stdin rather than getpass(3) */
 
-#define	PFLAG_GETPASS	0x01
-#define	PFLAG_STDIN	0x02
+#define	PFLAG_GETPASS		0x01
+#define	PFLAG_GETPASS_ECHO	0x02
+#define	PFLAG_GETPASS_MASK	0x03
+#define	PFLAG_STDIN		0x04
 int	pflag = PFLAG_GETPASS;
 
 static int	configure(int, char **, struct params *, int);
@@ -136,11 +138,11 @@ static void
 usage(void)
 {
 
-	(void)fprintf(stderr, "usage: %s [-npv] [-V vmeth] cgd dev "
+	(void)fprintf(stderr, "usage: %s [-enpv] [-V vmeth] cgd dev "
 	"[paramsfile]\n", getprogname());
-	(void)fprintf(stderr, "   %s -C [-npv] [-f configfile]\n",
+	(void)fprintf(stderr, "   %s -C [-enpv] [-f configfile]\n",
 	getprogname());
-	(void)fprintf(stderr, "   %s -G [-npv] [-i ivmeth] [-k kgmeth] "
+	(void)fprintf(stderr, "   %s -G [-enpv] [-i ivmeth] [-k kgmeth] "
 	"[-o outfile] paramsfile\n", getprogname());
 	(void)fprintf(stderr, "   %s -g [-nv] [-i ivmeth] [-k kgmeth] "
 	"[-o outfile] alg [keylen]\n", getprogname());
@@ -201,7 +203,7 @@ main(int argc, char **argv)
 	p = params_new();
 	kg = NULL;
 
-	while ((ch = getopt(argc, argv, "CGUV:b:f:gi:k:lno:spuv")) != -1)
+	while ((ch = getopt(argc, argv, "CGUV:b:ef:gi:k:lno:spuv")) != -1)
 		switch (ch) {
 		case 'C':
 			set_action(, ACTION_CONFIGALL);
@@ -230,6 +232,9 @@ main(int argc, char **argv)
 p = params_combine(p, tp);
 			}
 			break;
+		case 'e':
+			pflag = PFLAG_GETPASS_ECHO;
+			break;
 		case 'f':
 			if (cfile)
 usage();
@@ -377,12 +382,17 @@ static char *
 maybe_getpass(char *prompt)
 {
 	char	 buf[1024];
-	char	*p = buf;
-	char	*tmp;
+	char	*p = NULL;
+	char	*tmp, *pass;
 
 	switch (pflag) {
 	case PFLAG_GETPASS:
-		p = getpass(prompt);
+		p = getpass_r(prompt, buf, sizeof(buf));
+		break;
+
+	case PFLAG_GETPASS_ECHO:
+		p = getpassfd(prompt, buf, sizeof(buf), NULL,
+		GETPASS_ECHO|GETPASS_ECHO_NL|GETPASS_NEED_TTY, 0);
 		break;
 
 	case PFLAG_STDIN:
@@ -401,7 +411,10 @@ maybe_getpass(char *prompt)
 	if (!p)
 		err(EXIT_FAILURE, "failed to read passphrase");
 
-	return estrdup(p);
+	pass = estrdup(p);
+	memset(buf, 0, sizeof(buf));
+
+	return pass;
 }
 
 /*ARGSUSED*/
@@ -422,7 +435,8 @@ getkey_pkcs5_pbkdf2(const char *target, 
 	char		 buf[1024];
 	u_int8_t	*tmp;
 
-	snprintf(buf, sizeof(buf), "%s's passphrase:", target);
+	snprintf(buf, sizeof(buf), "%s's passphrase%s:", target,
+	pflag & PFLAG_GETPASS_ECHO ? " (echo)" : "");
 	

CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Wed May  9 18:11:56 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8 cgdconfig.c

Log Message:
Add '-e' option (echo the passphrase) and wipe the passphrase after use.

XXX Using memset for wiping isn't a good idea because memset is likely
optimised away by gcc. This should be revisited.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sbin/cgdconfig/cgdconfig.8
cvs rdiff -u -r1.45 -r1.46 src/sbin/cgdconfig/cgdconfig.c

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



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May  9 17:35:03 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8

Log Message:
Add commas in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/cgdconfig/cgdconfig.8

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.8
diff -u src/sbin/cgdconfig/cgdconfig.8:1.37 src/sbin/cgdconfig/cgdconfig.8:1.38
--- src/sbin/cgdconfig/cgdconfig.8:1.37	Wed May  9 14:27:41 2018
+++ src/sbin/cgdconfig/cgdconfig.8	Wed May  9 17:35:03 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgdconfig.8,v 1.37 2018/05/09 14:27:41 kre Exp $
+.\" $NetBSD: cgdconfig.8,v 1.38 2018/05/09 17:35:03 wiz Exp $
 .\"
 .\" Copyright (c) 2002, The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -435,8 +435,8 @@ Ensure that the processor clock frequenc
 program's execution.
 .El
 .Sh SEE ALSO
-.Xr cgd 4
-.Xr disklabel 8
+.Xr cgd 4 ,
+.Xr disklabel 8 ,
 .Xr gpt 8
 .Pp
 .Dq PKCS #5 v2.0: Password-Based Cryptography Standard ,



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed May  9 17:35:03 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8

Log Message:
Add commas in enumeration.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sbin/cgdconfig/cgdconfig.8

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



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 17:17:33 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun6i_dma.c

Log Message:
Set "DMA MCLK interface circuit auto gating bit" to 1 where required.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun6i_dma.c

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

Modified files:

Index: src/sys/arch/arm/sunxi/sun6i_dma.c
diff -u src/sys/arch/arm/sunxi/sun6i_dma.c:1.3 src/sys/arch/arm/sunxi/sun6i_dma.c:1.4
--- src/sys/arch/arm/sunxi/sun6i_dma.c:1.3	Fri Dec 15 02:24:22 2017
+++ src/sys/arch/arm/sunxi/sun6i_dma.c	Wed May  9 17:17:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sun6i_dma.c,v 1.3 2017/12/15 02:24:22 jmcneill Exp $ */
+/* $NetBSD: sun6i_dma.c,v 1.4 2018/05/09 17:17:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014-2017 Jared McNeill 
@@ -29,7 +29,7 @@
 #include "opt_ddb.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.3 2017/12/15 02:24:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sun6i_dma.c,v 1.4 2018/05/09 17:17:33 jmcneill Exp $");
 
 #include 
 #include 
@@ -92,11 +92,43 @@ struct sun6idma_desc {
 #define DMA_NULL	0xf800
 };
 
+struct sun6idma_config {
+	u_int		num_channels;
+	bool		autogate;
+	bus_size_t	autogate_reg;
+	uint32_t	autogate_mask;
+};
+
+static const struct sun6idma_config sun6i_a31_dma_config = {
+	.num_channels = 16
+};
+
+static const struct sun6idma_config sun8i_a83t_dma_config = {
+	.num_channels = 8,
+	.autogate = true,
+	.autogate_reg = 0x20,
+	.autogate_mask = 0x4,
+};
+
+static const struct sun6idma_config sun8i_h3_dma_config = {
+	.num_channels = 12,
+	.autogate = true,
+	.autogate_reg = 0x28,
+	.autogate_mask = 0x4,
+};
+
+static const struct sun6idma_config sun50i_a64_dma_config = {
+	.num_channels = 8,
+	.autogate = true,
+	.autogate_reg = 0x28,
+	.autogate_mask = 0x4,
+};
+
 static const struct of_compat_data compat_data[] = {
-	{ "allwinner,sun6i-a31-dma",		16 },
-	{ "allwinner,sun8i-a83t-dma",		8 },
-	{ "allwinner,sun8i-h3-dma",		12 },
-	{ "allwinner,sun50i-a64-dma",		8 },
+	{ "allwinner,sun6i-a31-dma",	(uintptr_t)_a31_dma_config },
+	{ "allwinner,sun8i-a83t-dma",	(uintptr_t)_a83t_dma_config },
+	{ "allwinner,sun8i-h3-dma",	(uintptr_t)_h3_dma_config },
+	{ "allwinner,sun50i-a64-dma",	(uintptr_t)_a64_dma_config },
 	{ NULL }
 };
 
@@ -324,6 +356,7 @@ sun6idma_attach(device_t parent, device_
 	struct fdt_attach_args * const faa = aux;
 	const int phandle = faa->faa_phandle;
 	const size_t desclen = sizeof(struct sun6idma_desc);
+	const struct sun6idma_config *conf;
 	struct fdtbus_reset *rst;
 	struct clk *clk;
 	char intrstr[128];
@@ -363,7 +396,9 @@ sun6idma_attach(device_t parent, device_
 		return;
 	}
 
-	sc->sc_nchan = of_search_compatible(phandle, compat_data)->data;
+	conf = of_search_compatible(phandle, compat_data)->data;
+
+	sc->sc_nchan = conf->num_channels;
 	sc->sc_chan = kmem_alloc(sizeof(*sc->sc_chan) * sc->sc_nchan, KM_SLEEP);
 
 	aprint_naive("\n");
@@ -401,6 +436,9 @@ sun6idma_attach(device_t parent, device_
 		DMA_WRITE(sc, DMA_EN_REG(index), 0);
 	}
 
+	if (conf->autogate)
+		DMA_WRITE(sc, conf->autogate_reg, conf->autogate_mask);
+
 	sc->sc_ih = fdtbus_intr_establish(phandle, 0, IPL_SCHED, FDT_INTR_MPSAFE,
 	sun6idma_intr, sc);
 	if (sc->sc_ih == NULL) {



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

2018-05-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May  9 17:17:33 UTC 2018

Modified Files:
src/sys/arch/arm/sunxi: sun6i_dma.c

Log Message:
Set "DMA MCLK interface circuit auto gating bit" to 1 where required.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/sunxi/sun6i_dma.c

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



CVS commit: [netbsd-8] src/doc

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:38:05 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #814 - #817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.195 -r1.1.2.196 src/doc/CHANGES-8.0

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

Modified files:

Index: src/doc/CHANGES-8.0
diff -u src/doc/CHANGES-8.0:1.1.2.195 src/doc/CHANGES-8.0:1.1.2.196
--- src/doc/CHANGES-8.0:1.1.2.195	Mon May  7 13:28:35 2018
+++ src/doc/CHANGES-8.0	Wed May  9 15:38:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-8.0,v 1.1.2.195 2018/05/07 13:28:35 martin Exp $
+# $NetBSD: CHANGES-8.0,v 1.1.2.196 2018/05/09 15:38:05 martin Exp $
 
 A complete list of changes from the initial NetBSD 8.0 branch on 2017-06-04
 until the 8.0 release:
@@ -13339,4 +13339,31 @@ sys/dev/usb/if_axe.c1.85-1.89
 	Use the proper station nodeid read command.
 	[nonaka, ticket #782]
 
+sys/dev/pci/if_bnx.c1.64
+sys/dev/pci/if_bnxvar.h1.7
+
+	- Fix potential panic in bnx(4) on shutdown.
+	- Use pci_intr_establish_xname().
+	[msaitoh, ticket #814]
+
+sys/dev/ic/hme.c1.97
+
+	Fix mis-placed parenthesis.
+	[pgoyette, ticket #815]
+
+sys/dev/pci/if_wm.c1.578
+
+	- Fix a bug that TX might stall after initializing wm interface.
+	- Fix a bug that watchdog timer doesn't reinitialize the interface
+	  correctly.
+	[msaitoh, ticket #816]
+
+sys/net/npf/npf.h1.56
+sys/net/npf/npf_alg_icmp.c			1.26
+sys/net/npf/npf_handler.c			1.38,1.39
+sys/net/npf/npf_inet.c1.38-1.44
+sys/net/npf/npf_sendpkt.c			1.17,1.18
+
+	Various fixes for NPF.
+	[maxv, ticket #817]
 



CVS commit: [netbsd-8] src/doc

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:38:05 UTC 2018

Modified Files:
src/doc [netbsd-8]: CHANGES-8.0

Log Message:
Tickets #814 - #817


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.195 -r1.1.2.196 src/doc/CHANGES-8.0

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



CVS commit: [netbsd-8] src/sys/net/npf

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:35:37 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-8]: npf.h npf_alg_icmp.c npf_handler.c
npf_inet.c npf_sendpkt.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #817):

sys/net/npf/npf_inet.c: revision 1.38-1.44
sys/net/npf/npf_handler.c: revision 1.38-1.39
sys/net/npf/npf_alg_icmp.c: revision 1.26
sys/net/npf/npf.h: revision 1.56
sys/net/npf/npf_sendpkt.c: revision 1.17-1.18

Declare NPC_FMTERR, and use it to kick malformed packets. Several sanity
checks are added in IPv6; after we see the first IPPROTO_FRAGMENT header,
we are allowed to fail to advance, otherwise we kick the packet.
Sent on tech-net@ a few days ago, no response, but I'm committing it now
anyway.

Switch nptr to uint8_t, and use nbuf_ensure_contig. Makes us use fewer
magic values.

Remove dead branches, 'npc' can't be NULL (and it is dereferenced
earlier).

Fix two consecutive mistakes.

The first mistake was npf_inet.c rev1.37:
"Don't reassemble ipv6 fragments, instead treat the first fragment
as a regular packet (subject to filtering rules), and pass
subsequent fragments in the same group unconditionally."

Doing this was entirely wrong, because then a packet just had to push
the L4 payload in a secondary fragment, and NPF wouldn't apply rules on
it - meaning any IPv6 packet could bypass >=L4 filtering. This mistake
was supposed to be a fix for the second mistake.

The second mistake was that ip6_reass_packet (in npf_reassembly) was
getting called with npc->npc_hlen. But npc_hlen pointed to the last
encountered header in the IPv6 chain, which was not necessarily the
fragment header. So ip6_reass_packet was given garbage, and would fail,
resulting in the packet getting kicked. So basically IPv6 was broken by
NPF.

The first mistake is reverted, and the second one is fixed by doing:
-   hlen = sizeof(struct ip6_frag);
+   hlen = 0;

Now the iteration stops on the fragment header, and the call to
ip6_reass_packet is valid.

My npf_inet.c rev1.38 is partially reverted: we don't need to worry
about failing properly to advance; once the packet is reassembled
npf_cache_ip gets called again, and this time the whole chain should be
there.

Tested with a simple UDPv6 server - send a 3000-byte-sized buffer, the
packet gets correctly reassembled by NPF now.

Mmh, put back the RFC6946 check (about dummy fragments), otherwise NPF
is not happy in npf_reassembly, because NPC_IPFRAG is again returned after
the packet was reassembled.

I'm wondering whether it would not be better to just remove the fragment
header in frag6_input directly.

Fix the "return-rst" rule on IPv6 packets.
The scopes needed to be set on the addresses before invoking ip6_output,
because ip6_output needs them. The reason they are not here already is
because pfil_run_hooks (in ip6_input) is called _before_ the kernel
initializes the scopes.

Until now ip6_output was always failing, and the IPv6-TCP-RST packet was
never actually sent.

Perhaps it would be better to have the kernel initialize the scopes
before invoking pfil_run_hooks, but several things will need to be fixed
in several places.

Tested with a simple TCPv6 server. Until now the client would block
waiting for an answer that never came; now it receives an RST right away
and closes the connection, as expected.
I believe that the same problem exists in the "return-icmp" rules, but I
can't investigate this right now (some problems with wireshark).

Fix the IPv6 payload computation in npf_tcpsaw. It was incorrect, and this
caused the "return-rst" rules to send back an RST with the wrong ACK when
the received SYN had an IPv6 option.

Set the scopes before calling icmp6_error(). This fixes a bug similar to
the one I fixed in rev1.17: since the scopes were not set the packet was
never actually sent.

Tested with wireshark, now the ICMPv6 reply is correctly sent, as
expected.

Don't read the L4 payload after IPPROTO_AH when handling IPv6 packets.
AH must be considered as the payload, otherwise a

block all
pass in proto ah from any
pass out proto ah from any

configuration will actually block everything, because NPF checks the
protocol against the one found after AH, and not AH itself.

In addition it may have been a problem for stateful connections; an AH
packet sent by an attacker with an incorrect authentication and a correct
TCP/UDP/whatever payload from an active connection could manage to change
NPF's FSM state, which would perhaps have altered the legitimate
connection with the authenticated remote IPsec host.

Note that IPv4 already doesn't go beyond AH, which is the correct
behavior.

Add XXX (we don't handle IPv6 Jumbograms), and whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.54.6.1 -r1.54.6.2 src/sys/net/npf/npf.h
cvs rdiff -u -r1.24 -r1.24.8.1 

CVS commit: [netbsd-8] src/sys/net/npf

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:35:37 UTC 2018

Modified Files:
src/sys/net/npf [netbsd-8]: npf.h npf_alg_icmp.c npf_handler.c
npf_inet.c npf_sendpkt.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #817):

sys/net/npf/npf_inet.c: revision 1.38-1.44
sys/net/npf/npf_handler.c: revision 1.38-1.39
sys/net/npf/npf_alg_icmp.c: revision 1.26
sys/net/npf/npf.h: revision 1.56
sys/net/npf/npf_sendpkt.c: revision 1.17-1.18

Declare NPC_FMTERR, and use it to kick malformed packets. Several sanity
checks are added in IPv6; after we see the first IPPROTO_FRAGMENT header,
we are allowed to fail to advance, otherwise we kick the packet.
Sent on tech-net@ a few days ago, no response, but I'm committing it now
anyway.

Switch nptr to uint8_t, and use nbuf_ensure_contig. Makes us use fewer
magic values.

Remove dead branches, 'npc' can't be NULL (and it is dereferenced
earlier).

Fix two consecutive mistakes.

The first mistake was npf_inet.c rev1.37:
"Don't reassemble ipv6 fragments, instead treat the first fragment
as a regular packet (subject to filtering rules), and pass
subsequent fragments in the same group unconditionally."

Doing this was entirely wrong, because then a packet just had to push
the L4 payload in a secondary fragment, and NPF wouldn't apply rules on
it - meaning any IPv6 packet could bypass >=L4 filtering. This mistake
was supposed to be a fix for the second mistake.

The second mistake was that ip6_reass_packet (in npf_reassembly) was
getting called with npc->npc_hlen. But npc_hlen pointed to the last
encountered header in the IPv6 chain, which was not necessarily the
fragment header. So ip6_reass_packet was given garbage, and would fail,
resulting in the packet getting kicked. So basically IPv6 was broken by
NPF.

The first mistake is reverted, and the second one is fixed by doing:
-   hlen = sizeof(struct ip6_frag);
+   hlen = 0;

Now the iteration stops on the fragment header, and the call to
ip6_reass_packet is valid.

My npf_inet.c rev1.38 is partially reverted: we don't need to worry
about failing properly to advance; once the packet is reassembled
npf_cache_ip gets called again, and this time the whole chain should be
there.

Tested with a simple UDPv6 server - send a 3000-byte-sized buffer, the
packet gets correctly reassembled by NPF now.

Mmh, put back the RFC6946 check (about dummy fragments), otherwise NPF
is not happy in npf_reassembly, because NPC_IPFRAG is again returned after
the packet was reassembled.

I'm wondering whether it would not be better to just remove the fragment
header in frag6_input directly.

Fix the "return-rst" rule on IPv6 packets.
The scopes needed to be set on the addresses before invoking ip6_output,
because ip6_output needs them. The reason they are not here already is
because pfil_run_hooks (in ip6_input) is called _before_ the kernel
initializes the scopes.

Until now ip6_output was always failing, and the IPv6-TCP-RST packet was
never actually sent.

Perhaps it would be better to have the kernel initialize the scopes
before invoking pfil_run_hooks, but several things will need to be fixed
in several places.

Tested with a simple TCPv6 server. Until now the client would block
waiting for an answer that never came; now it receives an RST right away
and closes the connection, as expected.
I believe that the same problem exists in the "return-icmp" rules, but I
can't investigate this right now (some problems with wireshark).

Fix the IPv6 payload computation in npf_tcpsaw. It was incorrect, and this
caused the "return-rst" rules to send back an RST with the wrong ACK when
the received SYN had an IPv6 option.

Set the scopes before calling icmp6_error(). This fixes a bug similar to
the one I fixed in rev1.17: since the scopes were not set the packet was
never actually sent.

Tested with wireshark, now the ICMPv6 reply is correctly sent, as
expected.

Don't read the L4 payload after IPPROTO_AH when handling IPv6 packets.
AH must be considered as the payload, otherwise a

block all
pass in proto ah from any
pass out proto ah from any

configuration will actually block everything, because NPF checks the
protocol against the one found after AH, and not AH itself.

In addition it may have been a problem for stateful connections; an AH
packet sent by an attacker with an incorrect authentication and a correct
TCP/UDP/whatever payload from an active connection could manage to change
NPF's FSM state, which would perhaps have altered the legitimate
connection with the authenticated remote IPsec host.

Note that IPv4 already doesn't go beyond AH, which is the correct
behavior.

Add XXX (we don't handle IPv6 Jumbograms), and whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.54.6.1 -r1.54.6.2 src/sys/net/npf/npf.h
cvs rdiff -u -r1.24 -r1.24.8.1 

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

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:28:44 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

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

sys/dev/pci/if_wm.c: revision 1.578

  Fix a bug that TX might stall because WM_TXQ_NO_SPACE is not cleared in
if_init() (though I've never seen this problem). Clear txq->txq_flags in
wm_init_tx_queue(). OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.17 -r1.508.4.18 src/sys/dev/pci/if_wm.c

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



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

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:28:44 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_wm.c

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

sys/dev/pci/if_wm.c: revision 1.578

  Fix a bug that TX might stall because WM_TXQ_NO_SPACE is not cleared in
if_init() (though I've never seen this problem). Clear txq->txq_flags in
wm_init_tx_queue(). OK'd by knakahara.


To generate a diff of this commit:
cvs rdiff -u -r1.508.4.17 -r1.508.4.18 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.508.4.17 src/sys/dev/pci/if_wm.c:1.508.4.18
--- src/sys/dev/pci/if_wm.c:1.508.4.17	Mon Apr 16 14:25:49 2018
+++ src/sys/dev/pci/if_wm.c	Wed May  9 15:28:44 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.508.4.17 2018/04/16 14:25:49 martin Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.508.4.18 2018/05/09 15:28:44 martin Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.17 2018/04/16 14:25:49 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.18 2018/05/09 15:28:44 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -6696,6 +6696,7 @@ wm_init_tx_queue(struct wm_softc *sc, st
 	wm_init_tx_regs(sc, wmq, txq);
 	wm_init_tx_buffer(sc, txq);
 
+	txq->txq_flags = 0; /* Clear WM_TXQ_NO_SPACE */
 	txq->txq_watchdog = false;
 }
 



CVS commit: [netbsd-8] src/sys/dev/ic

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:21:02 UTC 2018

Modified Files:
src/sys/dev/ic [netbsd-8]: hme.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #815):

sys/dev/ic/hme.c: revision 1.97

Fix mis-placed right paren.  kern/53271


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.2.1 src/sys/dev/ic/hme.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/hme.c
diff -u src/sys/dev/ic/hme.c:1.96 src/sys/dev/ic/hme.c:1.96.2.1
--- src/sys/dev/ic/hme.c:1.96	Tue May 23 02:19:14 2017
+++ src/sys/dev/ic/hme.c	Wed May  9 15:21:02 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: hme.c,v 1.96 2017/05/23 02:19:14 ozaki-r Exp $	*/
+/*	$NetBSD: hme.c,v 1.96.2.1 2018/05/09 15:21:02 martin Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.96 2017/05/23 02:19:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hme.c,v 1.96.2.1 2018/05/09 15:21:02 martin Exp $");
 
 /* #define HMEDEBUG */
 
@@ -753,7 +753,7 @@ hme_get(struct hme_softc *sc, int ri, ui
 			pktlen = m0->m_pkthdr.len - ETHER_HDR_LEN;
 		} else if (ntohs(eh->ether_type) == ETHERTYPE_VLAN) {
 			evh = (struct ether_vlan_header *)eh;
-			if (ntohs(evh->evl_proto != ETHERTYPE_IP))
+			if (ntohs(evh->evl_proto) != ETHERTYPE_IP)
 goto swcsum;
 			ip = (struct ip *)((char *)eh + ETHER_HDR_LEN +
 			ETHER_VLAN_ENCAP_LEN);



CVS commit: [netbsd-8] src/sys/dev/ic

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 15:21:02 UTC 2018

Modified Files:
src/sys/dev/ic [netbsd-8]: hme.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #815):

sys/dev/ic/hme.c: revision 1.97

Fix mis-placed right paren.  kern/53271


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.96.2.1 src/sys/dev/ic/hme.c

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



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

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 14:52:40 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bnx.c if_bnxvar.h

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

sys/dev/pci/if_bnxvar.h: revision 1.7
sys/dev/pci/if_bnx.c: revision 1.64

- Fix a bug that bnx(4) panics on shutdown. Stop callout before restroy.
   Reported by Andreas Gustafsson in PR#53265.
- Make sure not to re-arm the callout when we are about to detach. Same as
   if_bge.c rev. 1.292.
- Use pci_intr_establish_xname().


To generate a diff of this commit:
cvs rdiff -u -r1.61.8.1 -r1.61.8.2 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/pci/if_bnxvar.h

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

Modified files:

Index: src/sys/dev/pci/if_bnx.c
diff -u src/sys/dev/pci/if_bnx.c:1.61.8.1 src/sys/dev/pci/if_bnx.c:1.61.8.2
--- src/sys/dev/pci/if_bnx.c:1.61.8.1	Tue Oct 24 08:38:59 2017
+++ src/sys/dev/pci/if_bnx.c	Wed May  9 14:52:40 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bnx.c,v 1.61.8.1 2017/10/24 08:38:59 snj Exp $	*/
+/*	$NetBSD: if_bnx.c,v 1.61.8.2 2018/05/09 14:52:40 martin Exp $	*/
 /*	$OpenBSD: if_bnx.c,v 1.85 2009/11/09 14:32:41 dlg Exp $ */
 
 /*-
@@ -35,7 +35,7 @@
 #if 0
 __FBSDID("$FreeBSD: src/sys/dev/bce/if_bce.c,v 1.3 2006/04/13 14:12:26 ru Exp $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.61.8.1 2017/10/24 08:38:59 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bnx.c,v 1.61.8.2 2018/05/09 14:52:40 martin Exp $");
 
 /*
  * The following controllers are supported by this driver:
@@ -792,7 +792,8 @@ bnx_attach(device_t parent, device_t sel
 	IFCAP_CSUM_UDPv4_Tx | IFCAP_CSUM_UDPv4_Rx;
 
 	/* Hookup IRQ last. */
-	sc->bnx_intrhand = pci_intr_establish(pc, ih, IPL_NET, bnx_intr, sc);
+	sc->bnx_intrhand = pci_intr_establish_xname(pc, ih, IPL_NET, bnx_intr,
+	sc, device_xname(self));
 	if (sc->bnx_intrhand == NULL) {
 		aprint_error_dev(self, "couldn't establish interrupt");
 		if (intrstr != NULL)
@@ -890,17 +891,7 @@ bnx_detach(device_t dev, int flags)
 
 	/* Stop and reset the controller. */
 	s = splnet();
-	if (ifp->if_flags & IFF_RUNNING)
-		bnx_stop(ifp, 1);
-	else {
-		/* Disable the transmit/receive blocks. */
-		REG_WR(sc, BNX_MISC_ENABLE_CLR_BITS, 0x5ff);
-		REG_RD(sc, BNX_MISC_ENABLE_CLR_BITS);
-		DELAY(20);
-		bnx_disable_intr(sc);
-		bnx_reset(sc, BNX_DRV_MSG_CODE_RESET);
-	}
-
+	bnx_stop(ifp, 1);
 	splx(s);
 
 	pmf_device_deregister(dev);
@@ -3371,10 +3362,11 @@ bnx_stop(struct ifnet *ifp, int disable)
 
 	DBPRINT(sc, BNX_VERBOSE_RESET, "Entering %s()\n", __func__);
 
-	if ((ifp->if_flags & IFF_RUNNING) == 0)
-		return;
-
-	callout_stop(>bnx_timeout);
+	if (disable) {
+		sc->bnx_detaching = 1;
+		callout_halt(>bnx_timeout, NULL);
+	} else
+		callout_stop(>bnx_timeout);
 
 	mii_down(>bnx_mii);
 
@@ -5694,9 +5686,6 @@ bnx_tick(void *xsc)
 	/* Update the statistics from the hardware statistics block. */
 	bnx_stats_update(sc);
 
-	/* Schedule the next tick. */
-	callout_reset(>bnx_timeout, hz, bnx_tick, sc);
-
 	mii = >bnx_mii;
 	mii_tick(mii);
 
@@ -5707,6 +5696,11 @@ bnx_tick(void *xsc)
 	bnx_get_buf(sc, , _prod, _bseq);
 	sc->rx_prod = prod;
 	sc->rx_prod_bseq = prod_bseq;
+
+	/* Schedule the next tick. */
+	if (!sc->bnx_detaching)
+		callout_reset(>bnx_timeout, hz, bnx_tick, sc);
+
 	splx(s);
 	return;
 }

Index: src/sys/dev/pci/if_bnxvar.h
diff -u src/sys/dev/pci/if_bnxvar.h:1.6 src/sys/dev/pci/if_bnxvar.h:1.6.22.1
--- src/sys/dev/pci/if_bnxvar.h:1.6	Tue Jul  1 17:11:35 2014
+++ src/sys/dev/pci/if_bnxvar.h	Wed May  9 14:52:40 2018
@@ -210,6 +210,7 @@ struct bnx_softc
 	uint32_t		tx_prod_bseq;	/* Counts the bytes used.  */
 
 	struct callout		bnx_timeout;
+	int			bnx_detaching;
 
 	/* Frame size and mbuf allocation size for RX frames. */
 	uint32_t		max_frame_size;



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

2018-05-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed May  9 14:52:40 UTC 2018

Modified Files:
src/sys/dev/pci [netbsd-8]: if_bnx.c if_bnxvar.h

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

sys/dev/pci/if_bnxvar.h: revision 1.7
sys/dev/pci/if_bnx.c: revision 1.64

- Fix a bug that bnx(4) panics on shutdown. Stop callout before restroy.
   Reported by Andreas Gustafsson in PR#53265.
- Make sure not to re-arm the callout when we are about to detach. Same as
   if_bge.c rev. 1.292.
- Use pci_intr_establish_xname().


To generate a diff of this commit:
cvs rdiff -u -r1.61.8.1 -r1.61.8.2 src/sys/dev/pci/if_bnx.c
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/dev/pci/if_bnxvar.h

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



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 14:27:41 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8 cgdconfig.c

Log Message:
Fix missing -p in usage message (noted by Christoph Badura, thanks),
and update -l usage as well.

While here fix man page synopses and a few other odds and ends.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/cgdconfig/cgdconfig.8
cvs rdiff -u -r1.44 -r1.45 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.8
diff -u src/sbin/cgdconfig/cgdconfig.8:1.36 src/sbin/cgdconfig/cgdconfig.8:1.37
--- src/sbin/cgdconfig/cgdconfig.8:1.36	Sun Sep 11 01:09:34 2016
+++ src/sbin/cgdconfig/cgdconfig.8	Wed May  9 14:27:41 2018
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgdconfig.8,v 1.36 2016/09/11 01:09:34 sevan Exp $
+.\" $NetBSD: cgdconfig.8,v 1.37 2018/05/09 14:27:41 kre Exp $
 .\"
 .\" Copyright (c) 2002, 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 September 11, 2016
+.Dd May 9, 2018
 .Dt CGDCONFIG 8
 .Os
 .Sh NAME
@@ -41,11 +41,11 @@
 .Op Ar paramsfile
 .Nm
 .Fl C
-.Op Fl nv
+.Op Fl npv
 .Op Fl f Ar configfile
 .Nm
 .Fl G
-.Op Fl nv
+.Op Fl npv
 .Op Fl i Ar ivmeth
 .Op Fl k Ar kgmeth
 .Op Fl o Ar outfile
@@ -60,7 +60,8 @@
 .Op Ar keylen
 .Nm
 .Fl l
-.Op Fl cgd
+.Op Fl v Ns Op Cm v
+.Op Ar cgd
 .Nm
 .Fl s
 .Op Fl nv
@@ -96,7 +97,7 @@ configuration file
 Generate a new paramsfile (to stdout) using the values from
 .Ar paramsfile
 which will generate the same key.
-This may need to prompt for multiple passphrases.
+This may need to obtain multiple passphrases.
 .It Fl g
 Generate a paramsfile (to stdout).
 .It Fl i Ar ivmeth
@@ -116,6 +117,9 @@ When generating a
 .Ar paramsfile ,
 store it in
 .Ar outfile .
+If
+.Fl o
+is not given, any paramsfile content is written to standard output.
 .It Fl p
 Read all passphrases from stdin rather than
 .Pa /dev/tty .
@@ -126,7 +130,7 @@ If this flag is specified then verificat
 in question to be unconfigured rather than prompting for the passphrase
 again.
 .It Fl s
-Read the key from stdin.
+Read the key (nb: not the passphrase) from stdin.
 .It Fl U
 Unconfigure all the devices listed in the cgd configuration file.
 .It Fl u
@@ -421,7 +425,7 @@ And use the entered passphrase to genera
 .Pp
 Although not required, the partition type
 .Ar cgd
-should be used in the disklabel for the cgd partition.
+should be used in the disklabel or GPT type field for the cgd partition.
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "cgdconfig: could not calibrate pkcs5_pbkdf2"
@@ -432,6 +436,8 @@ program's execution.
 .El
 .Sh SEE ALSO
 .Xr cgd 4
+.Xr disklabel 8
+.Xr gpt 8
 .Pp
 .Dq PKCS #5 v2.0: Password-Based Cryptography Standard ,
 RSA Laboratories, March 25, 1999.
@@ -443,6 +449,12 @@ utility appeared in
 .Sh BUGS
 Since
 .Nm
+without
+.Fl p
 uses
 .Xr getpass 3
-to read in the passphrase, it is limited to 128 characters.
+to read in the passphrase,
+it is limited to sysconf(_SC_PASS_MAX) (128) characters.
+With
+.Fl p
+the limit is 1023 characters.

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.44 src/sbin/cgdconfig/cgdconfig.c:1.45
--- src/sbin/cgdconfig/cgdconfig.c:1.44	Wed May  9 13:19:33 2018
+++ src/sbin/cgdconfig/cgdconfig.c	Wed May  9 14:27:41 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $");
 #endif
 
 #include 
@@ -136,17 +136,19 @@ static void
 usage(void)
 {
 
-	(void)fprintf(stderr, "usage: %s [-nv] [-V vmeth] cgd dev [paramsfile]\n",
+	(void)fprintf(stderr, "usage: %s [-npv] [-V vmeth] cgd dev "
+	"[paramsfile]\n", getprogname());
+	(void)fprintf(stderr, "   %s -C [-npv] [-f configfile]\n",
 	getprogname());
-	(void)fprintf(stderr, "   %s -C [-nv] [-f configfile]\n", getprogname());
-	(void)fprintf(stderr, "   %s -G [-nv] [-i ivmeth] [-k kgmeth] "
+	(void)fprintf(stderr, "   %s -G [-npv] [-i ivmeth] [-k kgmeth] "
 	"[-o outfile] paramsfile\n", getprogname());
 	(void)fprintf(stderr, "   %s -g [-nv] [-i ivmeth] [-k kgmeth] "
 	"[-o outfile] alg [keylen]\n", getprogname());
-	(void)fprintf(stderr, "   %s -l\n", getprogname());
+	(void)fprintf(stderr, "   %s -l [-v[v]] [cgd]\n", getprogname());
 	(void)fprintf(stderr, "   %s -s [-nv] [-i ivmeth] cgd dev alg "
 	"[keylen]\n", getprogname());
-	

CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 14:27:41 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.8 cgdconfig.c

Log Message:
Fix missing -p in usage message (noted by Christoph Badura, thanks),
and update -l usage as well.

While here fix man page synopses and a few other odds and ends.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sbin/cgdconfig/cgdconfig.8
cvs rdiff -u -r1.44 -r1.45 src/sbin/cgdconfig/cgdconfig.c

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



CVS commit: src/external/gpl3/gdb/lib/libgdb

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  9 13:53:13 UTC 2018

Modified Files:
src/external/gpl3/gdb/lib/libgdb: Makefile

Log Message:
clean generated file


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/lib/libgdb/Makefile

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  9 13:52:55 UTC 2018

Removed Files:
src/external/gpl3/gdb/dist/gdb: rust-exp.c

Log Message:
remove generated file


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gdb/dist/gdb/rust-exp.c

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



CVS commit: src/external/gpl3/gdb/dist/gdb

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  9 13:52:55 UTC 2018

Removed Files:
src/external/gpl3/gdb/dist/gdb: rust-exp.c

Log Message:
remove generated file


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 src/external/gpl3/gdb/dist/gdb/rust-exp.c

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



CVS commit: src/external/gpl3/gdb/lib/libgdb

2018-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  9 13:53:13 UTC 2018

Modified Files:
src/external/gpl3/gdb/lib/libgdb: Makefile

Log Message:
clean generated file


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/gdb/lib/libgdb/Makefile

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

Modified files:

Index: src/external/gpl3/gdb/lib/libgdb/Makefile
diff -u src/external/gpl3/gdb/lib/libgdb/Makefile:1.19 src/external/gpl3/gdb/lib/libgdb/Makefile:1.20
--- src/external/gpl3/gdb/lib/libgdb/Makefile:1.19	Wed Dec 13 16:52:55 2017
+++ src/external/gpl3/gdb/lib/libgdb/Makefile	Wed May  9 09:53:13 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.19 2017/12/13 21:52:55 joerg Exp $
+#	$NetBSD: Makefile,v 1.20 2018/05/09 13:53:13 christos Exp $
 
 NOCTF=
 HOSTPROG_CXX=   1
@@ -83,4 +83,5 @@ CLEANDIRFILES+= \
 	go-exp.c \
 	jv-exp.c \
 	m2-exp.c \
-	p-exp.c
+	p-exp.c \
+	rust-exp.c



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 13:19:33 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
Check arg count in configure() at entry, rather than later.
This avoids the stupid null deref I added a couple of commits
ago (on bad usage) and also simplifies the rest of the routine
which no longer needs to check the arg count nearly as much.

Thanks to Alexander Nasonov for finding the null deref bug.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sbin/cgdconfig/cgdconfig.c

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

Modified files:

Index: src/sbin/cgdconfig/cgdconfig.c
diff -u src/sbin/cgdconfig/cgdconfig.c:1.43 src/sbin/cgdconfig/cgdconfig.c:1.44
--- src/sbin/cgdconfig/cgdconfig.c:1.43	Sun May  6 20:55:42 2018
+++ src/sbin/cgdconfig/cgdconfig.c	Wed May  9 13:19:33 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.43 2018/05/06 20:55:42 kre Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.43 2018/05/06 20:55:42 kre Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $");
 #endif
 
 #include 
@@ -515,6 +515,15 @@ configure(int argc, char **argv, struct 
 	char		 devicename[PATH_MAX];
 	const char	*dev = NULL;	/* XXX: gcc */
 
+	if (argc < 2 || argc > 3) {
+		/* print usage and exit, only if called from main() */
+		if (flags == CONFIG_FLAGS_FROMMAIN) {
+			warnx("wrong number of args");
+			usage();
+		}
+		return -1;
+	}
+
 	if ((
 	  fd = opendisk1(*argv, O_RDWR, cgdname, sizeof(cgdname), 1, prog_open)
 	) != -1) {
@@ -529,12 +538,10 @@ configure(int argc, char **argv, struct 
 		prog_close(fd);
 	}
 
-	if (argc == 2 || argc == 3) {
-		dev = getfsspecname(devicename, sizeof(devicename), argv[1]);
-		if (dev == NULL) {
-			warnx("getfsspecname failed: %s", devicename);
-			return -1;
-		}
+	dev = getfsspecname(devicename, sizeof(devicename), argv[1]);
+	if (dev == NULL) {
+		warnx("getfsspecname failed: %s", devicename);
+		return -1;
 	}
 
 	if (argc == 2) {
@@ -543,16 +550,8 @@ configure(int argc, char **argv, struct 
 		/* make string writable for basename */
 		strlcpy(pfile, dev, sizeof(pfile));
 		p = params_cget(basename(pfile));
-	} else if (argc == 3) {
+	} else
 		p = params_cget(argv[2]);
-	} else {
-		/* print usage and exit, only if called from main() */
-		if (flags == CONFIG_FLAGS_FROMMAIN) {
-			warnx("wrong number of args");
-			usage();
-		}
-		return -1;
-	}
 
 	if (!p)
 		return -1;



CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Wed May  9 13:19:33 UTC 2018

Modified Files:
src/sbin/cgdconfig: cgdconfig.c

Log Message:
Check arg count in configure() at entry, rather than later.
This avoids the stupid null deref I added a couple of commits
ago (on bad usage) and also simplifies the rest of the routine
which no longer needs to check the arg count nearly as much.

Thanks to Alexander Nasonov for finding the null deref bug.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sbin/cgdconfig/cgdconfig.c

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



CVS commit: src/tools

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:21:27 UTC 2018

Modified Files:
src/tools: Makefile

Log Message:
For EXTERNAL_TOOLCHAIN, MKLLVM=yes needs to build only tablegen.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/tools/Makefile

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



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:19:27 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Always provide --sysroot arguments, even for EXTERNAL_TOOLCHAIN.


To generate a diff of this commit:
cvs rdiff -u -r1.1059 -r1.1060 src/share/mk/bsd.own.mk

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

Modified files:

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.1059 src/share/mk/bsd.own.mk:1.1060
--- src/share/mk/bsd.own.mk:1.1059	Fri May  4 20:25:04 2018
+++ src/share/mk/bsd.own.mk	Wed May  9 13:19:27 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1059 2018/05/04 20:25:04 nisimura Exp $
+#	$NetBSD: bsd.own.mk,v 1.1060 2018/05/09 13:19:27 joerg Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -322,6 +322,7 @@ TOOL_OBJC.clang=	${TOOLDIR}/bin/${MACHIN
 TOOL_CC.pcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcc
 TOOL_CPP.pcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-pcpp
 TOOL_CXX.pcc=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-p++
+.endif	# EXTERNAL_TOOLCHAIN		# }
 
 #
 # Make sure DESTDIR is set, so that builds with these tools always
@@ -346,7 +347,6 @@ CPPFLAGS+=	--sysroot=/
 LDFLAGS+=	--sysroot=/
 .  endif
 .endif
-.endif	# EXTERNAL_TOOLCHAIN		# }
 
 DBSYM=		${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
 ELF2AOUT=	${TOOLDIR}/bin/${_TOOL_PREFIX}m68k-elf2aout



CVS commit: src/tools

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:21:27 UTC 2018

Modified Files:
src/tools: Makefile

Log Message:
For EXTERNAL_TOOLCHAIN, MKLLVM=yes needs to build only tablegen.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/tools/Makefile

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

Modified files:

Index: src/tools/Makefile
diff -u src/tools/Makefile:1.193 src/tools/Makefile:1.194
--- src/tools/Makefile:1.193	Sun Feb 18 01:06:24 2018
+++ src/tools/Makefile	Wed May  9 13:21:27 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.193 2018/02/18 01:06:24 uwe Exp $
+#	$NetBSD: Makefile,v 1.194 2018/05/09 13:21:27 joerg Exp $
 
 .include 
 .include 
@@ -124,8 +124,11 @@ SUBDIR+= stat .WAIT config
 SUBDIR+= \
 	llvm .WAIT \
 	llvm-lib/libLLVMDemangle llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
-	llvm-tblgen llvm-clang-tblgen .WAIT \
-	llvm-include .WAIT \
+	llvm-tblgen llvm-clang-tblgen
+.endif
+.if ${MKLLVM} != "no" && !defined(EXTERNAL_TOOLCHAIN)
+SUBDIR+= \
+	.WAIT llvm-include .WAIT \
 	llvm-lib .WAIT \
 	llvm-clang
 . if ${MKLLD} != "no"



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:19:27 UTC 2018

Modified Files:
src/share/mk: bsd.own.mk

Log Message:
Always provide --sysroot arguments, even for EXTERNAL_TOOLCHAIN.


To generate a diff of this commit:
cvs rdiff -u -r1.1059 -r1.1060 src/share/mk/bsd.own.mk

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



CVS commit: src/share/mk

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:18:53 UTC 2018

Modified Files:
src/share/mk: bsd.gcc.mk

Log Message:
Drop checks for EXTERNAL_TOOLCHAIN for crt*.o. We've been using our own
versions for a long time and haven't relied on external files as such.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/share/mk/bsd.gcc.mk

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



CVS commit: src/tests/lib/libobjc

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:18:02 UTC 2018

Modified Files:
src/tests/lib/libobjc: Makefile

Log Message:
Handle the GCC restriction like the set list by explicitly checking for
HAVE_GCC. When using EXTERNAL_TOOLCHAIN with LLVM, it would still be
picked up otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libobjc/Makefile

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

Modified files:

Index: src/tests/lib/libobjc/Makefile
diff -u src/tests/lib/libobjc/Makefile:1.2 src/tests/lib/libobjc/Makefile:1.3
--- src/tests/lib/libobjc/Makefile:1.2	Fri May 20 13:03:45 2011
+++ src/tests/lib/libobjc/Makefile	Wed May  9 13:18:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.2 2011/05/20 13:03:45 joerg Exp $
+# $NetBSD: Makefile,v 1.3 2018/05/09 13:18:02 joerg Exp $
 
 TESTSDIR=	${TESTSBASE}/lib/libobjc
 
@@ -7,7 +7,7 @@ TESTSDIR=	${TESTSBASE}/lib/libobjc
 UNSUPPORTED_COMPILER.clang=	# defined
 UNSUPPORTED_COMPILER.pcc=	# defined
 
-.if !empty(AVAILABLE_COMPILER:Mgcc)
+.if ${HAVE_GCC:U0} > 0
 TESTS_C=	t_threads
 .endif
 



CVS commit: src/tests/lib/libobjc

2018-05-09 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed May  9 13:18:02 UTC 2018

Modified Files:
src/tests/lib/libobjc: Makefile

Log Message:
Handle the GCC restriction like the set list by explicitly checking for
HAVE_GCC. When using EXTERNAL_TOOLCHAIN with LLVM, it would still be
picked up otherwise.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libobjc/Makefile

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



CVS commit: src/tests/lib/libc/sys

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:45:03 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
don't print "long" with "%zu".


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_getrusage.c

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

Modified files:

Index: src/tests/lib/libc/sys/t_getrusage.c
diff -u src/tests/lib/libc/sys/t_getrusage.c:1.7 src/tests/lib/libc/sys/t_getrusage.c:1.8
--- src/tests/lib/libc/sys/t_getrusage.c:1.7	Wed May  9 06:32:52 2018
+++ src/tests/lib/libc/sys/t_getrusage.c	Wed May  9 08:45:03 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: t_getrusage.c,v 1.7 2018/05/09 06:32:52 martin Exp $ */
+/* $NetBSD: t_getrusage.c,v 1.8 2018/05/09 08:45:03 mrg Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_getrusage.c,v 1.7 2018/05/09 06:32:52 martin Exp $");
+__RCSID("$NetBSD: t_getrusage.c,v 1.8 2018/05/09 08:45:03 mrg Exp $");
 
 #include 
 #include 
@@ -154,7 +154,7 @@ ATF_TC_BODY(getrusage_maxrss, tc)
 
 	ATF_REQUIRE(getrusage(RUSAGE_SELF, ) == 0);
 	ATF_REQUIRE_MSG(maxrss < ru.ru_maxrss,
-	"maxrss: %zu, ru.ru_maxrss: %zu", maxrss, ru.ru_maxrss);
+	"maxrss: %ld, ru.ru_maxrss: %ld", maxrss, ru.ru_maxrss);
 }
 
 ATF_TC(getrusage_msgsnd);



CVS commit: src/tests/lib/libc/sys

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:45:03 UTC 2018

Modified Files:
src/tests/lib/libc/sys: t_getrusage.c

Log Message:
don't print "long" with "%zu".


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/tests/lib/libc/sys/t_getrusage.c

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



CVS commit: src/external/mit/xorg

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:39:55 UTC 2018

Modified Files:
src/external/mit/xorg/bin/fonttosfnt: Makefile
src/external/mit/xorg/bin/mkfontscale: Makefile
src/external/mit/xorg/bin/x11perf: Makefile
src/external/mit/xorg/bin/xclock: Makefile
src/external/mit/xorg/bin/xditview: Makefile
src/external/mit/xorg/bin/xdm: Makefile.xdm
src/external/mit/xorg/bin/xfd: Makefile
src/external/mit/xorg/bin/xlogo: Makefile
src/external/mit/xorg/bin/xterm: Makefile
src/external/mit/xorg/lib/fontconfig/src: Makefile.fcarch
src/external/mit/xorg/lib/libXdmGreet: Makefile
src/external/mit/xorg/lib/libXfont: Makefile
src/external/mit/xorg/lib/libXfont2: Makefile
src/external/mit/xorg/lib/libXft: Makefile

Log Message:
add freetype2/freetype to the include path.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fonttosfnt/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/bin/mkfontscale/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/x11perf/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xclock/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xditview/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/bin/xdm/Makefile.xdm
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xfd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xlogo/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/mit/xorg/bin/xterm/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/external/mit/xorg/lib/fontconfig/src/Makefile.fcarch
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libXdmGreet/Makefile
cvs rdiff -u -r1.10 -r1.11 src/external/mit/xorg/lib/libXfont/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libXfont2/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/lib/libXft/Makefile

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

Modified files:

Index: src/external/mit/xorg/bin/fonttosfnt/Makefile
diff -u src/external/mit/xorg/bin/fonttosfnt/Makefile:1.2 src/external/mit/xorg/bin/fonttosfnt/Makefile:1.3
--- src/external/mit/xorg/bin/fonttosfnt/Makefile:1.2	Thu Aug 11 23:15:35 2011
+++ src/external/mit/xorg/bin/fonttosfnt/Makefile	Wed May  9 08:39:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2011/08/11 23:15:35 joerg Exp $
+#	$NetBSD: Makefile,v 1.3 2018/05/09 08:39:55 mrg Exp $
 
 .include 
 
@@ -7,10 +7,10 @@ SRCS=	fonttosfnt.c read.c write.c struct
 
 # XXX XVENDORNAME and XVENDORNAMESHORT should live in a common location
 CPPFLAGS+=	-DXFREE86_FT2 -I${DESTDIR}${X11INCDIR}/freetype2 \
+		-I${DESTDIR}${X11INCDIR}/freetype2/freetype \
 		-DXVENDORNAMESHORT=${XVENDORNAMESHORT} \
 		-DXVENDORNAME=${XVENDORNAME}
-CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11/fonts \
-		-I${X11SRCDIR.xc}/extras/freetype2/include
+CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/X11/fonts
 
 
 LDADD+=	-lfreetype -lfontenc -lz -lm

Index: src/external/mit/xorg/bin/mkfontscale/Makefile
diff -u src/external/mit/xorg/bin/mkfontscale/Makefile:1.5 src/external/mit/xorg/bin/mkfontscale/Makefile:1.6
--- src/external/mit/xorg/bin/mkfontscale/Makefile:1.5	Mon Jul 20 23:50:23 2015
+++ src/external/mit/xorg/bin/mkfontscale/Makefile	Wed May  9 08:39:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.5 2015/07/20 23:50:23 mrg Exp $
+#	$NetBSD: Makefile,v 1.6 2018/05/09 08:39:55 mrg Exp $
 
 .include 
 
@@ -6,6 +6,7 @@ PROG=	mkfontscale
 SRCS=	mkfontscale.c list.c hash.c ident.c
 
 CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/freetype2
+CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/freetype2/freetype
 
 LDADD+=	-lfontenc -lfreetype -lz -lbz2
 DPADD+=	${LIBFONTENC} ${LIBFREETYPE} ${LIBZ} ${LIBBZ2}

Index: src/external/mit/xorg/bin/x11perf/Makefile
diff -u src/external/mit/xorg/bin/x11perf/Makefile:1.3 src/external/mit/xorg/bin/x11perf/Makefile:1.4
--- src/external/mit/xorg/bin/x11perf/Makefile:1.3	Sun Nov 20 21:02:23 2011
+++ src/external/mit/xorg/bin/x11perf/Makefile	Wed May  9 08:39:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/11/20 21:02:23 dholland Exp $
+#	$NetBSD: Makefile,v 1.4 2018/05/09 08:39:55 mrg Exp $
 
 .include 
 
@@ -9,6 +9,7 @@ SRCS=	x11perf.c bitmaps.c do_tests.c do_
 
 CPPFLAGS+=	-DMITSHM -DXRENDER
 CPPFLAGS+=	-DXFT -DXFREE86_FT2 -I${DESTDIR}${X11INCDIR}/freetype2
+CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/freetype2/freetype
 
 MAN=	Xmark.1 x11perf.1 x11perfcomp.1
 

Index: src/external/mit/xorg/bin/xclock/Makefile
diff -u src/external/mit/xorg/bin/xclock/Makefile:1.3 src/external/mit/xorg/bin/xclock/Makefile:1.4
--- src/external/mit/xorg/bin/xclock/Makefile:1.3	Fri May 31 06:24:05 2013
+++ src/external/mit/xorg/bin/xclock/Makefile	Wed May  9 08:39:55 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2013/05/31 06:24:05 mrg Exp $
+#	$NetBSD: Makefile,v 1.4 2018/05/09 08:39:55 mrg Exp $
 
 .include 
 
@@ -6,6 +6,7 @@ PROG=	xclock
 SRCS=	xclock.c Clock.c
 
 CPPFLAGS+=-DXRENDER 

CVS commit: src/external/mit/xorg

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:39:55 UTC 2018

Modified Files:
src/external/mit/xorg/bin/fonttosfnt: Makefile
src/external/mit/xorg/bin/mkfontscale: Makefile
src/external/mit/xorg/bin/x11perf: Makefile
src/external/mit/xorg/bin/xclock: Makefile
src/external/mit/xorg/bin/xditview: Makefile
src/external/mit/xorg/bin/xdm: Makefile.xdm
src/external/mit/xorg/bin/xfd: Makefile
src/external/mit/xorg/bin/xlogo: Makefile
src/external/mit/xorg/bin/xterm: Makefile
src/external/mit/xorg/lib/fontconfig/src: Makefile.fcarch
src/external/mit/xorg/lib/libXdmGreet: Makefile
src/external/mit/xorg/lib/libXfont: Makefile
src/external/mit/xorg/lib/libXfont2: Makefile
src/external/mit/xorg/lib/libXft: Makefile

Log Message:
add freetype2/freetype to the include path.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/fonttosfnt/Makefile
cvs rdiff -u -r1.5 -r1.6 src/external/mit/xorg/bin/mkfontscale/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/x11perf/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xclock/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xditview/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/bin/xdm/Makefile.xdm
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xfd/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/bin/xlogo/Makefile
cvs rdiff -u -r1.16 -r1.17 src/external/mit/xorg/bin/xterm/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/external/mit/xorg/lib/fontconfig/src/Makefile.fcarch
cvs rdiff -u -r1.4 -r1.5 src/external/mit/xorg/lib/libXdmGreet/Makefile
cvs rdiff -u -r1.10 -r1.11 src/external/mit/xorg/lib/libXfont/Makefile
cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libXfont2/Makefile
cvs rdiff -u -r1.8 -r1.9 src/external/mit/xorg/lib/libXft/Makefile

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



Re: CVS commit: src/sbin/cgdconfig

2018-05-09 Thread Robert Elz
Date:Wed, 9 May 2018 08:59:55 +0100
From:Alexander Nasonov 
Message-ID:  <20180509075955.GA7743@neva>

  | Adding (argc > 0) check before calling opendisk1 fixes the crash.

Thanks - and I see what is wrong now, but (for whatever reason) that did
not fail for me, I guess Xen DomU allows *0 to work (though it is strange that
it would allow the opendisk(() to succeed.

Never mind, that is clearly broken, thanks.   I will fix it, but not quite 
that way I think.

kre



CVS commit: src/share/man/man4

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May  9 08:22:53 UTC 2018

Modified Files:
src/share/man/man4: Makefile

Log Message:
Add ixv.4.


To generate a diff of this commit:
cvs rdiff -u -r1.651 -r1.652 src/share/man/man4/Makefile

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

2018-05-09 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed May  9 08:22:53 UTC 2018

Modified Files:
src/share/man/man4: Makefile

Log Message:
Add ixv.4.


To generate a diff of this commit:
cvs rdiff -u -r1.651 -r1.652 src/share/man/man4/Makefile

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/Makefile
diff -u src/share/man/man4/Makefile:1.651 src/share/man/man4/Makefile:1.652
--- src/share/man/man4/Makefile:1.651	Wed Jan 24 09:04:42 2018
+++ src/share/man/man4/Makefile	Wed May  9 08:22:53 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.651 2018/01/24 09:04:42 skrll Exp $
+#	$NetBSD: Makefile,v 1.652 2018/05/09 08:22:53 msaitoh Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/18/93
 
 MAN=	aac.4 ac97.4 acardide.4 aceride.4 acphy.4 \
@@ -34,7 +34,7 @@ MAN=	aac.4 ac97.4 acardide.4 aceride.4 a
 	inet.4 ikphy.4 inphy.4 intersil7170.4 intro.4 \
 	ioasic.4 ioat.4 iop.4 iophy.4 iopsp.4 ip.4 ipkdb.4 ipmi.4 ipw.4 \
 	irmce.4 isp.4 ismt.4 isv.4 itesio.4 iteide.4 iwi.4 iwm.4 iwn.4 ixg.4 \
-	ixpide.4 \
+	ixpide.4 ixv.4 \
 	jme.4 jmide.4 joy.4 \
 	kloader.4 kse.4 ksyms.4 kttcp.4 \
 	l2tp.4 lc.4 ld.4 lii.4 lo.4 lua.4 lxtphy.4 \



CVS commit: src/external/mit/xorg/lib/fontconfig/src

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:15:09 UTC 2018

Modified Files:
src/external/mit/xorg/lib/fontconfig/src: Makefile

Log Message:
add more include paths for freetype 2.9.1.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/mit/xorg/lib/fontconfig/src/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/fontconfig/src/Makefile
diff -u src/external/mit/xorg/lib/fontconfig/src/Makefile:1.20 src/external/mit/xorg/lib/fontconfig/src/Makefile:1.21
--- src/external/mit/xorg/lib/fontconfig/src/Makefile:1.20	Tue Aug 29 09:02:10 2017
+++ src/external/mit/xorg/lib/fontconfig/src/Makefile	Wed May  9 08:15:09 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2017/08/29 09:02:10 mrg Exp $
+#	$NetBSD: Makefile,v 1.21 2018/05/09 08:15:09 mrg Exp $
 
 .include 
 
@@ -116,6 +116,7 @@ CPPFLAGS+=	${X11FLAGS.THREADLIB}
 CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/freetype2 \
 		-I${X11SRCDIR.freetype}/src \
 		-I${X11SRCDIR.freetype}/include \
+		-I${X11SRCDIR.freetype}/include/freetype \
 		-I${X11SRCDIR.${LIB}}/../include \
 		-I. \
 		-I${X11SRCDIR.${LIB}}



CVS commit: src/external/mit/xorg/lib/fontconfig/src

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:15:09 UTC 2018

Modified Files:
src/external/mit/xorg/lib/fontconfig/src: Makefile

Log Message:
add more include paths for freetype 2.9.1.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/external/mit/xorg/lib/fontconfig/src/Makefile

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



CVS commit: src/external/mit/xorg

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:13:23 UTC 2018

Modified Files:
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/tools/fc-cache: Makefile
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
add some missing -I paths for new freetype.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/mit/xorg/tools/fc-cache/Makefile
cvs rdiff -u -r1.11 -r1.12 src/external/mit/xorg/tools/mkfontscale/Makefile

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



CVS commit: src/external/mit/xorg

2018-05-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed May  9 08:13:23 UTC 2018

Modified Files:
src/external/mit/xorg/lib/freetype: Makefile
src/external/mit/xorg/tools/fc-cache: Makefile
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
add some missing -I paths for new freetype.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/external/mit/xorg/lib/freetype/Makefile
cvs rdiff -u -r1.14 -r1.15 src/external/mit/xorg/tools/fc-cache/Makefile
cvs rdiff -u -r1.11 -r1.12 src/external/mit/xorg/tools/mkfontscale/Makefile

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

Modified files:

Index: src/external/mit/xorg/lib/freetype/Makefile
diff -u src/external/mit/xorg/lib/freetype/Makefile:1.18 src/external/mit/xorg/lib/freetype/Makefile:1.19
--- src/external/mit/xorg/lib/freetype/Makefile:1.18	Wed May  9 07:28:44 2018
+++ src/external/mit/xorg/lib/freetype/Makefile	Wed May  9 08:13:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2018/05/09 07:28:44 maya Exp $
+#	$NetBSD: Makefile,v 1.19 2018/05/09 08:13:23 mrg Exp $
 
 .include 
 
@@ -89,6 +89,7 @@ CPPFLAGS+=	-DFT_CONFIG_OPTION_SYSTEM_ZLI
 		-DFT2_BUILD_LIBRARY \
 		-DFT_CONFIG_MODULES_H=""
 CPPFLAGS+=	-I${DESTDIR}${X11INCDIR}/freetype2 \
+		-I${DESTDIR}${X11INCDIR}/freetype2/freetype \
 		-I${DESTDIR}${X11INCDIR}/freetype2/freetype/config \
 		-I${X11SRCDIR.${LIB}}/include
 

Index: src/external/mit/xorg/tools/fc-cache/Makefile
diff -u src/external/mit/xorg/tools/fc-cache/Makefile:1.14 src/external/mit/xorg/tools/fc-cache/Makefile:1.15
--- src/external/mit/xorg/tools/fc-cache/Makefile:1.14	Wed May  9 07:28:45 2018
+++ src/external/mit/xorg/tools/fc-cache/Makefile	Wed May  9 08:13:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2018/05/09 07:28:45 maya Exp $
+#	$NetBSD: Makefile,v 1.15 2018/05/09 08:13:23 mrg Exp $
 
 .include 
 
@@ -111,7 +111,8 @@ HOST_CPPFLAGS=	-DFONTCONFIG_PATH='"${DES
 		-DFLEXIBLE_ARRAY_MEMBER="/**/"
 HOST_CPPFLAGS+=	-DFT_CONFIG_OPTION_DISABLE_BZIP2
 HOST_CPPFLAGS+=	-I${FONTCONFIG} -I${FREETYPE} \
-		-I${FREETYPE}/include -I${EXPAT}/lib \
+		-I${FREETYPE}/include -I${FREETYPE}/include/freetype \
+		-I${EXPAT}/lib \
 		-I${FONTCONFIG}/../include \
 		-I${DESTDIR}${X11INCDIR} -I.
 

Index: src/external/mit/xorg/tools/mkfontscale/Makefile
diff -u src/external/mit/xorg/tools/mkfontscale/Makefile:1.11 src/external/mit/xorg/tools/mkfontscale/Makefile:1.12
--- src/external/mit/xorg/tools/mkfontscale/Makefile:1.11	Wed May  9 07:28:45 2018
+++ src/external/mit/xorg/tools/mkfontscale/Makefile	Wed May  9 08:13:23 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.11 2018/05/09 07:28:45 maya Exp $
+#	$NetBSD: Makefile,v 1.12 2018/05/09 08:13:23 mrg Exp $
 
 .include 
 
@@ -89,7 +89,8 @@ HOST_CPPFLAGS+=	-DFT_CONFIG_OPTION_DISAB
 # fontconfig atomic ops.
 HOST_CPPFLAGS+=	-DFC_NO_MT=1
 
-HOST_CPPFLAGS+=	-I${FREETYPE}/include -I${DESTDIR}${X11INCDIR} \
+HOST_CPPFLAGS+=	-I${FREETYPE}/include -I${FREETYPE}/include/freetype \
+		-I${DESTDIR}${X11INCDIR} \
 		-I${DESTDIR}${X11INCDIR}/freetype2
 
 .include 



CVS commit: xsrc/external/mit/freetype/dist

2018-05-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed May  9 08:08:55 UTC 2018

Modified Files:
xsrc/external/mit/freetype/dist: CMakeLists.txt ChangeLog ChangeLog.20
ChangeLog.21 ChangeLog.22 ChangeLog.23 ChangeLog.24 Jamfile
Jamrules Makefile README README.git autogen.sh configure
modules.cfg vms_make.com
xsrc/external/mit/freetype/dist/builds: detect.mk exports.mk
freetype.mk link_dos.mk link_std.mk modules.mk toplevel.mk
xsrc/external/mit/freetype/dist/builds/amiga: README makefile
makefile.os4 smakefile
xsrc/external/mit/freetype/dist/builds/amiga/include/config: ftconfig.h
ftmodule.h
xsrc/external/mit/freetype/dist/builds/amiga/src/base: ftdebug.c
ftsystem.c
xsrc/external/mit/freetype/dist/builds/ansi: ansi-def.mk ansi.mk
xsrc/external/mit/freetype/dist/builds/atari: ATARI.H README.TXT
xsrc/external/mit/freetype/dist/builds/beos: beos-def.mk beos.mk
detect.mk
xsrc/external/mit/freetype/dist/builds/cmake: iOS.cmake
xsrc/external/mit/freetype/dist/builds/compiler: ansi-cc.mk bcc-dev.mk
bcc.mk emx.mk gcc-dev.mk gcc.mk intelc.mk unix-lcc.mk visualage.mk
visualc.mk watcom.mk win-lcc.mk
xsrc/external/mit/freetype/dist/builds/dos: detect.mk dos-def.mk
dos-emx.mk dos-gcc.mk dos-wat.mk
xsrc/external/mit/freetype/dist/builds/mac: FreeType.m68k_cfm.make.txt
FreeType.m68k_far.make.txt FreeType.ppc_carbon.make.txt
FreeType.ppc_classic.make.txt ftmac.c
xsrc/external/mit/freetype/dist/builds/os2: detect.mk os2-def.mk
os2-dev.mk os2-gcc.mk
xsrc/external/mit/freetype/dist/builds/symbian: bld.inf freetype.mmp
xsrc/external/mit/freetype/dist/builds/unix: aclocal.m4 config.guess
config.sub configure configure.ac configure.raw detect.mk
freetype-config.in freetype2.in freetype2.m4 ft-munmap.m4
ftconfig.in ftsystem.c install.mk pkg.m4 unix-cc.in unix-def.in
unix-dev.mk unix-lcc.mk unix.mk unixddef.mk
xsrc/external/mit/freetype/dist/builds/vms: ftconfig.h ftsystem.c
xsrc/external/mit/freetype/dist/builds/wince: ftdebug.c
xsrc/external/mit/freetype/dist/builds/wince/vc2005-ce: freetype.sln
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/wince/vc2008-ce: freetype.sln
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/windows: detect.mk ftdebug.c
w32-bcc.mk w32-bccd.mk w32-dev.mk w32-gcc.mk w32-icc.mk w32-intl.mk
w32-lcc.mk w32-mingw32.mk w32-vcc.mk w32-wat.mk win32-def.mk
xsrc/external/mit/freetype/dist/builds/windows/vc2005: freetype.vcproj
index.html
xsrc/external/mit/freetype/dist/builds/windows/vc2008: freetype.vcproj
index.html
xsrc/external/mit/freetype/dist/builds/windows/vc2010: freetype.sln
freetype.vcxproj freetype.vcxproj.filters index.html
xsrc/external/mit/freetype/dist/builds/windows/visualc: freetype.dsp
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/windows/visualce: freetype.dsp
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/devel: ft2build.h ftoption.h
xsrc/external/mit/freetype/dist/docs: CHANGES CUSTOMIZE DEBUG FTL.TXT
INSTALL INSTALL.ANY INSTALL.CROSS INSTALL.GNU INSTALL.MAC
INSTALL.UNIX INSTALL.VMS LICENSE.TXT MAKEPP TODO formats.txt
freetype-config.1 raster.txt release
xsrc/external/mit/freetype/dist/docs/reference: ft2-auto_hinter.html
ft2-base_interface.html ft2-basic_types.html ft2-bdf_fonts.html
ft2-bitmap_handling.html ft2-bzip2.html ft2-cache_subsystem.html
ft2-cff_driver.html ft2-cid_fonts.html ft2-computations.html
ft2-font_formats.html ft2-gasp_table.html ft2-glyph_management.html
ft2-glyph_stroker.html ft2-glyph_variants.html
ft2-gx_validation.html ft2-gzip.html ft2-header_file_macros.html
ft2-header_inclusion.html ft2-incremental.html ft2-index.html
ft2-lcd_filtering.html ft2-list_processing.html ft2-lzw.html
ft2-mac_specific.html ft2-module_management.html
ft2-multiple_masters.html ft2-ot_validation.html
ft2-outline_processing.html ft2-pfr_fonts.html
ft2-quick_advance.html ft2-raster.html ft2-sfnt_names.html
ft2-sizes_management.html ft2-system_interface.html ft2-toc.html
ft2-truetype_engine.html ft2-truetype_tables.html
ft2-tt_driver.html ft2-type1_tables.html ft2-user_allocation.html
ft2-version.html ft2-winfnt_fonts.html
xsrc/external/mit/freetype/dist/include: ft2build.h
xsrc/external/mit/freetype/dist/include/freetype: freetype.h 

CVS commit: xsrc/external/mit/freetype/dist

2018-05-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed May  9 08:08:55 UTC 2018

Modified Files:
xsrc/external/mit/freetype/dist: CMakeLists.txt ChangeLog ChangeLog.20
ChangeLog.21 ChangeLog.22 ChangeLog.23 ChangeLog.24 Jamfile
Jamrules Makefile README README.git autogen.sh configure
modules.cfg vms_make.com
xsrc/external/mit/freetype/dist/builds: detect.mk exports.mk
freetype.mk link_dos.mk link_std.mk modules.mk toplevel.mk
xsrc/external/mit/freetype/dist/builds/amiga: README makefile
makefile.os4 smakefile
xsrc/external/mit/freetype/dist/builds/amiga/include/config: ftconfig.h
ftmodule.h
xsrc/external/mit/freetype/dist/builds/amiga/src/base: ftdebug.c
ftsystem.c
xsrc/external/mit/freetype/dist/builds/ansi: ansi-def.mk ansi.mk
xsrc/external/mit/freetype/dist/builds/atari: ATARI.H README.TXT
xsrc/external/mit/freetype/dist/builds/beos: beos-def.mk beos.mk
detect.mk
xsrc/external/mit/freetype/dist/builds/cmake: iOS.cmake
xsrc/external/mit/freetype/dist/builds/compiler: ansi-cc.mk bcc-dev.mk
bcc.mk emx.mk gcc-dev.mk gcc.mk intelc.mk unix-lcc.mk visualage.mk
visualc.mk watcom.mk win-lcc.mk
xsrc/external/mit/freetype/dist/builds/dos: detect.mk dos-def.mk
dos-emx.mk dos-gcc.mk dos-wat.mk
xsrc/external/mit/freetype/dist/builds/mac: FreeType.m68k_cfm.make.txt
FreeType.m68k_far.make.txt FreeType.ppc_carbon.make.txt
FreeType.ppc_classic.make.txt ftmac.c
xsrc/external/mit/freetype/dist/builds/os2: detect.mk os2-def.mk
os2-dev.mk os2-gcc.mk
xsrc/external/mit/freetype/dist/builds/symbian: bld.inf freetype.mmp
xsrc/external/mit/freetype/dist/builds/unix: aclocal.m4 config.guess
config.sub configure configure.ac configure.raw detect.mk
freetype-config.in freetype2.in freetype2.m4 ft-munmap.m4
ftconfig.in ftsystem.c install.mk pkg.m4 unix-cc.in unix-def.in
unix-dev.mk unix-lcc.mk unix.mk unixddef.mk
xsrc/external/mit/freetype/dist/builds/vms: ftconfig.h ftsystem.c
xsrc/external/mit/freetype/dist/builds/wince: ftdebug.c
xsrc/external/mit/freetype/dist/builds/wince/vc2005-ce: freetype.sln
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/wince/vc2008-ce: freetype.sln
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/windows: detect.mk ftdebug.c
w32-bcc.mk w32-bccd.mk w32-dev.mk w32-gcc.mk w32-icc.mk w32-intl.mk
w32-lcc.mk w32-mingw32.mk w32-vcc.mk w32-wat.mk win32-def.mk
xsrc/external/mit/freetype/dist/builds/windows/vc2005: freetype.vcproj
index.html
xsrc/external/mit/freetype/dist/builds/windows/vc2008: freetype.vcproj
index.html
xsrc/external/mit/freetype/dist/builds/windows/vc2010: freetype.sln
freetype.vcxproj freetype.vcxproj.filters index.html
xsrc/external/mit/freetype/dist/builds/windows/visualc: freetype.dsp
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/builds/windows/visualce: freetype.dsp
freetype.vcproj index.html
xsrc/external/mit/freetype/dist/devel: ft2build.h ftoption.h
xsrc/external/mit/freetype/dist/docs: CHANGES CUSTOMIZE DEBUG FTL.TXT
INSTALL INSTALL.ANY INSTALL.CROSS INSTALL.GNU INSTALL.MAC
INSTALL.UNIX INSTALL.VMS LICENSE.TXT MAKEPP TODO formats.txt
freetype-config.1 raster.txt release
xsrc/external/mit/freetype/dist/docs/reference: ft2-auto_hinter.html
ft2-base_interface.html ft2-basic_types.html ft2-bdf_fonts.html
ft2-bitmap_handling.html ft2-bzip2.html ft2-cache_subsystem.html
ft2-cff_driver.html ft2-cid_fonts.html ft2-computations.html
ft2-font_formats.html ft2-gasp_table.html ft2-glyph_management.html
ft2-glyph_stroker.html ft2-glyph_variants.html
ft2-gx_validation.html ft2-gzip.html ft2-header_file_macros.html
ft2-header_inclusion.html ft2-incremental.html ft2-index.html
ft2-lcd_filtering.html ft2-list_processing.html ft2-lzw.html
ft2-mac_specific.html ft2-module_management.html
ft2-multiple_masters.html ft2-ot_validation.html
ft2-outline_processing.html ft2-pfr_fonts.html
ft2-quick_advance.html ft2-raster.html ft2-sfnt_names.html
ft2-sizes_management.html ft2-system_interface.html ft2-toc.html
ft2-truetype_engine.html ft2-truetype_tables.html
ft2-tt_driver.html ft2-type1_tables.html ft2-user_allocation.html
ft2-version.html ft2-winfnt_fonts.html
xsrc/external/mit/freetype/dist/include: ft2build.h
xsrc/external/mit/freetype/dist/include/freetype: freetype.h 

  1   2   >