CVS commit: src/share/man/man9

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 05:37:05 UTC 2019

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

Log Message:
update for usbnet_mii and read/write reg return change.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 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/share/man/man9/usbnet.9
diff -u src/share/man/man9/usbnet.9:1.7 src/share/man/man9/usbnet.9:1.8
--- src/share/man/man9/usbnet.9:1.7	Thu Aug 15 08:37:13 2019
+++ src/share/man/man9/usbnet.9	Fri Aug 23 05:37:05 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: usbnet.9,v 1.7 2019/08/15 08:37:13 wiz Exp $
+.\"	$NetBSD: usbnet.9,v 1.8 2019/08/23 05:37:05 mrg Exp $
 .\"
 .\" Copyright (c) 2019 Matthew R. Green
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd August 14, 2019
+.Dd August 22, 2019
 .Dt USBNET 9
 .Os
 .Sh NAME
@@ -104,7 +104,7 @@
 .Ft void
 .Fn usbnet_attach "struct usbnet *un" "const char *detname"
 .Ft void
-.Fn usbnet_attach_ifp "struct usbnet *un" "bool have_mii" "unsigned if_flags" "unsigned if_extflags" "int mii_flags"
+.Fn usbnet_attach_ifp "struct usbnet *un" "unsigned if_flags" "unsigned if_extflags" "const struct usbnet_mii *unm"
 .Ft int
 .Fn usbnet_detach "device_t dev" "int flags"
 .Ft int
@@ -395,13 +395,31 @@ Initial stage attach of a usb network de
 The
 .Fa detachname
 will be used while waiting for final references to drain when detaching.
-.It Fn usbnet_attach_ifp un have_mii if_flags if_extflags mii_flags
+.It Fn usbnet_attach_ifp un if_flags if_extflags unm
 Final stage attach of usb network device.
-If
-.Fa have_mii
-is true then an MII interface will be created and
-.Fa mii_flags
-added.
+If the passed in
+.Fa unm
+is non-NULL then an MII interface will be created using the values
+provided in the
+.Fa struct usbnet_mii
+structure, which has these members passed to
+.Fn mii_attach :
+.Bl -tag -width 4n
+.It un_mii_flags
+Flags.
+.It un_mii_capmask
+Capability mask.
+.It un_mii_phyloc
+PHY location.
+.It un_mii_offset
+PHY offset.
+.El
+.Pp
+A default
+.Fa unm
+can be set using the
+.Fn USBNET_MII_DECL_DEFAULT
+macro.
 The
 .Fa if_flags
 and
@@ -449,19 +467,19 @@ Initialize (bring up) interface.
 Required.
 Must call
 .Fn usbnet_rx_tx_init .
