CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 05:14:42 UTC 2019

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

Log Message:
void -Wsign-compare issue and add a stupid cast.

revert this if m_pkthdr.len becomes unsigned.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/usb/if_axe.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.111 src/sys/dev/usb/if_axe.c:1.112
--- src/sys/dev/usb/if_axe.c:1.111	Sun Aug 11 02:37:03 2019
+++ src/sys/dev/usb/if_axe.c	Sun Aug 11 05:14:41 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.111 2019/08/11 02:37:03 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.112 2019/08/11 05:14:41 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.111 2019/08/11 02:37:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.112 2019/08/11 05:14:41 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1192,7 +1192,7 @@ axe_tx_prepare(struct usbnet *un, struct
 			length, m->m_pkthdr.len, sizeof(hdr), 0);
 	}
 
-	if (m->m_pkthdr.len > un->un_tx_bufsz - hdr_len - tlr_len)
+	if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - hdr_len - tlr_len)
 		return 0;
 	length = hdr_len + m->m_pkthdr.len + tlr_len;
 



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 05:14:42 UTC 2019

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

Log Message:
void -Wsign-compare issue and add a stupid cast.

revert this if m_pkthdr.len becomes unsigned.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/dev/usb/if_axe.c

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



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 02:37:04 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
copy a pattern from if_udav.c, which already had "too much" check.

even though overflow or underflow is really unlikely here, reorder
various expressions to reduce the likelyhood even further.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/if_ure.c

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



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 02:37:04 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
copy a pattern from if_udav.c, which already had "too much" check.

even though overflow or underflow is really unlikely here, reorder
various expressions to reduce the likelyhood even further.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.62 -r1.63 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.110 src/sys/dev/usb/if_axe.c:1.111
--- src/sys/dev/usb/if_axe.c:1.110	Sun Aug 11 01:04:33 2019
+++ src/sys/dev/usb/if_axe.c	Sun Aug 11 02:37:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.110 2019/08/11 01:04:33 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.111 2019/08/11 02:37:03 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.110 2019/08/11 01:04:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.111 2019/08/11 02:37:03 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1192,9 +1192,9 @@ axe_tx_prepare(struct usbnet *un, struct
 			length, m->m_pkthdr.len, sizeof(hdr), 0);
 	}
 
-	length = hdr_len + m->m_pkthdr.len + tlr_len;
-	if (length > un->un_tx_bufsz)
+	if (m->m_pkthdr.len > un->un_tx_bufsz - hdr_len - tlr_len)
 		return 0;
