CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: christos Date: Mon Aug 12 05:40:42 UTC 2019 Modified Files: src/external/gpl3/gdb/dist/gdb: auxv.c Log Message: On NetBSD the auxv tag is always 32 bits long. Gdb assumes it is 64 on _LP64. This works most of the time, except for 64 bit big endian (sparc64 eg). To generate a diff of this commit: cvs rdiff -u -r1.1.1.7 -r1.2 src/external/gpl3/gdb/dist/gdb/auxv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/xbase
Module Name:src Committed By: uki Date: Mon Aug 12 03:51:23 UTC 2019 Modified Files: src/distrib/sets/lists/xbase: shl.mi Log Message: Give syspkg names to xbase shl.mi files To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/distrib/sets/lists/xbase/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/xbase
Module Name:src Committed By: uki Date: Mon Aug 12 03:51:23 UTC 2019 Modified Files: src/distrib/sets/lists/xbase: shl.mi Log Message: Give syspkg names to xbase shl.mi files To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/distrib/sets/lists/xbase/shl.mi 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/xbase/shl.mi diff -u src/distrib/sets/lists/xbase/shl.mi:1.87 src/distrib/sets/lists/xbase/shl.mi:1.88 --- src/distrib/sets/lists/xbase/shl.mi:1.87 Sat Jul 20 02:06:12 2019 +++ src/distrib/sets/lists/xbase/shl.mi Mon Aug 12 03:51:23 2019 @@ -1,317 +1,317 @@ -# $NetBSD: shl.mi,v 1.87 2019/07/20 02:06:12 mrg Exp $ +# $NetBSD: shl.mi,v 1.88 2019/08/12 03:51:23 uki Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # -./usr/X11R7/lib/X11/locale/lib/common/ximcp.so -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2.0 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so.2 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so.2.0 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so.2 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so.2.0 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so.2 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so.2.0 -unknown- xorg +./usr/X11R7/lib/X11/locale/lib/common/ximcp.so xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/ximcp.so.2.0 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so.2 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcDef.so.2.0 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so.2 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlcUTF8Load.so.2.0 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so.2 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xlibi18n.so.2.0 xbase-libX11-lib xorg ./usr/X11R7/lib/X11/locale/lib/common/xlocale.so xbase-obsolete obsolete ./usr/X11R7/lib/X11/locale/lib/common/xlocale.so.2 xbase-obsolete obsolete ./usr/X11R7/lib/X11/locale/lib/common/xlocale.so.2.0 xbase-obsolete obsolete -./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so.2 -unknown- xorg -./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so.2.0 -unknown- xorg -./usr/X11R7/lib/libEGL.so -unknown- xorg,compatx11file,xorg_glamor -./usr/X11R7/lib/libEGL.so.0 -unknown- xorg,compatx11file,xorg_glamor -./usr/X11R7/lib/libEGL.so.0.0 -unknown- xorg,compatx11file,xorg_glamor -./usr/X11R7/lib/libFS.so -unknown- xorg,compatx11file -./usr/X11R7/lib/libFS.so.7 -unknown- xorg,compatx11file -./usr/X11R7/lib/libFS.so.7.0 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGL.so -unknown- xorg,compatx11file -./usr/X11R7/lib/libGL.so.3 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGL.so.3.0 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLU.so -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLU.so.3 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLU.so.3.0 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLw.so -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLw.so.2 -unknown- xorg,compatx11file -./usr/X11R7/lib/libGLw.so.2.0 -unknown- xorg,compatx11file -./usr/X11R7/lib/libICE.so -unknown- xorg,compatx11file -./usr/X11R7/lib/libICE.so.7 -unknown- xorg,compatx11file -./usr/X11R7/lib/libICE.so.7.0 -unknown- xorg,compatx11file +./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so.2 xbase-libX11-lib xorg +./usr/X11R7/lib/X11/locale/lib/common/xomGeneric.so.2.0 xbase-libX11-lib xorg +./usr/X11R7/lib/libEGL.so xbase-libEGL-lib xorg,compatx11file,xorg_glamor +./usr/X11R7/lib/libEGL.so.0 xbase-libEGL-lib xorg,compatx11file,xorg_glamor +./usr/X11R7/lib/libEGL.so.0.0 xbase-libEGL-lib xorg,compatx11file,xorg_glamor +./usr/X11R7/lib/libFS.so xbase-libFS-lib xorg,compatx11file +./usr/X11R7/lib/libFS.so.7 xbase-libFS-lib xorg,compatx11file +./usr/X11R7/lib/libFS.so.7.0 xbase-libFS-lib xorg,compatx11file +./usr/X11R7/lib/libGL.so xbase-libGL-lib xorg,compatx11file +./usr/X11R7/lib/libGL.so.3 xbase-libGL-lib xorg,compatx11file
CVS commit: src/distrib/sets/lists/xbase
Module Name:src Committed By: uki Date: Mon Aug 12 03:48:32 UTC 2019 Modified Files: src/distrib/sets/lists/xbase: md.amd64 md.evbarm md.i386 Log Message: Change xbase MD package names for more correctly To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/distrib/sets/lists/xbase/md.amd64 cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/xbase/md.evbarm cvs rdiff -u -r1.32 -r1.33 src/distrib/sets/lists/xbase/md.i386 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/xbase
Module Name:src Committed By: uki Date: Mon Aug 12 03:48:32 UTC 2019 Modified Files: src/distrib/sets/lists/xbase: md.amd64 md.evbarm md.i386 Log Message: Change xbase MD package names for more correctly To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/distrib/sets/lists/xbase/md.amd64 cvs rdiff -u -r1.4 -r1.5 src/distrib/sets/lists/xbase/md.evbarm cvs rdiff -u -r1.32 -r1.33 src/distrib/sets/lists/xbase/md.i386 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/xbase/md.amd64 diff -u src/distrib/sets/lists/xbase/md.amd64:1.18 src/distrib/sets/lists/xbase/md.amd64:1.19 --- src/distrib/sets/lists/xbase/md.amd64:1.18 Thu Jun 13 12:01:20 2019 +++ src/distrib/sets/lists/xbase/md.amd64 Mon Aug 12 03:48:32 2019 @@ -1,25 +1,25 @@ -# $NetBSD: md.amd64,v 1.18 2019/06/13 12:01:20 uki Exp $ -./usr/X11R7/lib/libI810XvMC.so xbase-i810-lib xorg,compatx11file -./usr/X11R7/lib/libI810XvMC.so.1 xbase-i810-lib xorg,compatx11file -./usr/X11R7/lib/libI810XvMC.so.1.0 xbase-i810-lib xorg,compatx11file -./usr/X11R7/lib/libIntelXvMC.so xbase-xvmc-lib xorg,compatx11file -./usr/X11R7/lib/libIntelXvMC.so.1 xbase-xvmc-lib xorg,compatx11file -./usr/X11R7/lib/libIntelXvMC.so.1.0 xbase-xvmc-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMC.so xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMC.so.1 xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMC.so.1.0 xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMCPro.so xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMCPro.so.1 xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libchromeXvMCPro.so.1.0 xbase-openchrome-lib xorg,compatx11file -./usr/X11R7/lib/libdrm_amdgpu.so xbase-libdrm-amdgpu xorg,compatx11file -./usr/X11R7/lib/libdrm_amdgpu.so.1 xbase-libdrm-amdgpu xorg,compatx11file -./usr/X11R7/lib/libdrm_amdgpu.so.1.0 xbase-libdrm-amdgpu xorg,compatx11file -./usr/X11R7/lib/libdrm_intel.so xbase-libdrm-intel xorg,compatx11file -./usr/X11R7/lib/libdrm_intel.so.0 xbase-libdrm-intel xorg,compatx11file -./usr/X11R7/lib/libdrm_intel.so.0.2 xbase-libdrm-intel xorg,compatx11file -./usr/X11R7/lib/libdrm_nouveau.so xbase-libdrm-nouveau xorg,compatx11file -./usr/X11R7/lib/libdrm_nouveau.so.3 xbase-libdrm-nouveau xorg,compatx11file -./usr/X11R7/lib/libdrm_nouveau.so.3.0 xbase-libdrm-nouveau xorg,compatx11file +# $NetBSD: md.amd64,v 1.19 2019/08/12 03:48:32 uki Exp $ +./usr/X11R7/lib/libI810XvMC.so xbase-libI810XvMC-lib xorg,compatx11file +./usr/X11R7/lib/libI810XvMC.so.1 xbase-libI810XvMC-lib xorg,compatx11file +./usr/X11R7/lib/libI810XvMC.so.1.0 xbase-libI810XvMC-lib xorg,compatx11file +./usr/X11R7/lib/libIntelXvMC.so xbase-libIntelXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libIntelXvMC.so.1 xbase-libIntelXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libIntelXvMC.so.1.0 xbase-libIntelXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMC.so xbase-libchromeXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMC.so.1 xbase-libchromeXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMC.so.1.0 xbase-libchromeXvMC-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMCPro.so xbase-libchromeXvMCPro-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMCPro.so.1 xbase-libchromeXvMCPro-lib xorg,compatx11file +./usr/X11R7/lib/libchromeXvMCPro.so.1.0 xbase-libchromeXvMCPro-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_amdgpu.so xbase-libdrm_amdgpu-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_amdgpu.so.1 xbase-libdrm_amdgpu-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_amdgpu.so.1.0 xbase-libdrm_amdgpu-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_intel.so xbase-libdrm_intel-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_intel.so.0 xbase-libdrm_intel-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_intel.so.0.2 xbase-libdrm_intel-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_nouveau.so xbase-libdrm_nouveau-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_nouveau.so.3 xbase-libdrm_nouveau-lib xorg,compatx11file +./usr/X11R7/lib/libdrm_nouveau.so.3.0 xbase-libdrm_nouveau-lib xorg,compatx11file ./usr/X11R7/lib/libvdpau.so xbase-libvdpau-lib xorg,compatx11file ./usr/X11R7/lib/libvdpau.so.1 xbase-libvdpau-lib xorg,compatx11file ./usr/X11R7/lib/libvdpau.so.1.0 xbase-libvdpau-lib xorg,compatx11file Index: src/distrib/sets/lists/xbase/md.evbarm diff -u src/distrib/sets/lists/xbase/md.evbarm:1.4 src/distrib/sets/lists/xbase/md.evbarm:1.5 --- src/distrib/sets/lists/xbase/md.evbarm:1.4 Thu Jun 13 12:01:20 2019 +++ src/distrib/sets/lists/xbase/md.evbarm Mon Aug 12 03:48:32 2019 @@ -1,7 +1,7 @@ -# $NetBSD: md.evbarm,v 1.4 2019/06/13 12:01:20 uki Exp $ -./usr/X11R7/lib/libdrm_nouveau.so xbase-libdrm-nouveau xorg -./usr/X11R7/lib/libdrm_nouveau.so.3 xbase-libdrm-nouveau
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Mon Aug 12 00:01:23 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: remove mention of dv_private and note that usbnet must be first. fix Ethernet capitalisation in one place. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 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/share/man/man9
Module Name:src Committed By: mrg Date: Mon Aug 12 00:01:23 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: remove mention of dv_private and note that usbnet must be first. fix Ethernet capitalisation in one place. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 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.4 src/share/man/man9/usbnet.9:1.5 --- src/share/man/man9/usbnet.9:1.4 Sun Aug 11 22:03:16 2019 +++ src/share/man/man9/usbnet.9 Mon Aug 12 00:01:23 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.4 2019/08/11 22:03:16 wiz Exp $ +.\" $NetBSD: usbnet.9,v 1.5 2019/08/12 00:01:23 mrg Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -152,11 +152,9 @@ that will be described below. For autoconfiguration the device attach routine is expected to ensure that this device's .Va struct usbnet -is set to the device -.Fa dv_private , -if it can not be used directly as the device softc, as well as set -up the necessary structure members, find end-points, find the -Ethernet address if relevant, call +is the first member of the device softc, if it can not be used directly +as the device softc, as well as set up the necessary structure members, +find end-points, find the Ethernet address if relevant, call .Fn usbnet_attach , set up interface, Ethernet, and MII capabilities, and finally call .Fn usbnet_attach_ifp . @@ -682,7 +680,7 @@ The majority of the driver's existing structure can likely be replaced with usage of .Va struct usbnet and its related functionality. -This includes at least the device_t pointer, ethernet address, the +This includes at least the device_t pointer, Ethernet address, the ethercom and mii_data structures, end point descriptors, usbd device, interface, and task and callout structures (both these probably go away entirely) and all the associated watchdog handling,
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Sun Aug 11 23:55:43 UTC 2019 Modified Files: src/sys/dev/usb: if_axe.c if_smsc.c if_ure.c if_urndis.c usbnet.c Log Message: don't set dv_private. it's a bad pattern and only didn't trip kmem_free() lossage because struct usbnet is at the start of the softc. for now, enforce this as part of the ABI. catch up urndis with tx_prepare checking buffer length, and also add an assert to usbnet_start_locked() to match. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/dev/usb/if_axe.c cvs rdiff -u -r1.55 -r1.56 src/sys/dev/usb/if_smsc.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/if_ure.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_urndis.c cvs rdiff -u -r1.12 -r1.13 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
Module Name:src Committed By: mrg Date: Sun Aug 11 23:55:43 UTC 2019 Modified Files: src/sys/dev/usb: if_axe.c if_smsc.c if_ure.c if_urndis.c usbnet.c Log Message: don't set dv_private. it's a bad pattern and only didn't trip kmem_free() lossage because struct usbnet is at the start of the softc. for now, enforce this as part of the ABI. catch up urndis with tx_prepare checking buffer length, and also add an assert to usbnet_start_locked() to match. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/dev/usb/if_axe.c cvs rdiff -u -r1.55 -r1.56 src/sys/dev/usb/if_smsc.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/if_ure.c cvs rdiff -u -r1.28 -r1.29 src/sys/dev/usb/if_urndis.c cvs rdiff -u -r1.12 -r1.13 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/if_axe.c diff -u src/sys/dev/usb/if_axe.c:1.112 src/sys/dev/usb/if_axe.c:1.113 --- src/sys/dev/usb/if_axe.c:1.112 Sun Aug 11 05:14:41 2019 +++ src/sys/dev/usb/if_axe.c Sun Aug 11 23:55:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.112 2019/08/11 05:14:41 mrg Exp $ */ +/* $NetBSD: if_axe.c,v 1.113 2019/08/11 23:55:43 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.112 2019/08/11 05:14:41 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.113 2019/08/11 23:55:43 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -873,8 +873,7 @@ axe_attach(device_t parent, device_t sel unsigned bufsz; int i; - /* Switch to usbnet for device_private() */ - self->dv_private = un; + KASSERT((void *)sc == un); aprint_naive("\n"); aprint_normal("\n"); Index: src/sys/dev/usb/if_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.55 src/sys/dev/usb/if_smsc.c:1.56 --- src/sys/dev/usb/if_smsc.c:1.55 Sun Aug 11 12:16:59 2019 +++ src/sys/dev/usb/if_smsc.c Sun Aug 11 23:55:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.55 2019/08/11 12:16:59 skrll Exp $ */ +/* $NetBSD: if_smsc.c,v 1.56 2019/08/11 23:55:43 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.55 2019/08/11 12:16:59 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.56 2019/08/11 23:55:43 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -823,8 +823,7 @@ smsc_attach(device_t parent, device_t se int err, i; uint32_t mac_h, mac_l; - /* Switch to usbnet for device_private() */ - self->dv_private = un; + KASSERT((void *)sc == un); aprint_naive("\n"); aprint_normal("\n"); Index: src/sys/dev/usb/if_ure.c diff -u src/sys/dev/usb/if_ure.c:1.24 src/sys/dev/usb/if_ure.c:1.25 --- src/sys/dev/usb/if_ure.c:1.24 Sun Aug 11 08:57:36 2019 +++ src/sys/dev/usb/if_ure.c Sun Aug 11 23:55:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ure.c,v 1.24 2019/08/11 08:57:36 skrll Exp $ */ +/* $NetBSD: if_ure.c,v 1.25 2019/08/11 23:55:43 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.24 2019/08/11 08:57:36 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.25 2019/08/11 23:55:43 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -842,9 +842,6 @@ ure_attach(device_t parent, device_t sel uint8_t eaddr[8]; /* 2byte padded */ char *devinfop; - /* Switch to usbnet for device_private() */ - self->dv_private = un; - aprint_naive("\n"); aprint_normal("\n"); devinfop = usbd_devinfo_alloc(dev, 0); Index: src/sys/dev/usb/if_urndis.c diff -u src/sys/dev/usb/if_urndis.c:1.28 src/sys/dev/usb/if_urndis.c:1.29 --- src/sys/dev/usb/if_urndis.c:1.28 Sun Aug 11 13:16:10 2019 +++ src/sys/dev/usb/if_urndis.c Sun Aug 11 23:55:43 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_urndis.c,v 1.28 2019/08/11 13:16:10 hannken Exp $ */ +/* $NetBSD: if_urndis.c,v 1.29 2019/08/11 23:55:43 mrg Exp $ */ /* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */ /* @@ -21,7 +21,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.28 2019/08/11 13:16:10 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.29 2019/08/11 23:55:43 mrg Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -720,6 +720,11 @@ urndis_tx_prepare(struct usbnet *un, str { struct rndis_packet_msg *msg; + usbnet_isowned_tx(un); + + if (m->m_pkthdr.len > un->un_tx_bufsz - sizeof(*msg)) + return 0; + msg = (struct rndis_packet_msg *)c->unc_buf; memset(msg, 0, sizeof(*msg)); @@ -929,8 +934,7 @@ urndis_attach(device_t parent, device_t uint32_t filter; char*devinfop; - /* Switch to usbnet for device_private() */ - self->dv_private = un; + KASSERT((void
CVS commit: src/sys/dev/usb
Module Name:src Committed By: mrg Date: Sun Aug 11 22:55:03 UTC 2019 Modified Files: src/sys/dev/usb: ohci.c Log Message: relax an assert to be mutex_owned || polling. half of the patch i sent for netbsd-8 in PR#54331. the other half is already applied. To generate a diff of this commit: cvs rdiff -u -r1.289 -r1.290 src/sys/dev/usb/ohci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.sbin/npf
Module Name:src Committed By: gutteridge Date: Sun Aug 11 22:27:15 UTC 2019 Modified Files: src/usr.sbin/npf: npf.7 Log Message: npf.7: add xref to npf-params.7 (Adding directly here since this particular file isn't included in rmind@'s upstream GitHub repo at present.) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npf.7 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/npf.7 diff -u src/usr.sbin/npf/npf.7:1.6 src/usr.sbin/npf/npf.7:1.7 --- src/usr.sbin/npf/npf.7:1.6 Sat Jan 19 21:19:32 2019 +++ src/usr.sbin/npf/npf.7 Sun Aug 11 22:27:15 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: npf.7,v 1.6 2019/01/19 21:19:32 rmind Exp $ +.\" $NetBSD: npf.7,v 1.7 2019/08/11 22:27:15 gutteridge Exp $ .\" .\" Copyright (c) 2009-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -27,7 +27,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd December 29, 2018 +.Dd August 11, 2019 .Dt NPF 7 .Os .Sh NAME @@ -79,6 +79,7 @@ documentation website and other manual p .Xr bpf 4 , .Xr bpfjit 4 , .Xr npf.conf 5 , +.Xr npf-params 7 , .Xr pcap-filter 7 , .Xr npfctl 8 , .Xr npfd 8
CVS commit: src/usr.sbin/npf
Module Name:src Committed By: gutteridge Date: Sun Aug 11 22:27:15 UTC 2019 Modified Files: src/usr.sbin/npf: npf.7 Log Message: npf.7: add xref to npf-params.7 (Adding directly here since this particular file isn't included in rmind@'s upstream GitHub repo at present.) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/npf/npf.7 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
Module Name:src Committed By: wiz Date: Sun Aug 11 22:03:16 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Minor fixes. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 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/share/man/man9
Module Name:src Committed By: wiz Date: Sun Aug 11 22:03:16 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Minor fixes. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 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.3 src/share/man/man9/usbnet.9:1.4 --- src/share/man/man9/usbnet.9:1.3 Sun Aug 11 21:33:08 2019 +++ src/share/man/man9/usbnet.9 Sun Aug 11 22:03:16 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.3 2019/08/11 21:33:08 mrg Exp $ +.\" $NetBSD: usbnet.9,v 1.4 2019/08/11 22:03:16 wiz Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -755,7 +755,8 @@ framework handles pipes and transfers an The .Nm framework provides four locks for the system: normal device/softc lock, -receive and transmit locks, and the MII lock. The normal locking order +receive and transmit locks, and the MII lock. +The normal locking order for these locks is ifnet lock -> usbnet lock -> usbnet rxlock -> usbne txlock, or, ifnet lock -> usbnet lock -> MII lock. .It MII handling @@ -767,9 +768,9 @@ These functions are called with the 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 -.Fr int +.Vt int to -.Fr usbd_status +.Vt usbd_status and should use .Dv USBD_NORMAL_COMPLETION for success. @@ -781,7 +782,7 @@ and .Fn usbnet_havelink . Other ifmedia callbacks that were passed to .Fn ifmedia_init -should be deleted and any work moved into +should be deleted and any work moved into .Dq uno_statchg . .It Receive and Transmit The @@ -816,8 +817,11 @@ Be sure to call .Fn usbent_set_link during any status change event. .Pp -Many locking issues are hidden without LOCKDEBUG, including hard-hangs. -It's highly recommended to develop with LOCKDEBUG. +Many locking issues are hidden without +.Dv LOCKDEBUG , +including hard-hangs. +It's highly recommended to develop with +.Dv LOCKDEBUG . .Pp The .Va usbnet @@ -826,7 +830,6 @@ array is unsigned and should use .Dq 0 as the no-endpoint value. .El -.Pp .Sh SEE ALSO .Xr usb 4 , .Xr driver 9 ,
CVS commit: src/share/man/man9
Module Name:src Committed By: mrg Date: Sun Aug 11 21:33:09 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: minor rewording of a few places and add a new section to describe the type of changes required to port a driver to usbnet interfaces. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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/share/man/man9
Module Name:src Committed By: mrg Date: Sun Aug 11 21:33:09 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: minor rewording of a few places and add a new section to describe the type of changes required to port a driver to usbnet interfaces. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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.2 src/share/man/man9/usbnet.9:1.3 --- src/share/man/man9/usbnet.9:1.2 Sun Aug 11 08:26:46 2019 +++ src/share/man/man9/usbnet.9 Sun Aug 11 21:33:08 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.2 2019/08/11 08:26:46 wiz Exp $ +.\" $NetBSD: usbnet.9,v 1.3 2019/08/11 21:33:08 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 10, 2019 +.Dd August 11, 2019 .Dt USBNET 9 .Os .Sh NAME @@ -599,6 +599,11 @@ callback must convert the provided into the provided .Va struct usbnet_chain performing any device-specific padding, checksum, header or other. +Note that this callback must check that it is not attempting to copy +more than the chain buffer size, as set in the +.Va usbnet +.Dq un_tx_bufsz +member. This callback is only called once per packet. .Pp The @@ -638,16 +643,190 @@ using the function (instead of the .Fn usbd_open_pipe function.) -To enable the -.Dq uno_intr -callback the +To enable the this callback point the .Va struct usbnet member .Dq un_intr -must point to a +to a .Va struct usbnet_intr -structure that has the data buffer, size and interval to be passed to +structure with these members set: +.Bl -tag -width 4n +.It uni_buf +Data buffer for interrupt status relies. +.It uni_bufsz +Size of the above buffer. +.It uni_interval +Interval in millieconds. +.El +.Pp +These values will be passed to .Fn usbd_open_pipe_intr . +.Sh CONVERTING OLD-STYLE DRIVERS +The porting of an older driver to the +.Nm +framework is largely an effort in deleting code. +The process involves making these changes: +.Bl -tag -width 4n +.It Headers +Many headers are included in +.Pa usbnet.h +and can be removed from the driver, as well as headers no longer used, +such as +.Pa callout.h +and +.Pa rndsource.h , +etc. +.It Device softc +The majority of the driver's existing +.Dq softc +structure can likely be replaced with usage of +.Va struct usbnet +and its related functionality. +This includes at least the device_t pointer, ethernet address, the +ethercom and mii_data structures, end point descriptors, usbd device, +interface, and task and callout structures (both these probably go +away entirely) and all the associated watchdog handling, +timevals, list size, buffer size and xfer flags for +both Rx, and Tx, and interrupt notices, interface flags, device link, +PHY number, chain data, locks including Rx, Tx, MII, and the +base softc lock. +There is a driver-only +.Dq un_flags +in the +.Va usbnet +structure available for drivers to use. +.Pp +Many drivers can use the +.Va usbnet +structure as the device private storage passed to +.Dv CFATTACH_DECL_NEW . +Many internal functions to the driver may look better if switched to +operate on the device's +.Va usbnet +as, for example, the +.Va usbd_device +value is now available (and must be set by the driver) in the +.Va usbnet , +which may be needed for any call to +.Fn usbd_do_request . +The standard endpoint values must be stored in the +.Nm +.Dq un_ed[] +array. +.Pp +As +.Nm +manages xfer chains all code related to the opening, closing, aborting +and transferring of data on pipes is performed by the framework based +upon the buffer size and more provided in +.Va subnet , +so all code related to them should be deleted. +.It Interface setup +The vast majority of interface specific code should be deleted. +For device-specific interface values, the +.Va ifnet +flags and exflags can be set, as well as the +.Va ethercom +.Dq ec_capabilities +member, before calling +.Fn usbnet_attach_ifp . +All calls to +.Fn ifmedia_init , +.Fn mii_attach , +.Fn ifmedia_add , +.Fn ifmedia_set , +.Fn if_attach , +.Fn ether_ifattach , +.Fn rnd_attach_source , +and +.Fn usbd_add_drv_event +should be eliminated. +The device +.Dq ioctl +routine can use the default handling with a callback for additional +device specific programming (multicast filters, etc.), which can be +empty, or, the override ioctl can be used for heavier requirements. +The device +.Dq stop +routine is replaced with a simple call that turns off the +device-specific transmitter and receiver if necessary, as the +framework handles pipes and transfers and buffers. +.It Device locking +The +.Nm +framework provides four locks for the system: normal device/softc lock, +receive and transmit locks, and the
CVS commit: src
Module Name:src Committed By: rmind Date: Sun Aug 11 20:26:34 UTC 2019 Modified Files: src/sys/net/npf: npf.c npf_conf.c npf_conn.h npf_ctl.c npf_handler.c npf_if.c npf_impl.h npf_inet.c npf_nat.c npf_os.c npf_params.c npf_portmap.c npf_worker.c npfkern.h src/usr.sbin/npf/npftest/libnpftest: npf_conn_test.c npf_nat_test.c npf_perf_test.c npf_rule_test.c npf_test_subr.c Log Message: Adjust some internal NPF APIs: * npfkern: use the npfk_ prefix. * NPF portmap: amend the API so it could be used elsewhere. * Make npf_connkey_t public. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/net/npf/npf.c cvs rdiff -u -r1.13 -r1.14 src/sys/net/npf/npf_conf.c \ src/sys/net/npf/npf_os.c cvs rdiff -u -r1.17 -r1.18 src/sys/net/npf/npf_conn.h cvs rdiff -u -r1.54 -r1.55 src/sys/net/npf/npf_ctl.c \ src/sys/net/npf/npf_inet.c cvs rdiff -u -r1.46 -r1.47 src/sys/net/npf/npf_handler.c \ src/sys/net/npf/npf_nat.c cvs rdiff -u -r1.9 -r1.10 src/sys/net/npf/npf_if.c cvs rdiff -u -r1.75 -r1.76 src/sys/net/npf/npf_impl.h cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_params.c cvs rdiff -u -r1.3 -r1.4 src/sys/net/npf/npf_portmap.c \ src/sys/net/npf/npfkern.h cvs rdiff -u -r1.6 -r1.7 src/sys/net/npf/npf_worker.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/npf/npftest/libnpftest/npf_conn_test.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c cvs rdiff -u -r1.17 -r1.18 \ src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c cvs rdiff -u -r1.15 -r1.16 \ src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/npf/npf.c diff -u src/sys/net/npf/npf.c:1.39 src/sys/net/npf/npf.c:1.40 --- src/sys/net/npf/npf.c:1.39 Tue Aug 6 11:40:15 2019 +++ src/sys/net/npf/npf.c Sun Aug 11 20:26:33 2019 @@ -33,7 +33,7 @@ #ifdef _KERNEL #include -__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.39 2019/08/06 11:40:15 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.40 2019/08/11 20:26:33 rmind Exp $"); #include #include @@ -49,7 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: npf.c,v 1.39 static __read_mostly npf_t * npf_kernel_ctx = NULL; __dso_public int -npf_sysinit(unsigned nworkers) +npfk_sysinit(unsigned nworkers) { npf_bpf_sysinit(); npf_tableset_sysinit(); @@ -58,7 +58,7 @@ npf_sysinit(unsigned nworkers) } __dso_public void -npf_sysfini(void) +npfk_sysfini(void) { npf_worker_sysfini(); npf_nat_sysfini(); @@ -67,7 +67,7 @@ npf_sysfini(void) } __dso_public npf_t * -npf_create(int flags, const npf_mbufops_t *mbufops, const npf_ifops_t *ifops) +npfk_create(int flags, const npf_mbufops_t *mbufops, const npf_ifops_t *ifops) { npf_t *npf; @@ -94,7 +94,7 @@ npf_create(int flags, const npf_mbufops_ } __dso_public void -npf_destroy(npf_t *npf) +npfk_destroy(npf_t *npf) { /* * Destroy the current configuration. Note: at this point all @@ -117,25 +117,25 @@ npf_destroy(npf_t *npf) } __dso_public int -npf_load(npf_t *npf, void *config_ref, npf_error_t *err) +npfk_load(npf_t *npf, void *config_ref, npf_error_t *err) { return npfctl_load(npf, 0, config_ref); } __dso_public void -npf_gc(npf_t *npf) +npfk_gc(npf_t *npf) { npf_conn_worker(npf); } __dso_public void -npf_thread_register(npf_t *npf) +npfk_thread_register(npf_t *npf) { pserialize_register(npf->qsbr); } __dso_public void -npf_thread_unregister(npf_t *npf) +npfk_thread_unregister(npf_t *npf) { pserialize_perform(npf->qsbr); pserialize_unregister(npf->qsbr); @@ -198,14 +198,14 @@ npf_stats_clear_cb(void *mem, void *arg, */ __dso_public void -npf_stats(npf_t *npf, uint64_t *buf) +npfk_stats(npf_t *npf, uint64_t *buf) { memset(buf, 0, NPF_STATS_SIZE); percpu_foreach(npf->stats_percpu, npf_stats_collect, buf); } __dso_public void -npf_stats_clear(npf_t *npf) +npfk_stats_clear(npf_t *npf) { percpu_foreach(npf->stats_percpu, npf_stats_clear_cb, NULL); } Index: src/sys/net/npf/npf_conf.c diff -u src/sys/net/npf/npf_conf.c:1.13 src/sys/net/npf/npf_conf.c:1.14 --- src/sys/net/npf/npf_conf.c:1.13 Tue Jul 23 00:52:01 2019 +++ src/sys/net/npf/npf_conf.c Sun Aug 11 20:26:33 2019 @@ -47,7 +47,7 @@ #ifdef _KERNEL #include -__KERNEL_RCSID(0, "$NetBSD: npf_conf.c,v 1.13 2019/07/23 00:52:01 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npf_conf.c,v 1.14 2019/08/11 20:26:33 rmind Exp $"); #include #include @@ -169,7 +169,7 @@ npf_config_load(npf_t *npf, npf_ruleset_ /* Synchronise: drain all references. */ pserialize_perform(npf->qsbr); if (flush) { - npf_portmap_flush(npf); + npf_portmap_flush(npf->portmap); npf_ifmap_flush(npf); } Index: src/sys/net/npf/npf_os.c diff -u src/sys/net/npf/npf_os.c:1.13 src/sys/net/npf/npf_os.c:1.14 --- src/sys/net/npf/npf_os.c:1.13 Sat
CVS commit: src
Module Name:src Committed By: rmind Date: Sun Aug 11 20:26:34 UTC 2019 Modified Files: src/sys/net/npf: npf.c npf_conf.c npf_conn.h npf_ctl.c npf_handler.c npf_if.c npf_impl.h npf_inet.c npf_nat.c npf_os.c npf_params.c npf_portmap.c npf_worker.c npfkern.h src/usr.sbin/npf/npftest/libnpftest: npf_conn_test.c npf_nat_test.c npf_perf_test.c npf_rule_test.c npf_test_subr.c Log Message: Adjust some internal NPF APIs: * npfkern: use the npfk_ prefix. * NPF portmap: amend the API so it could be used elsewhere. * Make npf_connkey_t public. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 src/sys/net/npf/npf.c cvs rdiff -u -r1.13 -r1.14 src/sys/net/npf/npf_conf.c \ src/sys/net/npf/npf_os.c cvs rdiff -u -r1.17 -r1.18 src/sys/net/npf/npf_conn.h cvs rdiff -u -r1.54 -r1.55 src/sys/net/npf/npf_ctl.c \ src/sys/net/npf/npf_inet.c cvs rdiff -u -r1.46 -r1.47 src/sys/net/npf/npf_handler.c \ src/sys/net/npf/npf_nat.c cvs rdiff -u -r1.9 -r1.10 src/sys/net/npf/npf_if.c cvs rdiff -u -r1.75 -r1.76 src/sys/net/npf/npf_impl.h cvs rdiff -u -r1.1 -r1.2 src/sys/net/npf/npf_params.c cvs rdiff -u -r1.3 -r1.4 src/sys/net/npf/npf_portmap.c \ src/sys/net/npf/npfkern.h cvs rdiff -u -r1.6 -r1.7 src/sys/net/npf/npf_worker.c cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/npf/npftest/libnpftest/npf_conn_test.c cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/npf/npftest/libnpftest/npf_nat_test.c cvs rdiff -u -r1.8 -r1.9 src/usr.sbin/npf/npftest/libnpftest/npf_perf_test.c cvs rdiff -u -r1.17 -r1.18 \ src/usr.sbin/npf/npftest/libnpftest/npf_rule_test.c cvs rdiff -u -r1.15 -r1.16 \ src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c 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
Module Name:src Committed By: rmind Date: Sun Aug 11 20:25:14 UTC 2019 Modified Files: src/usr.sbin/npf: npf-params.7 Log Message: npf-params(7): add more bpf.jit details. >From David H. Gutteridge. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/npf/npf-params.7 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/npf-params.7 diff -u src/usr.sbin/npf/npf-params.7:1.2 src/usr.sbin/npf/npf-params.7:1.3 --- src/usr.sbin/npf/npf-params.7:1.2 Tue Jul 23 14:24:02 2019 +++ src/usr.sbin/npf/npf-params.7 Sun Aug 11 20:25:14 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: npf-params.7,v 1.2 2019/07/23 14:24:02 wiz Exp $ +.\" $NetBSD: npf-params.7,v 1.3 2019/08/11 20:25:14 rmind Exp $ .\" .\" Copyright (c) 2019 Mindaugas Rasiukevicius .\" All rights reserved. @@ -24,7 +24,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 26, 2019 +.Dd August 3, 2019 .Dt NPF-PARAMS 7 .Os .Sh NAME @@ -44,7 +44,13 @@ or 1 ("on"). .\" --- .Bl -tag -width "123456" .It Li bpf.jit -BPF just-in time compilation. +BPF just-in-time compilation: enables or disables +.Xr bpfjit 4 +support. +Some machine architectures are not presently supported by +.Xr bpfjit 4 . +Setting this parameter to off stops NPF from trying to enable this +functionality, and generating a warning if it is unable to do so. Default: 1. .El .\" --- @@ -121,6 +127,7 @@ set state.tcp.timeout.time_wait 0 .Sh SEE ALSO .Xr libnpf 3 , .Xr npfkern 3 , +.Xr bpfjit 4 , .Xr npf.conf 5 , .Xr pcap-filter 7 , .Xr npfctl 8
CVS commit: src/usr.sbin/npf
Module Name:src Committed By: rmind Date: Sun Aug 11 20:25:14 UTC 2019 Modified Files: src/usr.sbin/npf: npf-params.7 Log Message: npf-params(7): add more bpf.jit details. >From David H. Gutteridge. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/npf/npf-params.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: skrll Date: Sun Aug 11 19:34:04 UTC 2019 Modified Files: src/sys/arch/evbarm/conf: BCM56340 CUBOX-I DUOVERO HUMMINGBOARD NITROGEN6X PANDABOARD PARALLELLA ZEDBOARD Log Message: Update for recent a9wdt changes To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/BCM56340 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/CUBOX-I cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/DUOVERO cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/HUMMINGBOARD cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/conf/NITROGEN6X cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/PANDABOARD cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/PARALLELLA cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/ZEDBOARD Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: skrll Date: Sun Aug 11 19:34:04 UTC 2019 Modified Files: src/sys/arch/evbarm/conf: BCM56340 CUBOX-I DUOVERO HUMMINGBOARD NITROGEN6X PANDABOARD PARALLELLA ZEDBOARD Log Message: Update for recent a9wdt changes To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/evbarm/conf/BCM56340 cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbarm/conf/CUBOX-I cvs rdiff -u -r1.13 -r1.14 src/sys/arch/evbarm/conf/DUOVERO cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/HUMMINGBOARD cvs rdiff -u -r1.23 -r1.24 src/sys/arch/evbarm/conf/NITROGEN6X cvs rdiff -u -r1.29 -r1.30 src/sys/arch/evbarm/conf/PANDABOARD cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/PARALLELLA cvs rdiff -u -r1.5 -r1.6 src/sys/arch/evbarm/conf/ZEDBOARD Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/BCM56340 diff -u src/sys/arch/evbarm/conf/BCM56340:1.18 src/sys/arch/evbarm/conf/BCM56340:1.19 --- src/sys/arch/evbarm/conf/BCM56340:1.18 Tue Oct 23 19:58:52 2018 +++ src/sys/arch/evbarm/conf/BCM56340 Sun Aug 11 19:34:04 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: BCM56340,v 1.18 2018/10/23 19:58:52 jdolecek Exp $ +# $NetBSD: BCM56340,v 1.19 2019/08/11 19:34:04 skrll Exp $ # # BCM5301X -- Broadcom BCM5301X Eval Board Kernel # @@ -170,7 +170,7 @@ armperiph0 at mainbus? # A9 On-Chip Per armgic0 at armperiph? # ARM Generic Interrupt Controller arml2cc0 at armperiph? flags 0 # ARM PL310 L2CC arma9tmr0 at armperiph? # A9 Global Timer -a9wdt0 at armperiph? flags 1 # A9 Watchdog Timer +arma9wdt0 at armperiph? flags 1 # A9 Watchdog Timer # ChipCommonA Peripherals bcmcca0 at mainbus? # ChipCommonA Index: src/sys/arch/evbarm/conf/CUBOX-I diff -u src/sys/arch/evbarm/conf/CUBOX-I:1.22 src/sys/arch/evbarm/conf/CUBOX-I:1.23 --- src/sys/arch/evbarm/conf/CUBOX-I:1.22 Mon Jul 29 11:11:19 2019 +++ src/sys/arch/evbarm/conf/CUBOX-I Sun Aug 11 19:34:04 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CUBOX-I,v 1.22 2019/07/29 11:11:19 martin Exp $ +# $NetBSD: CUBOX-I,v 1.23 2019/08/11 19:34:04 skrll Exp $ # # CuBox-i # - http://www.solid-run.com/products/cubox-i-mini-computer/ @@ -192,7 +192,7 @@ armperiph0 at mainbus? # A9 On-Chip Per armgic0 at armperiph? # ARM Generic Interrupt Controller arml2cc0 at armperiph? flags 0 # ARM PL310 L2CC arma9tmr0 at armperiph? # A9 Global Timer -#a9wdt0 at armperiph? flags 0 # A9 Watchdog Timer +#arma9wdt0 at armperiph? flags 0 # A9 Watchdog Timer axi0 at mainbus? Index: src/sys/arch/evbarm/conf/DUOVERO diff -u src/sys/arch/evbarm/conf/DUOVERO:1.13 src/sys/arch/evbarm/conf/DUOVERO:1.14 --- src/sys/arch/evbarm/conf/DUOVERO:1.13 Fri Apr 26 22:46:03 2019 +++ src/sys/arch/evbarm/conf/DUOVERO Sun Aug 11 19:34:04 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: DUOVERO,v 1.13 2019/04/26 22:46:03 sevan Exp $ +# $NetBSD: DUOVERO,v 1.14 2019/08/11 19:34:04 skrll Exp $ # # DUOOVERO -- Gumstix. Inc. DuoVero COMS platforms kernel # @@ -154,7 +154,7 @@ armperiph0 at mainbus? arml2cc0 at armperiph?# L2 Cache Controller armgic0 at armperiph?# Interrupt Controller arma9tmr0 at armperiph?# Global Timer -a9wdt0 at armperiph?# Watchdog +arma9wdt0 at armperiph?# Watchdog # L3 Interconnect L3i0 at mainbus? Index: src/sys/arch/evbarm/conf/HUMMINGBOARD diff -u src/sys/arch/evbarm/conf/HUMMINGBOARD:1.8 src/sys/arch/evbarm/conf/HUMMINGBOARD:1.9 --- src/sys/arch/evbarm/conf/HUMMINGBOARD:1.8 Wed Jul 24 12:33:18 2019 +++ src/sys/arch/evbarm/conf/HUMMINGBOARD Sun Aug 11 19:34:04 2019 @@ -1,5 +1,5 @@ # -# $NetBSD: HUMMINGBOARD,v 1.8 2019/07/24 12:33:18 hkenken Exp $ +# $NetBSD: HUMMINGBOARD,v 1.9 2019/08/11 19:34:04 skrll Exp $ # # Hummingboard -- Freescale i.MX6 Eval Board Kernel # @@ -58,7 +58,7 @@ armperiph0 at mainbus? # A9 On-Chip Per armgic0 at armperiph? # ARM Generic Interrupt Controller arml2cc0 at armperiph? flags 0 # ARM PL310 L2CC arma9tmr0 at armperiph? # A9 Global Timer -#a9wdt0 at armperiph? flags 0 # A9 Watchdog Timer +#arma9wdt0 at armperiph? flags 0 # A9 Watchdog Timer axi0 at mainbus? Index: src/sys/arch/evbarm/conf/NITROGEN6X diff -u src/sys/arch/evbarm/conf/NITROGEN6X:1.23 src/sys/arch/evbarm/conf/NITROGEN6X:1.24 --- src/sys/arch/evbarm/conf/NITROGEN6X:1.23 Wed Jul 24 12:33:18 2019 +++ src/sys/arch/evbarm/conf/NITROGEN6X Sun Aug 11 19:34:04 2019 @@ -1,4 +1,4 @@ -# $NetBSD: NITROGEN6X,v 1.23 2019/07/24 12:33:18 hkenken Exp $ +# $NetBSD: NITROGEN6X,v 1.24 2019/08/11 19:34:04 skrll Exp $ # # Nitrogen6X # - http://boundarydevices.com/products/nitrogen6x-board-imx6-arm-cortex-a9-sbc/ @@ -45,7 +45,7 @@ armperiph0 at mainbus? # A9 On-Chip Per armgic0 at armperiph? # ARM Generic Interrupt Controller arml2cc0 at armperiph? flags 0 # ARM PL310 L2CC arma9tmr0 at armperiph? # A9 Global Timer -#a9wdt0 at armperiph? flags 0 # A9 Watchdog Timer +#arma9wdt0 at armperiph? flags 0 # A9 Watchdog Timer axi0
CVS commit: src/distrib/common
Module Name:src Committed By: martin Date: Sun Aug 11 17:50:26 UTC 2019 Modified Files: src/distrib/common: Makefile.mdset Log Message: Back out previous, it causes build fallout like: release ===> etc/dreamcast/cdroms/installcd shle--netbsdelf-install: .WAIT: stat: No such file or directory To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/distrib/common/Makefile.mdset Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/common
Module Name:src Committed By: martin Date: Sun Aug 11 17:50:26 UTC 2019 Modified Files: src/distrib/common: Makefile.mdset Log Message: Back out previous, it causes build fallout like: release ===> etc/dreamcast/cdroms/installcd shle--netbsdelf-install: .WAIT: stat: No such file or directory To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/distrib/common/Makefile.mdset Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/Makefile.mdset diff -u src/distrib/common/Makefile.mdset:1.44 src/distrib/common/Makefile.mdset:1.45 --- src/distrib/common/Makefile.mdset:1.44 Sun Aug 11 13:55:18 2019 +++ src/distrib/common/Makefile.mdset Sun Aug 11 17:50:26 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.mdset,v 1.44 2019/08/11 13:55:18 martin Exp $ +# $NetBSD: Makefile.mdset,v 1.45 2019/08/11 17:50:26 martin Exp $ # # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels # @@ -103,9 +103,9 @@ ${_KERNEL.${_K}.${_F}}.${_S}: ${_KERNEL. .endif .if defined(MDSET_NOGZIP.${_FILENAME}) || defined(MDSET_NOGZIP) -KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S} .WAIT +KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S} .else # { -KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S}.gz .WAIT +KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S}.gz ${_KERNEL.${_K}.${_F}}.${_S}.gz: ${_KERNEL.${_K}.${_F}}.${_S} ${_MKTARGET_CREATE}
Re: CVS commit: src/sys/sys
On Sun, Aug 11, 2019 at 03:46:02PM +0200, Kamil Rytarowski wrote: > Not usable in C++, we shipped with patches in 3rd party code. Patches in 3rd party code means to me: the system header is usable (but maybe awkward). Martin
CVS commit: src/distrib/common
Module Name:src Committed By: martin Date: Sun Aug 11 13:55:18 UTC 2019 Modified Files: src/distrib/common: Makefile.mdset Log Message: Various suffixes for the same kernel image may depend on each other, so .WAIT after creating one before moving on to the next. Case at hand: evbarm/installation/instkernel: netbsd-RPI_INSTALL.bin needs to be complete before netbsd-RPI_INSTALL.img can be created. Better solutions welcome... To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/distrib/common/Makefile.mdset Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/common
Module Name:src Committed By: martin Date: Sun Aug 11 13:55:18 UTC 2019 Modified Files: src/distrib/common: Makefile.mdset Log Message: Various suffixes for the same kernel image may depend on each other, so .WAIT after creating one before moving on to the next. Case at hand: evbarm/installation/instkernel: netbsd-RPI_INSTALL.bin needs to be complete before netbsd-RPI_INSTALL.img can be created. Better solutions welcome... To generate a diff of this commit: cvs rdiff -u -r1.43 -r1.44 src/distrib/common/Makefile.mdset Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/Makefile.mdset diff -u src/distrib/common/Makefile.mdset:1.43 src/distrib/common/Makefile.mdset:1.44 --- src/distrib/common/Makefile.mdset:1.43 Wed Feb 6 07:33:08 2019 +++ src/distrib/common/Makefile.mdset Sun Aug 11 13:55:18 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.mdset,v 1.43 2019/02/06 07:33:08 mrg Exp $ +# $NetBSD: Makefile.mdset,v 1.44 2019/08/11 13:55:18 martin Exp $ # # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels # @@ -103,9 +103,9 @@ ${_KERNEL.${_K}.${_F}}.${_S}: ${_KERNEL. .endif .if defined(MDSET_NOGZIP.${_FILENAME}) || defined(MDSET_NOGZIP) -KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S} +KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S} .WAIT .else # { -KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S}.gz +KERNELS+= ${_KERNEL.${_K}.${_F}}.${_S}.gz .WAIT ${_KERNEL.${_K}.${_F}}.${_S}.gz: ${_KERNEL.${_K}.${_F}}.${_S} ${_MKTARGET_CREATE}
Re: CVS commit: src/sys/sys
On 11.08.2019 09:17, Martin Husemann wrote: > On Sat, Aug 10, 2019 at 11:37:28PM +0200, Kamil Rytarowski wrote: >>> can we go back to the drawing board on this one and discuss the original >>> problem? >>> >> >> C++ and cast rules. > > The question is whether we really should play this game in our system headers. > The original state was usable in C++ (but awkward), or do I misunderstand > someting? > Not usable in C++, we shipped with patches in 3rd party code. Christos added casts for C to handle differences, but they do not work in C++ and its picky cast rules. > Martin > signature.asc Description: OpenPGP digital signature
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hannken Date: Sun Aug 11 13:16:10 UTC 2019 Modified Files: src/sys/dev/usb: if_urndis.c Log Message: urndis_attach: change "sc->sc_bulkout_no" to "un->un_ed[USBNET_ENDPT_TX]" in DPRINTF(). Kernels ALL/amd64 and ALL/i386 compile again. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/if_urndis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/usb
Module Name:src Committed By: hannken Date: Sun Aug 11 13:16:10 UTC 2019 Modified Files: src/sys/dev/usb: if_urndis.c Log Message: urndis_attach: change "sc->sc_bulkout_no" to "un->un_ed[USBNET_ENDPT_TX]" in DPRINTF(). Kernels ALL/amd64 and ALL/i386 compile again. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/usb/if_urndis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/if_urndis.c diff -u src/sys/dev/usb/if_urndis.c:1.27 src/sys/dev/usb/if_urndis.c:1.28 --- src/sys/dev/usb/if_urndis.c:1.27 Sat Aug 10 02:17:36 2019 +++ src/sys/dev/usb/if_urndis.c Sun Aug 11 13:16:10 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_urndis.c,v 1.27 2019/08/10 02:17:36 mrg Exp $ */ +/* $NetBSD: if_urndis.c,v 1.28 2019/08/11 13:16:10 hannken Exp $ */ /* $OpenBSD: if_urndis.c,v 1.31 2011/07/03 15:47:17 matthew Exp $ */ /* @@ -21,7 +21,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.27 2019/08/10 02:17:36 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_urndis.c,v 1.28 2019/08/11 13:16:10 hannken Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1032,7 +1032,7 @@ urndis_attach(device_t parent, device_t DPRINTF(("%s: in=0x%x, out=0x%x\n", DEVNAME(un), un->un_ed[USBNET_ENDPT_RX], - sc->sc_bulkout_no)); + un->un_ed[USBNET_ENDPT_TX])); break; } }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 12:16:59 UTC 2019 Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Fix and improve USMSC_DEBUG To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/usb/if_smsc.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_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.54 src/sys/dev/usb/if_smsc.c:1.55 --- src/sys/dev/usb/if_smsc.c:1.54 Sun Aug 11 11:17:35 2019 +++ src/sys/dev/usb/if_smsc.c Sun Aug 11 12:16:59 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.54 2019/08/11 11:17:35 skrll Exp $ */ +/* $NetBSD: if_smsc.c,v 1.55 2019/08/11 12:16:59 skrll 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.54 2019/08/11 11:17:35 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.55 2019/08/11 12:16:59 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -121,7 +121,7 @@ static const struct usb_devno smsc_devs[ #ifndef USMSC_DEBUG #define usmscdebug 0 #else -static int usmscdebug = 20; +static int usmscdebug = 1; SYSCTL_SETUP(sysctl_hw_smsc_setup, "sysctl hw.usmsc setup") { @@ -153,10 +153,10 @@ fail: #endif /* SMSC_DEBUG */ #endif /* USB_DEBUG */ -#define DPRINTF(FMT,A,B,C,D) USBHIST_LOGN(usmscdebug,1,FMT,A,B,C,D) +#define DPRINTF(FMT,A,B,C,D) USBHIST_LOG(usmscdebug,FMT,A,B,C,D) #define DPRINTFN(N,FMT,A,B,C,D) USBHIST_LOGN(usmscdebug,N,FMT,A,B,C,D) #define USMSCHIST_FUNC() USBHIST_FUNC() -#define USMSCHIST_CALLED(name) USBHIST_CALLED(usmscdebug) +#define USMSCHIST_CALLED() USBHIST_CALLED(usmscdebug) #define smsc_warn_printf(un, fmt, args...) \ printf("%s: warning: " fmt, device_xname((un)->un_dev), ##args) @@ -543,10 +543,10 @@ smsc_setmacaddress(struct usbnet *un, co int err; uint32_t val; - DPRINTF("setting mac address to %02x:%02x:%02x:...", addr[0], addr[1], + DPRINTF("setting mac address to %02jx:%02jx:%02jx:...", addr[0], addr[1], addr[2], 0); - DPRINTF("... %02x:%02x:%02x", addr[3], addr[4], addr[5], 0); + DPRINTF("... %02jx:%0j2x:%02jx", addr[3], addr[4], addr[5], 0); val = (addr[3] << 24) | (addr[2] << 16) | (addr[1] << 8) | addr[0]; if ((err = smsc_writereg(un, SMSC_MAC_ADDRL, val)) != 0) @@ -950,10 +950,11 @@ smsc_rxeof_loop(struct usbnet * un, stru usbnet_isowned_rx(un); + DPRINTF("total_len %jd/0x%jx", total_len, total_len, 0, 0); while (total_len != 0) { uint32_t rxhdr; if (total_len < sizeof(rxhdr)) { - DPRINTF("total_len %d < sizeof(rxhdr) %zu", + DPRINTF("total_len %jd < sizeof(rxhdr) %jd", total_len, sizeof(rxhdr), 0, 0); ifp->if_ierrors++; return; @@ -970,18 +971,18 @@ smsc_rxeof_loop(struct usbnet * un, stru if (rxhdr & (SMSC_RX_STAT_ERROR | SMSC_RX_STAT_LENGTH_ERROR | SMSC_RX_STAT_MII_ERROR)) { - DPRINTF("rx error (hdr 0x%08x)", rxhdr, 0, 0, 0); + DPRINTF("rx error (hdr 0x%08jx)", rxhdr, 0, 0, 0); ifp->if_ierrors++; return; } uint16_t pktlen = (uint16_t)SMSC_RX_STAT_FRM_LENGTH(rxhdr); - DPRINTF("rxeof total_len %d pktlen %d rxhdr " - "0x%08x", total_len, pktlen, rxhdr, 0); + DPRINTF("total_len %jd pktlen %jd rxhdr 0x%08jx", total_len, + pktlen, rxhdr, 0); if (pktlen < ETHER_HDR_LEN) { - DPRINTF("pktlen %d < ETHER_HDR_LEN %d", - pktlen, ETHER_HDR_LEN, 0, 0); + DPRINTF("pktlen %jd < ETHER_HDR_LEN %jd", pktlen, + ETHER_HDR_LEN, 0, 0); ifp->if_ierrors++; return; } @@ -989,15 +990,15 @@ smsc_rxeof_loop(struct usbnet * un, stru pktlen += ETHER_ALIGN; if (pktlen > MCLBYTES) { - DPRINTF("pktlen %d > MCLBYTES %d", - pktlen, MCLBYTES, 0, 0); + DPRINTF("pktlen %jd > MCLBYTES %jd", pktlen, MCLBYTES, 0, + 0); ifp->if_ierrors++; return; } if (pktlen > total_len) { - DPRINTF("pktlen %d > total_len %d", - pktlen, total_len, 0, 0); + DPRINTF("pktlen %jd > total_len %jd", pktlen, total_len, + 0, 0); ifp->if_ierrors++; return; } @@ -1030,7 +1031,7 @@ smsc_rxeof_loop(struct usbnet * un, stru * * Ignore H/W csum for non-IPv4 packets. */ - DPRINTF("Ethertype %02x pktlen %02x", + DPRINTF("Ethertype %02jx pktlen %02jx", be16toh(eh->ether_type), pktlen, 0, 0); if (be16toh(eh->ether_type) == ETHERTYPE_IP && pktlen > ETHER_MIN_LEN) { @@ -1051,7 +1052,7 @@ smsc_rxeof_loop(struct usbnet * un, stru * in host network order. */ csum_data = ntohs(csum_data); -DPRINTF("RX checksum offloaded (0x%04x)", +DPRINTF("RX checksum offloaded (0x%04jx)", csum_data, 0, 0, 0); } }
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 12:16:59 UTC 2019 Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Fix and improve USMSC_DEBUG To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/dev/usb/if_smsc.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
In article <20190810203301.be06bf...@cvs.netbsd.org>, 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. > > >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.hSat 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 > "diagnistic"? christos
CVS commit: src/tests/lib/libpthread
Module Name:src Committed By: martin Date: Sun Aug 11 11:42:23 UTC 2019 Modified Files: src/tests/lib/libpthread: t_condwait.c Log Message: Re-enable the QEMU specific timing limits, but only an increased upper limit for now - let's see if that works on the test-bed. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 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/tests/lib/libpthread
Module Name:src Committed By: martin Date: Sun Aug 11 11:42:23 UTC 2019 Modified Files: src/tests/lib/libpthread: t_condwait.c Log Message: Re-enable the QEMU specific timing limits, but only an increased upper limit for now - let's see if that works on the test-bed. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 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.7 src/tests/lib/libpthread/t_condwait.c:1.8 --- src/tests/lib/libpthread/t_condwait.c:1.7 Sat Aug 10 07:36:15 2019 +++ src/tests/lib/libpthread/t_condwait.c Sun Aug 11 11:42:23 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: t_condwait.c,v 1.7 2019/08/10 07:36:15 martin Exp $ */ +/* $NetBSD: t_condwait.c,v 1.8 2019/08/11 11:42:23 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.7 2019/08/10 07:36:15 martin Exp $"); +__RCSID("$NetBSD: t_condwait.c,v 1.8 2019/08/11 11:42:23 martin Exp $"); #include #include @@ -87,12 +87,12 @@ run(void *param) } twmin.tv_sec = WAITTIME; twmin.tv_nsec = 0; - if (0 /* XXX */ && isQEMU()) { + if (isQEMU()) { struct timespec td, t; - td.tv_sec = 0; - td.tv_nsec = 9; + // td.tv_sec = 0; + // td.tv_nsec = 9; t = twmin; - timespecsub(, , ); + // timespecsub(, , ); td.tv_sec = 2; td.tv_nsec = 5; timespecadd(, , );
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 11:17:36 UTC 2019 Modified Files: src/sys/dev/usb: files.usb if_smsc.c Log Message: Convert smsc_dbg_printf to usbhist To generate a diff of this commit: cvs rdiff -u -r1.162 -r1.163 src/sys/dev/usb/files.usb cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/if_smsc.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/files.usb diff -u src/sys/dev/usb/files.usb:1.162 src/sys/dev/usb/files.usb:1.163 --- src/sys/dev/usb/files.usb:1.162 Fri Aug 9 06:38:39 2019 +++ src/sys/dev/usb/files.usb Sun Aug 11 11:17:35 2019 @@ -1,4 +1,4 @@ -# $NetBSD: files.usb,v 1.162 2019/08/09 06:38:39 mrg Exp $ +# $NetBSD: files.usb,v 1.163 2019/08/11 11:17:35 skrll Exp $ # # Config file and device description for machine-independent USB code. # Included by ports that need it. Ports that use it must provide @@ -75,6 +75,7 @@ defflag opt_usb.h URTWN_DEBUG: USB_DEBUG defflag opt_usb.h URTW_DEBUG: USB_DEBUG defflag opt_usb.h USCANNER_DEBUG: USB_DEBUG defflag opt_usb.h USLSA_DEBUG: USB_DEBUG +defflag opt_usb.h USMSC_DEBUG: USB_DEBUG defflag opt_usb.h USSCANNER_DEBUG: USB_DEBUG defflag opt_usb.h USTIR_DEBUG: USB_DEBUG defflag opt_usb.h UTHUM_DEBUG: USB_DEBUG Index: src/sys/dev/usb/if_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.53 src/sys/dev/usb/if_smsc.c:1.54 --- src/sys/dev/usb/if_smsc.c:1.53 Sun Aug 11 07:58:16 2019 +++ src/sys/dev/usb/if_smsc.c Sun Aug 11 11:17:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $ */ +/* $NetBSD: if_smsc.c,v 1.54 2019/08/11 11:17:35 skrll 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.53 2019/08/11 07:58:16 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.54 2019/08/11 11:17:35 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -71,15 +71,12 @@ __KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v #include #include +#include #include #include "ioconf.h" -#ifdef USB_DEBUG -int smsc_debug = 0; -#endif - struct smsc_softc { struct usbnet smsc_un; @@ -121,14 +118,45 @@ static const struct usb_devno smsc_devs[ }; #ifdef USB_DEBUG -#define smsc_dbg_printf(un, fmt, args...) \ - do { \ - if (smsc_debug > 0) \ - printf("debug: " fmt, ##args); \ - } while(0) +#ifndef USMSC_DEBUG +#define usmscdebug 0 #else -#define smsc_dbg_printf(un, fmt, args...) -#endif +static int usmscdebug = 20; + +SYSCTL_SETUP(sysctl_hw_smsc_setup, "sysctl hw.usmsc setup") +{ + int err; + const struct sysctlnode *rnode; + const struct sysctlnode *cnode; + + err = sysctl_createv(clog, 0, NULL, , + CTLFLAG_PERMANENT, CTLTYPE_NODE, "usmsc", + SYSCTL_DESCR("usmsc global controls"), + NULL, 0, NULL, 0, CTL_HW, CTL_CREATE, CTL_EOL); + + if (err) + goto fail; + + /* control debugging printfs */ + err = sysctl_createv(clog, 0, , , + CTLFLAG_PERMANENT | CTLFLAG_READWRITE, CTLTYPE_INT, + "debug", SYSCTL_DESCR("Enable debugging output"), + NULL, 0, , sizeof(usmscdebug), CTL_CREATE, CTL_EOL); + if (err) + goto fail; + + return; +fail: + aprint_error("%s: sysctl_createv failed (err = %d)\n", __func__, err); +} + +#endif /* SMSC_DEBUG */ +#endif /* USB_DEBUG */ + +#define DPRINTF(FMT,A,B,C,D) USBHIST_LOGN(usmscdebug,1,FMT,A,B,C,D) +#define DPRINTFN(N,FMT,A,B,C,D) USBHIST_LOGN(usmscdebug,N,FMT,A,B,C,D) +#define USMSCHIST_FUNC() USBHIST_FUNC() +#define USMSCHIST_CALLED(name) USBHIST_CALLED(usmscdebug) #define smsc_warn_printf(un, fmt, args...) \ printf("%s: warning: " fmt, device_xname((un)->un_dev), ##args) @@ -309,6 +337,7 @@ smsc_miibus_writereg(struct usbnet *un, void smsc_miibus_statchg(struct ifnet *ifp) { + USMSCHIST_FUNC(); USMSCHIST_CALLED(); struct usbnet * const un = ifp->if_softc; if (usbnet_isdying(un)) @@ -350,7 +379,7 @@ smsc_miibus_statchg(struct ifnet *ifp) /* Enable/disable full duplex operation and TX/RX pause */ if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { - smsc_dbg_printf(un, "full duplex operation\n"); + DPRINTF("full duplex operation", 0, 0, 0, 0); sc->sc_mac_csr &= ~SMSC_MAC_CSR_RCVOWN; sc->sc_mac_csr |= SMSC_MAC_CSR_FDPX; @@ -364,7 +393,7 @@ smsc_miibus_statchg(struct ifnet *ifp) else afc_cfg &= ~0xf; } else { - smsc_dbg_printf(un, "half duplex operation\n"); + DPRINTF("half duplex operation", 0, 0, 0, 0); sc->sc_mac_csr &= ~SMSC_MAC_CSR_FDPX; sc->sc_mac_csr |= SMSC_MAC_CSR_RCVOWN; @@ -392,7 +421,8 @@ smsc_hash(uint8_t addr[ETHER_ADDR_LEN]) static void smsc_setiff_locked(struct usbnet *un) { - struct smsc_softc * const sc = usbnet_softc(un); + USMSCHIST_FUNC(); USMSCHIST_CALLED(); + struct smsc_softc * const sc = usbnet_softc(un); struct ifnet * const ifp = usbnet_ifp(un); struct
CVS commit: src/distrib/amd64/liveimage/emuimage
Module Name:src Committed By: gson Date: Sun Aug 11 11:00:30 UTC 2019 Modified Files: src/distrib/amd64/liveimage/emuimage: Makefile Log Message: Live images built with MKDEBUG=yes fit in 2 GB since installing _pic.a libraries was disabled in src/share/mk/bsd.own.mk 1.1150. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/distrib/amd64/liveimage/emuimage/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/amd64/liveimage/emuimage/Makefile diff -u src/distrib/amd64/liveimage/emuimage/Makefile:1.6 src/distrib/amd64/liveimage/emuimage/Makefile:1.7 --- src/distrib/amd64/liveimage/emuimage/Makefile:1.6 Wed Aug 7 07:59:35 2019 +++ src/distrib/amd64/liveimage/emuimage/Makefile Sun Aug 11 11:00:30 2019 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.6 2019/08/07 07:59:35 gson Exp $ +# $NetBSD: Makefile,v 1.7 2019/08/11 11:00:30 gson Exp $ LIVEIMGBASE= NetBSD-${DISTRIBVER}-amd64-live # gives ${IMGBASE}.img -EMUIMAGEMB?= 3725 # 4GB USB flash memories aren't 4GiB +EMUIMAGEMB?= 1907 # 2GB USB flash memories aren't 2GiB LIVEIMAGEMB= ${EMUIMAGEMB} .include "${.CURDIR}/../Makefile.liveimage"
CVS commit: src/distrib/amd64/liveimage/emuimage
Module Name:src Committed By: gson Date: Sun Aug 11 11:00:30 UTC 2019 Modified Files: src/distrib/amd64/liveimage/emuimage: Makefile Log Message: Live images built with MKDEBUG=yes fit in 2 GB since installing _pic.a libraries was disabled in src/share/mk/bsd.own.mk 1.1150. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/distrib/amd64/liveimage/emuimage/Makefile 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
Module Name:src Committed By: martin Date: Sun Aug 11 10:13:30 UTC 2019 Modified Files: src/doc [netbsd-9]: CHANGES-9.0 Log Message: Tickets #44 and #45 To generate a diff of this commit: cvs rdiff -u -r1.1.2.13 -r1.1.2.14 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
Module Name:src Committed By: martin Date: Sun Aug 11 10:13:30 UTC 2019 Modified Files: src/doc [netbsd-9]: CHANGES-9.0 Log Message: Tickets #44 and #45 To generate a diff of this commit: cvs rdiff -u -r1.1.2.13 -r1.1.2.14 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.13 src/doc/CHANGES-9.0:1.1.2.14 --- src/doc/CHANGES-9.0:1.1.2.13 Sat Aug 10 06:19:48 2019 +++ src/doc/CHANGES-9.0 Sun Aug 11 10:13:30 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.0,v 1.1.2.13 2019/08/10 06:19:48 martin Exp $ +# $NetBSD: CHANGES-9.0,v 1.1.2.14 2019/08/11 10:13:30 martin Exp $ A complete list of changes from the initial NetBSD 9.0 branch on 2019-07-30 until the 9.0 release: @@ -1612,3 +1612,16 @@ doc/3RDPARTY 1.1642 Import OpenLDAP 2.4.48 [christos, ticket #41] +usr.sbin/npf/npfctl/npf_bpf_comp.c 1.14 +usr.sbin/npf/npfctl/npf_build.c 1.51 +usr.sbin/npf/npfctl/npfctl.h 1.49 + + NPF: fix BPF byte-code generation for a port-range used in a group. + [rmind, ticket #44] + +usr.sbin/npf/npfctl/npf_show.c 1.29 + + npfctl show/validate: fix couple bugs in multiple table/port + representation. + [rmind, ticket #45] +
CVS commit: [netbsd-9] src/usr.sbin/npf/npfctl
Module Name:src Committed By: martin Date: Sun Aug 11 10:12:18 UTC 2019 Modified Files: src/usr.sbin/npf/npfctl [netbsd-9]: npf_show.c Log Message: Pull up following revision(s) (requested by rmind in ticket #45): usr.sbin/npf/npfctl/npf_show.c: revision 1.29 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.28.2.1 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.
CVS commit: [netbsd-9] src/usr.sbin/npf/npfctl
Module Name:src Committed By: martin Date: Sun Aug 11 10:12:18 UTC 2019 Modified Files: src/usr.sbin/npf/npfctl [netbsd-9]: npf_show.c Log Message: Pull up following revision(s) (requested by rmind in ticket #45): usr.sbin/npf/npfctl/npf_show.c: revision 1.29 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.28.2.1 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.28.2.1 --- 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 Sun Aug 11 10:12:18 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.28.2.1 2019/08/11 10:12:18 martin 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: [netbsd-9] src/usr.sbin/npf/npfctl
Module Name:src Committed By: martin Date: Sun Aug 11 10:10:23 UTC 2019 Modified Files: src/usr.sbin/npf/npfctl [netbsd-9]: npf_bpf_comp.c npf_build.c npfctl.h Log Message: Pull up following revision(s) (requested by rmind in ticket #44): usr.sbin/npf/npfctl/npfctl.h: revision 1.49 usr.sbin/npf/npfctl/npf_build.c: revision 1.51 usr.sbin/npf/npfctl/npf_bpf_comp.c: revision 1.14 NPF: fix BPF byte-code generation for a port-range used in a group. Resolved PR/52609 and PR/54169. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.13.2.1 src/usr.sbin/npf/npfctl/npf_bpf_comp.c cvs rdiff -u -r1.50 -r1.50.2.1 src/usr.sbin/npf/npfctl/npf_build.c cvs rdiff -u -r1.48 -r1.48.2.1 src/usr.sbin/npf/npfctl/npfctl.h 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_bpf_comp.c diff -u src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.13 src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.13.2.1 --- src/usr.sbin/npf/npfctl/npf_bpf_comp.c:1.13 Tue Jul 23 00:52:02 2019 +++ src/usr.sbin/npf/npfctl/npf_bpf_comp.c Sun Aug 11 10:10:23 2019 @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010-2014 The NetBSD Foundation, Inc. + * Copyright (c) 2010-2019 The NetBSD Foundation, Inc. * All rights reserved. * * This material is based upon work partially supported by The @@ -29,10 +29,60 @@ /* * BPF byte-code generation for NPF rules. + * + * Overview + * + * Each NPF rule is compiled into BPF micro-program. There is a + * BPF byte-code fragment for each higher-level filtering logic, + * e.g. to match L4 protocol, IP/mask, etc. The generation process + * combines multiple BPF-byte code fragments into one program. + * + * Basic case + * + * Consider a basic case, where all filters should match. They + * are expressed as logical conjunction, e.g.: + * + * A and B and C and D + * + * Each test (filter) criterion can be evaluated to true (match) or + * false (no match) and the logic is as follows: + * + * - If the value is true, then jump to the "next" test (offset 0). + * + * - If the value is false, then jump to the JUMP_MAGIC value (0xff). + * This "magic" value is used to indicate that it will have to be + * patched at a later stage. + * + * Once all byte-code fragments are combined into one, then there + * are two additional steps: + * + * - Two instructions are appended at the end of the program: return + * "success" followed by return "failure". + * + * - All jumps with the JUMP_MAGIC value are patched to point to the + * "return failure" instruction. + * + * Therefore, if all filter criteria will match, then the first + * instruction will be reached, indicating a successful match of the + * rule. Otherwise, if any of the criteria will not match, it will + * take the failure path and the rule will not matching. + * + * Grouping + * + * Filters can have groups, which are have a meaning of logical + * disjunction, e.g.: + * + * A and B and (C or D) + * + * In such case, the logic inside the group has to be inverted i.e. + * the jump values swapped. If the test value is true, then jump + * out of the group; if false, then jump "next". At the end of the + * group, an addition failure path is appended and the JUMP_MAGIC + * uses within the group are patched to jump past the said path. */ #include -__RCSID("$NetBSD: npf_bpf_comp.c,v 1.13 2019/07/23 00:52:02 rmind Exp $"); +__RCSID("$NetBSD: npf_bpf_comp.c,v 1.13.2.1 2019/08/11 10:10:23 martin Exp $"); #include #include @@ -75,7 +125,10 @@ struct npf_bpf { sa_family_t af; uint32_t flags; - /* The current group offset and block number. */ + /* + * The current group offset (counted in BPF instructions) + * and block number at the start of the group. + */ bool ingroup; u_int goff; u_int gblock; @@ -120,6 +173,7 @@ fixup_jumps(npf_bpf_t *ctx, u_int start, for (u_int i = start; i < end; i++) { struct bpf_insn *insn = >bf_insns[i]; const u_int fail_off = end - i; + bool seen_magic = false; if (fail_off >= JUMP_MAGIC) { errx(EXIT_FAILURE, "BPF generation error: " @@ -128,15 +182,37 @@ fixup_jumps(npf_bpf_t *ctx, u_int start, if (BPF_CLASS(insn->code) != BPF_JMP) { continue; } - if (swap) { + if (BPF_OP(insn->code) == BPF_JA) { + /* + * BPF_JA can be used to jump to the failure path. + * If we are swapping i.e. inside the group, then + * jump "next"; groups have a failure path appended + * at their end. + */ + if (insn->k == JUMP_MAGIC) { +insn->k = swap ? 0 : fail_off; + } + continue; + } + + /* + * Fixup the "magic" value. Swap only the "magic" jumps. + */ + + if (insn->jt == JUMP_MAGIC) { + insn->jt = fail_off; + seen_magic = true; + } + if (insn->jf == JUMP_MAGIC) { + insn->jf = fail_off; + seen_magic = true; + } + + if (seen_magic && swap) { uint8_t jt = insn->jt; insn->jt = insn->jf; insn->jf = jt; } -
CVS commit: [netbsd-9] src/usr.sbin/npf/npfctl
Module Name:src Committed By: martin Date: Sun Aug 11 10:10:23 UTC 2019 Modified Files: src/usr.sbin/npf/npfctl [netbsd-9]: npf_bpf_comp.c npf_build.c npfctl.h Log Message: Pull up following revision(s) (requested by rmind in ticket #44): usr.sbin/npf/npfctl/npfctl.h: revision 1.49 usr.sbin/npf/npfctl/npf_build.c: revision 1.51 usr.sbin/npf/npfctl/npf_bpf_comp.c: revision 1.14 NPF: fix BPF byte-code generation for a port-range used in a group. Resolved PR/52609 and PR/54169. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.13.2.1 src/usr.sbin/npf/npfctl/npf_bpf_comp.c cvs rdiff -u -r1.50 -r1.50.2.1 src/usr.sbin/npf/npfctl/npf_build.c cvs rdiff -u -r1.48 -r1.48.2.1 src/usr.sbin/npf/npfctl/npfctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Aug 11 10:05:06 UTC 2019 Modified Files: src/doc [netbsd-8]: CHANGES-8.2 Log Message: Tickets #1332 and #1333 To generate a diff of this commit: cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/CHANGES-8.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Aug 11 10:05:06 UTC 2019 Modified Files: src/doc [netbsd-8]: CHANGES-8.2 Log Message: Tickets #1332 and #1333 To generate a diff of this commit: cvs rdiff -u -r1.1.2.22 -r1.1.2.23 src/doc/CHANGES-8.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-8.2 diff -u src/doc/CHANGES-8.2:1.1.2.22 src/doc/CHANGES-8.2:1.1.2.23 --- src/doc/CHANGES-8.2:1.1.2.22 Fri Aug 9 19:22:51 2019 +++ src/doc/CHANGES-8.2 Sun Aug 11 10:05:06 2019 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.2,v 1.1.2.22 2019/08/09 19:22:51 martin Exp $ +# $NetBSD: CHANGES-8.2,v 1.1.2.23 2019/08/11 10:05:06 martin Exp $ A complete list of changes from the NetBSD 8.1 release to the NetBSD 8.2 release: @@ -545,3 +545,13 @@ sys/external/bsd/ipf/netinet/fil.c 1.30 0x as bad. [christos, ticket #1331] +sys/uvm/uvm_mmap.c1.173 + + Change 'npgs' from int to size_t. + [maxv, ticket #1332] + +sys/kern/sys_lwp.c1.69 (patch) + + Fix info leak in sys___sigaltstack14(). + [maxv, ticket #1333] +
CVS commit: [netbsd-8] src/sys/kern
Module Name:src Committed By: martin Date: Sun Aug 11 10:04:03 UTC 2019 Modified Files: src/sys/kern [netbsd-8]: sys_lwp.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1333): sys/kern/sys_lwp.c: revision 1.69 (patch) Fix info leak: instead of using SS_INIT as a literal compound, use a global variable from rodata. The compound gets pushed on the stack, the padding of the structure was therefore not initialized, and was getting leaked to userland in sys___sigaltstack14(). To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.61.2.1 src/sys/kern/sys_lwp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-8] src/sys/kern
Module Name:src Committed By: martin Date: Sun Aug 11 10:04:03 UTC 2019 Modified Files: src/sys/kern [netbsd-8]: sys_lwp.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1333): sys/kern/sys_lwp.c: revision 1.69 (patch) Fix info leak: instead of using SS_INIT as a literal compound, use a global variable from rodata. The compound gets pushed on the stack, the padding of the structure was therefore not initialized, and was getting leaked to userland in sys___sigaltstack14(). To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.61.2.1 src/sys/kern/sys_lwp.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/kern/sys_lwp.c diff -u src/sys/kern/sys_lwp.c:1.61 src/sys/kern/sys_lwp.c:1.61.2.1 --- src/sys/kern/sys_lwp.c:1.61 Thu Jun 1 02:45:13 2017 +++ src/sys/kern/sys_lwp.c Sun Aug 11 10:04:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_lwp.c,v 1.61 2017/06/01 02:45:13 chs Exp $ */ +/* $NetBSD: sys_lwp.c,v 1.61.2.1 2019/08/11 10:04:03 martin Exp $ */ /*- * Copyright (c) 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.61 2017/06/01 02:45:13 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v 1.61.2.1 2019/08/11 10:04:03 martin Exp $"); #include #include @@ -53,6 +53,8 @@ __KERNEL_RCSID(0, "$NetBSD: sys_lwp.c,v #define LWP_UNPARK_MAX 1024 +static const stack_t lwp_ss_init = SS_INIT; + static syncobj_t lwp_park_sobj = { SOBJ_SLEEPQ_LIFO, sleepq_unsleep, @@ -86,7 +88,7 @@ do_lwp_create(lwp_t *l, void *arg, u_lon return ENOMEM; error = lwp_create(l, p, uaddr, flags & LWP_DETACHED, NULL, 0, - p->p_emul->e_startlwp, arg, , l->l_class, sigmask, _INIT); + p->p_emul->e_startlwp, arg, , l->l_class, sigmask, _ss_init); if (__predict_false(error)) { uvm_uarea_free(uaddr); return error;
CVS commit: [netbsd-8] src/sys/uvm
Module Name:src Committed By: martin Date: Sun Aug 11 10:01:15 UTC 2019 Modified Files: src/sys/uvm [netbsd-8]: uvm_mmap.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1332): sys/uvm/uvm_mmap.c: revision 1.173 Change 'npgs' from int to size_t. Otherwise the 64bit->32bit conversion could lead to npgs=0, which is not expected. It later triggers a panic in uvm_vsunlock(). Found by TriforceAFL (Akul Pillai). To generate a diff of this commit: cvs rdiff -u -r1.166.2.1 -r1.166.2.2 src/sys/uvm/uvm_mmap.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/uvm/uvm_mmap.c diff -u src/sys/uvm/uvm_mmap.c:1.166.2.1 src/sys/uvm/uvm_mmap.c:1.166.2.2 --- src/sys/uvm/uvm_mmap.c:1.166.2.1 Thu Nov 2 21:39:18 2017 +++ src/sys/uvm/uvm_mmap.c Sun Aug 11 10:01:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_mmap.c,v 1.166.2.1 2017/11/02 21:39:18 snj Exp $ */ +/* $NetBSD: uvm_mmap.c,v 1.166.2.2 2019/08/11 10:01:14 martin Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.166.2.1 2017/11/02 21:39:18 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_mmap.c,v 1.166.2.2 2019/08/11 10:01:14 martin Exp $"); #include "opt_compat_netbsd.h" #include "opt_pax.h" @@ -146,7 +146,8 @@ sys_mincore(struct lwp *l, const struct vaddr_t start, end, lim; struct vm_map *map; vsize_t len; - int error = 0, npgs; + int error = 0; + size_t npgs; map = >p_vmspace->vm_map;
CVS commit: [netbsd-8] src/sys/uvm
Module Name:src Committed By: martin Date: Sun Aug 11 10:01:15 UTC 2019 Modified Files: src/sys/uvm [netbsd-8]: uvm_mmap.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1332): sys/uvm/uvm_mmap.c: revision 1.173 Change 'npgs' from int to size_t. Otherwise the 64bit->32bit conversion could lead to npgs=0, which is not expected. It later triggers a panic in uvm_vsunlock(). Found by TriforceAFL (Akul Pillai). To generate a diff of this commit: cvs rdiff -u -r1.166.2.1 -r1.166.2.2 src/sys/uvm/uvm_mmap.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
Module Name:src Committed By: skrll Date: Sun Aug 11 08:57:36 UTC 2019 Modified Files: src/sys/dev/usb: if_axen.c if_ure.c Log Message: Appease module build To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/dev/usb/if_axen.c cvs rdiff -u -r1.23 -r1.24 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
Module Name:src Committed By: skrll Date: Sun Aug 11 08:57:36 UTC 2019 Modified Files: src/sys/dev/usb: if_axen.c if_ure.c Log Message: Appease module build To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/dev/usb/if_axen.c cvs rdiff -u -r1.23 -r1.24 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_axen.c diff -u src/sys/dev/usb/if_axen.c:1.61 src/sys/dev/usb/if_axen.c:1.62 --- src/sys/dev/usb/if_axen.c:1.61 Sun Aug 11 02:37:03 2019 +++ src/sys/dev/usb/if_axen.c Sun Aug 11 08:57:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_axen.c,v 1.61 2019/08/11 02:37:03 mrg Exp $ */ +/* $NetBSD: if_axen.c,v 1.62 2019/08/11 08:57:36 skrll Exp $ */ /* $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */ /* @@ -23,7 +23,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.61 2019/08/11 02:37:03 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.62 2019/08/11 08:57:36 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -863,7 +863,7 @@ axen_tx_prepare(struct usbnet *un, struc usbnet_isowned_tx(un); - if (m->m_pkthdr.len > un->un_tx_bufsz - sizeof(hdr)) + if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - sizeof(hdr)) return 0; length = m->m_pkthdr.len + sizeof(hdr); Index: src/sys/dev/usb/if_ure.c diff -u src/sys/dev/usb/if_ure.c:1.23 src/sys/dev/usb/if_ure.c:1.24 --- src/sys/dev/usb/if_ure.c:1.23 Sun Aug 11 02:37:04 2019 +++ src/sys/dev/usb/if_ure.c Sun Aug 11 08:57:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_ure.c,v 1.23 2019/08/11 02:37:04 mrg Exp $ */ +/* $NetBSD: if_ure.c,v 1.24 2019/08/11 08:57:36 skrll 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.23 2019/08/11 02:37:04 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_ure.c,v 1.24 2019/08/11 08:57:36 skrll 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 > un->un_tx_bufsz - sizeof(txhdr)) + if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - sizeof(txhdr)) return 0; /* header */
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 08:56:53 UTC 2019 Modified Files: src/sys/dev/usb: if_udav.c Log Message: Appease module build To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/if_udav.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_udav.c diff -u src/sys/dev/usb/if_udav.c:1.65 src/sys/dev/usb/if_udav.c:1.66 --- src/sys/dev/usb/if_udav.c:1.65 Sat Aug 10 02:17:36 2019 +++ src/sys/dev/usb/if_udav.c Sun Aug 11 08:56:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_udav.c,v 1.65 2019/08/10 02:17:36 mrg Exp $ */ +/* $NetBSD: if_udav.c,v 1.66 2019/08/11 08:56:53 skrll Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -45,7 +45,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.65 2019/08/10 02:17:36 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_udav.c,v 1.66 2019/08/11 08:56:53 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -672,7 +672,7 @@ udav_tx_prepare(struct usbnet *un, struc DPRINTF(("%s: %s: enter\n", device_xname(un->un_dev), __func__)); - if (m->m_pkthdr.len > UDAV_BUFSZ - 2) + if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - 2) return 0; /* Copy the mbuf data into a contiguous buffer */
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 08:56:53 UTC 2019 Modified Files: src/sys/dev/usb: if_udav.c Log Message: Appease module build To generate a diff of this commit: cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/if_udav.c 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
Module Name:src Committed By: wiz Date: Sun Aug 11 08:26:46 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Various fixes: Pp cleanup, use more macros, sort sections, fix typos, Americanize spelling (like other man pages), fix macro arguments. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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.1 src/share/man/man9/usbnet.9:1.2 --- src/share/man/man9/usbnet.9:1.1 Sat Aug 10 20:35:35 2019 +++ src/share/man/man9/usbnet.9 Sun Aug 11 08:26:46 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: usbnet.9,v 1.1 2019/08/10 20:35:35 mrg Exp $ +.\" $NetBSD: usbnet.9,v 1.2 2019/08/11 08:26:46 wiz Exp $ .\" .\" Copyright (c) 2019 Matthew R. Green .\" All rights reserved. @@ -31,7 +31,7 @@ .Os .Sh NAME .Nm usbnet -.Nd common USB ethernet driver framework +.Nd common USB Ethernet driver framework .Sh SYNOPSIS .In dev/usb/usbnet.h .Ss Functions offered by usbnet.h @@ -114,10 +114,9 @@ .Sh DESCRIPTION The .Nm -framework provides methods usable for USB ethernet drivers. +framework provides methods usable for USB Ethernet drivers. The framework has support for these features: -.Pp -.Bl -tag -width "123456" +.Bl -bullet -offset 8n .It Partial autoconf handling .It @@ -129,7 +128,7 @@ Generic handlers or support for several .It MII bus locking .It -Interrupt handling +Interrupt handling .El .Pp .Nm @@ -139,7 +138,7 @@ members inside .Va struct usbnet , which can be used directly as the device softc structure if no additional storage is required. -An structure exists for receive and transmit chain management, +A structure exists for receive and transmit chain management, .Va struct usbnet_chain , that tracks the metadata for each transfer descriptor available, minimum of one each for Rx and Tx slot, and will be passed @@ -157,9 +156,9 @@ is set to the device .Fa dv_private , if it can not be used directly as the device softc, as well as set up the necessary structure members, find end-points, find the -ethernet address if relevant, call +Ethernet address if relevant, call .Fn usbnet_attach , -setup interface, ethernet, and MII capabilities, and finally call +set up interface, Ethernet, and MII capabilities, and finally call .Fn usbnet_attach_ifp . The device detach routine should free any resources allocated by attach and then call @@ -177,9 +176,9 @@ To manage all Rx and Tx chains the .Dq uno_init callback of .Va struct usbnet_ops -should perform any device specific initialisation and then call +should perform any device specific initialization and then call .Fn usbnet_init_rx_tx -which will allocate chains, setup and open pipes, and start the +which will allocate chains, set up and open pipes, and start the Rx transfers so that packets can arrived. These allocations and pipes can be closed and destroyed by calling .Fn usbnet_stop . @@ -191,7 +190,7 @@ must be called with the .Nm lock held, see .Fn usbnet_lock -and +and .Fn usbnet_unlock . See the .Sx RECEIVE AND SEND @@ -199,11 +198,11 @@ section for details on using the chains. .Pp The interface init, ioctl, start, and stop, routines are handled by the framework with callbacks for device-specific handling. -For interface init (ie, when bringing the interface up), the +For interface init (i.e., when bringing the interface up), the .Dq uno_init -callback should perform any device specific initialisation and then call +callback should perform any device specific initialization and then call .Fn usbnet_init_rx_tx -to finalise Rx and Tx queue initialisation. +to finalize Rx and Tx queue initialization. For interface ioctl, most of the handling is in the framework and the optional .Dq uno_ioctl @@ -228,11 +227,11 @@ For devices requiring MII handling there writing registers, and for status change events. The framework provides an MII-specific lock per interface which will be held when calling these functions, and these locks should be used by -internal code that also requires serialised access to registers with the +internal code that also requires serialized access to registers with the .Fn usbnet_lock_mii , .Fn usbnet_unlock_mii , .Fn usbnet_lock_mii_un_locked , -and +and .Fn usbnet_unlock_mii_un_locked functions. These functions handle device detach events safely, and as such take @@ -252,7 +251,7 @@ the network frame up the stack via eithe .Fn usbnet_enqueue or .Fn usbnet_input . -Typically ethernet devices prefer +Typically Ethernet devices prefer .Fn usbnet_enqueue . .Pp General accessor functions for @@ -295,11 +294,10 @@ Returns true if device is dying (has bee pending detach.) .El .Pp - Lock handling functions for .Fa struct usbnet : .Pp -.Bl -compact -tag -width 4n +.Bl -tag -width 4n -compact .It Fn usbnet_lock un .It Fn
CVS commit: src/share/man/man9
Module Name:src Committed By: wiz Date: Sun Aug 11 08:26:46 UTC 2019 Modified Files: src/share/man/man9: usbnet.9 Log Message: Various fixes: Pp cleanup, use more macros, sort sections, fix typos, Americanize spelling (like other man pages), fix macro arguments. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 07:58:16 UTC 2019 Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Correct the length of the buffer to copy into the mbuf. Spotted by sc dying. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/dev/usb/if_smsc.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
Module Name:src Committed By: skrll Date: Sun Aug 11 07:58:16 UTC 2019 Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Correct the length of the buffer to copy into the mbuf. Spotted by sc dying. To generate a diff of this commit: cvs rdiff -u -r1.52 -r1.53 src/sys/dev/usb/if_smsc.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_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.52 src/sys/dev/usb/if_smsc.c:1.53 --- src/sys/dev/usb/if_smsc.c:1.52 Sun Aug 11 06:54:14 2019 +++ src/sys/dev/usb/if_smsc.c Sun Aug 11 07:58:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $ */ +/* $NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll 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.52 2019/08/11 06:54:14 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.53 2019/08/11 07:58:16 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -970,7 +970,7 @@ smsc_rxeof_loop(struct usbnet * un, stru } uint8_t *pktbuf = buf + ETHER_ALIGN; - size_t buflen = pktlen; + size_t buflen = pktlen - ETHER_ALIGN; int mbuf_flags = M_HASFCS; int csum_flags = 0; uint16_t csum_data = 0;
Re: CVS commit: src/sys/sys
On Sun, Aug 11, 2019 at 09:17:05AM +0200, Martin Husemann wrote: > On Sat, Aug 10, 2019 at 11:37:28PM +0200, Kamil Rytarowski wrote: > > > can we go back to the drawing board on this one and discuss the original > > > problem? > > > > > > > C++ and cast rules. > > The question is whether we really should play this game in our system headers. > The original state was usable in C++ (but awkward), or do I misunderstand > someting? > > Martin The key point seems to be: NetBSD: struct kevent { ... intptr_tudata; /* opaque user data identifier */ Everyone else (apparently)**: struct kevent { ... void*udata; /* opaque user data identifier */ > doing __CAST(intptr_t, (udata)) with a static inline* For C++, that's static_cast(udata). This errors with nullptr as an argument. > Let C++ polymorphism handle it. provide a void* and a uintptr_t case. > Discover the following are all valid types for arguments for udata: 0, NULL, nullptr, 0L, 0LL, 0U, 0UL, 0ULL, intptr_t, uintptr_t Create an EV_SET version for all of them, letting C++ sort out which it is. * It's at this point I should mention that a C-style cast seems to make C++ stop erroring in all these cases. Accidentally tested this first. They are discouraged though for (I don't C++ a lot, so someone fill this in). ** FreeBSD just changed their struct kevent in freebsd 12, adding an argument.
Re: CVS commit: src/sys/sys
On Sat, Aug 10, 2019 at 11:37:28PM +0200, Kamil Rytarowski wrote: > > can we go back to the drawing board on this one and discuss the original > > problem? > > > > C++ and cast rules. The question is whether we really should play this game in our system headers. The original state was usable in C++ (but awkward), or do I misunderstand someting? Martin
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 07:12:08 UTC 2019 Modified Files: src/sys/dev/usb: TODO Log Message: G/C To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/dev/usb/TODO 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/TODO diff -u src/sys/dev/usb/TODO:1.50 src/sys/dev/usb/TODO:1.51 --- src/sys/dev/usb/TODO:1.50 Fri Aug 9 06:38:39 2019 +++ src/sys/dev/usb/TODO Sun Aug 11 07:12:08 2019 @@ -75,8 +75,6 @@ Factor out the common code from the Ethe if_url - patch available if_urndis - done -Get rid of hcpriv. - Keyspan serial driver Clean up umass driver
CVS commit: src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Aug 11 06:54:15 UTC 2019 Modified Files: src/sys/dev/usb: if_smsc.c Log Message: Add a check in smsc_tx_prepare for the mbuf being too big. Discussed with mrg@ To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/dev/usb/if_smsc.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_smsc.c diff -u src/sys/dev/usb/if_smsc.c:1.51 src/sys/dev/usb/if_smsc.c:1.52 --- src/sys/dev/usb/if_smsc.c:1.51 Sat Aug 10 02:17:36 2019 +++ src/sys/dev/usb/if_smsc.c Sun Aug 11 06:54:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_smsc.c,v 1.51 2019/08/10 02:17:36 mrg Exp $ */ +/* $NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll 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.51 2019/08/10 02:17:36 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_smsc.c,v 1.52 2019/08/11 06:54:14 skrll Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1048,6 +1048,11 @@ smsc_tx_prepare(struct usbnet *un, struc usbnet_isowned_tx(un); + const size_t hdrsz = sizeof(txhdr) * 2; + + if ((unsigned)m->m_pkthdr.len > un->un_tx_bufsz - hdrsz) + return 0; + /* * Each frame is prefixed with two 32-bit values describing the * length of the packet and buffer. @@ -1059,9 +1064,9 @@ smsc_tx_prepare(struct usbnet *un, struc txhdr = SMSC_TX_CTRL_1_PKT_LENGTH(m->m_pkthdr.len); txhdr = htole32(txhdr); - memcpy(c->unc_buf + 4, , sizeof(txhdr)); + memcpy(c->unc_buf + sizeof(txhdr), , sizeof(txhdr)); - frm_len += 8; + frm_len += hdrsz; /* Next copy in the actual packet */ m_copydata(m, 0, m->m_pkthdr.len, c->unc_buf + frm_len);
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sun Aug 11 06:49:31 UTC 2019 Modified Files: src/sys/arch/arm/arm32: exception.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/arm32/exception.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/exception.S diff -u src/sys/arch/arm/arm32/exception.S:1.24 src/sys/arch/arm/arm32/exception.S:1.25 --- src/sys/arch/arm/arm32/exception.S:1.24 Fri Jul 7 00:34:09 2017 +++ src/sys/arch/arm/arm32/exception.S Sun Aug 11 06:49:31 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: exception.S,v 1.24 2017/07/07 00:34:09 chs Exp $ */ +/* $NetBSD: exception.S,v 1.25 2019/08/11 06:49:31 skrll Exp $ */ /* * Copyright (c) 1994-1997 Mark Brinicombe. @@ -51,9 +51,9 @@ #include - RCSID("$NetBSD: exception.S,v 1.24 2017/07/07 00:34:09 chs Exp $") + RCSID("$NetBSD: exception.S,v 1.25 2019/08/11 06:49:31 skrll Exp $") - .text + .text .align 0 AST_ALIGNMENT_FAULT_LOCALS
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sun Aug 11 06:49:31 UTC 2019 Modified Files: src/sys/arch/arm/arm32: exception.S Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/sys/arch/arm/arm32/exception.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: rin Date: Sun Aug 11 06:46:35 UTC 2019 Modified Files: src/sys/dev/acpi: pckbc_acpi.c Log Message: Appease GCC maybe-uninitialized for optimization level -Os on amd64. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/acpi/pckbc_acpi.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/acpi/pckbc_acpi.c diff -u src/sys/dev/acpi/pckbc_acpi.c:1.36 src/sys/dev/acpi/pckbc_acpi.c:1.37 --- src/sys/dev/acpi/pckbc_acpi.c:1.36 Sat Oct 28 04:53:55 2017 +++ src/sys/dev/acpi/pckbc_acpi.c Sun Aug 11 06:46:35 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pckbc_acpi.c,v 1.36 2017/10/28 04:53:55 riastradh Exp $ */ +/* $NetBSD: pckbc_acpi.c,v 1.37 2019/08/11 06:46:35 rin Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.36 2017/10/28 04:53:55 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pckbc_acpi.c,v 1.37 2019/08/11 06:46:35 rin Exp $"); #include #include @@ -234,7 +234,7 @@ out: static void pckbc_acpi_intr_establish(struct pckbc_softc *sc, pckbc_slot_t slot) { - struct pckbc_acpi_softc *psc; + struct pckbc_acpi_softc *psc = NULL; /* XXX: gcc */ isa_chipset_tag_t ic = NULL; void *rv = NULL; int irq = 0, ist = 0; /* XXX: gcc */
CVS commit: src/sys/arch/sparc/dev
Module Name:src Committed By: macallan Date: Sun Aug 11 06:04:16 UTC 2019 Modified Files: src/sys/arch/sparc/dev: cgfourteen.c Log Message: remove orphaned comment To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/sparc/dev/cgfourteen.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/sparc/dev
Module Name:src Committed By: macallan Date: Sun Aug 11 06:04:16 UTC 2019 Modified Files: src/sys/arch/sparc/dev: cgfourteen.c Log Message: remove orphaned comment To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/arch/sparc/dev/cgfourteen.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/sparc/dev/cgfourteen.c diff -u src/sys/arch/sparc/dev/cgfourteen.c:1.87 src/sys/arch/sparc/dev/cgfourteen.c:1.88 --- src/sys/arch/sparc/dev/cgfourteen.c:1.87 Thu Jan 17 23:05:15 2019 +++ src/sys/arch/sparc/dev/cgfourteen.c Sun Aug 11 06:04:16 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: cgfourteen.c,v 1.87 2019/01/17 23:05:15 macallan Exp $ */ +/* $NetBSD: cgfourteen.c,v 1.88 2019/08/11 06:04:16 macallan Exp $ */ /* * Copyright (c) 1996 @@ -59,13 +59,6 @@ * XXX should defer colormap updates to vertical retrace interrupts */ -/* - * The following is for debugging only; it opens up a security hole - * enabled by allowing any user to map the control registers for the - * cg14 into their space. - */ -#undef CG14_MAP_REGS - #include "opt_wsemul.h" #include "sx.h"