-.It Ft usbd_status Fn (*uno_read_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t *val"
+.It Ft int Fn (*uno_read_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t *val"
 Read MII register.
 Required with MII.
-.It Ft usbd_status Fn (*uno_write_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t val"
+.It Ft int Fn (*uno_write_reg) "struct usbnet *un" "int phy" "int reg" "uint16_t val"
 Write MII register.
 Required with MII.
 .It Ft usbd_status Fn (*uno_statchg) "struct ifnet *ifp"
 Handle MII status change.
 Required with MII.
-.It Ft usbd_status Fn (*uno_tx_prepare) "struct usbnet *un" "struct mbuf *m" "struct usbnet_chain *c"
+.It Ft unsigned Fn (*uno_tx_prepare) "struct usbnet *un" "struct mbuf *m" "struct usbnet_chain *c"
 Prepare an mbuf for transmit.
 Required.
-.It Ft usbd_status Fn (*uno_rx_loop) "struct usbnet *un" "struct usbnet_chain *c" "uint32_t total_len"
+.It Ft void Fn (*uno_rx_loop) "struct usbnet *un" "struct usbnet_chain *c" "uint32_t total_len"
 Prepare one or more chain for enqueue.
 Required.
 .It Ft void Fn (*uno_intr) "struct usbnet *un" "usbd_status status"
@@ -495,6 +513,8 @@ and
 The Rx and Tx endpoints are required.
 .It un_phyno
 MII phy number.
+Not used by
+.Nm .
 .It un_eaddr
 6 bytes of Ethernet address that must be provided before calling
 .Fn usbnet_attach_ifp
@@ -594,8 +614,13 @@ enqueued with the higher layers using ei
 .Fn usbnet_enqueue
 (for most devices) or
 .Fn usbnet_input
-for devices that currently use
-.Fn if_input .
+for devices that use
+.Fn if_input
+(this currently relies upon the
+.Va struct ifnet
+having the
+.Dq _if_input
+member set as well, which is true for current consumers.)
 The Rx lock will be held during this call, see
 .Fn usbnet_lock_rx
 and
@@ -637,12 +662,12 @@ must be provided:
 .Bl -tag -width 4n
 .It uno_read_reg
 Read an MII register for a particular PHY.
-Returns
-.Xr usbd_status 9 .
+Returns standard
+.Xr errno 2 .
 .It uno_write_reg
 Write an MII register for a particular PHY.
-Returns
-.Xr usbd_status 9 .
+Returns standard
+.Xr errno 2 .
 .It uno_statchg
 Handle a status change event for this interface.
 .El
@@ -789,13 +814,6 @@ These functions are called with the MII 
 .Dq Fn usbnet_isowned_mii ) ,
 and do not require any checking for running, or up, or dying devices
 unless they drop and retake the MII lock.
-Their return value is changed from
-.Vt int
-to
-.Vt usbd_status
-and should use
-.Dv USBD_NORMAL_COMPLETION
-for success.
 Local
 .Dq link
 variables need to be replaced with accesses to
@@ -868,5 +886,7 @@ This
 .Nm
 interface 

CVS commit: src/share/man/man9

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 05:37:05 UTC 2019

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

Log Message:
update for usbnet_mii and read/write reg return change.


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



re: CVS commit: src/tests/net

2019-08-22 Thread matthew green
> It's awkward but it's reasonable for now.  A proper fix would
> be to stop using kvm(3) for vmstat and drop the sgid bit from
> the binary.

please finish this work :-)  it's been ongoing for a very 
long time now...


.mrg.


re: CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
> To generate a diff of this commit:
> cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/if_axe.c

FYI: this change included a fix for two problems identified by sc.debug.


Re: CVS commit: src/tests/net

2019-08-22 Thread Ryota Ozaki
On Thu, Aug 22, 2019 at 5:45 PM Ryota Ozaki  wrote:
>
> On Tue, Aug 20, 2019 at 7:06 PM Ryota Ozaki  wrote:
> >
> > On Tue, Aug 20, 2019 at 6:58 PM Martin Husemann  wrote:
> > >
> > > On Tue, Aug 20, 2019 at 06:50:31PM +0900, Ryota Ozaki wrote:
> > > > Hmm, okay, I'm going to disable the feature until the issue is 
> > > > addressed.
> > >
> > > Could it be page size related?
> >
> > I'm not sure.
> >
> > My fresh chroot environment for ATF tests on amd64 also fails so
> > I guess I'm missing something important :-/
>
> It seems that the official AFT tests work expectedly except for
> evbarm-aarch64.  The leak checker uses vmstat -m with rumphijack
> to get pool statistics from a rump kernel, however, for failed
> cases, rumphijack doesn't work correctly and it gets pool statistics
> of the host kernel, resulting in test failures.

I understood why vmstat with rumphijack doesn't work.  Because
vmstat has the sgid bit and it prevents rumphijack, i.e.,
LD_PRELOAD from working.  (Thanks hikaru@ for the suggestion!)

A workaround for the issue is:
  cp /usr/bin/vmstat ./vmstat
  $HIJACKING ./vmstat
  rm -f ./vmstat

It's awkward but it's reasonable for now.  A proper fix would
be to stop using kvm(3) for vmstat and drop the sgid bit from
the binary.

>
> I don't understand yet why rumphijack doesn't work for vmstat -m
> in some cases and does work in other cases.

I guess on most anita environments leak checks pass just in luck
because the environment normally doesn't communicate with outside
and there are no L2 caches.  OTOH on baremetal environments there
can be active L2 caches, which makes the leak checks fail.

  ozaki-r


CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:34:51 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c if_auereg.h

Log Message:
convert aue(4) to usbnet(9).

besides the not-enabled umb(4), this completes the conversion
of all the non-wifi usb network devices.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_auereg.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-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:34:51 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c if_auereg.h

Log Message:
convert aue(4) to usbnet(9).

besides the not-enabled umb(4), this completes the conversion
of all the non-wifi usb network devices.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/usb/if_auereg.h

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

Modified files:

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.160 src/sys/dev/usb/if_aue.c:1.161
--- src/sys/dev/usb/if_aue.c:1.160	Thu Aug 22 09:16:08 2019
+++ src/sys/dev/usb/if_aue.c	Fri Aug 23 04:34:51 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.160 2019/08/22 09:16:08 mrg Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.160 2019/08/22 09:16:08 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -84,49 +84,21 @@ __KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1
 #endif
 
 #include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
 
-#include 
+#include 
+#include 
+#include 
 
-#include 
 #ifdef INET
 #include 
 #include 
 #endif
 
-
-
-#include 
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-#include 
-
-#include 
-
 #ifdef USB_DEBUG
 #ifndef AUE_DEBUG
 #define auedebug 0
 #else
-static int auedebug = 0;
+static int auedebug = 10;
 
 SYSCTL_SETUP(sysctl_hw_aue_setup, "sysctl hw.aue setup")
 {
@@ -170,62 +142,10 @@ fail:
 #define AUE_TX_LIST_CNT		1
 #define AUE_RX_LIST_CNT		1
 
-struct aue_softc;
-
-struct aue_chain {
-	struct aue_softc	*aue_sc;
-	struct usbd_xfer	*aue_xfer;
-	char			*aue_buf;
-	struct mbuf		*aue_mbuf;
-};
-
-struct aue_cdata {
-	struct aue_chain	aue_tx_chain[AUE_TX_LIST_CNT];
-	struct aue_chain	aue_rx_chain[AUE_RX_LIST_CNT];
-	struct aue_intrpkt	aue_ibuf;
-	int			aue_tx_prod;
-	int			aue_tx_cnt;
-};
-
 struct aue_softc {
-	device_t aue_dev;
-
-	struct ethercom		aue_ec;
-	struct mii_data		aue_mii;
-	krndsource_t	rnd_source;
-	struct lwp		*aue_thread;
-	int			aue_closing;
-	kcondvar_t		aue_domc;
-	kcondvar_t		aue_closemc;
-	kmutex_t		aue_mcmtx;
-#define GET_IFP(sc) (&(sc)->aue_ec.ec_if)
-#define GET_MII(sc) (&(sc)->aue_mii)
-
-	struct callout aue_stat_ch;
-
-	struct usbd_device	*aue_udev;
-	struct usbd_interface	*aue_iface;
-	uint16_t		aue_vendor;
-	uint16_t		aue_product;
-	int			aue_ed[AUE_ENDPT_MAX];
-	struct usbd_pipe	*aue_ep[AUE_ENDPT_MAX];
-	uint8_t			aue_link;
-	int			aue_if_flags;
-	struct aue_cdata	aue_cdata;
-
-	uint16_t		aue_flags;
-
-	int			aue_refcnt;
-	char			aue_dying;
-	char			aue_attached;
-	u_int			aue_rx_errs;
-	u_int			aue_intr_errs;
-	struct timeval		aue_rx_notice;
-
-	struct usb_task		aue_tick_task;
-	struct usb_task		aue_stop_task;
-
-	kmutex_t		aue_mii_lock;
+	struct usbnet		aue_un;
+	struct usbnet_intr	aue_intr;
+	struct aue_intrpkt	aue_ibuf;
 };
 
 #define AUE_TIMEOUT		1000
@@ -313,42 +233,35 @@ static const struct aue_type aue_devs[] 
 
 int aue_match(device_t, cfdata_t, void *);
 void aue_attach(device_t, device_t, void *);
-int aue_detach(device_t, int);
-int aue_activate(device_t, enum devact);
 
 CFATTACH_DECL_NEW(aue, sizeof(struct aue_softc), aue_match, aue_attach,
-aue_detach, aue_activate);
-
-static void aue_multithread(void *);
+usbnet_detach, usbnet_activate);
 
 static void aue_reset_pegasus_II(struct aue_softc *);
-static int aue_tx_list_init(struct aue_softc *);
-static int aue_rx_list_init(struct aue_softc *);
-static int aue_newbuf(struct aue_softc *, struct aue_chain *, struct mbuf *);
-static int aue_send(struct aue_softc *, struct mbuf *, int);
-static void aue_intr(struct usbd_xfer *, void *, usbd_status);
-static void aue_rxeof(struct usbd_xfer *, void *, usbd_status);
-static void aue_txeof(struct usbd_xfer *, void *, usbd_status);
-static void aue_tick(void *);
-static void aue_tick_task(void *);
-static void aue_start(struct ifnet *);
-static int aue_ioctl(struct ifnet *, u_long, void *);
-static void aue_init(void *);
-static void aue_stop(struct aue_softc *);
-static void aue_watchdog(struct ifnet *);
-static int aue_openpipes(struct aue_softc *);
-static int aue_ifmedia_upd(struct ifnet *);
-
-static int aue_eeprom_getword(struct aue_softc *, int);
-static void aue_read_mac(struct aue_softc *, u_char *);
-static int aue_miibus_readreg(device_t, int, int, uint16_t *);
-static int aue_miibus_writereg(device_t, int, int, uint16_t);
-static void aue_miibus_statchg(struct ifnet *);
 
-static void aue_lock_mii(struct aue_softc *);
-static void aue_unlock_mii(struct aue_softc *);
+static void aue_stop_cb(struct ifnet *, int);

CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:34:01 UTC 2019

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

Log Message:
convert a debug message to an error message.  will help more quickly
identify next time xhci version changes.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/usb/xhci.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/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.109 src/sys/dev/usb/xhci.c:1.110
--- src/sys/dev/usb/xhci.c:1.109	Wed Aug 21 06:19:43 2019
+++ src/sys/dev/usb/xhci.c	Fri Aug 23 04:34:01 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: xhci.c,v 1.109 2019/08/21 06:19:43 mrg Exp $	*/
+/*	$NetBSD: xhci.c,v 1.110 2019/08/23 04:34:01 mrg Exp $	*/
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.109 2019/08/21 06:19:43 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.110 2019/08/23 04:34:01 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -783,7 +783,7 @@ xhci_id_protocols(struct xhci_softc *sc,
 		major == 3 ? "ss" : "hs", cpo, cpo + cpc -1);
 		break;
 	default:
-		aprint_debug_dev(sc->sc_dev, " unknown major/minor (%d/%d)\n",
+		aprint_error_dev(sc->sc_dev, " unknown major/minor (%d/%d)\n",
 		major, minor);
 		return;
 	}



CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:34:01 UTC 2019

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

Log Message:
convert a debug message to an error message.  will help more quickly
identify next time xhci version changes.


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/dev/usb/xhci.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-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:32:57 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_mue.c if_smsc.c if_udav.c
if_ure.c if_url.c usbnet.h

Log Message:
s/UBSNET_MII_DECL_DEFAULT/USBNET_MII_DECL_DEFAULT/.  from sc.dying.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.13 -r1.14 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/if_axe.c
diff -u src/sys/dev/usb/if_axe.c:1.118 src/sys/dev/usb/if_axe.c:1.119
--- src/sys/dev/usb/if_axe.c:1.118	Tue Aug 20 06:37:06 2019
+++ src/sys/dev/usb/if_axe.c	Fri Aug 23 04:32:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axe.c,v 1.118 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: if_axe.c,v 1.119 2019/08/23 04:32:57 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.118 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.119 2019/08/23 04:32:57 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -863,7 +863,7 @@ void
 axe_attach(device_t parent, device_t self, void *aux)
 {
 	AXEHIST_FUNC(); AXEHIST_CALLED();
-	UBSNET_MII_DECL_DEFAULT(unm);
+	USBNET_MII_DECL_DEFAULT(unm);
 	struct axe_softc *sc = device_private(self);
 	struct usbnet * const un = >axe_un;
 	struct usb_attach_arg *uaa = aux;
@@ -1201,7 +1201,7 @@ axe_tx_prepare(struct usbnet *un, struct
 		memcpy(c->unc_buf, , hdr_len);
 	m_copydata(m, 0, m->m_pkthdr.len, c->unc_buf + hdr_len);
 	if (tlr_len)
-		memcpy(c->unc_buf + length, , tlr_len);
+		memcpy(c->unc_buf + length - tlr_len, , tlr_len);
 
 	return length;
 }

Index: src/sys/dev/usb/if_axen.c
diff -u src/sys/dev/usb/if_axen.c:1.66 src/sys/dev/usb/if_axen.c:1.67
--- src/sys/dev/usb/if_axen.c:1.66	Tue Aug 20 06:37:06 2019
+++ src/sys/dev/usb/if_axen.c	Fri Aug 23 04:32:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_axen.c,v 1.66 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: if_axen.c,v 1.67 2019/08/23 04:32:57 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.66 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.67 2019/08/23 04:32:57 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -599,7 +599,7 @@ axen_match(device_t parent, cfdata_t mat
 static void
 axen_attach(device_t parent, device_t self, void *aux)
 {
-	UBSNET_MII_DECL_DEFAULT(unm);
+	USBNET_MII_DECL_DEFAULT(unm);
 	struct usbnet * const un = device_private(self);
 	struct usb_attach_arg *uaa = aux;
 	struct usbd_device *dev = uaa->uaa_device;

Index: src/sys/dev/usb/if_mue.c
diff -u src/sys/dev/usb/if_mue.c:1.54 src/sys/dev/usb/if_mue.c:1.55
--- src/sys/dev/usb/if_mue.c:1.54	Tue Aug 20 06:37:06 2019
+++ src/sys/dev/usb/if_mue.c	Fri Aug 23 04:32:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mue.c,v 1.54 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: if_mue.c,v 1.55 2019/08/23 04:32:57 mrg Exp $	*/
 /*	$OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $	*/
 
 /*
@@ -20,7 +20,7 @@
 /* Driver for Microchip LAN7500/LAN7800 chipsets. */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.54 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.55 2019/08/23 04:32:57 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -761,7 +761,7 @@ mue_match(device_t parent, cfdata_t matc
 static void
 mue_attach(device_t parent, device_t self, void *aux)
 {
-	UBSNET_MII_DECL_DEFAULT(unm);
+	USBNET_MII_DECL_DEFAULT(unm);
 	struct usbnet * const un = device_private(self);
 	prop_dictionary_t dict = device_properties(self);
 	struct usb_attach_arg *uaa = aux;

Index: src/sys/dev/usb/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.60 src/sys/dev/usb/if_smsc.c:1.61
--- src/sys/dev/usb/if_smsc.c:1.60	Tue Aug 20 06:37:06 2019
+++ src/sys/dev/usb/if_smsc.c	Fri Aug 23 04:32:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.60 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.61 2019/08/23 04:32:57 mrg Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.60 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.61 2019/08/23 04:32:57 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -809,7 +809,7 @@ smsc_match(device_t parent, cfdata_t mat
 void
 

CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:32:57 UTC 2019

Modified Files:
src/sys/dev/usb: if_axe.c if_axen.c if_mue.c if_smsc.c if_udav.c
if_ure.c if_url.c usbnet.h

Log Message:
s/UBSNET_MII_DECL_DEFAULT/USBNET_MII_DECL_DEFAULT/.  from sc.dying.


To generate a diff of this commit:
cvs rdiff -u -r1.118 -r1.119 src/sys/dev/usb/if_axe.c
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/usb/if_axen.c
cvs rdiff -u -r1.54 -r1.55 src/sys/dev/usb/if_mue.c
cvs rdiff -u -r1.60 -r1.61 src/sys/dev/usb/if_smsc.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/if_udav.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_ure.c
cvs rdiff -u -r1.69 -r1.70 src/sys/dev/usb/if_url.c
cvs rdiff -u -r1.13 -r1.14 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-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:29:28 UTC 2019

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

Log Message:
- remove unused uncd_rx_cnt
- add USBNETHIST_CALLARGSN and use it in many places
- add more history logs
- add a log if watchdog abort leaves uncd_tx_cnt non zero
- add a unique (32-bit) number for a each usbnet device and
  use it for logging
- explicitly check for full tx ring in usbnet_start_locked()
  and return early, which avoids setting the 5 second timer
  and triggering a watchdog
- reset uncd_tx_prod and uncd_tx_cnt to zero in stop


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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.22 src/sys/dev/usb/usbnet.c:1.23
--- src/sys/dev/usb/usbnet.c:1.22	Tue Aug 20 06:37:06 2019
+++ src/sys/dev/usb/usbnet.c	Fri Aug 23 04:29:28 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.22 2019/08/20 06:37:06 mrg Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.23 2019/08/23 04:29:28 mrg Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,12 +33,13 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.22 2019/08/20 06:37:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.23 2019/08/23 04:29:28 mrg Exp $");
 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -49,7 +50,6 @@ struct usbnet_cdata {
 
 	int			uncd_tx_prod;
 	int			uncd_tx_cnt;
-	int			uncd_rx_cnt;
 };
 
 struct usbnet_private {
@@ -82,6 +82,7 @@ struct usbnet_private {
 	int			unp_refcnt;
 	int			unp_timer;
 	int			unp_if_flags;
+	unsigned		unp_number;
 
 	krndsource_t		unp_rndsrc;
 
@@ -92,6 +93,8 @@ struct usbnet_private {
 
 #define un_cdata(un)	(&(un)->un_pri->unp_cdata)
 
+volatile unsigned usbnet_number;
+
 static int usbnet_modcmd(modcmd_t, void *);
 
 #ifdef USB_DEBUG
@@ -136,6 +139,8 @@ fail:
 #define USBNETHIST_CALLED(name)	USBHIST_CALLED(usbnetdebug)
 #define USBNETHIST_CALLARGS(FMT,A,B,C,D) \
 USBHIST_CALLARGS(usbnetdebug,FMT,A,B,C,D)
+#define USBNETHIST_CALLARGSN(N,FMT,A,B,C,D) \
+USBHIST_CALLARGSN(usbnetdebug,N,FMT,A,B,C,D)
 
 /* Callback vectors. */
 
@@ -246,14 +251,19 @@ void
 usbnet_enqueue(struct usbnet * const un, uint8_t *buf, size_t buflen,
 	   int csum_flags, uint32_t csum_data, int mbuf_flags)
 {
-	USBNETHIST_FUNC(); USBNETHIST_CALLED();
+	USBNETHIST_FUNC();
 	struct ifnet * const ifp = usbnet_ifp(un);
+	struct usbnet_private * const unp __unused = un->un_pri;
 	struct mbuf *m;
 
+	USBNETHIST_CALLARGSN(5, "%d: enter: len=%zu csf %x mbf %x",
+	unp->unp_number, buflen, csum_flags, mbuf_flags);
+
 	usbnet_isowned_rx(un);
 
 	m = usbnet_newbuf(buflen);
 	if (m == NULL) {
+		DPRINTF("%d: no memory", unp->unp_number, 0, 0, 0);
 		ifp->if_ierrors++;
 		return;
 	}
@@ -271,13 +281,15 @@ usbnet_enqueue(struct usbnet * const un,
 void
 usbnet_input(struct usbnet * const un, uint8_t *buf, size_t buflen)
 {
-	USBNETHIST_FUNC(); USBNETHIST_CALLED();
+	USBNETHIST_FUNC();
 	struct ifnet * const ifp = usbnet_ifp(un);
+	struct usbnet_private * const unp __unused = un->un_pri;
 	struct mbuf *m;
 
+	USBNETHIST_CALLARGSN(5, "%d: enter: buf %jx len %ju",
+	unp->unp_number, (uintptr_t)buf, buflen, 0);
+
 	usbnet_isowned_rx(un);
-	DPRINTFN(0, "called! un %jx buf %jx len %ju",
-	(uintmax_t)(uintptr_t)un, (uintmax_t)(uintptr_t)buf, buflen, 0);
 
 	m = usbnet_newbuf(buflen);
 	if (m == NULL) {
@@ -299,13 +311,16 @@ usbnet_input(struct usbnet * const un, u
 static void
 usbnet_rxeof(struct usbd_xfer *xfer, void *priv, usbd_status status)
 {
-	USBNETHIST_FUNC(); USBNETHIST_CALLED();
+	USBNETHIST_FUNC();
 	struct usbnet_chain * const c = priv;
 	struct usbnet * const un = c->unc_un;
 	struct usbnet_private * const unp = un->un_pri;
 	struct ifnet * const ifp = usbnet_ifp(un);
 	uint32_t total_len;
 
+	USBNETHIST_CALLARGSN(5, "%d: enter: status %x xfer %jx",
+	unp->unp_number, status, (uintptr_t)xfer, 0);
+
 	mutex_enter(>unp_rxlock);
 
 	if (unp->unp_dying || unp->unp_stopping ||
@@ -360,6 +375,9 @@ usbnet_txeof(struct usbd_xfer *xfer, voi
 	struct usbnet_private * const unp = un->un_pri;
 	struct ifnet * const ifp = usbnet_ifp(un);
 
+	USBNETHIST_CALLARGSN(5, "%d: enter: status %x xfer %jx",
+	unp->unp_number, status, (uintptr_t)xfer, 0);
+
 	mutex_enter(>unp_txlock);
 	if (unp->unp_stopping || unp->unp_dying) {
 		mutex_exit(>unp_txlock);
@@ -443,22 +461,32 @@ usbnet_start_locked(struct ifnet *ifp)
 		return;
 	}
 
+	if (cd->uncd_tx_cnt == un->un_tx_list_cnt) {
+		DPRINTF("start called, tx busy (%jx == %jx)",
+		cd->uncd_tx_cnt, un->un_tx_list_cnt, 0, 0);
+		return;
+	}
+
 	idx = cd->uncd_tx_prod;
 	while (cd->uncd_tx_cnt < un->un_tx_list_cnt) {
 		IFQ_POLL(>if_snd, m);
-		if (m == NULL)
+		if (m == NULL) {
+			DPRINTF("start called, queue empty", 0, 0, 0, 0);
 			break;
+		}
 		

CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Aug 23 04:29:28 UTC 2019

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

Log Message:
- remove unused uncd_rx_cnt
- add USBNETHIST_CALLARGSN and use it in many places
- add more history logs
- add a log if watchdog abort leaves uncd_tx_cnt non zero
- add a unique (32-bit) number for a each usbnet device and
  use it for logging
- explicitly check for full tx ring in usbnet_start_locked()
  and return early, which avoids setting the 5 second timer
  and triggering a watchdog
- reset uncd_tx_prod and uncd_tx_cnt to zero in stop


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 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: [netbsd-9] src/doc

2019-08-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 04:24:01 UTC 2019

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

Log Message:
Ticket #105.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 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-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 04:24:01 UTC 2019

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

Log Message:
Ticket #105.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.26 -r1.1.2.27 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.26 src/doc/CHANGES-9.0:1.1.2.27
--- src/doc/CHANGES-9.0:1.1.2.26	Wed Aug 21 14:35:49 2019
+++ src/doc/CHANGES-9.0	Fri Aug 23 04:24:00 2019
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.0,v 1.1.2.26 2019/08/21 14:35:49 martin Exp $
+# $NetBSD: CHANGES-9.0,v 1.1.2.27 2019/08/23 04:24:00 msaitoh Exp $
 
 A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30
 until the 9.0 release:
@@ -2142,3 +2142,12 @@ sys/dev/usb/xhci.c1.108
 	Fix typo in error message.
 	[skrll, ticket #104]
 
+distrib/evbarm/instkernel/sshramdisk/Makefile		1.18
+distrib/evbarm/instkernel/sshramdisk/list		1.2
+distrib/evbarm/instkernel/sshramdisk/sshd_config	1.2
+distrib/evbarm/instkernel/sshramdisk/ssh_host_dsa_key	delete
+distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key	1.1
+
+	Update to newer sshd (the host key is the same as before, it already
+	was a rsa key). From Harold Gutch.
+	[martin, ticket #105]



CVS commit: [netbsd-9] src/distrib/evbarm/instkernel/sshramdisk

2019-08-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 04:22:49 UTC 2019

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: Makefile list
sshd_config
Added Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: ssh_host_rsa_key
Removed Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: ssh_host_dsa_key

Log Message:
Pullup the following revision (requested by martin in ticket #105):

distrib/evbarm/instkernel/sshramdisk/Makefile   1.18
distrib/evbarm/instkernel/sshramdisk/list   1.2
distrib/evbarm/instkernel/sshramdisk/sshd_config1.2
distrib/evbarm/instkernel/sshramdisk/ssh_host_dsa_key   delete
distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key   1.1

Update to newer sshd (the host key is the same as before, it already
was a rsa key). From Harold Gutch


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile
cvs rdiff -u -r1.1 -r1.1.38.1 src/distrib/evbarm/instkernel/sshramdisk/list \
src/distrib/evbarm/instkernel/sshramdisk/sshd_config
cvs rdiff -u -r1.1 -r0 \
src/distrib/evbarm/instkernel/sshramdisk/ssh_host_dsa_key
cvs rdiff -u -r0 -r1.1.2.2 \
src/distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key

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

Modified files:

Index: src/distrib/evbarm/instkernel/sshramdisk/Makefile
diff -u src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17 src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17.4.1
--- src/distrib/evbarm/instkernel/sshramdisk/Makefile:1.17	Sun Apr  8 15:48:39 2018
+++ src/distrib/evbarm/instkernel/sshramdisk/Makefile	Fri Aug 23 04:22:49 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.17 2018/04/08 15:48:39 mlelstv Exp $
+#	$NetBSD: Makefile,v 1.17.4.1 2019/08/23 04:22:49 msaitoh Exp $
 
 .include 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -25,7 +25,7 @@ IMAGEENDIAN=	be
 .endif
 MAKEDEVTARGETS=	ramdisk
 IMAGEDEPENDS=	${CRUNCHBIN} \
-		dot.profile master.passwd sshd_config ssh_host_dsa_key \
+		dot.profile master.passwd sshd_config ssh_host_rsa_key \
 		${NETBSDSRCDIR}/etc/group \
 		${NETBSDSRCDIR}/etc/netconfig ${DISTRIBDIR}/common/protocols \
 		${DISTRIBDIR}/common/services

Index: src/distrib/evbarm/instkernel/sshramdisk/list
diff -u src/distrib/evbarm/instkernel/sshramdisk/list:1.1 src/distrib/evbarm/instkernel/sshramdisk/list:1.1.38.1
--- src/distrib/evbarm/instkernel/sshramdisk/list:1.1	Tue Mar 19 22:16:53 2013
+++ src/distrib/evbarm/instkernel/sshramdisk/list	Fri Aug 23 04:22:49 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.1 2013/03/19 22:16:53 garbled Exp $
+#	$NetBSD: list,v 1.1.38.1 2019/08/23 04:22:49 msaitoh Exp $
 
 SRCDIRS	bin sbin external/bsd/less/bin crypto/external/bsd/openssh/bin/sshd usr.bin usr.sbin
 
@@ -88,4 +88,4 @@ COPY	${DISTRIBDIR}/common/services		etc/
 COPY	${CURDIR}/dot.profile		.profile
 COPY	${CURDIR}/inst.profile		inst/.profile
 COPY	${CURDIR}/sshd_config		etc/ssh/sshd_config
-COPY	${CURDIR}/ssh_host_dsa_key	etc/ssh/ssh_host_dsa_key 600
+COPY	${CURDIR}/ssh_host_rsa_key	etc/ssh/ssh_host_rsa_key 600
Index: src/distrib/evbarm/instkernel/sshramdisk/sshd_config
diff -u src/distrib/evbarm/instkernel/sshramdisk/sshd_config:1.1 src/distrib/evbarm/instkernel/sshramdisk/sshd_config:1.1.38.1
--- src/distrib/evbarm/instkernel/sshramdisk/sshd_config:1.1	Tue Mar 19 22:16:53 2013
+++ src/distrib/evbarm/instkernel/sshramdisk/sshd_config	Fri Aug 23 04:22:49 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: sshd_config,v 1.1 2013/03/19 22:16:53 garbled Exp $
+#	$NetBSD: sshd_config,v 1.1.38.1 2019/08/23 04:22:49 msaitoh Exp $
 
 # Special cut-down sshd_config for sshramdisk
 # Tim Rightnour 
@@ -8,7 +8,7 @@
 #ListenAddress 0.0.0.0
 #ListenAddress ::
 #Protocol 2
-#HostKey /etc/ssh/ssh_host_dsa_key
+#HostKey /etc/ssh/ssh_host_rsa_key
 LoginGraceTime 600
 # needed because sysinst is uid 0
 PermitRootLogin yes
@@ -16,5 +16,4 @@ AuthorizedKeysFile	.ssh/authorized_keys
 PasswordAuthentication yes
 # just in case
 PermitEmptyPasswords yes
-UsePrivilegeSeparation sandbox
 AllowUsers pi sysinst

Added files:

Index: src/distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key
diff -u /dev/null src/distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key:1.1.2.2
--- /dev/null	Fri Aug 23 04:22:49 2019
+++ src/distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key	Fri Aug 23 04:22:49 2019
@@ -0,0 +1,27 @@
+-BEGIN RSA PRIVATE KEY-
+MIIEogIBAAKCAQEA2O4DZIR5YH7ESnvKmdTfJbPDzDZt44chEe27eFf28AhnfGYW
+962xKQbzzZqmMsH19CUAxpQ1UJ/o9MPULCZvYDwhn6t0cT3oNaIhj774Nw5Uni99
+d0DV/PSPsZlk22MySEsXI5rygnUg0ZMEQbw3pPlRYb8pjUwbkgsxR6KCDanFMhuK
+DtCTKbtK/y06BpievoFpENGpwwamfbpQxjK0MvT1TU744eKfBcWPtBl2KZM0cnbS
+vxNAvkSQrku2Sb56JzBo7b1TlxeDjBwHmdoFbUWjmXV5YsNkNdXvx52cro5o+z1f
+obpul8qpy+WQOsucRbltzfcBSRQ7lA09D4Hg5QIDAQABAoIBADQsOmCog9CzbF5F

CVS commit: [netbsd-9] src/distrib/evbarm/instkernel/sshramdisk

2019-08-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 04:22:49 UTC 2019

Modified Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: Makefile list
sshd_config
Added Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: ssh_host_rsa_key
Removed Files:
src/distrib/evbarm/instkernel/sshramdisk [netbsd-9]: ssh_host_dsa_key

Log Message:
Pullup the following revision (requested by martin in ticket #105):

distrib/evbarm/instkernel/sshramdisk/Makefile   1.18
distrib/evbarm/instkernel/sshramdisk/list   1.2
distrib/evbarm/instkernel/sshramdisk/sshd_config1.2
distrib/evbarm/instkernel/sshramdisk/ssh_host_dsa_key   delete
distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key   1.1

Update to newer sshd (the host key is the same as before, it already
was a rsa key). From Harold Gutch


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.4.1 \
src/distrib/evbarm/instkernel/sshramdisk/Makefile
cvs rdiff -u -r1.1 -r1.1.38.1 src/distrib/evbarm/instkernel/sshramdisk/list \
src/distrib/evbarm/instkernel/sshramdisk/sshd_config
cvs rdiff -u -r1.1 -r0 \
src/distrib/evbarm/instkernel/sshramdisk/ssh_host_dsa_key
cvs rdiff -u -r0 -r1.1.2.2 \
src/distrib/evbarm/instkernel/sshramdisk/ssh_host_rsa_key

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



CVS commit: src/sys/net

2019-08-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 02:33:16 UTC 2019

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

Log Message:
- kmem_alloc(,KM_SLEEP) never return NULL, so remove NULL check.
- VLAN ID is never duplicated, so break the loop when found. Also move
  kmen_free() outside of ETHER_LOCK(ec)/ETHER_UNLOCK(ec) to reduce the hold
  time. suggested by ozaki-r.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/net/if_vlan.c

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



CVS commit: src/sys/net

2019-08-22 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Fri Aug 23 02:33:16 UTC 2019

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

Log Message:
- kmem_alloc(,KM_SLEEP) never return NULL, so remove NULL check.
- VLAN ID is never duplicated, so break the loop when found. Also move
  kmen_free() outside of ETHER_LOCK(ec)/ETHER_UNLOCK(ec) to reduce the hold
  time. suggested by ozaki-r.
- Whitespace fix.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/sys/net/if_vlan.c

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

Modified files:

Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.145 src/sys/net/if_vlan.c:1.146
--- src/sys/net/if_vlan.c:1.145	Wed Aug 21 06:00:07 2019
+++ src/sys/net/if_vlan.c	Fri Aug 23 02:33:15 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vlan.c,v 1.145 2019/08/21 06:00:07 msaitoh Exp $	*/
+/*	$NetBSD: if_vlan.c,v 1.146 2019/08/23 02:33:15 msaitoh Exp $	*/
 
 /*
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.145 2019/08/21 06:00:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.146 2019/08/23 02:33:15 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -487,10 +487,6 @@ vlan_config(struct ifvlan *ifv, struct i
 		}
 		/* Add a vid to the list */
 		vidmem = kmem_alloc(sizeof(struct vlanid_list), KM_SLEEP);
-		if (vidmem == NULL) {
-			error = ENOMEM;
-			goto viderr;
-		}
 		vidmem->vid = vid;
 		ETHER_LOCK(ec);
 		SIMPLEQ_INSERT_TAIL(>ec_vids, vidmem, vid_list);
@@ -502,7 +498,6 @@ vlan_config(struct ifvlan *ifv, struct i
 			 * HW tagging function.
 			 */
 			error = (*ec->ec_vlan_cb)(ec, vid, true);
-viderr:
 			if (error) {
 ec->ec_nvlans--;
 if (ec->ec_nvlans == 0) {
@@ -638,18 +633,21 @@ vlan_unconfig_locked(struct ifvlan *ifv,
 	case IFT_ETHER:
 	{
 		struct ethercom *ec = (void *)p;
-		struct vlanid_list *vlanidp, *tmpp;
+		struct vlanid_list *vlanidp;
 		uint16_t vid = EVL_VLANOFTAG(nmib->ifvm_tag);
 
 		ETHER_LOCK(ec);
-		SIMPLEQ_FOREACH_SAFE(vlanidp, >ec_vids, vid_list, tmpp) {
+		SIMPLEQ_FOREACH(vlanidp, >ec_vids, vid_list) {
 			if (vlanidp->vid == vid) {
 SIMPLEQ_REMOVE(>ec_vids, vlanidp,
 vlanid_list, vid_list);
-kmem_free(vlanidp, sizeof(*vlanidp));
+break;
 			}
 		}
 		ETHER_UNLOCK(ec);
+		if (vlanidp != NULL)
+			kmem_free(vlanidp, sizeof(*vlanidp));
+
 		if (ec->ec_vlan_cb != NULL) {
 			/*
 			 * Call ec_vlan_cb(). It will setup VLAN HW filter or
@@ -1038,7 +1036,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd
 			error = ENOENT;
 			break;
 		}
-		
+
 		error = vlan_config(ifv, pr, vlr.vlr_tag);
 		if (error != 0)
 			break;



CVS commit: src/games/fortune/datfiles

2019-08-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Aug 22 22:51:47 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Donnie Darko


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/games/fortune/datfiles/fortunes

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



CVS commit: src/games/fortune/datfiles

2019-08-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Aug 22 22:51:47 UTC 2019

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
Donnie Darko


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/games/fortune/datfiles/fortunes

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

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.82 src/games/fortune/datfiles/fortunes:1.83
--- src/games/fortune/datfiles/fortunes:1.82	Fri Jul 26 07:41:22 2019
+++ src/games/fortune/datfiles/fortunes	Thu Aug 22 22:51:47 2019
@@ -16271,3 +16271,5 @@ that was instantly responsive to every a
 you derive from that?
 		-- Douglas Engelbart, Fall Joint Computer Conference,
 		   December 9th, 1968
+%
+They made me do it



CVS commit: src/share/misc

2019-08-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Aug 22 21:30:47 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
ATF NURBS


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/share/misc/acronyms.comp

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



CVS commit: src/share/misc

2019-08-22 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Thu Aug 22 21:30:47 UTC 2019

Modified Files:
src/share/misc: acronyms.comp

Log Message:
ATF NURBS


To generate a diff of this commit:
cvs rdiff -u -r1.284 -r1.285 src/share/misc/acronyms.comp

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

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.284 src/share/misc/acronyms.comp:1.285
--- src/share/misc/acronyms.comp:1.284	Sat Aug 17 21:14:22 2019
+++ src/share/misc/acronyms.comp	Thu Aug 22 21:30:47 2019
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.284 2019/08/17 21:14:22 sevan Exp $
+$NetBSD: acronyms.comp,v 1.285 2019/08/22 21:30:47 sevan Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -109,6 +109,8 @@ AT	advanced technology
 ATA	advanced technology attachment
 ATAPI	advanced technology attachment packet interface
 ATC	address translation cache
+ATF	ARM trusted firmware
+ATF	automated testing framework
 ATM	asynchronous transfer mode
 ATX	advanced technology extended
 AV	anti virus
@@ -1044,6 +1046,7 @@ NSA	National Security Agency
 NTM	non-deterministic Turing machine
 NTP	Network Time Protocol
 NUMA	non-uniform memory access
+NURBS	non-uniform rational basis spline
 NVMM	NetBSD Virtual Machine Monitor
 NVMM	non-volatile main memory
 NVRAM	non-volatile random access memory



CVS commit: src/sys/netinet6

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 21:22:50 UTC 2019

Modified Files:
src/sys/netinet6: nd6.c nd6_nbr.c

Log Message:
nd6: notify userland of neighbour lla updates once more

XXX pullup -8 -9


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.166 -r1.167 src/sys/netinet6/nd6_nbr.c

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



CVS commit: src/sys/netinet6

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 21:22:50 UTC 2019

Modified Files:
src/sys/netinet6: nd6.c nd6_nbr.c

Log Message:
nd6: notify userland of neighbour lla updates once more

XXX pullup -8 -9


To generate a diff of this commit:
cvs rdiff -u -r1.258 -r1.259 src/sys/netinet6/nd6.c
cvs rdiff -u -r1.166 -r1.167 src/sys/netinet6/nd6_nbr.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/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.258 src/sys/netinet6/nd6.c:1.259
--- src/sys/netinet6/nd6.c:1.258	Thu Aug 22 21:14:46 2019
+++ src/sys/netinet6/nd6.c	Thu Aug 22 21:22:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $	*/
+/*	$NetBSD: nd6.c,v 1.259 2019/08/22 21:22:50 roy Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.259 2019/08/22 21:22:50 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1192,6 +1192,7 @@ nd6_free(struct llentry *ln, int gc)
 	struct nd_defrouter *dr;
 	struct ifnet *ifp;
 	struct in6_addr *in6;
+	struct sockaddr_in6 sin6;
 
 	KASSERT(ln != NULL);
 	LLE_WLOCK_ASSERT(ln);
@@ -1293,6 +1294,10 @@ nd6_free(struct llentry *ln, int gc)
 			LLE_WLOCK(ln);
 	}
 
+	sockaddr_in6_init(, in6, 0, 0, 0);
+	rt_clonedmsg(RTM_DELETE, sin6tosa(),
+	(const uint8_t *)>ll_addr, ifp);
+
 	/*
 	 * Save to unlock. We still hold an extra reference and will not
 	 * free(9) in llentry_free() if someone else holds one as well.
@@ -2225,11 +2230,13 @@ nd6_cache_lladdr(
 		break;
 	}
 
-#if 0
-	/* XXX should we send rtmsg as it used to be? */
-	if (do_update)
-		rt_newmsg(RTM_CHANGE, rt);  /* tell user process */
-#endif
+	if (do_update) {
+		struct sockaddr_in6 sin6;
+
+		sockaddr_in6_init(, from, 0, 0, 0);
+		rt_clonedmsg(is_newentry ? RTM_ADD : RTM_CHANGE,
+		sin6tosa(), lladdr, ifp);
+	}
 
 	if (ln != NULL) {
 		router = ln->ln_router;

Index: src/sys/netinet6/nd6_nbr.c
diff -u src/sys/netinet6/nd6_nbr.c:1.166 src/sys/netinet6/nd6_nbr.c:1.167
--- src/sys/netinet6/nd6_nbr.c:1.166	Mon Apr 29 16:12:30 2019
+++ src/sys/netinet6/nd6_nbr.c	Thu Aug 22 21:22:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6_nbr.c,v 1.166 2019/04/29 16:12:30 roy Exp $	*/
+/*	$NetBSD: nd6_nbr.c,v 1.167 2019/08/22 21:22:50 roy Exp $	*/
 /*	$KAME: nd6_nbr.c,v 1.61 2001/02/10 16:06:14 jinmei Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.166 2019/04/29 16:12:30 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6_nbr.c,v 1.167 2019/08/22 21:22:50 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -883,11 +883,13 @@ nd6_na_input(struct mbuf *m, int off, in
 	 */
 	ln->ln_asked = 0;
 	nd6_llinfo_release_pkts(ln, ifp);
-	/* FIXME */
-#if 0
-	if (rt_announce) /* tell user process about any new lladdr */
-		rt_newmsg(RTM_CHANGE, rt);
-#endif
+
+	if (rt_announce) {
+		struct sockaddr_in6 sin6;
+
+		sockaddr_in6_init(, , 0, 0, 0);
+		rt_clonedmsg(RTM_CHANGE, sin6tosa(), lladdr, ifp);
+	}
 
  freeit:
 	if (ln != NULL)



CVS commit: src/sys

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 21:14:46 UTC 2019

Modified Files:
src/sys/net: route.h rtsock.c
src/sys/netinet: if_arp.c
src/sys/netinet6: nd6.c

Log Message:
rtsock: rework rt_clonedmsg to take a message type and lladdr

We will use this in a future patch to notify userland of lladdr
changes.

XXX pullup -8 -9


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/net/route.h
cvs rdiff -u -r1.250 -r1.251 src/sys/net/rtsock.c
cvs rdiff -u -r1.283 -r1.284 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.257 -r1.258 src/sys/netinet6/nd6.c

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

Modified files:

Index: src/sys/net/route.h
diff -u src/sys/net/route.h:1.123 src/sys/net/route.h:1.124
--- src/sys/net/route.h:1.123	Mon Apr 29 16:12:30 2019
+++ src/sys/net/route.h	Thu Aug 22 21:14:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.h,v 1.123 2019/04/29 16:12:30 roy Exp $	*/
+/*	$NetBSD: route.h,v 1.124 2019/08/22 21:14:45 roy Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -521,8 +521,8 @@ void	rt_addrmsg_rt(int, struct ifaddr *,
 void	route_enqueue(struct mbuf *, int);
 
 struct llentry;
-void	rt_clonedmsg(const struct sockaddr *, const struct ifnet *,
-	const struct rtentry *);
+void	rt_clonedmsg(int, const struct sockaddr *, const uint8_t *,
+const struct ifnet *);
 
 void	rt_setmetrics(void *, struct rtentry *);
 

Index: src/sys/net/rtsock.c
diff -u src/sys/net/rtsock.c:1.250 src/sys/net/rtsock.c:1.251
--- src/sys/net/rtsock.c:1.250	Mon May 27 05:33:48 2019
+++ src/sys/net/rtsock.c	Thu Aug 22 21:14:45 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtsock.c,v 1.250 2019/05/27 05:33:48 ozaki-r Exp $	*/
+/*	$NetBSD: rtsock.c,v 1.251 2019/08/22 21:14:45 roy Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.250 2019/05/27 05:33:48 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtsock.c,v 1.251 2019/08/22 21:14:45 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -145,14 +145,14 @@ if_addrflags(struct ifaddr *ifa)
  * Send a routing message as mimicing that a cloned route is added.
  */
 void
-rt_clonedmsg(const struct sockaddr *dst, const struct ifnet *ifp,
-const struct rtentry *rt)
+rt_clonedmsg(int type, const struct sockaddr *dst, const uint8_t *lladdr,
+const struct ifnet *ifp)
 {
 	struct rt_addrinfo info;
 	/* Mimic flags exactly */
 #define RTF_LLINFO	0x400
 #define RTF_CLONED	0x2000
-	int flags = RTF_UP | RTF_HOST | RTF_DONE | RTF_LLINFO | RTF_CLONED;
+	int flags = RTF_HOST | RTF_DONE | RTF_LLINFO | RTF_CLONED;
 	union {
 		struct sockaddr sa;
 		struct sockaddr_storage ss;
@@ -161,16 +161,15 @@ rt_clonedmsg(const struct sockaddr *dst,
 	uint8_t namelen = strlen(ifp->if_xname);
 	uint8_t addrlen = ifp->if_addrlen;
 
-	if (rt == NULL)
-		return; /* XXX */
-
+	if (type != RTM_DELETE)
+		flags |= RTF_UP;
 	memset(, 0, sizeof(info));
 	info.rti_info[RTAX_DST] = dst;
 	sockaddr_dl_init(, sizeof(u.ss), ifp->if_index, ifp->if_type,
-	NULL, namelen, NULL, addrlen);
+	NULL, namelen, lladdr, addrlen);
 	info.rti_info[RTAX_GATEWAY] = 
 
-	rt_missmsg(RTM_ADD, , flags, 0);
+	rt_missmsg(type, , flags, 0);
 #undef RTF_LLINFO
 #undef RTF_CLONED
 }

Index: src/sys/netinet/if_arp.c
diff -u src/sys/netinet/if_arp.c:1.283 src/sys/netinet/if_arp.c:1.284
--- src/sys/netinet/if_arp.c:1.283	Mon Aug 19 03:23:30 2019
+++ src/sys/netinet/if_arp.c	Thu Aug 22 21:14:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_arp.c,v 1.283 2019/08/19 03:23:30 ozaki-r Exp $	*/
+/*	$NetBSD: if_arp.c,v 1.284 2019/08/22 21:14:46 roy Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.283 2019/08/19 03:23:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.284 2019/08/22 21:14:46 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -751,7 +751,8 @@ notfound:
 
 			arp_init_llentry(ifp, la);
 			sockaddr_in_init(, >r_l3addr.addr4, 0);
-			rt_clonedmsg(sintosa(), ifp, rt);
+			if (rt != NULL)
+rt_clonedmsg(RTM_ADD, sintosa(), NULL, ifp);
 		}
 	} else if (LLE_TRY_UPGRADE(la) == 0) {
 		create_lookup = "lookup";

Index: src/sys/netinet6/nd6.c
diff -u src/sys/netinet6/nd6.c:1.257 src/sys/netinet6/nd6.c:1.258
--- src/sys/netinet6/nd6.c:1.257	Wed Aug 14 08:34:44 2019
+++ src/sys/netinet6/nd6.c	Thu Aug 22 21:14:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: nd6.c,v 1.257 2019/08/14 08:34:44 ozaki-r Exp $	*/
+/*	$NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $	*/
 /*	$KAME: nd6.c,v 1.279 2002/06/08 11:16:51 itojun Exp $	*/
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.257 2019/08/14 08:34:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nd6.c,v 1.258 2019/08/22 21:14:46 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -2357,7 

CVS commit: src/sys

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 21:14:46 UTC 2019

Modified Files:
src/sys/net: route.h rtsock.c
src/sys/netinet: if_arp.c
src/sys/netinet6: nd6.c

Log Message:
rtsock: rework rt_clonedmsg to take a message type and lladdr

We will use this in a future patch to notify userland of lladdr
changes.

XXX pullup -8 -9


To generate a diff of this commit:
cvs rdiff -u -r1.123 -r1.124 src/sys/net/route.h
cvs rdiff -u -r1.250 -r1.251 src/sys/net/rtsock.c
cvs rdiff -u -r1.283 -r1.284 src/sys/netinet/if_arp.c
cvs rdiff -u -r1.257 -r1.258 src/sys/netinet6/nd6.c

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



CVS commit: src/libexec/lfs_cleanerd

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:28:08 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
Use getdiskrawname to find the device name

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/libexec/lfs_cleanerd/lfs_cleanerd.c

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



CVS commit: src/libexec/lfs_cleanerd

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:28:08 UTC 2019

Modified Files:
src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
Use getdiskrawname to find the device name

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/libexec/lfs_cleanerd/lfs_cleanerd.c

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

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.58 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.59
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.58	Fri Mar 18 10:10:21 2016
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Thu Aug 22 20:28:08 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.58 2016/03/18 10:10:21 mrg Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.59 2019/08/22 20:28:08 brad Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -213,7 +213,7 @@ init_fs(struct clfs *fs, char *fsname)
 	int rootfd;
 	int i;
 	void *sbuf;
-	char *bn;
+	size_t mlen;
 
 	/*
 	 * Get the raw device from the block device.
@@ -222,16 +222,17 @@ init_fs(struct clfs *fs, char *fsname)
 	 */
 	if (kops.ko_statvfs(fsname, , ST_WAIT) < 0)
 		return -1;
-	fs->clfs_dev = malloc(strlen(sf.f_mntfromname) + 2);
+	mlen = strlen(sf.f_mntfromname) + 2;
+	fs->clfs_dev = malloc(mlen);
 	if (fs->clfs_dev == NULL) {
 		syslog(LOG_ERR, "couldn't malloc device name string: %m");
 		return -1;
 	}
-	bn = strrchr(sf.f_mntfromname, '/');
-	bn = bn ? bn+1 : sf.f_mntfromname;
-	strlcpy(fs->clfs_dev, sf.f_mntfromname, bn - sf.f_mntfromname + 1);
-	strcat(fs->clfs_dev, "r");
-	strcat(fs->clfs_dev, bn);
+	if (getdiskrawname(fs->clfs_dev, mlen, sf.f_mntfromname) == NULL) {
+		syslog(LOG_ERR, "couldn't convert '%s' ro raw name: %m",
+		sf.f_mntfromname);
+		return -1;
+	}
 	if ((fs->clfs_devfd = kops.ko_open(fs->clfs_dev, O_RDONLY, 0)) < 0) {
 		syslog(LOG_ERR, "couldn't open device %s for reading",
 			fs->clfs_dev);



CVS commit: src/lib/libutil

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:23:43 UTC 2019

Modified Files:
src/lib/libutil: getdiskrawname.c

Log Message:
Teach getdiskrawname and getdiskcookedname about zvols.

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libutil/getdiskrawname.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/libutil/getdiskrawname.c
diff -u src/lib/libutil/getdiskrawname.c:1.5 src/lib/libutil/getdiskrawname.c:1.6
--- src/lib/libutil/getdiskrawname.c:1.5	Wed Sep 17 23:54:42 2014
+++ src/lib/libutil/getdiskrawname.c	Thu Aug 22 20:23:43 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: getdiskrawname.c,v 1.5 2014/09/17 23:54:42 christos Exp $	*/
+/*	$NetBSD: getdiskrawname.c,v 1.6 2019/08/22 20:23:43 brad Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: getdiskrawname.c,v 1.5 2014/09/17 23:54:42 christos Exp $");
+__RCSID("$NetBSD: getdiskrawname.c,v 1.6 2019/08/22 20:23:43 brad Exp $");
 
 #include 
 
@@ -70,10 +70,74 @@ resolve_link(char *buf, size_t bufsiz, c
 	return buf;
 }
 
+/*
+ * zvol device names look like:
+ * /dev/zvol/dsk/pool_name/.../volume_name
+ * /dev/zvol/rdsk/pool_name/.../volume_name
+ *
+ * ZFS pools can be divided nearly to infinity
+ *
+ * This allows for 16 pool names, which one would hope would be enough
+ */
+#define DISKMAXPARTS 20
+static int
+calc_zvol_name(char *buf, size_t bufsiz, const char *name, const char *raw)
+{
+	char copyname[PATH_MAX];
+	char *names[DISKMAXPARTS];
+	char *last, *p;
+	size_t i = 0;
+
+	strlcpy(copyname, name, sizeof(copyname));
+	for (p = strtok_r(copyname, "/", ); p;
+	 p = strtok_r(NULL, "/", )) {
+		if (i >= DISKMAXPARTS) {
+			errno =  ENOSPC;
+			return -1;
+		}
+		names[i++] = p;
+	}
+
+	if (i < 4) {
+		errno = EINVAL;
+		return -1;
+	}
+
+	snprintf(buf, bufsiz, "/dev/zvol/%sdsk", raw);
+	for (size_t j = 3; j < i; j++) {
+		strlcat(buf, "/", bufsiz);
+		strlcat(buf, names[j], bufsiz);
+	}
+	return 0;
+}
+
+static int
+calc_name(char *buf, size_t bufsiz, const char *name, const char *raw)
+{
+	int skip = 1;
+
+	if (strncmp("/dev/zvol/", name, 10) == 0)
+		return calc_zvol_name(buf, bufsiz, name, raw);
+
+	const char *dp = strrchr(name, '/');
+	if (!*raw && ((dp != NULL && dp[1] != 'r')
+		|| (dp == NULL && name[0] != 'r'))) {
+		errno = EINVAL;
+		return -1;
+	}
+	if (raw[0] != 'r')
+		skip = 2;
+	if (dp != NULL)
+		snprintf(buf, bufsiz, "%.*s/%s%s", (int)(dp - name),
+		name, raw, dp + skip);
+	else
+		snprintf(buf, bufsiz, "%s%s", raw, name);
+	return 0;
+}
+
 const char *
 getdiskrawname(char *buf, size_t bufsiz, const char *name)
 {
-	const char *dp;
 	struct stat st;
 	char dest[PATH_MAX];
 
@@ -82,8 +146,6 @@ getdiskrawname(char *buf, size_t bufsiz,
 		return NULL;
 	}
 
-	dp = strrchr(name, '/');
-
 	if (stat(name, ) == -1)
 		return NULL;
 
@@ -92,10 +154,8 @@ getdiskrawname(char *buf, size_t bufsiz,
 		return NULL;
 	}
 
-	if (dp != NULL)
-		(void)snprintf(buf, bufsiz, "%.*s/r%s", (int)(dp - name), name, dp + 1);
-	else
-		(void)snprintf(buf, bufsiz, "r%s", name);
+	if (calc_name(buf, bufsiz, name, "r") == -1)
+		return NULL;
 
 	return buf;
 }
@@ -103,7 +163,6 @@ getdiskrawname(char *buf, size_t bufsiz,
 const char *
 getdiskcookedname(char *buf, size_t bufsiz, const char *name)
 {
-	const char *dp;
 	struct stat st;
 	char dest[PATH_MAX];
 
@@ -112,13 +171,6 @@ getdiskcookedname(char *buf, size_t bufs
 		return NULL;
 	}
 
-	dp = strrchr(name, '/');
-
-	if ((dp != NULL && dp[1] != 'r') || (dp == NULL && name[0] != 'r')) {
-		errno = EINVAL;
-		return NULL;
-	}
-
 	if (stat(name, ) == -1)
 		return NULL;
 
@@ -127,10 +179,8 @@ getdiskcookedname(char *buf, size_t bufs
 		return NULL;
 	}
 
-	if (dp != NULL)
-		(void)snprintf(buf, bufsiz, "%.*s/%s", (int)(dp - name), name, dp + 2);
-	else
-		(void)snprintf(buf, bufsiz, "%s", name + 1);
+	if (calc_name(buf, bufsiz, name, "") == -1)
+		return NULL;
 
 	return buf;
 }



CVS commit: src/lib/libutil

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:23:43 UTC 2019

Modified Files:
src/lib/libutil: getdiskrawname.c

Log Message:
Teach getdiskrawname and getdiskcookedname about zvols.

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libutil/getdiskrawname.c

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



CVS commit: src/sbin/resize_lfs

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:26:07 UTC 2019

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

Log Message:
Use getdiskrawname to find the device name.

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/resize_lfs/resize_lfs.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/resize_lfs/resize_lfs.c
diff -u src/sbin/resize_lfs/resize_lfs.c:1.14 src/sbin/resize_lfs/resize_lfs.c:1.15
--- src/sbin/resize_lfs/resize_lfs.c:1.14	Sun Aug  2 18:18:09 2015
+++ src/sbin/resize_lfs/resize_lfs.c	Thu Aug 22 20:26:07 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: resize_lfs.c,v 1.14 2015/08/02 18:18:09 dholland Exp $	*/
+/*	$NetBSD: resize_lfs.c,v 1.15 2019/08/22 20:26:07 brad Exp $	*/
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "partutil.h"
 
@@ -98,7 +99,8 @@ main(int argc, char **argv)
 		err(1, "%s", fsname);
 	rdevlen = strlen(vfs.f_mntfromname) + 2;
 	rdev = malloc(rdevlen);
-	snprintf(rdev, rdevlen, "/dev/r%s", vfs.f_mntfromname + 5);
+	if (getdiskrawname(rdev, rdevlen, vfs.f_mntfromname) == NULL)
+		err(1, "Could not convert '%s' to raw name", vfs.f_mntfromname);
 	devfd = open(rdev, O_RDONLY);
 	if (devfd < 0)
 		err(1, "open raw device");



CVS commit: src/sbin/resize_lfs

2019-08-22 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Thu Aug 22 20:26:07 UTC 2019

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

Log Message:
Use getdiskrawname to find the device name.

Reviewed by Christos


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sbin/resize_lfs/resize_lfs.c

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



CVS commit: src

2019-08-22 Thread Adam Ciarcinski
Module Name:src
Committed By:   adam
Date:   Thu Aug 22 18:15:44 UTC 2019

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile

Log Message:
Fix building compiler_rt with MKCOMPAT=no; approved by kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile

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/base/md.amd64
diff -u src/distrib/sets/lists/base/md.amd64:1.278 src/distrib/sets/lists/base/md.amd64:1.279
--- src/distrib/sets/lists/base/md.amd64:1.278	Wed Aug 14 01:42:08 2019
+++ src/distrib/sets/lists/base/md.amd64	Thu Aug 22 18:15:44 2019
@@ -1,21 +1,21 @@
-# $NetBSD: md.amd64,v 1.278 2019/08/14 01:42:08 kamil Exp $
+# $NetBSD: md.amd64,v 1.279 2019/08/22 18:15:44 adam Exp $
 ./dev/lms0	base-obsolete		obsolete
 ./dev/mms0	base-obsolete		obsolete
 ./libexec/ld.elf_so-i386			base-sys-shlib		compat,pic
 ./usr/bin/fdformatbase-util-bin
 ./usr/bin/iasl	base-util-bin
 ./usr/bin/pmc	base-obsolete		obsolete
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.a	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so	comp-cxx-lib	compat,llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0	comp-cxx-lib	compat,llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-i386.so.0.0	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so.0	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-x86_64.so.0.0	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan-preinit-x86_64.a	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.asan_cxx-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dd-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.dyndd-x86_64.so	comp-cxx-lib	llvm
@@ -25,27 +25,27 @@
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.fuzzer_no_main-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.msan-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.msan_cxx-x86_64.a	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.safestack-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.tsan-x86_64.a	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.tsan_cxx-x86_64.a	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.a	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0.0	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so	comp-cxx-lib	compat,llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0	comp-cxx-lib	compat,llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-i386.so.0.0	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so.0	comp-cxx-lib	llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_minimal-x86_64.so.0.0	comp-cxx-lib	llvm
-./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.a	comp-cxx-lib	llvm
+./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-i386.a	comp-cxx-lib	compat,llvm
 ./usr/lib/clang/7.0.0/lib/netbsd/libclang_rt.ubsan_standalone-x86_64.a	comp-cxx-lib	llvm

CVS commit: src

2019-08-22 Thread Adam Ciarcinski
Module Name:src
Committed By:   adam
Date:   Thu Aug 22 18:15:44 UTC 2019

Modified Files:
src/distrib/sets/lists/base: md.amd64
src/external/bsd/compiler_rt/lib/clang/lib/netbsd: Makefile

Log Message:
Fix building compiler_rt with MKCOMPAT=no; approved by kamil@


To generate a diff of this commit:
cvs rdiff -u -r1.278 -r1.279 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.1 -r1.2 \
src/external/bsd/compiler_rt/lib/clang/lib/netbsd/Makefile

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



CVS commit: src/sbin/route

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 16:10:48 UTC 2019

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

Log Message:
route(8): print RTM_CHANGE messages

XXX Pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sbin/route/route.c

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



CVS commit: src/sbin/route

2019-08-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Thu Aug 22 16:10:48 UTC 2019

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

Log Message:
route(8): print RTM_CHANGE messages

XXX Pullup -9


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.160 src/sbin/route/route.c:1.161
--- src/sbin/route/route.c:1.160	Tue Aug 14 20:53:07 2018
+++ src/sbin/route/route.c	Thu Aug 22 16:10:48 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.160 2018/08/14 20:53:07 roy Exp $	*/
+/*	$NetBSD: route.c,v 1.161 2019/08/22 16:10:48 roy Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = "@(#)route.c	8.6 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: route.c,v 1.160 2018/08/14 20:53:07 roy Exp $");
+__RCSID("$NetBSD: route.c,v 1.161 2019/08/22 16:10:48 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -1460,6 +1460,7 @@ print_rtmsg(struct rt_msghdr *rtm, int m
 		printf("\n");
 		break;
 	case RTM_ADD:
+	case RTM_CHANGE:
 	case RTM_DELETE:
 	case RTM_GET:
 		(void)printf("pid %d, seq %d, errno %d, flags: ",



CVS commit: src/sys/arch/mac68k/dev

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 14:57:00 UTC 2019

Removed Files:
src/sys/arch/mac68k/dev: adbsys.c

Log Message:
Remove adbsys.c, which has been unused since 1998!


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r0 src/sys/arch/mac68k/dev/adbsys.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/mac68k/dev

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 14:57:00 UTC 2019

Removed Files:
src/sys/arch/mac68k/dev: adbsys.c

Log Message:
Remove adbsys.c, which has been unused since 1998!


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r0 src/sys/arch/mac68k/dev/adbsys.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/mac68k/conf

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 14:52:58 UTC 2019

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k

Log Message:
G/C obsoleted


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/mac68k/conf/files.mac68k

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



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

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 14:52:58 UTC 2019

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k

Log Message:
G/C obsoleted


To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/mac68k/conf/files.mac68k

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/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.129 src/sys/arch/mac68k/conf/files.mac68k:1.130
--- src/sys/arch/mac68k/conf/files.mac68k:1.129	Fri Jul 26 10:48:44 2019
+++ src/sys/arch/mac68k/conf/files.mac68k	Thu Aug 22 14:52:58 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.129 2019/07/26 10:48:44 rin Exp $
+#	$NetBSD: files.mac68k,v 1.130 2019/08/22 14:52:58 rin Exp $
 
 # mac68k-specific configuration info
 
@@ -69,10 +69,6 @@ file	arch/mac68k/dev/genfb_grfbus.c	genf
 
 file	arch/mac68k/dev/maccons.c	akbd & (macfb | genfb_grfbus)
 
-#device	ite: wsemuldisplaydev
-#attach	ite at wsdisplay
-#file	arch/mac68k/dev/ite_compat.c	ite needs-flag
-
 device	ae: ifnet, ether, arp, dp8390nic
 attach	ae at nubus with ae_nubus
 file	arch/mac68k/nubus/if_ae_nubus.c	ae_nubus
@@ -123,10 +119,6 @@ file	arch/mac68k/obio/sbc_obio.c	sbc_obi
 attach	esp at obio
 file	arch/mac68k/obio/esp.c		esp
 
-#device	qsc: scsi, ncr53c9x
-#attach	qsc at nubus
-#file	arch/mac68k/nubus/qsc.c		qsc
-
 #
 # Machine-independent ATA drivers
 #
@@ -142,7 +134,6 @@ file	arch/mac68k/nubus/cpi_nubus.c	cpi
 device	zsc { channel = -1 }
 attach	zsc at obio
 file	arch/mac68k/dev/zs.c		zsc needs-flag
-#file	arch/mac68k/dev/z8530sc.c	zsc
 file	dev/ic/z8530sc.c		zsc
 
 device	zstty: tty



CVS commit: src/usr.bin/audiocfg

2019-08-22 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Aug 22 14:40:14 UTC 2019

Modified Files:
src/usr.bin/audiocfg: main.c

Log Message:
Fix assertion of "audiocfg list " when n is an illegal index.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/main.c

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

Modified files:

Index: src/usr.bin/audiocfg/main.c
diff -u src/usr.bin/audiocfg/main.c:1.8 src/usr.bin/audiocfg/main.c:1.9
--- src/usr.bin/audiocfg/main.c:1.8	Wed May  8 14:36:12 2019
+++ src/usr.bin/audiocfg/main.c	Thu Aug 22 14:40:14 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.8 2019/05/08 14:36:12 isaki Exp $ */
+/* $NetBSD: main.c,v 1.9 2019/08/22 14:40:14 isaki Exp $ */
 
 /*
  * Copyright (c) 2010 Jared D. McNeill 
@@ -164,7 +164,12 @@ main(int argc, char *argv[])
 		if (errno)
 			usage(argv[0]);
 			/* NOTREACHED */
-		print_audiodev(audiodev_get(i), i);
+		adev = audiodev_get(i);
+		if (adev == NULL) {
+			fprintf(stderr, "no such device\n");
+			return EXIT_FAILURE;
+		}
+		print_audiodev(adev, i);
 	} else if (strcmp(argv[1], "default") == 0 && argc == 3) {
 		if (*argv[2] < '0' || *argv[2] > '9')
 			usage(argv[0]);



CVS commit: src/usr.bin/audiocfg

2019-08-22 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Aug 22 14:40:14 UTC 2019

Modified Files:
src/usr.bin/audiocfg: main.c

Log Message:
Fix assertion of "audiocfg list " when n is an illegal index.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/audiocfg/main.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/mac68k/mac68k

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 12:47:57 UTC 2019

Modified Files:
src/sys/arch/mac68k/mac68k: clock.c

Log Message:
Adjust GMT bias automatically by using data obtained from Mac OS,
unless RTC_OFFSET is set explicitly.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/mac68k/mac68k/clock.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/mac68k/mac68k

2019-08-22 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Aug 22 12:47:57 UTC 2019

Modified Files:
src/sys/arch/mac68k/mac68k: clock.c

Log Message:
Adjust GMT bias automatically by using data obtained from Mac OS,
unless RTC_OFFSET is set explicitly.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/mac68k/mac68k/clock.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/mac68k/mac68k/clock.c
diff -u src/sys/arch/mac68k/mac68k/clock.c:1.49 src/sys/arch/mac68k/mac68k/clock.c:1.50
--- src/sys/arch/mac68k/mac68k/clock.c:1.49	Tue Feb  8 20:20:18 2011
+++ src/sys/arch/mac68k/mac68k/clock.c	Thu Aug 22 12:47:57 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.49 2011/02/08 20:20:18 rmind Exp $	*/
+/*	$NetBSD: clock.c,v 1.50 2019/08/22 12:47:57 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -75,7 +75,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.49 2011/02/08 20:20:18 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.50 2019/08/22 12:47:57 rin Exp $");
+
+#include "opt_rtc_offset.h"
 
 #include 
 #include 
@@ -391,6 +393,12 @@ mac68k_gettime(todr_chip_handle_t tch, s
 		mac68k_trust_pram = 0;
 	}
 	tvp->tv_sec = timbuf;
+#if !defined(RTC_OFFSET) || RTC_OFFSET == 0
+	/*
+	 * Adjust GTM bias unless RTC_OFFSET is set explicitly.
+	 */
+	tvp->tv_sec -= macos_gmtbias * 60;
+#endif
 	tvp->tv_usec = 0;
 	return 0;
 }



CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 22 09:16:08 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c if_auereg.h

Log Message:
- move software parts into if_aue.c.
- s/Static/static/.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_auereg.h

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

Modified files:

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.159 src/sys/dev/usb/if_aue.c:1.160
--- src/sys/dev/usb/if_aue.c:1.159	Thu Aug 22 07:38:06 2019
+++ src/sys/dev/usb/if_aue.c	Thu Aug 22 09:16:08 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.159 2019/08/22 07:38:06 mrg Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.160 2019/08/22 09:16:08 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -70,14 +70,13 @@
 /*
  * TODO:
  * better error messages from rxstat
- * split out if_auevar.h
  * more error checks
  * investigate short rx problem
  * proper cleanup on errors
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.159 2019/08/22 07:38:06 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.160 2019/08/22 09:16:08 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -168,6 +167,73 @@ fail:
 #define AUEHIST_CALLARGSN(N,FMT,A,B,C,D) \
 USBHIST_CALLARGSN(auedebug,N,FMT,A,B,C,D)
 
+#define AUE_TX_LIST_CNT		1
+#define AUE_RX_LIST_CNT		1
+
+struct aue_softc;
+
+struct aue_chain {
+	struct aue_softc	*aue_sc;
+	struct usbd_xfer	*aue_xfer;
+	char			*aue_buf;
+	struct mbuf		*aue_mbuf;
+};
+
+struct aue_cdata {
+	struct aue_chain	aue_tx_chain[AUE_TX_LIST_CNT];
+	struct aue_chain	aue_rx_chain[AUE_RX_LIST_CNT];
+	struct aue_intrpkt	aue_ibuf;
+	int			aue_tx_prod;
+	int			aue_tx_cnt;
+};
+
+struct aue_softc {
+	device_t aue_dev;
+
+	struct ethercom		aue_ec;
+	struct mii_data		aue_mii;
+	krndsource_t	rnd_source;
+	struct lwp		*aue_thread;
+	int			aue_closing;
+	kcondvar_t		aue_domc;
+	kcondvar_t		aue_closemc;
+	kmutex_t		aue_mcmtx;
+#define GET_IFP(sc) (&(sc)->aue_ec.ec_if)
+#define GET_MII(sc) (&(sc)->aue_mii)
+
+	struct callout aue_stat_ch;
+
+	struct usbd_device	*aue_udev;
+	struct usbd_interface	*aue_iface;
+	uint16_t		aue_vendor;
+	uint16_t		aue_product;
+	int			aue_ed[AUE_ENDPT_MAX];
+	struct usbd_pipe	*aue_ep[AUE_ENDPT_MAX];
+	uint8_t			aue_link;
+	int			aue_if_flags;
+	struct aue_cdata	aue_cdata;
+
+	uint16_t		aue_flags;
+
+	int			aue_refcnt;
+	char			aue_dying;
+	char			aue_attached;
+	u_int			aue_rx_errs;
+	u_int			aue_intr_errs;
+	struct timeval		aue_rx_notice;
+
+	struct usb_task		aue_tick_task;
+	struct usb_task		aue_stop_task;
+
+	kmutex_t		aue_mii_lock;
+};
+
+#define AUE_TIMEOUT		1000
+#define AUE_BUFSZ		1536
+#define AUE_MIN_FRAMELEN	60
+#define AUE_TX_TIMEOUT		1 /* ms */
+#define AUE_INTR_INTERVAL	100 /* ms */
+
 /*
  * Various supported device vendors/products.
  */
@@ -179,7 +245,7 @@ struct aue_type {
 #define PII	0x0004		/* Pegasus II chip */
 };
 
-Static const struct aue_type aue_devs[] = {
+static const struct aue_type aue_devs[] = {
  {{ USB_VENDOR_3COM,		USB_PRODUCT_3COM_3C460B},	  PII },
  {{ USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_XX1},	  PNA | PII },
  {{ USB_VENDOR_ABOCOM,		USB_PRODUCT_ABOCOM_XX2},	  PII },
@@ -253,43 +319,43 @@ int aue_activate(device_t, enum devact);
 CFATTACH_DECL_NEW(aue, sizeof(struct aue_softc), aue_match, aue_attach,
 aue_detach, aue_activate);
 
-Static void aue_multithread(void *);
+static void aue_multithread(void *);
 
-Static void aue_reset_pegasus_II(struct aue_softc *);
-Static int aue_tx_list_init(struct aue_softc *);
-Static int aue_rx_list_init(struct aue_softc *);
-Static int aue_newbuf(struct aue_softc *, struct aue_chain *, struct mbuf *);
-Static int aue_send(struct aue_softc *, struct mbuf *, int);
-Static void aue_intr(struct usbd_xfer *, void *, usbd_status);
-Static void aue_rxeof(struct usbd_xfer *, void *, usbd_status);
-Static void aue_txeof(struct usbd_xfer *, void *, usbd_status);
-Static void aue_tick(void *);
-Static void aue_tick_task(void *);
-Static void aue_start(struct ifnet *);
-Static int aue_ioctl(struct ifnet *, u_long, void *);
-Static void aue_init(void *);
-Static void aue_stop(struct aue_softc *);
-Static void aue_watchdog(struct ifnet *);
-Static int aue_openpipes(struct aue_softc *);
-Static int aue_ifmedia_upd(struct ifnet *);
-
-Static int aue_eeprom_getword(struct aue_softc *, int);
-Static void aue_read_mac(struct aue_softc *, u_char *);
-Static int aue_miibus_readreg(device_t, int, int, uint16_t *);
-Static int aue_miibus_writereg(device_t, int, int, uint16_t);
-Static void aue_miibus_statchg(struct ifnet *);
-
-Static void aue_lock_mii(struct aue_softc *);
-Static void aue_unlock_mii(struct aue_softc *);
-
-Static void aue_setmulti(struct aue_softc *);
-Static uint32_t aue_crc(void *);
-Static void aue_reset(struct aue_softc *);
-
-Static int aue_csr_read_1(struct aue_softc *, int);
-Static 

CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 22 09:16:08 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c if_auereg.h

Log Message:
- move software parts into if_aue.c.
- s/Static/static/.


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/usb/if_auereg.h

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



Re: CVS commit: src/tests/net

2019-08-22 Thread Ryota Ozaki
On Tue, Aug 20, 2019 at 7:06 PM Ryota Ozaki  wrote:
>
> On Tue, Aug 20, 2019 at 6:58 PM Martin Husemann  wrote:
> >
> > On Tue, Aug 20, 2019 at 06:50:31PM +0900, Ryota Ozaki wrote:
> > > Hmm, okay, I'm going to disable the feature until the issue is addressed.
> >
> > Could it be page size related?
>
> I'm not sure.
>
> My fresh chroot environment for ATF tests on amd64 also fails so
> I guess I'm missing something important :-/

It seems that the official AFT tests work expectedly except for
evbarm-aarch64.  The leak checker uses vmstat -m with rumphijack
to get pool statistics from a rump kernel, however, for failed
cases, rumphijack doesn't work correctly and it gets pool statistics
of the host kernel, resulting in test failures.

I don't understand yet why rumphijack doesn't work for vmstat -m
in some cases and does work in other cases.

  ozaki-r


CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts

2019-08-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 22 08:32:34 UTC 2019

Modified Files:
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-rpi.dtsi

Log Message:
Revert a change I made to this file a long time ago so that is now matches
linux mainline again.  This fixes the rpi0w..

Tested on rpi0 and rpi0w by Jun Ebihara

PR/53284 (Support RPI3B+,RPI0W,RPI2-1.2)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi

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



CVS commit: src/sys/external/gpl2/dts/dist/arch/arm/boot/dts

2019-08-22 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Aug 22 08:32:34 UTC 2019

Modified Files:
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts: bcm2835-rpi.dtsi

Log Message:
Revert a change I made to this file a long time ago so that is now matches
linux mainline again.  This fixes the rpi0w..

Tested on rpi0 and rpi0w by Jun Ebihara

PR/53284 (Support RPI3B+,RPI0W,RPI2-1.2)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.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/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi
diff -u src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi:1.5 src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi:1.6
--- src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi:1.5	Sat May 25 11:48:05 2019
+++ src/sys/external/gpl2/dts/dist/arch/arm/boot/dts/bcm2835-rpi.dtsi	Thu Aug 22 08:32:34 2019
@@ -71,13 +71,13 @@
  {
 	pinctrl-names = "default";
 	pinctrl-0 = <_gpio48>;
-	status = "okay";
 	bus-width = <4>;
 };
 
  {
 	pinctrl-names = "default";
 	pinctrl-0 = <_gpio48>;
+	status = "okay";
 	bus-width = <4>;
 };
 



CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 22 07:38:06 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c usbdi.c

Log Message:
fix more kernhist vs 32 bit issues.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/usbdi.c

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

Modified files:

Index: src/sys/dev/usb/if_aue.c
diff -u src/sys/dev/usb/if_aue.c:1.158 src/sys/dev/usb/if_aue.c:1.159
--- src/sys/dev/usb/if_aue.c:1.158	Thu Aug 22 00:25:18 2019
+++ src/sys/dev/usb/if_aue.c	Thu Aug 22 07:38:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_aue.c,v 1.158 2019/08/22 00:25:18 mrg Exp $	*/
+/*	$NetBSD: if_aue.c,v 1.159 2019/08/22 07:38:06 mrg Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000
@@ -77,7 +77,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.158 2019/08/22 00:25:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.159 2019/08/22 07:38:06 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -317,8 +317,8 @@ aue_csr_read_1(struct aue_softc *sc, int
 
 	if (err) {
 		AUEHIST_FUNC();
-		AUEHIST_CALLARGS("%d: aue_csr_read_1: reg=%#x err=%#s",
-		device_unit(sc->aue_dev), reg, usbd_errstr(err), 0);
+		AUEHIST_CALLARGS("%d: aue_csr_read_1: reg=%#x err=%d",
+		device_unit(sc->aue_dev), reg, err, 0);
 		return 0;
 	}
 
@@ -345,8 +345,8 @@ aue_csr_read_2(struct aue_softc *sc, int
 
 	if (err) {
 		AUEHIST_FUNC();
-		AUEHIST_CALLARGS("%d: aue_csr_read_2: reg=%#x err=%s",
-		device_unit(sc->aue_dev), reg, usbd_errstr(err), 0);
+		AUEHIST_CALLARGS("%d: aue_csr_read_2: reg=%#x err=%d",
+		device_unit(sc->aue_dev), reg, err, 0);
 		return 0;
 	}
 
@@ -374,8 +374,8 @@ aue_csr_write_1(struct aue_softc *sc, in
 
 	if (err) {
 		AUEHIST_FUNC();
-		AUEHIST_CALLARGS("%d: aue_csr_write_1: reg=%#x err=%s",
-		device_unit(sc->aue_dev), reg, usbd_errstr(err), 0);
+		AUEHIST_CALLARGS("%d: aue_csr_write_1: reg=%#x err=%d",
+		device_unit(sc->aue_dev), reg, err, 0);
 		return -1;
 	}
 
@@ -403,8 +403,8 @@ aue_csr_write_2(struct aue_softc *sc, in
 
 	if (err) {
 		AUEHIST_FUNC();
-		AUEHIST_CALLARGS("%s: aue_csr_write_2: reg=%#x err=%s",
-		device_unit(sc->aue_dev), reg, usbd_errstr(err), 0);
+		AUEHIST_CALLARGS("%s: aue_csr_write_2: reg=%#x err=%d",
+		device_unit(sc->aue_dev), reg, err, 0);
 		return -1;
 	}
 
@@ -1362,7 +1362,7 @@ aue_tick_task(void *xsc)
 		if (mii->mii_media_status & IFM_ACTIVE &&
 		IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE) {
 			DPRINTFN(2, "%d: got link",
-			device_unit(sc->aue_dev), __func__, 0, 0);
+			device_unit(sc->aue_dev), 0, 0, 0);
 			sc->aue_link++;
 			if (IFQ_IS_EMPTY(>if_snd) == 0)
 aue_start(ifp);

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.183 src/sys/dev/usb/usbdi.c:1.184
--- src/sys/dev/usb/usbdi.c:1.183	Wed Aug 21 10:48:37 2019
+++ src/sys/dev/usb/usbdi.c	Thu Aug 22 07:38:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.183 2019/08/21 10:48:37 mrg Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.184 2019/08/22 07:38:06 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2012, 2015 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.183 2019/08/21 10:48:37 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.184 2019/08/22 07:38:06 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1105,7 +1105,7 @@ usbd_do_request_flags(struct usbd_device
 
 	USBHIST_FUNC();
 	USBHIST_CALLARGS(usbdebug, "dev=%#jx req=%jx flgas=%jx len=%jx",
-	(uintptr_t)dev, (uintptr_t)req, flags, actlen);
+	(uintptr_t)dev, (uintptr_t)req, flags, *actlen);
 
 	ASSERT_SLEEPABLE();
 



CVS commit: src/sys/dev/usb

2019-08-22 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Aug 22 07:38:06 UTC 2019

Modified Files:
src/sys/dev/usb: if_aue.c usbdi.c

Log Message:
fix more kernhist vs 32 bit issues.


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/dev/usb/if_aue.c
cvs rdiff -u -r1.183 -r1.184 src/sys/dev/usb/usbdi.c

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