+	length = hdr_len + m->m_pkthdr.len + tlr_len;
 
 	if (hdr_len)
 		memcpy(c->unc_buf, , hdr_len);

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.60 src/sys/dev/usb/if_axen.c:1.61
--- src/sys/dev/usb/if_axen.c:1.60	Sun Aug 11 01:04:33 2019
+++ src/sys/dev/usb/if_axen.c	Sun Aug 11 02:37:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.60 2019/08/11 01:04:33 mrg Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.61 2019/08/11 02:37:03 mrg Exp $	*/
 /*	$OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.60 2019/08/11 01:04:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.61 2019/08/11 02:37:03 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -863,9 +863,9 @@ axen_tx_prepare(struct usbnet *un, struc
 
 	usbnet_isowned_tx(un);
 
-	length = m->m_pkthdr.len + sizeof(hdr);
-	if (length > un->un_tx_bufsz)
+	if (m->m_pkthdr.len > un->un_tx_bufsz - sizeof(hdr))
 		return 0;
+	length = m->m_pkthdr.len + sizeof(hdr);
 
 	/* XXX Is this needed?  wMaxPacketSize? */
 	switch (un->un_udev->ud_speed) {

Index: src/sys/dev/usb/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.62 src/sys/dev/usb/if_cdce.c:1.63
--- src/sys/dev/usb/if_cdce.c:1.62	Sun Aug 11 01:04:33 2019
+++ src/sys/dev/usb/if_cdce.c	Sun Aug 11 02:37:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.62 2019/08/11 01:04:33 mrg Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.63 2019/08/11 02:37:03 mrg Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul 
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.62 2019/08/11 01:04:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cdce.c,v 1.63 2019/08/11 02:37:03 mrg Exp $");
 
 #include 
 #include 
@@ -305,9 +305,9 @@ cdce_tx_prepare(struct usbnet *un, struc
 	if (un->un_flags & CDCE_ZAURUS)
 		extra = sizeof(crc);
 
-	length = m->m_pkthdr.len + extra;
-	if (length > un->un_tx_bufsz)
+	if (m->m_pkthdr.len > un->un_tx_bufsz - extra)
 		return 0;
+	length = m->m_pkthdr.len + extra;
 
 	m_copydata(m, 0, m->m_pkthdr.len, c->unc_buf);
 	if (un->un_flags & CDCE_ZAURUS) {

Index: src/sys/dev/usb/if_ure.c
diff -u src/sys/dev/usb/if_ure.c:1.22 src/sys/dev/usb/if_ure.c:1.23
--- src/sys/dev/usb/if_ure.c:1.22	Sun Aug 11 01:04:33 2019
+++ src/sys/dev/usb/if_ure.c	Sun Aug 11 02:37:04 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ure.c,v 1.22 2019/08/11 01:04:33 mrg Exp $	*/
+/*	$NetBSD: if_ure.c,v 1.23 2019/08/11 02:37:04 mrg Exp $	*/
 /*	$OpenBSD: if_ure.c,v 1.10 2018/11/02 21:32:30 jcs Exp $	*/
 
 /*-
@@ -30,7 +30,7 @@
 /* RealTek RTL8152/RTL8153 10/100/Gigabit USB Ethernet device */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.22 2019/08/11 01:04:33 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.23 2019/08/11 02:37:04 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1066,7 +1066,7 @@ ure_tx_prepare(struct usbnet *un, struct
 
 	usbnet_isowned_tx(un);
 
-	if (m->m_pkthdr.len + sizeof(txhdr) > un->un_tx_bufsz)
+	if (m->m_pkthdr.len > un->un_tx_bufsz - sizeof(txhdr))
 		return 0;
 
 	/* header */



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:31:19 UTC 2019

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

Log Message:
- use usbnet_isowned*() more
- more const


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/usbnet.c

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

Modified files:

Index: src/sys/dev/usb/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.11 src/sys/dev/usb/usbnet.c:1.12
--- src/sys/dev/usb/usbnet.c:1.11	Sat Aug 10 02:17:36 2019
+++ src/sys/dev/usb/usbnet.c	Sun Aug 11 01:31:19 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.11 2019/08/10 02:17:36 mrg Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.12 2019/08/11 01:31:19 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.11 2019/08/10 02:17:36 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.12 2019/08/11 01:31:19 mrg Exp $");
 
 #include 
 #include 
@@ -242,7 +242,7 @@ usbnet_enqueue(struct usbnet * const un,
 	struct ifnet * const ifp = usbnet_ifp(un);
 	struct mbuf *m;
 
-	KASSERT(mutex_owned(>un_pri->unp_rxlock));
+	usbnet_isowned_rx(un);
 
 	m = usbnet_newbuf();
 	if (m == NULL) {
@@ -268,7 +268,7 @@ usbnet_input(struct usbnet * const un, u
 	struct ifnet * const ifp = usbnet_ifp(un);
 	struct mbuf *m;
 
-	KASSERT(mutex_owned(>un_pri->unp_rxlock));
+	usbnet_isowned_rx(un);
 
 	m = usbnet_newbuf();
 	if (m == NULL) {
@@ -324,7 +324,7 @@ usbnet_rxeof(struct usbd_xfer *xfer, voi
 	}
 
 	uno_rx_loop(un, xfer, c, total_len);
-	KASSERT(mutex_owned(>unp_rxlock));
+	usbnet_isowned_rx(un);
 
 done:
 	if (unp->unp_dying || unp->unp_stopping)
@@ -427,7 +427,7 @@ usbnet_start_locked(struct ifnet *ifp)
 	unsigned length;
 	int idx;
 
-	KASSERT(mutex_owned(>unp_txlock));
+	usbnet_isowned_tx(un);
 	KASSERT(cd->uncd_tx_cnt <= un->un_tx_list_cnt);
 
 	if (!unp->unp_link || (ifp->if_flags & IFF_RUNNING) == 0)
@@ -503,13 +503,13 @@ usbnet_start(struct ifnet *ifp)
 /* Start of common RX functions */
 
 static size_t
-usbnet_rx_list_size(struct usbnet_cdata *cd, struct usbnet *un)
+usbnet_rx_list_size(struct usbnet_cdata * const cd, struct usbnet * const un)
 {
 	return sizeof(*cd->uncd_rx_chain) * un->un_rx_list_cnt;
 }
 
 static void
-usbnet_rx_list_alloc(struct usbnet *un)
+usbnet_rx_list_alloc(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -517,7 +517,7 @@ usbnet_rx_list_alloc(struct usbnet *un)
 }
 
 static void
-usbnet_rx_list_free(struct usbnet *un)
+usbnet_rx_list_free(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -528,7 +528,7 @@ usbnet_rx_list_free(struct usbnet *un)
 }
 
 static int
-usbnet_rx_list_init(struct usbnet *un)
+usbnet_rx_list_init(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 	struct usbnet_private * const unp = un->un_pri;
@@ -551,7 +551,7 @@ usbnet_rx_list_init(struct usbnet *un)
 }
 
 static void
-usbnet_rx_list_fini(struct usbnet *un)
+usbnet_rx_list_fini(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -569,7 +569,7 @@ usbnet_rx_list_fini(struct usbnet *un)
 /* End of common RX functions */
 
 static void
-usbnet_rx_start_pipes(struct usbnet *un, usbd_callback cb)
+usbnet_rx_start_pipes(struct usbnet * const un, usbd_callback cb)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 	struct usbnet_private * const unp = un->un_pri;
@@ -593,13 +593,13 @@ usbnet_rx_start_pipes(struct usbnet *un,
 /* Start of common TX functions */
 
 static size_t
-usbnet_tx_list_size(struct usbnet_cdata *cd, struct usbnet *un)
+usbnet_tx_list_size(struct usbnet_cdata * const cd, struct usbnet * const un)
 {
 	return sizeof(*cd->uncd_tx_chain) * un->un_tx_list_cnt;
 }
 
 static void
-usbnet_tx_list_alloc(struct usbnet *un)
+usbnet_tx_list_alloc(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -607,7 +607,7 @@ usbnet_tx_list_alloc(struct usbnet *un)
 }
 
 static void
-usbnet_tx_list_free(struct usbnet *un)
+usbnet_tx_list_free(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -618,7 +618,7 @@ usbnet_tx_list_free(struct usbnet *un)
 }
 
 static int
-usbnet_tx_list_init(struct usbnet *un)
+usbnet_tx_list_init(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 	struct usbnet_private * const unp = un->un_pri;
@@ -641,7 +641,7 @@ usbnet_tx_list_init(struct usbnet *un)
 }
 
 static void
-usbnet_tx_list_fini(struct usbnet *un)
+usbnet_tx_list_fini(struct usbnet * const un)
 {
 	struct usbnet_cdata * const cd = un_cdata(un);
 
@@ -661,7 +661,7 @@ usbnet_tx_list_fini(struct usbnet *un)
 /* Endpoint pipe management. */
 
 static void
-usbnet_ep_close_pipes(struct usbnet *un)
+usbnet_ep_close_pipes(struct usbnet * const un)
 {
 	struct usbnet_private * const unp = un->un_pri;
 
@@ -677,7 +677,7 @@ usbnet_ep_close_pipes(struct usbnet 

CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:31:19 UTC 2019

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

Log Message:
- use usbnet_isowned*() more
- more const


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/usb/usbnet.c

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



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:29:45 UTC 2019

Modified Files:
src/sys/dev/usb: usbnet.h

Log Message:
adjust some comments to reality.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/usbnet.h

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

Modified files:

Index: src/sys/dev/usb/usbnet.h
diff -u src/sys/dev/usb/usbnet.h:1.9 src/sys/dev/usb/usbnet.h:1.10
--- src/sys/dev/usb/usbnet.h:1.9	Sat Aug 10 02:17:36 2019
+++ src/sys/dev/usb/usbnet.h	Sun Aug 11 01:29:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.h,v 1.9 2019/08/10 02:17:36 mrg Exp $	*/
+/*	$NetBSD: usbnet.h,v 1.10 2019/08/11 01:29:45 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -100,10 +100,11 @@
 #include 
 
 /*
- * Per-transfer data, initialised in usbnet_[rt]x_list_init().
+ * Per-transfer data.
  *
- * Front-end must set uncd_tx_list_cnt and uncd_rx_list_cnt before calling
- * list init, which will allocate the chain arrays, and must be NULL to
+ * Front-end must set un_rx_list_cnt and un_tx_list_cnt before
+ * calling usbnet_attach(), and then call usbnet_rx_tx_init()
+ * which will allocate the chain arrays, and must be NULL to
  * indicate the first call.
  */
 struct usbnet;
@@ -276,7 +277,7 @@ usbnet_isowned_tx(struct usbnet *un)
 /*
  * Endpoint / rx/tx chain management:
  *
- * usbnet_attach() allocates rx and tx chains
+ * usbnet_attach() initialises usbnet and allocates rx and tx chains
  * usbnet_init_rx_tx() open pipes, initialises the rx/tx chains for use
  * usbnet_stop() stops pipes, cleans (not frees) rx/tx chains, locked
  *   version assumes un_lock is held



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:29:45 UTC 2019

Modified Files:
src/sys/dev/usb: usbnet.h

Log Message:
adjust some comments to reality.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/usbnet.h

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



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:04:33 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
in tx_prepare callback make sure to reject any mbuf that is larger
than can fit in the buffer.  done at the driver and not usbnet
layer because the driver knows how much beyond the mbuf data needs
to be sent (headers and trailers.)

axen(4) had a KASSERT() for this condition, but there's no
invariant here we can check so it's best as an error return.

XXX: only tested on these drivers, needs to be copied to udav, smsc
and urndis after testing as well as the not commited conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/if_ure.c

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



CVS commit: src/sys/dev/usb

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Aug 11 01:04:33 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_cdce.c if_ure.c

Log Message:
in tx_prepare callback make sure to reject any mbuf that is larger
than can fit in the buffer.  done at the driver and not usbnet
layer because the driver knows how much beyond the mbuf data needs
to be sent (headers and trailers.)

axen(4) had a KASSERT() for this condition, but there's no
invariant here we can check so it's best as an error return.

XXX: only tested on these drivers, needs to be copied to udav, smsc
and urndis after testing as well as the not commited conversions.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.59 -r1.60 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.61 -r1.62 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.21 -r1.22 src/sys/dev/usb/if_ure.c

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

Modified files:

Index: src/sys/dev/usb/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.109 src/sys/dev/usb/if_axe.c:1.110
--- src/sys/dev/usb/if_axe.c:1.109	Sat Aug 10 02:17:36 2019
+++ src/sys/dev/usb/if_axe.c	Sun Aug 11 01:04:33 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.109 2019/08/10 02:17:36 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.110 2019/08/11 01:04:33 mrg Exp $	*/
 /*	$OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */
 
 /*
@@ -87,7 +87,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.109 2019/08/10 02:17:36 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.110 2019/08/11 01:04:33 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -261,16 +261,16 @@ void	axe_attach(device_t, device_t, void
 CFATTACH_DECL_NEW(axe, sizeof(struct axe_softc),
 	axe_match, axe_attach, usbnet_detach, usbnet_activate);
 
-static void	axe_stop_cb(struct ifnet *, int);
-static int	axe_ioctl_cb(struct ifnet *, u_long, void *);
+static void	axe_stop(struct ifnet *, int);
+static int	axe_ioctl(struct ifnet *, u_long, void *);
 static int	axe_init(struct ifnet *);
 static usbd_status axe_mii_read_reg(struct usbnet *, int, int, uint16_t *);
 static usbd_status axe_mii_write_reg(struct usbnet *, int, int, uint16_t);
-static void	axe_mii_statchg_cb(struct ifnet *);
-static void	axe_rx_loop_cb(struct usbnet *, struct usbd_xfer *,
-			   struct usbnet_chain *, uint32_t);
-static unsigned axe_tx_prepare_cb(struct usbnet *, struct mbuf *,
-  struct usbnet_chain *);
+static void	axe_mii_statchg(struct ifnet *);
+static void	axe_rx_loop(struct usbnet *, struct usbd_xfer *,
+			struct usbnet_chain *, uint32_t);
+static unsigned axe_tx_prepare(struct usbnet *, struct mbuf *,
+			   struct usbnet_chain *);
 
 static void	axe_ax88178_init(struct axe_softc *);
 static void	axe_ax88772_init(struct axe_softc *);
@@ -278,13 +278,13 @@ static void	axe_ax88772a_init(struct axe
 static void	axe_ax88772b_init(struct axe_softc *);
 
 static struct usbnet_ops axe_ops = {
-	.uno_stop = axe_stop_cb,
-	.uno_ioctl = axe_ioctl_cb,
+	.uno_stop = axe_stop,
+	.uno_ioctl = axe_ioctl,
 	.uno_read_reg = axe_mii_read_reg,
 	.uno_write_reg = axe_mii_write_reg,
-	.uno_statchg = axe_mii_statchg_cb,
-	.uno_tx_prepare = axe_tx_prepare_cb,
-	.uno_rx_loop = axe_rx_loop_cb,
+	.uno_statchg = axe_mii_statchg,
+	.uno_tx_prepare = axe_tx_prepare,
+	.uno_rx_loop = axe_rx_loop,
 	.uno_init = axe_init,
 };
 
@@ -372,7 +372,7 @@ axe_mii_write_reg(struct usbnet *un, int
 }
 
 static void
-axe_mii_statchg_cb(struct ifnet *ifp)
+axe_mii_statchg(struct ifnet *ifp)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
 
@@ -1016,8 +1016,8 @@ axe_attach(device_t parent, device_t sel
 }
 
 static void
-axe_rx_loop_cb(struct usbnet * un, struct usbd_xfer *xfer,
-	   struct usbnet_chain *c, uint32_t total_len)
+axe_rx_loop(struct usbnet * un, struct usbd_xfer *xfer,
+	struct usbnet_chain *c, uint32_t total_len)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
 	struct axe_softc * const sc = usbnet_softc(un);
@@ -1161,45 +1161,46 @@ axe_rx_loop_cb(struct usbnet * un, struc
 }
 
 static unsigned
-axe_tx_prepare_cb(struct usbnet *un, struct mbuf *m, struct usbnet_chain *c)
+axe_tx_prepare(struct usbnet *un, struct mbuf *m, struct usbnet_chain *c)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
+	struct axe_sframe_hdr hdr, tlr;
+	size_t hdr_len = 0, tlr_len = 0;
 	int length, boundary;
 
 	usbnet_isowned_tx(un);
 
-	/*
-	 * Copy the mbuf data into a contiguous buffer, leaving two
-	 * bytes at the beginning to hold the frame length.
-	 */
 	if (AXE_IS_178_FAMILY(un)) {
-		struct axe_sframe_hdr hdr;
-
+		/*
+		 * Copy the mbuf data into a contiguous buffer, leaving two
+		 * bytes at the beginning to hold the frame length.
+		 */
 		boundary = (un->un_udev->ud_speed == USB_SPEED_HIGH) ? 512 : 64;
 
 		hdr.len = htole16(m->m_pkthdr.len);
 		hdr.ilen = ~hdr.len;
+		hdr_len = sizeof(hdr);
 
-		memcpy(c->unc_buf, , sizeof(hdr));
-		length = sizeof(hdr);
-
-	

CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 23:47:13 UTC 2019

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

Log Message:
Fix typo in pragma in sys/event.h

Reenable -Wconversion-null.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/event.h

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

Modified files:

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.36 src/sys/sys/event.h:1.37
--- src/sys/sys/event.h:1.36	Sat Aug 10 20:33:01 2019
+++ src/sys/sys/event.h	Sat Aug 10 23:47:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.36 2019/08/10 20:33:01 kamil Exp $	*/
+/*	$NetBSD: event.h,v 1.37 2019/08/10 23:47:13 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon 
@@ -91,7 +91,7 @@ _EV_SET_INTEGER_TYPE(unsigned int)
 _EV_SET_INTEGER_TYPE(unsigned long int)
 _EV_SET_INTEGER_TYPE(unsigned long long int)
 
-#pragma GCC diagnistic pop
+#pragma GCC diagnostic pop
 #else
 static __inline void
 _EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,



CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 23:47:13 UTC 2019

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

Log Message:
Fix typo in pragma in sys/event.h

Reenable -Wconversion-null.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/event.h

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



CVS commit: src/share/man/man9

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 23:33:10 UTC 2019

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

Log Message:
oops. i must have deleted the 'u' in 'ustore.9' when partially
fixing the alphabeta ordering here.  fixes build.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/share/man/man9/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/man9/Makefile
diff -u src/share/man/man9/Makefile:1.438 src/share/man/man9/Makefile:1.439
--- src/share/man/man9/Makefile:1.438	Sat Aug 10 20:35:35 2019
+++ src/share/man/man9/Makefile	Sat Aug 10 23:33:10 2019
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.438 2019/08/10 20:35:35 mrg Exp $
+#   $NetBSD: Makefile,v 1.439 2019/08/10 23:33:10 mrg Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -53,14 +53,13 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	SET.9 setbit.9 setjmp.9 shutdownhook_establish.9 \
 	signal.9 skpc.9 sockopt.9 softintr.9 spl.9 specificdata.9 \
 	spi.9 splraiseipl.9 \
-	store.9 \
 	suspendsched.9 \
 	sysctl.9 sysmon_envsys.9 sysmon_pswitch.9 sysmon_taskq.9 tc.9 \
 	tcp_congctl.9 threadpool.9 timecounter.9 time_second.9 todr.9 \
 	ts2timo.9 tvtohz.9 \
 	ubc.9 ucas.9 ucom.9 ufetch.9 uiomove.9 \
 	usbd_status.9 usbdi.9 usbnet.9 \
-	userret.9 \
+	userret.9 ustore.9 \
 	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 \
 	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
 	video.9 vme.9 vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vmem.9  \



CVS commit: src/share/man/man9

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 23:33:10 UTC 2019

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

Log Message:
oops. i must have deleted the 'u' in 'ustore.9' when partially
fixing the alphabeta ordering here.  fixes build.


To generate a diff of this commit:
cvs rdiff -u -r1.438 -r1.439 src/share/man/man9/Makefile

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



CVS commit: src/usr.sbin/npf/npfctl

2019-08-10 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Aug 10 22:23:55 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf_show.c

Log Message:
npfctl show/validate: fix couple bugs in multiple table/port representation.
Fixes PR/54122.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/npf/npfctl/npf_show.c

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

Modified files:

Index: src/usr.sbin/npf/npfctl/npf_show.c
diff -u src/usr.sbin/npf/npfctl/npf_show.c:1.28 src/usr.sbin/npf/npfctl/npf_show.c:1.29
--- src/usr.sbin/npf/npfctl/npf_show.c:1.28	Tue Jul 23 00:52:02 2019
+++ src/usr.sbin/npf/npfctl/npf_show.c	Sat Aug 10 22:23:55 2019
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2013 The NetBSD Foundation, Inc.
+ * Copyright (c) 2013-2019 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -34,7 +34,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: npf_show.c,v 1.28 2019/07/23 00:52:02 rmind Exp $");
+__RCSID("$NetBSD: npf_show.c,v 1.29 2019/08/10 22:23:55 rmind Exp $");
 
 #include 
 #define	__FAVOR_BSD
@@ -220,21 +220,29 @@ print_tcpflags(npf_conf_info_t *ctx __un
 }
 
 static char *
-print_portrange(npf_conf_info_t *ctx, const uint32_t *words)
+print_pbarrier(npf_conf_info_t *ctx, const uint32_t *words __unused)
+{
+	if (ctx->curmark == BM_SRC_PORTS && (ctx->flags & SEEN_SRC) == 0) {
+		ctx->flags |= SEEN_SRC;
+		return estrdup("from any");
+	}
+	if (ctx->curmark == BM_DST_PORTS && (ctx->flags & SEEN_DST) == 0) {
+		ctx->flags |= SEEN_DST;
+		return estrdup("to any");
+	}
+	return NULL;
+}
+
+static char *
+print_portrange(npf_conf_info_t *ctx __unused, const uint32_t *words)
 {
 	u_int fport = words[0], tport = words[1];
-	const char *any_str = "";
 	char *p;
 
-	if (ctx->curmark == BM_SRC_PORTS && (ctx->flags & SEEN_SRC) == 0)
-		any_str = "from any ";
-	if (ctx->curmark == BM_DST_PORTS && (ctx->flags & SEEN_DST) == 0)
-		any_str = "to any ";
-
 	if (fport != tport) {
-		easprintf(, "%sport %u:%u", any_str, fport, tport);
+		easprintf(, "%u-%u", fport, tport);
 	} else {
-		easprintf(, "%sport %u", any_str, fport);
+		easprintf(, "%u", fport);
 	}
 	return p;
 }
@@ -283,12 +291,14 @@ static const struct mark_keyword_mapent 
 	{ BM_ICMP_CODE,	"code %s",	NULL, 0,	print_number,	1 },
 
 	{ BM_SRC_CIDR,	"from %s",	", ", SEEN_SRC,	print_address,	6 },
-	{ BM_SRC_TABLE,	"from %s",	NULL, SEEN_SRC,	print_table,	1 },
-	{ BM_SRC_PORTS,	"%s",		", ", 0,	print_portrange,2 },
+	{ BM_SRC_TABLE,	"from %s",	", ", SEEN_SRC,	print_table,	1 },
+	{ BM_SRC_PORTS,	"%s",		NULL, 0,	print_pbarrier,	2 },
+	{ BM_SRC_PORTS,	"port %s",	", ", 0,	print_portrange,2 },
 
 	{ BM_DST_CIDR,	"to %s",	", ", SEEN_DST,	print_address,	6 },
-	{ BM_DST_TABLE,	"to %s",	NULL, SEEN_DST,	print_table,	1 },
-	{ BM_DST_PORTS,	"%s",		", ", 0,	print_portrange,2 },
+	{ BM_DST_TABLE,	"to %s",	", ", SEEN_DST,	print_table,	1 },
+	{ BM_DST_PORTS,	"%s",		NULL, 0,	print_pbarrier,	2 },
+	{ BM_DST_PORTS,	"port %s",	", ", 0,	print_portrange,2 },
 };
 
 static const char * __attribute__((format_arg(2)))
@@ -314,13 +324,17 @@ scan_marks(npf_conf_info_t *ctx, const s
 			errx(EXIT_FAILURE, "byte-code marking inconsistency");
 		}
 		if (m == mk->mark) {
+			char *val;
+
 			/* Set the current mark and the flags. */
 			ctx->flags |= mk->set_flags;
 			ctx->curmark = m;
 
 			/* Value is processed by the print function. */
 			assert(mk->fwords == nwords);
-			vals[nvals++] = mk->printfn(ctx, marks);
+			if ((val = mk->printfn(ctx, marks)) != NULL) {
+vals[nvals++] = val;
+			}
 		}
 		marks += nwords;
 		mlen -= nwords;



CVS commit: src/usr.sbin/npf/npfctl

2019-08-10 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Aug 10 22:23:55 UTC 2019

Modified Files:
src/usr.sbin/npf/npfctl: npf_show.c

Log Message:
npfctl show/validate: fix couple bugs in multiple table/port representation.
Fixes PR/54122.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.sbin/npf/npfctl/npf_show.c

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



Re: CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
On 10.08.2019 22:37, m...@netbsd.org wrote:
> On Sat, Aug 10, 2019 at 08:33:01PM +, Kamil Rytarowski wrote:
>> Module Name: src
>> Committed By:kamil
>> Date:Sat Aug 10 20:33:01 UTC 2019
>>
>> Modified Files:
>>  src/sys/sys: event.h
>>
>> Log Message:
>> Use common macro for _EV_SET() for integer types
>>
>> Deduplicate code.
>>
>> No functional change change intended.
> 
> this looks much worse.


I actually like it now more.

> can we go back to the drawing board on this one and discuss the original
> problem?
> 

C++ and cast rules.

> thanks.
> 
> 




signature.asc
Description: OpenPGP digital signature


CVS commit: src/sys

2019-08-10 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Sat Aug 10 21:13:54 UTC 2019

Modified Files:
src/sys/net: if.h
src/sys/net/npf: npf_os.c
src/sys/sys: param.h

Log Message:
Add the ifnet_t::if_npf_private field.  Bump the kernel version.
Fixes PR/54098.


To generate a diff of this commit:
cvs rdiff -u -r1.274 -r1.275 src/sys/net/if.h
cvs rdiff -u -r1.12 -r1.13 src/sys/net/npf/npf_os.c
cvs rdiff -u -r1.605 -r1.606 src/sys/sys/param.h

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

Modified files:

Index: src/sys/net/if.h
diff -u src/sys/net/if.h:1.274 src/sys/net/if.h:1.275
--- src/sys/net/if.h:1.274	Thu Jul  4 02:44:25 2019
+++ src/sys/net/if.h	Sat Aug 10 21:13:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.h,v 1.274 2019/07/04 02:44:25 ozaki-r Exp $	*/
+/*	$NetBSD: if.h,v 1.275 2019/08/10 21:13:54 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -340,6 +340,7 @@ typedef struct ifnet {
 	struct mowner	*if_mowner;	/* ?: who owns mbufs for this interface */
 
 	void		*if_agrprivate;	/* ?: used only when #if NAGR > 0 */
+	void		*if_npf_private;/* ?: associated NPF context */
 
 	/*
 	 * pf specific data, used only when #if NPF > 0.

Index: src/sys/net/npf/npf_os.c
diff -u src/sys/net/npf/npf_os.c:1.12 src/sys/net/npf/npf_os.c:1.13
--- src/sys/net/npf/npf_os.c:1.12	Tue Jul 23 00:52:01 2019
+++ src/sys/net/npf/npf_os.c	Sat Aug 10 21:13:54 2019
@@ -33,7 +33,7 @@
 
 #ifdef _KERNEL
 #include 
-__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.12 2019/07/23 00:52:01 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: npf_os.c,v 1.13 2019/08/10 21:13:54 rmind Exp $");
 
 #ifdef _KERNEL_OPT
 #include "pf.h"
@@ -313,7 +313,7 @@ npf_ifop_flush(void *arg)
 	KERNEL_LOCK(1, NULL);
 	IFNET_GLOBAL_LOCK();
 	IFNET_WRITER_FOREACH(ifp) {
-		ifp->if_pf_kif = arg;
+		ifp->if_npf_private = arg;
 	}
 	IFNET_GLOBAL_UNLOCK();
 	KERNEL_UNLOCK_ONE(NULL);
@@ -322,13 +322,13 @@ npf_ifop_flush(void *arg)
 static void *
 npf_ifop_getmeta(const ifnet_t *ifp)
 {
-	return ifp->if_pf_kif;
+	return ifp->if_npf_private;
 }
 
 static void
 npf_ifop_setmeta(ifnet_t *ifp, void *arg)
 {
-	ifp->if_pf_kif = arg;
+	ifp->if_npf_private = arg;
 }
 
 #ifdef _KERNEL

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.605 src/sys/sys/param.h:1.606
--- src/sys/sys/param.h:1.605	Sat Aug 10 02:17:36 2019
+++ src/sys/sys/param.h	Sat Aug 10 21:13:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.605 2019/08/10 02:17:36 mrg Exp $	*/
+/*	$NetBSD: param.h,v 1.606 2019/08/10 21:13:54 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -67,7 +67,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	999000600	/* NetBSD 9.99.6 */
+#define	__NetBSD_Version__	999000700	/* NetBSD 9.99.7 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) <= __NetBSD_Version__)



Re: CVS commit: src/sys/sys

2019-08-10 Thread maya
On Sat, Aug 10, 2019 at 08:33:01PM +, Kamil Rytarowski wrote:
> Module Name:  src
> Committed By: kamil
> Date: Sat Aug 10 20:33:01 UTC 2019
> 
> Modified Files:
>   src/sys/sys: event.h
> 
> Log Message:
> Use common macro for _EV_SET() for integer types
> 
> Deduplicate code.
> 
> No functional change change intended.

this looks much worse.
can we go back to the drawing board on this one and discuss the original
problem?

thanks.




CVS commit: src

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 20:35:36 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: usbnet.9

Log Message:
usbnet may be stable now.  document it.


To generate a diff of this commit:
cvs rdiff -u -r1.2278 -r1.2279 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.437 -r1.438 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/usbnet.9

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



CVS commit: src

2019-08-10 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Aug 10 20:35:36 UTC 2019

Modified Files:
src/distrib/sets/lists/comp: mi
src/share/man/man9: Makefile
Added Files:
src/share/man/man9: usbnet.9

Log Message:
usbnet may be stable now.  document it.


To generate a diff of this commit:
cvs rdiff -u -r1.2278 -r1.2279 src/distrib/sets/lists/comp/mi
cvs rdiff -u -r1.437 -r1.438 src/share/man/man9/Makefile
cvs rdiff -u -r0 -r1.1 src/share/man/man9/usbnet.9

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

Modified files:

Index: src/distrib/sets/lists/comp/mi
diff -u src/distrib/sets/lists/comp/mi:1.2278 src/distrib/sets/lists/comp/mi:1.2279
--- src/distrib/sets/lists/comp/mi:1.2278	Wed Jul 24 14:07:16 2019
+++ src/distrib/sets/lists/comp/mi	Sat Aug 10 20:35:35 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: mi,v 1.2278 2019/07/24 14:07:16 joerg Exp $
+#	$NetBSD: mi,v 1.2279 2019/08/10 20:35:35 mrg Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.compcomp-sys-root
@@ -11952,6 +11952,7 @@
 ./usr/share/man/cat9/uprintf.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/usbd_status.0		comp-sys-catman		.cat
 ./usr/share/man/cat9/usbdi.0			comp-sys-catman		.cat
+./usr/share/man/cat9/usbnet.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/useracc.0			comp-obsolete		obsolete
 ./usr/share/man/cat9/userret.0			comp-sys-catman		.cat
 ./usr/share/man/cat9/ustore.0			comp-sys-catman		.cat
@@ -19839,6 +19840,7 @@
 ./usr/share/man/html9/uprintf.html		comp-sys-htmlman	html
 ./usr/share/man/html9/usbd_status.html		comp-sys-htmlman	html
 ./usr/share/man/html9/usbdi.html		comp-sys-htmlman	html
+./usr/share/man/html9/usbnet.html		comp-sys-htmlman	html
 ./usr/share/man/html9/userret.html		comp-sys-htmlman	html
 ./usr/share/man/html9/ustore.html		comp-sys-htmlman	html
 ./usr/share/man/html9/ustore_16.html		comp-sys-htmlman	html
@@ -27933,6 +27935,7 @@
 ./usr/share/man/man9/uprintf.9			comp-sys-man		.man
 ./usr/share/man/man9/usbd_status.9		comp-sys-man		.man
 ./usr/share/man/man9/usbdi.9			comp-sys-man		.man
+./usr/share/man/man9/usbnet.9			comp-sys-man		.man
 ./usr/share/man/man9/useracc.9			comp-obsolete		obsolete
 ./usr/share/man/man9/userret.9			comp-sys-man		.man
 ./usr/share/man/man9/ustore.9			comp-sys-man		.man

Index: src/share/man/man9/Makefile
diff -u src/share/man/man9/Makefile:1.437 src/share/man/man9/Makefile:1.438
--- src/share/man/man9/Makefile:1.437	Wed May  8 14:25:39 2019
+++ src/share/man/man9/Makefile	Sat Aug 10 20:35:35 2019
@@ -1,4 +1,4 @@
-#   $NetBSD: Makefile,v 1.437 2019/05/08 14:25:39 isaki Exp $
+#   $NetBSD: Makefile,v 1.438 2019/08/10 20:35:35 mrg Exp $
 
 #	Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -53,17 +53,18 @@ MAN=	accept_filter.9 accf_data.9 accf_ht
 	SET.9 setbit.9 setjmp.9 shutdownhook_establish.9 \
 	signal.9 skpc.9 sockopt.9 softintr.9 spl.9 specificdata.9 \
 	spi.9 splraiseipl.9 \
+	store.9 \
 	suspendsched.9 \
 	sysctl.9 sysmon_envsys.9 sysmon_pswitch.9 sysmon_taskq.9 tc.9 \
 	tcp_congctl.9 threadpool.9 timecounter.9 time_second.9 todr.9 \
 	ts2timo.9 tvtohz.9 \
-	ucas.9 uiomove.9 ucom.9 userret.9 \
+	ubc.9 ucas.9 ucom.9 ufetch.9 uiomove.9 \
+	usbd_status.9 usbdi.9 usbnet.9 \
+	userret.9 \
+	uvm.9 uvm_hotplug.9 uvm_km.9 uvm_map.9 \
 	vattr.9 veriexec.9 vcons.9 vfs.9 vfs_hooks.9 vfsops.9 vfssubr.9 \
-	video.9 vme.9 \
-	vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 \
-	ubc.9 ufetch.9 usbd_status.9 usbdi.9 ustore.9 uvm.9 uvm_hotplug.9 \
-	uvm_km.9 uvm_map.9 \
-	vmem.9 wapbl.9 wdc.9 workqueue.9 \
+	video.9 vme.9 vnfileops.9 vnode.9 vnodeops.9 vnsubr.9 vmem.9  \
+	wapbl.9 wdc.9 workqueue.9 \
 	wsbell.9 wscons.9 wsdisplay.9 wsfont.9 wskbd.9 wsmouse.9 \
 	xcall.9
 

Added files:

Index: src/share/man/man9/usbnet.9
diff -u /dev/null src/share/man/man9/usbnet.9:1.1
--- /dev/null	Sat Aug 10 20:35:36 2019
+++ src/share/man/man9/usbnet.9	Sat Aug 10 20:35:35 2019
@@ -0,0 +1,663 @@
+.\"	$NetBSD: usbnet.9,v 1.1 2019/08/10 20:35:35 mrg Exp $
+.\"
+.\" Copyright (c) 2019 Matthew R. Green
+.\" 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.
+.\" 3. The name of the author may not be used to endorse or promote products
+.\"derived from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 

CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 20:33:01 UTC 2019

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

Log Message:
Use common macro for _EV_SET() for integer types

Deduplicate code.

No functional change change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/event.h

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

Modified files:

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.35 src/sys/sys/event.h:1.36
--- src/sys/sys/event.h:1.35	Sat Aug 10 15:02:03 2019
+++ src/sys/sys/event.h	Sat Aug 10 20:33:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.35 2019/08/10 15:02:03 kamil Exp $	*/
+/*	$NetBSD: event.h,v 1.36 2019/08/10 20:33:01 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon 
@@ -75,54 +75,21 @@ _EV_SET(struct kevent *_kevp, uintptr_t 
 	_kevp->udata = reinterpret_cast(_udata);
 }
 
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data, int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
-}
-
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data, long int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
+#define _EV_SET_INTEGER_TYPE(_UTYPE)	\
+static __inline void			\
+_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,	\
+uint32_t _flags, uint32_t _fflags, int64_t _data, _UTYPE _udata)	\
+{	\
+	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,		\
+	reinterpret_cast(static_cast(_udata)));	\
 }
 
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data, long long int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
-}
-
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data, unsigned int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
-}
-
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data, unsigned long int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
-}
-
-static __inline void
-_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
-uint32_t _flags, uint32_t _fflags, int64_t _data,
-unsigned long long int _udata)
-{
-	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
-	reinterpret_cast(static_cast(_udata)));
-}
+_EV_SET_INTEGER_TYPE(int)
+_EV_SET_INTEGER_TYPE(long int)
+_EV_SET_INTEGER_TYPE(long long int)
+_EV_SET_INTEGER_TYPE(unsigned int)
+_EV_SET_INTEGER_TYPE(unsigned long int)
+_EV_SET_INTEGER_TYPE(unsigned long long int)
 
 #pragma GCC diagnistic pop
 #else



CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 20:33:01 UTC 2019

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

Log Message:
Use common macro for _EV_SET() for integer types

Deduplicate code.

No functional change change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/event.h

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

2019-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 10 17:03:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: a9tmr_var.h a9wdt.c files.cortex
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/cortex: a9ptmr.c a9ptmr_var.h
src/sys/arch/arm/fdt: a9ptmr_fdt.c a9wdt_fdt.c

Log Message:
Add a driver for the A5/A9 Private timer.

While here FDTise the Watchdog driver.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/cortex/a9ptmr.c \
src/sys/arch/arm/cortex/a9ptmr_var.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/a9tmr_var.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/cortex/a9wdt.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/a9ptmr_fdt.c \
src/sys/arch/arm/fdt/a9wdt_fdt.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/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/arch/arm/cortex/a9tmr_var.h
diff -u src/sys/arch/arm/cortex/a9tmr_var.h:1.6 src/sys/arch/arm/cortex/a9tmr_var.h:1.7
--- src/sys/arch/arm/cortex/a9tmr_var.h:1.6	Wed Jun 20 05:01:39 2018
+++ src/sys/arch/arm/cortex/a9tmr_var.h	Sat Aug 10 17:03:59 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: a9tmr_var.h,v 1.6 2018/06/20 05:01:39 hkenken Exp $ */
+/* $NetBSD: a9tmr_var.h,v 1.7 2019/08/10 17:03:59 skrll Exp $ */
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -54,6 +54,9 @@ void	a9tmr_cpu_initclocks(void);
 int	a9tmr_intr(void *);
 void	a9tmr_update_freq(uint32_t);
 void	a9tmr_delay(unsigned int n);
+
+int	a9ptmr_intr(void *);
+void	a9ptmr_delay(unsigned int n);
 #endif
 
 #endif /* _ARM_CORTEX_A9TMR_VAR_ */

Index: src/sys/arch/arm/cortex/a9wdt.c
diff -u src/sys/arch/arm/cortex/a9wdt.c:1.9 src/sys/arch/arm/cortex/a9wdt.c:1.10
--- src/sys/arch/arm/cortex/a9wdt.c:1.9	Sat Aug 10 16:50:23 2019
+++ src/sys/arch/arm/cortex/a9wdt.c	Sat Aug 10 17:03:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: a9wdt.c,v 1.9 2019/08/10 16:50:23 skrll Exp $	*/
+/*	$NetBSD: a9wdt.c,v 1.10 2019/08/10 17:03:59 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.9 2019/08/10 16:50:23 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: a9wdt.c,v 1.10 2019/08/10 17:03:59 skrll Exp $");
 
 #include 
 #include 
@@ -67,7 +67,7 @@ struct a9wdt_softc {
 #define	A9WDT_PERIOD_DEFAULT	12
 #endif
 
-CFATTACH_DECL_NEW(a9wdt, sizeof(struct a9wdt_softc),
+CFATTACH_DECL_NEW(arma9wdt, sizeof(struct a9wdt_softc),
 a9wdt_match, a9wdt_attach, NULL, NULL);
 
 static bool attached;
@@ -192,7 +192,7 @@ a9wdt_attach(device_t parent, device_t s
 	sc->sc_memt = mpcaa->mpcaa_memt;
 
 	bus_space_subregion(sc->sc_memt, mpcaa->mpcaa_memh,
-	TMR_WDOG_BASE, TMR_WDOG_SIZE, >sc_wdog_memh);
+	mpcaa->mpcaa_off1, TMR_WDOG_SIZE, >sc_wdog_memh);
 
 	/*
 	 * This runs at the ARM PERIPHCLOCK which should be 1/2 of the

Index: src/sys/arch/arm/cortex/files.cortex
diff -u src/sys/arch/arm/cortex/files.cortex:1.11 src/sys/arch/arm/cortex/files.cortex:1.12
--- src/sys/arch/arm/cortex/files.cortex:1.11	Mon Nov 12 12:56:05 2018
+++ src/sys/arch/arm/cortex/files.cortex	Sat Aug 10 17:03:59 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.cortex,v 1.11 2018/11/12 12:56:05 jmcneill Exp $
+# $NetBSD: files.cortex,v 1.12 2019/08/10 17:03:59 skrll Exp $
 
 defflag opt_cpu_in_cksum.h			NEON_IN_CKSUM
 
@@ -37,7 +37,12 @@ device	arma9tmr
 attach	arma9tmr at mpcorebus
 file	arch/arm/cortex/a9tmr.c			arma9tmr
 
+# A9 MPcore Private Timer
+device	arma9ptmr
+attach	arma9ptmr at mpcorebus
+file	arch/arm/cortex/a9ptmr.c		arma9ptmr
+
 # A9 MPcore Watchdog Timer
-device	a9wdt: sysmon_wdog
-attach	a9wdt at mpcorebus
-file	arch/arm/cortex/a9wdt.c			a9wdt
+device	arma9wdt: sysmon_wdog
+attach	arma9wdt at mpcorebus
+file	arch/arm/cortex/a9wdt.c			arma9wdt

Index: src/sys/arch/arm/fdt/files.fdt
diff -u src/sys/arch/arm/fdt/files.fdt:1.28 src/sys/arch/arm/fdt/files.fdt:1.29
--- src/sys/arch/arm/fdt/files.fdt:1.28	Wed Dec  5 21:43:33 2018
+++ src/sys/arch/arm/fdt/files.fdt	Sat Aug 10 17:03:59 2019
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.28 2018/12/05 21:43:33 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.29 2019/08/10 17:03:59 skrll Exp $
 
 include	"dev/pckbport/files.pckbport"
 
@@ -17,6 +17,14 @@ device	a9tmr: mpcorebus
 attach	a9tmr at fdt with a9tmr_fdt
 file	arch/arm/fdt/a9tmr_fdt.c		a9tmr_fdt
 
+device	a9ptmr: mpcorebus
+attach	a9ptmr at fdt with a9ptmr_fdt
+file	arch/arm/fdt/a9ptmr_fdt.c		a9ptmr_fdt
+
+device	a9wdt: mpcorebus
+attach	a9wdt at fdt with a9wdt_fdt
+file	arch/arm/fdt/a9wdt_fdt.c		a9wdt_fdt
+
 device	gtmr: mpcorebus
 attach	gtmr at fdt with gtmr_fdt
 file	arch/arm/fdt/gtmr_fdt.c			gtmr_fdt

Added files:

Index: src/sys/arch/arm/cortex/a9ptmr.c
diff -u /dev/null src/sys/arch/arm/cortex/a9ptmr.c:1.1
--- /dev/null	Sat Aug 10 17:03:59 2019
+++ 

CVS commit: src/sys/arch/arm

2019-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 10 17:03:59 UTC 2019

Modified Files:
src/sys/arch/arm/cortex: a9tmr_var.h a9wdt.c files.cortex
src/sys/arch/arm/fdt: files.fdt
Added Files:
src/sys/arch/arm/cortex: a9ptmr.c a9ptmr_var.h
src/sys/arch/arm/fdt: a9ptmr_fdt.c a9wdt_fdt.c

Log Message:
Add a driver for the A5/A9 Private timer.

While here FDTise the Watchdog driver.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/cortex/a9ptmr.c \
src/sys/arch/arm/cortex/a9ptmr_var.h
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/a9tmr_var.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/cortex/a9wdt.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/cortex/files.cortex
cvs rdiff -u -r0 -r1.1 src/sys/arch/arm/fdt/a9ptmr_fdt.c \
src/sys/arch/arm/fdt/a9wdt_fdt.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/arm/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/aarch64/include

2019-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 10 16:46:07 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: bus_funcs.h

Log Message:
Really provide bus_funcs.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/include/bus_funcs.h

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



CVS commit: src/sys/arch/aarch64/include

2019-08-10 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Aug 10 16:46:07 UTC 2019

Modified Files:
src/sys/arch/aarch64/include: bus_funcs.h

Log Message:
Really provide bus_funcs.h


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/aarch64/include/bus_funcs.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/arch/aarch64/include/bus_funcs.h
diff -u src/sys/arch/aarch64/include/bus_funcs.h:1.2 src/sys/arch/aarch64/include/bus_funcs.h:1.3
--- src/sys/arch/aarch64/include/bus_funcs.h:1.2	Sun Apr  1 04:35:03 2018
+++ src/sys/arch/aarch64/include/bus_funcs.h	Sat Aug 10 16:46:07 2019
@@ -1,3 +1,3 @@
-/*	$NetBSD: bus_funcs.h,v 1.2 2018/04/01 04:35:03 ryo Exp $	*/
+/*	$NetBSD: bus_funcs.h,v 1.3 2019/08/10 16:46:07 skrll Exp $	*/
 
-#include 
+#include 



CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 15:02:03 UTC 2019

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

Log Message:
Handle more corner cases in sys/event.h for C++ EV_SET()

Handle the udata argument as Plain-Old-Data types separately.

 - int, long int, long long int
 - unsigned int, unsigned long int, unsigned long long int
 - void *

This approach handles each of the POD types separately on purpose as
intermediate types such as intptr_t can be either int or long (even long
long) and handling them is not portable.

This approach is compatibile with C++98 and newer.

Fixes i386 usage.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/sys/event.h

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



CVS commit: src/share/mk

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:50:37 UTC 2019

Added Files:
src/share/mk: compare-lib-lists

Log Message:
Add a script to compare the library lists so we can keep them in sync easier.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/mk/compare-lib-lists

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



CVS commit: src/share/mk

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:50:37 UTC 2019

Added Files:
src/share/mk: compare-lib-lists

Log Message:
Add a script to compare the library lists so we can keep them in sync easier.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/share/mk/compare-lib-lists

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

Added files:

Index: src/share/mk/compare-lib-lists
diff -u /dev/null src/share/mk/compare-lib-lists:1.1
--- /dev/null	Sat Aug 10 08:50:37 2019
+++ src/share/mk/compare-lib-lists	Sat Aug 10 08:50:36 2019
@@ -0,0 +1,33 @@
+#!/bin/sh
+# $NetBSD: compare-lib-lists,v 1.1 2019/08/10 12:50:36 christos Exp $
+#
+# Q+D script to print the library lists for compariston between whats in the
+# bsd.prog.mk file and bsd.README
+
+prog=$(basename "$0")
+
+RD=/tmp/${prog}.rd.$$
+MK=/tmp/${prog}.mk.$$
+
+trap "rm -f ${MK} ${RD}" 0 1 2 3 15
+
+make -f - all << \EOF > ${MK}
+.include 
+
+all:
+.for l in ${_LIBLIST}
+	@echo $l
+.endfor
+.for l in crt0.o crti.o crti.o crtn.o
+	@echo $l
+.endfor
+.for l in ${_X11LIBLIST}
+	@echo $l
+.endfor
+EOF
+
+grep '	LIB' bsd.README | \
+grep DESTDIR | \
+sed -e 's/.*lib\([a-zA-Z0-9_+\-]*\)\.a$/\1/' > ${RD}
+
+paste ${MK} ${RD}



CVS commit: src/share/mk

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:46:39 UTC 2019

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

Log Message:
Make the X11 library lists consistent again.


To generate a diff of this commit:
cvs rdiff -u -r1.393 -r1.394 src/share/mk/bsd.README
cvs rdiff -u -r1.319 -r1.320 src/share/mk/bsd.prog.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

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:46:39 UTC 2019

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

Log Message:
Make the X11 library lists consistent again.


To generate a diff of this commit:
cvs rdiff -u -r1.393 -r1.394 src/share/mk/bsd.README
cvs rdiff -u -r1.319 -r1.320 src/share/mk/bsd.prog.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.README
diff -u src/share/mk/bsd.README:1.393 src/share/mk/bsd.README:1.394
--- src/share/mk/bsd.README:1.393	Wed Jul 24 05:28:29 2019
+++ src/share/mk/bsd.README	Sat Aug 10 08:46:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.README,v 1.393 2019/07/24 09:28:29 roy Exp $
+#	$NetBSD: bsd.README,v 1.394 2019/08/10 12:46:38 christos Exp $
 #	@(#)bsd.README	8.2 (Berkeley) 4/2/94
 
 This is the README file for the make "include" files for the NetBSD
@@ -1754,24 +1754,31 @@ DPADD		Additional dependencies for the p
 
 		The following X-Windows libraries are predefined for DPADD:
 
+		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
+		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
+		LIBFONTCACHE?=		${DESTDIR}/usr/X11R7/lib/libfontcache.a
+		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
+		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
+		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
 		LIBFS?=			${DESTDIR}/usr/X11R7/lib/libFS.a
 		LIBGL?=			${DESTDIR}/usr/X11R7/lib/libGL.a
 		LIBGLU?=		${DESTDIR}/usr/X11R7/lib/libGLU.a
 		LIBICE?=		${DESTDIR}/usr/X11R7/lib/libICE.a
+		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
 		LIBSM?=			${DESTDIR}/usr/X11R7/lib/libSM.a
 		LIBX11?=		${DESTDIR}/usr/X11R7/lib/libX11.a
 		LIBX11_XCB?=		${DESTDIR}/usr/X11R7/lib/libX11-xcb.a
-		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
 		LIBXAU?=		${DESTDIR}/usr/X11R7/lib/libXau.a
 		LIBXAW?=		${DESTDIR}/usr/X11R7/lib/libXaw.a
 		LIBXCB?=		${DESTDIR}/usr/X11R7/lib/libxcb.a
 		LIBXDMCP?=		${DESTDIR}/usr/X11R7/lib/libXdmcp.a
 		LIBXEXT?=		${DESTDIR}/usr/X11R7/lib/libXext.a
-		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
 		LIBXFONT2?=		${DESTDIR}/usr/X11R7/lib/libXfont2.a
+		LIBXFONT?=		${DESTDIR}/usr/X11R7/lib/libXfont.a
 		LIBXFT?=		${DESTDIR}/usr/X11R7/lib/libXft.a
 		LIBXI?=			${DESTDIR}/usr/X11R7/lib/libXi.a
 		LIBXINERAMA?=		${DESTDIR}/usr/X11R7/lib/libXinerama.a
+		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
 		LIBXMU?=		${DESTDIR}/usr/X11R7/lib/libXmu.a
 		LIBXMUU?=		${DESTDIR}/usr/X11R7/lib/libXmuu.a
 		LIBXPM?=		${DESTDIR}/usr/X11R7/lib/libXpm.a
@@ -1779,18 +1786,12 @@ DPADD		Additional dependencies for the p
 		LIBXRENDER?=		${DESTDIR}/usr/X11R7/lib/libXrender.a
 		LIBXSS?=		${DESTDIR}/usr/X11R7/lib/libXss.a
 		LIBXT?=			${DESTDIR}/usr/X11R7/lib/libXt.a
+		LIBXTRAP?=		${DESTDIR}/usr/X11R7/lib/libXTrap.a
 		LIBXTST?=		${DESTDIR}/usr/X11R7/lib/libXtst.a
 		LIBXV?=			${DESTDIR}/usr/X11R7/lib/libXv.a
 		LIBXXF86DGA?=		${DESTDIR}/usr/X11R7/lib/libXxf86dga.a
 		LIBXXF86MISC?=		${DESTDIR}/usr/X11R7/lib/libXxf86misc.a
 		LIBXXF86VM?=		${DESTDIR}/usr/X11R7/lib/libXxf86vm.a
-		LIBDPS?=		${DESTDIR}/usr/X11R7/lib/libdps.a
-		LIBFNTSTUBS?=		${DESTDIR}/usr/X11R7/lib/libfntstubs.a
-		LIBFONTCONFIG?=		${DESTDIR}/usr/X11R7/lib/libfontconfig.a
-		LIBFONTENC?=		${DESTDIR}/usr/X11R7/lib/libfontenc.a
-		LIBFREETYPE?=		${DESTDIR}/usr/X11R7/lib/libfreetype.a
-		LIBLBXUTIL?=		${DESTDIR}/usr/X11R7/lib/liblbxutil.a
-		LIBXKBFILE?=		${DESTDIR}/usr/X11R7/lib/libxkbfile.a
 
 SHAREDSTRINGS	If defined, a new .c.o rule is used that results in shared
 		strings, using xstr(1). Note that this will not work with

Index: src/share/mk/bsd.prog.mk
diff -u src/share/mk/bsd.prog.mk:1.319 src/share/mk/bsd.prog.mk:1.320
--- src/share/mk/bsd.prog.mk:1.319	Mon Jan 21 16:11:54 2019
+++ src/share/mk/bsd.prog.mk	Sat Aug 10 08:46:38 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.prog.mk,v 1.319 2019/01/21 21:11:54 christos Exp $
+#	$NetBSD: bsd.prog.mk,v 1.320 2019/08/10 12:46:38 christos Exp $
 #	@(#)bsd.prog.mk	8.2 (Berkeley) 4/2/94
 
 .ifndef HOSTPROG
@@ -267,43 +267,13 @@ PAM_STATIC_DPADD=
 .endif
 
 #	NB:	If you are a library here, add it in bsd.README
-.for _lib in \
-	FS \
-	GL \
-	GLU \
-	ICE \
-	SM \
-	X11 \
-	XTrap \
-	Xau \
-	Xaw \
-	Xdmcp \
-	Xext \
-	Xfont2 \
-	Xfont \
-	Xft \
-	Xi \
-	Xinerama \
-	Xmu \
-	Xmuu \
-	Xpm \
-	Xrandr \
-	Xrender \
-	Xss \
-	Xt \
-	Xtst \
-	Xv \
-	Xxf86dga \
-	Xxf86misc \
-	Xxf86vm \
-	dps \
-	fntstubs \
-	fontcache \
-	fontconfig \
-	fontenc \
-	freetype \
-	lbxutil \
-	xkbfile
+#	This list is sorted with -f so that it matches the order in bsd.README
+_X11LIBLIST= dps fntstubs fontcache fontconfig fontenc freetype FS GL GLU \
+ICE lbxutil SM X11 X11_xcb Xau Xaw xcb Xdmcp Xext Xfont Xfont2 Xft Xi \
+Xinerama xkbfile Xmu Xmuu Xpm Xrandr Xrender Xss Xt XTrap Xtst Xv Xxf86dga \
+Xxf86misc Xxf86vm
+
+.for _lib in ${_X11LIBLIST}
 .ifndef LIB${_lib:tu}
 LIB${_lib:tu}=	

CVS commit: src/share/mk

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:20:17 UTC 2019

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

Log Message:
Don't install PIC libraries by default because they are too big since they
contain debug symbols. I supplied a patch in PR/54449 to remove the debugging
symbols but folks preferred to not install them at all.


To generate a diff of this commit:
cvs rdiff -u -r1.1149 -r1.1150 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.1149 src/share/mk/bsd.own.mk:1.1150
--- src/share/mk/bsd.own.mk:1.1149	Wed Jul 24 05:28:29 2019
+++ src/share/mk/bsd.own.mk	Sat Aug 10 08:20:17 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.1149 2019/07/24 09:28:29 roy Exp $
+#	$NetBSD: bsd.own.mk,v 1.1150 2019/08/10 12:20:17 christos Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -1070,7 +1070,7 @@ _MKVARS.yes= \
 	MKNPF \
 	MKOBJ \
 	MKPAM MKPERFUSE \
-	MKPF MKPIC MKPICINSTALL MKPICLIB MKPOSTFIX MKPROFILE \
+	MKPF MKPIC MKPICLIB MKPOSTFIX MKPROFILE \
 	MKRUMP \
 	MKSHARE MKSKEY MKSTATICLIB \
 	MKUNBOUND \
@@ -1186,7 +1186,7 @@ _MKVARS.no= \
 	MKMANZ MKMCLINKER \
 	MKNOUVEAUFIRMWARE MKNSD \
 	MKOBJDIRS \
-	MKPCC MKPIGZGZIP \
+	MKPCC MKPICINSTALL MKPIGZGZIP \
 	MKRADEONFIRMWARE MKREPRO \
 	MKSLJIT MKSOFTFLOAT MKSTRIPIDENT \
 	MKTEGRAFIRMWARE MKTPM \



CVS commit: src/share/mk

2019-08-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Aug 10 12:20:17 UTC 2019

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

Log Message:
Don't install PIC libraries by default because they are too big since they
contain debug symbols. I supplied a patch in PR/54449 to remove the debugging
symbols but folks preferred to not install them at all.


To generate a diff of this commit:
cvs rdiff -u -r1.1149 -r1.1150 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/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 11:20:50 UTC 2019

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

Log Message:
Add fallback defintion for C++ of _EV_SET with the last argument of type 0

Converting 0 to intptr and void* is ambiguous according to a C++ compiler.
New _EV_SET() accepts int type and casts it with static_cast() to
intptr_t.

Reported and fix tested by 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/event.h

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

Modified files:

Index: src/sys/sys/event.h
diff -u src/sys/sys/event.h:1.33 src/sys/sys/event.h:1.34
--- src/sys/sys/event.h:1.33	Tue Aug  6 11:21:59 2019
+++ src/sys/sys/event.h	Sat Aug 10 11:20:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: event.h,v 1.33 2019/08/06 11:21:59 kamil Exp $	*/
+/*	$NetBSD: event.h,v 1.34 2019/08/10 11:20:50 kamil Exp $	*/
 
 /*-
  * Copyright (c) 1999,2000,2001 Jonathan Lemon 
@@ -79,6 +79,14 @@ _EV_SET(struct kevent *_kevp, uintptr_t 
 	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
 	reinterpret_cast(_udata));
 }
+
+static __inline void
+_EV_SET(struct kevent *_kevp, uintptr_t _ident, uint32_t _filter,
+uint32_t _flags, uint32_t _fflags, int64_t _data, int _udata)
+{
+	_EV_SET(_kevp, _ident, _filter, _flags, _fflags, _data,
+	static_cast(_udata));
+}
 #else
 #define EV_SET(kevp, ident, filter, flags, fflags, data, udata)	\
 _EV_SET((kevp), __CAST(uintptr_t, (ident)), (filter), (flags), \



CVS commit: src/sys/sys

2019-08-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Aug 10 11:20:50 UTC 2019

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

Log Message:
Add fallback defintion for C++ of _EV_SET with the last argument of type 0

Converting 0 to intptr and void* is ambiguous according to a C++ compiler.
New _EV_SET() accepts int type and casts it with static_cast() to
intptr_t.

Reported and fix tested by 


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/event.h

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



CVS commit: src/doc

2019-08-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug 10 08:46:09 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Fix format in order not to confuse changes2html script.
Minor improvements of wording for my entry.


To generate a diff of this commit:
cvs rdiff -u -r1.2566 -r1.2567 src/doc/CHANGES

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
diff -u src/doc/CHANGES:1.2566 src/doc/CHANGES:1.2567
--- src/doc/CHANGES:1.2566	Sat Aug 10 03:38:36 2019
+++ src/doc/CHANGES	Sat Aug 10 08:46:09 2019
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2566 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2567 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -24,10 +24,10 @@
 # 
 
 Changes from NetBSD 9.0 to NetBSD 10.0:
-openldap: Import 2.4.48. [christos 20180808]
-rasops(9): Major improvements for rasops(9) routines. General putchar functions
-	added to color depths 2 and 4. Width-optimized putchar functions added
-	to depth 32. Anti-aliasing supported for depths 2 and 24. Shadow
-	framebuffer supported for all color depths. A lot of bug fixes, both
-	major or minor. Dedup more than 20% of lines, or 50% of characters.
-	[rin 20190810]
+	openldap: Import 2.4.48. [christos 20180808]
+	rasops(9): Major improvements for rasops(9) routines. General putchar
+		functions added for color depths 2 and 4. Width-optimized
+		putchar functions added for depth 32. Anti-aliasing supported
+		for depths 2 and 24. Shadow framebuffer supported for all
+		depths. A lot of bug fixes, both major and minor. Dedup more
+		than 20% of lines, or 50% of characters. [rin 20190810]



CVS commit: src/doc

2019-08-10 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Aug 10 08:46:09 UTC 2019

Modified Files:
src/doc: CHANGES

Log Message:
Fix format in order not to confuse changes2html script.
Minor improvements of wording for my entry.


To generate a diff of this commit:
cvs rdiff -u -r1.2566 -r1.2567 src/doc/CHANGES

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



CVS commit: src/tests/lib/libpthread

2019-08-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 10 07:36:15 UTC 2019

Modified Files:
src/tests/lib/libpthread: t_condwait.c

Log Message:
PR lib/54440: adapt the FreeBSD change to this test and calculate time
differences more exact, allowing between 0 and 1 s delay between the
expected wakeup and the actual event happening.
Also convert the QEMU special case code to the same scheme, but for now
disable it (with XXX mark) and see if the proper timing limits fix that
case too.
If not, we will re-enable the QEMU special case.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libpthread/t_condwait.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/libpthread/t_condwait.c
diff -u src/tests/lib/libpthread/t_condwait.c:1.6 src/tests/lib/libpthread/t_condwait.c:1.7
--- src/tests/lib/libpthread/t_condwait.c:1.6	Tue Jul  9 16:24:01 2019
+++ src/tests/lib/libpthread/t_condwait.c	Sat Aug 10 07:36:15 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: t_condwait.c,v 1.6 2019/07/09 16:24:01 maya Exp $ */
+/* $NetBSD: t_condwait.c,v 1.7 2019/08/10 07:36:15 martin Exp $ */
 
 /*
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -26,7 +26,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_condwait.c,v 1.6 2019/07/09 16:24:01 maya Exp $");
+__RCSID("$NetBSD: t_condwait.c,v 1.7 2019/08/10 07:36:15 martin Exp $");
 
 #include 
 #include 
@@ -50,7 +50,7 @@ static const int debug = 1;
 static void *
 run(void *param)
 {
-	struct timespec ts, to, te;
+	struct timespec ts, to, te, twmin, twmax;
 	clockid_t clck;
 	pthread_condattr_t attr;
 	pthread_cond_t cond;
@@ -85,14 +85,23 @@ run(void *param)
 			printf("elapsed: %lld.%09ld sec\n",
 			(long long)to.tv_sec, to.tv_nsec);
 		}
-		if (isQEMU()) {
-			double to_seconds = to.tv_sec + 1e-9 * to.tv_nsec;
-			ATF_REQUIRE(to_seconds >= WAITTIME * 0.9);
-			/* Loose upper limit because of qemu timing bugs */
-			ATF_REQUIRE(to_seconds < WAITTIME * 2.5);
+		twmin.tv_sec = WAITTIME;
+		twmin.tv_nsec = 0;
+		if (0 /* XXX */ && isQEMU()) {
+			struct timespec td, t;
+			td.tv_sec = 0;
+			td.tv_nsec = 9;
+			t = twmin;
+			timespecsub(, , );
+			td.tv_sec = 2;
+			td.tv_nsec = 5;
+			timespecadd(, , );
 		} else {
-			ATF_REQUIRE_EQ(to.tv_sec, WAITTIME);
+			twmax = twmin;
+			twmax.tv_sec++;
 		}
+		ATF_REQUIRE(timespeccmp(, , >=));
+		ATF_REQUIRE(timespeccmp(, , <=));
 		break;
 	default:
 		ATF_REQUIRE_MSG(0, "pthread_cond_timedwait: %s", strerror(ret));



CVS commit: src/tests/lib/libpthread

2019-08-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 10 07:36:15 UTC 2019

Modified Files:
src/tests/lib/libpthread: t_condwait.c

Log Message:
PR lib/54440: adapt the FreeBSD change to this test and calculate time
differences more exact, allowing between 0 and 1 s delay between the
expected wakeup and the actual event happening.
Also convert the QEMU special case code to the same scheme, but for now
disable it (with XXX mark) and see if the proper timing limits fix that
case too.
If not, we will re-enable the QEMU special case.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/tests/lib/libpthread/t_condwait.c

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



CVS commit: src/lib/libperfuse

2019-08-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Sat Aug 10 07:08:12 UTC 2019

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
Rollback directory filehandle screening for FUSE lock operations

libfuse has a different usage of filehandles for files and directories.
A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/lib/libperfuse/ops.c

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



CVS commit: src/lib/libperfuse

2019-08-10 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Sat Aug 10 07:08:12 UTC 2019

Modified Files:
src/lib/libperfuse: ops.c

Log Message:
Rollback directory filehandle screening for FUSE lock operations

libfuse has a different usage of filehandles for files and directories.
A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.


To generate a diff of this commit:
cvs rdiff -u -r1.86 -r1.87 src/lib/libperfuse/ops.c

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

Modified files:

Index: src/lib/libperfuse/ops.c
diff -u src/lib/libperfuse/ops.c:1.86 src/lib/libperfuse/ops.c:1.87
--- src/lib/libperfuse/ops.c:1.86	Sat Feb  9 02:22:45 2019
+++ src/lib/libperfuse/ops.c	Sat Aug 10 07:08:11 2019
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.86 2019/02/09 02:22:45 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.87 2019/08/10 07:08:11 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2976,24 +2976,15 @@ perfuse_node_advlock(struct puffs_usermo
 	 * expect one. E.g.: if we provide none, GlusterFS logs an error
 	 * "0-glusterfs-fuse: xl is NULL"
 	 *
-	 * There is one exception with directories where filehandle
-	 * is not included, because libfuse uses different filehandle
-	 * in opendir/releasedir/readdir/fsyncdir compared to other 
-	 * operations. Who locks a directory anyway?
-	 *
 	 * We need the read file handle if the file is open read only,
 	 * in order to support shared locks on read-only files.
 	 * NB: The kernel always sends advlock for read-only
 	 * files at exit time when the process used lock, see
 	 * sys_exit -> exit1 -> fd_free -> fd_close -> VOP_ADVLOCK
 	 */
-	if (!PN_ISDIR(opc)) {
-		if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
-			error = EBADF;
-			goto out;
-		}
-	} else {
-		fh = FUSE_UNKNOWN_FH;
+	if ((fh = perfuse_get_fh(opc, FREAD)) == FUSE_UNKNOWN_FH) {
+		error = EBADF;
+		goto out;
 	}
 
 	ps = puffs_getspecific(pu);



Re: CVS commit: src/sys/dev

2019-08-10 Thread Yorick Hardy
Dear Ryo,

On 2019-07-26, Ryo ONODERA wrote:
> Hi,
> 
> O.k.
> I will commit your fix later.
> 
> Thank you.

Thanks! I can commit again, and I commited this change.
Please let me know if I broke anything!

(src/sys/dev/usb/ums.c v1.94)

> Yorick Hardy  writes:
> 
> > Dear Ryo,
> >
> > On 2019-07-25, Ryo ONODERA wrote:
> >> Hi,
> >> 
> >> Yorick Hardy  writes:
> >> 
> >> > Dear Ryo,
> >> >
> >> > On 2019-07-09, Ryo ONODERA wrote:
> >> >> Module Name:src
> >> >> Committed By:   ryoon
> >> >> Date:   Tue Jul  9 12:52:51 UTC 2019
> >> >> 
> >> >> Modified Files:
> >> >> src/sys/dev/hid: hidms.c hidms.h
> >> >> src/sys/dev/i2c: ims.c
> >> >> 
> >> >> Log Message:
> >> >> Add tpcalib, touch panel calibration to ims(4)
> >> >> 
> >> >> Suggested by ryo@ at Japan NetBSD Users' Group BOF 2019-07-06.
> >> >> 
> >> >> 
> >> >> To generate a diff of this commit:
> >> >> cvs rdiff -u -r1.2 -r1.3 src/sys/dev/hid/hidms.c
> >> >> cvs rdiff -u -r1.1 -r1.2 src/sys/dev/hid/hidms.h
> >> >> cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/ims.c
> >> >> 
> >> >> Please note that diffs are not public domain; they are subject to the
> >> >> copyright notices on the relevant files.
> >> >
> >> > I think this change has the side effect that ums(4) devices which
> >> > report absolute coordinates seem to stop "moving" because
> >> > tcpalib_init is never called for these devices.
> >> >
> >> > Is the patch below okay? Or, should hidms call tcpalib_init?
> >> > (I tested the patch with an ACECAD digimemo.)
> >> 
> >> Sorry for breakage.
> >> It looks good to me.
> >> And I feel tpcalib_init should be called from ums.c like your patch.
> >> Could you commit it?
> >
> > I am very sorry, but I retired my commit privilege because I was
> > contributing very little to NetBSD. Otherwise I would be happy to do so!
> >
> >> Thank you.
> >> 
> >> > -- 
> >> > Kind regards,
> >> >
> >> > Yorick Hardy
> >> >
> >> > Index: sys/dev/usb/ums.c
> >> > ===
> >> > RCS file: /cvsroot/src/sys/dev/usb/ums.c,v
> >> > retrieving revision 1.93
> >> > diff -u -r1.93 ums.c
> >> > --- sys/dev/usb/ums.c5 May 2019 03:17:54 -   1.93
> >> > +++ sys/dev/usb/ums.c24 Jul 2019 21:29:35 -
> >> > @@ -192,6 +192,7 @@
> >> >  }
> >> >  }
> >> >  
> >> > +tpcalib_init(>sc_ms.sc_tpcalib);
> >> >  hidms_attach(self, >sc_ms, _accessops);
> >> >  }
> >> >  
> >> 
> >> -- 
> >> Ryo ONODERA // r...@tetera.org
> >> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3

-- 
Kind regards,

Yorick Hardy


CVS commit: src/sys/dev/usb

2019-08-10 Thread Yorick Hardy
Module Name:src
Committed By:   yhardy
Date:   Sat Aug 10 06:30:26 UTC 2019

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

Log Message:
Initialize tcpalib for ums devices.

In r1.3 of src/sys/dev/hid/hidms.c, tpcalib is used for any hidms
device reporting absolute coordinates. So ums devices reporting
absolute coordinates also need to initialize tcpalib - do it for
all ums devices. An uninitialized tcpalib stops a mouse with
absolute coordinates from "moving".

OK: ryoon@


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/usb/ums.c

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

Modified files:

Index: src/sys/dev/usb/ums.c
diff -u src/sys/dev/usb/ums.c:1.93 src/sys/dev/usb/ums.c:1.94
--- src/sys/dev/usb/ums.c:1.93	Sun May  5 03:17:54 2019
+++ src/sys/dev/usb/ums.c	Sat Aug 10 06:30:26 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: ums.c,v 1.93 2019/05/05 03:17:54 mrg Exp $	*/
+/*	$NetBSD: ums.c,v 1.94 2019/08/10 06:30:26 yhardy Exp $	*/
 
 /*
  * Copyright (c) 1998, 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.93 2019/05/05 03:17:54 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ums.c,v 1.94 2019/08/10 06:30:26 yhardy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -192,6 +192,7 @@ ums_attach(device_t parent, device_t sel
 		}
 	}
 
+	tpcalib_init(>sc_ms.sc_tpcalib);
 	hidms_attach(self, >sc_ms, _accessops);
 }
 



CVS commit: src/sys/dev/usb

2019-08-10 Thread Yorick Hardy
Module Name:src
Committed By:   yhardy
Date:   Sat Aug 10 06:30:26 UTC 2019

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

Log Message:
Initialize tcpalib for ums devices.

In r1.3 of src/sys/dev/hid/hidms.c, tpcalib is used for any hidms
device reporting absolute coordinates. So ums devices reporting
absolute coordinates also need to initialize tcpalib - do it for
all ums devices. An uninitialized tcpalib stops a mouse with
absolute coordinates from "moving".

OK: ryoon@


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/dev/usb/ums.c

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



CVS commit: [netbsd-9] src/doc

2019-08-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 10 06:19:48 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tcikets #40 and #41


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-9.0

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



CVS commit: [netbsd-9] src/doc

2019-08-10 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug 10 06:19:48 UTC 2019

Modified Files:
src/doc [netbsd-9]: CHANGES-9.0

Log Message:
Tcikets #40 and #41


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-9.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-9.0
diff -u src/doc/CHANGES-9.0:1.1.2.12 src/doc/CHANGES-9.0:1.1.2.13
--- src/doc/CHANGES-9.0:1.1.2.12	Fri Aug  9 16:16:26 2019
+++ src/doc/CHANGES-9.0	Sat Aug 10 06:19:48 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.12 2019/08/09 16:16:26 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.13 2019/08/10 06:19:48 martin Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -411,3 +411,1204 @@ sys/dev/usb/if_aue.c1.156
 	Fix panic when setting multicast addresses.
 	[msaitoh, ticket #39]
 
+sys/external/bsd/ipf/netinet/fil.c		1.30
+
+	PR/54443: ipf mistakenly regards UDP packet with checksum field
+	0x as bad.
+	[christos, ticket #40]
+
+external/bsd/openldap/dist/include/openldap.h   up to 1.1.1.1
+external/bsd/openldap/dist/servers/slapd/back-sock/extended.c up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8444/its8444 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8444/slapd-provider1.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8444/slapd-provider2.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8444/slapd-provider3.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8444/slapd-provider4.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8616/its8616 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8616/slapd-provider.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8663/its8663 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8663/slapd-provider.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/accounting.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/administrative.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/its8667 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/janitorial.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/root.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8667/slapd.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8752/its8752 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8752/slapd.conf up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8752/slapd.conf.mmr up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/db.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/its8800 up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/slapd-provider1.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/slapd-provider2.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/slapd-provider3.ldif up to 1.1.1.1
+external/bsd/openldap/dist/tests/data/regressions/its8800/slapd-provider4.ldif up to 1.1.1.1
+external/bsd/openldap/dist/doc/man/man5/slapd-ldbm.5 delete
+external/bsd/openldap/dist/tests/scripts/test058-syncrepl-asymmetric delete
+external/bsd/openldap/dist/ANNOUNCEMENT up to 1.1.1.7
+external/bsd/openldap/dist/CHANGES  up to 1.1.1.8
+external/bsd/openldap/dist/COPYRIGHTup to 1.1.1.8
+external/bsd/openldap/dist/INSTALL  up to 1.1.1.7
+external/bsd/openldap/dist/Makefile.in  up to 1.1.1.7
+external/bsd/openldap/dist/README   up to 1.1.1.7
+external/bsd/openldap/dist/configureup to 1.1.1.7
+external/bsd/openldap/dist/configure.in up to 1.1.1.7
+external/bsd/openldap/dist/build/dir.mk up to 1.1.1.7
+external/bsd/openldap/dist/build/info.mkup to 1.1.1.7
+external/bsd/openldap/dist/build/lib-shared.mk  up to 1.1.1.7
+external/bsd/openldap/dist/build/lib-static.mk  up to 1.1.1.7
+external/bsd/openldap/dist/build/lib.mk up to 1.1.1.7
+external/bsd/openldap/dist/build/ltmain.sh  up to 1.1.1.7
+external/bsd/openldap/dist/build/man.mk up to 1.1.1.7
+external/bsd/openldap/dist/build/missingup to 1.1.1.7
+external/bsd/openldap/dist/build/mkdep  up to 1.1.1.7
+external/bsd/openldap/dist/build/mkdep.aix  up to 1.1.1.7
+external/bsd/openldap/dist/build/mkrelease  up to 1.1.1.7
+external/bsd/openldap/dist/build/mkvers.bat up to 1.1.1.7
+external/bsd/openldap/dist/build/mkversion  up to 1.8
+external/bsd/openldap/dist/build/mod.mk up to 1.1.1.7
+external/bsd/openldap/dist/build/openldap.m4up to 1.1.1.7