CVS commit: src/tests/net/ipsec

2022-11-23 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Nov 24 02:58:28 UTC 2022

Modified Files:
src/tests/net/ipsec: t_ipsec_forwarding.sh

Log Message:
clean up


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/ipsec/t_ipsec_forwarding.sh

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



CVS commit: src/tests/net/ipsec

2022-11-23 Thread Kengo NAKAHARA
Module Name:src
Committed By:   knakahara
Date:   Thu Nov 24 02:58:28 UTC 2022

Modified Files:
src/tests/net/ipsec: t_ipsec_forwarding.sh

Log Message:
clean up


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/net/ipsec/t_ipsec_forwarding.sh

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

Modified files:

Index: src/tests/net/ipsec/t_ipsec_forwarding.sh
diff -u src/tests/net/ipsec/t_ipsec_forwarding.sh:1.1 src/tests/net/ipsec/t_ipsec_forwarding.sh:1.2
--- src/tests/net/ipsec/t_ipsec_forwarding.sh:1.1	Wed Nov  9 08:21:20 2022
+++ src/tests/net/ipsec/t_ipsec_forwarding.sh	Thu Nov 24 02:58:28 2022
@@ -1,4 +1,4 @@
-#   $NetBSD: t_ipsec_forwarding.sh,v 1.1 2022/11/09 08:21:20 knakahara Exp $
+#   $NetBSD: t_ipsec_forwarding.sh,v 1.2 2022/11/24 02:58:28 knakahara Exp $
 #
 # Copyright (c) 2022 Internet Initiative Japan Inc.
 # All rights reserved.
@@ -456,33 +456,6 @@ test_ipsec_sp_port_ipv6()
 	atf_check -s exit:0 \
 	-o match:"${ip_remote_i}\.$port > ${ip_local_i}\.[0-9]+" \
 	cat $routfile
-
-#	# Check TCP communications from remote to local
-#	start_nc_server $SOCK_LOCAL $port $file_recv ipv6
-#	prepare_file $file_send
-#	export RUMP_SERVER=$SOCK_REMOTE
-#	atf_check -s exit:0 $HIJACKING nc -w 3 $ip_local_i $port < $file_send
-#	atf_check -s exit:0 diff -q $file_send $file_recv
-#	stop_nc_server
-#
-#	extract_new_packets $BUS_LOCAL_F > $loutfile
-#	extract_new_packets $BUS_REMOTE_F > $routfile
-#	$DEBUG && cat $loutfile
-#	atf_check -s exit:0 \
-#	-o match:"${ip_local_f}\.[0-9]+ > ${ip_remote_i}\.$port" \
-#	cat $loutfile
-#	atf_check -s exit:0 \
-#	-o match:"${ip_remote_i}\.$port > ${ip_local_f}\.[0-9]+" \
-#	cat $loutfile
-#	$DEBUG && cat $routfile
-#	atf_check -s exit:0 \
-#	-o match:"${ip_forward_l} > ${ip_remote_i}: ESP" \
-#	cat $routfile
-#	atf_check -s exit:0 \
-#	-o match:"${ip_remote_i} > ${ip_forward_l}: ESP" \
-#	cat $routfile
-
-
 }
 
 add_test_ipsec_sp_port()



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

2022-11-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 24 00:13:55 UTC 2022

Modified Files:
src/sys/arch/powerpc/powerpc: ofw_machdep.c

Log Message:
in ofprint() only append \r if the last character is \n


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/powerpc/ofw_machdep.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/powerpc/powerpc

2022-11-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 24 00:13:55 UTC 2022

Modified Files:
src/sys/arch/powerpc/powerpc: ofw_machdep.c

Log Message:
in ofprint() only append \r if the last character is \n


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/powerpc/powerpc/ofw_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/powerpc/ofw_machdep.c
diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.32 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.33
--- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.32	Thu Nov 24 00:07:48 2022
+++ src/sys/arch/powerpc/powerpc/ofw_machdep.c	Thu Nov 24 00:13:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.33 2022/11/24 00:13:54 macallan Exp $");
 
 #include 
 #include 
@@ -115,7 +115,8 @@ void ofprint(const char *blah, ...)
 	va_end(va);
 	OF_write(console_instance, buf, len);
 	/* Apple OF only does a newline on \n, so add an explicit CR */
-	OF_write(console_instance, "\r", 1);
+	if ((len > 0) && (buf[len - 1] == '\n'))
+		OF_write(console_instance, "\r", 1);
 }
 
 static int



CVS commit: src/sys/arch/powerpc

2022-11-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 24 00:07:49 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: ofw_machdep.h
src/sys/arch/powerpc/oea: ofw_consinit.c
src/sys/arch/powerpc/powerpc: ofw_machdep.c

Log Message:
move ofprint() to powerpc/ofw_machdep.c and make it official
now that console output uses locks it needs more of the kernel to function, so
for now use direct OF calls for earliest debug output


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/ofw_machdep.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/oea/ofw_consinit.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/powerpc/ofw_machdep.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/powerpc

2022-11-23 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Thu Nov 24 00:07:49 UTC 2022

Modified Files:
src/sys/arch/powerpc/include: ofw_machdep.h
src/sys/arch/powerpc/oea: ofw_consinit.c
src/sys/arch/powerpc/powerpc: ofw_machdep.c

Log Message:
move ofprint() to powerpc/ofw_machdep.c and make it official
now that console output uses locks it needs more of the kernel to function, so
for now use direct OF calls for earliest debug output


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/powerpc/include/ofw_machdep.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/powerpc/oea/ofw_consinit.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/powerpc/powerpc/ofw_machdep.c

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

Modified files:

Index: src/sys/arch/powerpc/include/ofw_machdep.h
diff -u src/sys/arch/powerpc/include/ofw_machdep.h:1.5 src/sys/arch/powerpc/include/ofw_machdep.h:1.6
--- src/sys/arch/powerpc/include/ofw_machdep.h:1.5	Wed Nov  2 20:38:22 2022
+++ src/sys/arch/powerpc/include/ofw_machdep.h	Thu Nov 24 00:07:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_machdep.h,v 1.5 2022/11/02 20:38:22 andvar Exp $ */
+/* $NetBSD: ofw_machdep.h,v 1.6 2022/11/24 00:07:49 macallan Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -60,6 +60,8 @@ extern int ofw_chosen;		/* cached handle
 extern struct OF_translation ofw_translations[OFW_MAX_TRANSLATIONS];
 
 void	ofw_bootstrap(void);
+void 	ofprint(const char *, ...);
+
 #endif /* _KERNEL */
 
 #endif /* _POWERPC_OFW_MACHDEP_H_ */

Index: src/sys/arch/powerpc/oea/ofw_consinit.c
diff -u src/sys/arch/powerpc/oea/ofw_consinit.c:1.25 src/sys/arch/powerpc/oea/ofw_consinit.c:1.26
--- src/sys/arch/powerpc/oea/ofw_consinit.c:1.25	Sun Feb 13 12:24:24 2022
+++ src/sys/arch/powerpc/oea/ofw_consinit.c	Thu Nov 24 00:07:49 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: ofw_consinit.c,v 1.25 2022/02/13 12:24:24 martin Exp $ */
+/* $NetBSD: ofw_consinit.c,v 1.26 2022/11/24 00:07:49 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.25 2022/02/13 12:24:24 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_consinit.c,v 1.26 2022/11/24 00:07:49 macallan Exp $");
 
 #include "adb.h"
 #include "adbkbd.h"
@@ -89,7 +89,7 @@ extern struct consdev consdev_zs;
 #include 
 #endif
 
-extern int console_node, console_instance;
+extern int console_node;
 
 int ofkbd_ihandle = -1;
 
@@ -98,19 +98,6 @@ static void ofwoea_cnprobe_keyboard(void
 /*#define OFDEBUG*/
 
 #ifdef OFDEBUG
-void ofprint(const char *, ...);
-
-void ofprint(const char *blah, ...)
-{
-	va_list va;
-	char buf[256];
-	int len;
-
-	va_start(va, blah);
-	len = vsnprintf(buf, sizeof(buf), blah, va);
-	va_end(va);
-	OF_write(console_instance, buf, len);
-}
 
 #define OFPRINTF ofprint
 #else

Index: src/sys/arch/powerpc/powerpc/ofw_machdep.c
diff -u src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.31 src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.32
--- src/sys/arch/powerpc/powerpc/ofw_machdep.c:1.31	Wed Oct 12 20:50:43 2022
+++ src/sys/arch/powerpc/powerpc/ofw_machdep.c	Thu Nov 24 00:07:48 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ofw_machdep.c,v 1.31 2022/10/12 20:50:43 andvar Exp $	*/
+/*	$NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2021 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.31 2022/10/12 20:50:43 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.32 2022/11/24 00:07:48 macallan Exp $");
 
 #include 
 #include 
@@ -83,7 +83,7 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_machdep.
 #include 
 
 #ifdef DEBUG
-#define DPRINTF aprint_error
+#define DPRINTF ofprint
 #else
 #define DPRINTF while(0) printf
 #endif
@@ -104,6 +104,20 @@ bool	ofwbootcons_suppress;
 int	ofw_address_cells;
 int	ofw_size_cells;
 
+void ofprint(const char *blah, ...)
+{
+	va_list va;
+	char buf[256];
+	int len;
+
+	va_start(va, blah);
+	len = vsnprintf(buf, sizeof(buf), blah, va);
+	va_end(va);
+	OF_write(console_instance, buf, len);
+	/* Apple OF only does a newline on \n, so add an explicit CR */
+	OF_write(console_instance, "\r", 1);
+}
+
 static int
 ofwbootcons_cngetc(dev_t dev)
 {
@@ -227,14 +241,14 @@ ofw_bootstrap_get_memory(void)
 #ifndef _LP64
 		if (addr > 0x || size > 0x ||
 			(addr + size) > 0x) {
-			aprint_error("Base addr of %llx or size of %llx too"
+			ofprint("Base addr of %llx or size of %llx too"
 			" large for 32 bit OS. Skipping.", addr, size);
 			continue;
 		}
 #endif
 		OFmem[memcnt].start = addr;
 		OFmem[memcnt].size = size;
-		aprint_normal("mem region %d start=%"PRIx64" size=%"PRIx64"\n",
+		ofprint("mem region %d start=%"PRIx64" size=%"PRIx64"\n",
 		memcnt, addr, size);
 		memcnt++;
 	}
@@ -290,14 +304,14 @@ ofw_bootstrap_get_memory(void)
 #ifndef _LP64
 		if (addr > 

CVS commit: src/sys/uvm

2022-11-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Nov 23 23:53:53 UTC 2022

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
mmap(2): Avoid arithmetic overflow in search for free space.

PR kern/56900

Reported-by: syzbot+3833ae1d38037a263...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e542bcf59b2564cca1cb38c12f076fb08dcac37e


To generate a diff of this commit:
cvs rdiff -u -r1.402 -r1.403 src/sys/uvm/uvm_map.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_map.c
diff -u src/sys/uvm/uvm_map.c:1.402 src/sys/uvm/uvm_map.c:1.403
--- src/sys/uvm/uvm_map.c:1.402	Wed Jun  8 16:55:00 2022
+++ src/sys/uvm/uvm_map.c	Wed Nov 23 23:53:53 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.402 2022/06/08 16:55:00 macallan Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.403 2022/11/23 23:53:53 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.402 2022/06/08 16:55:00 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.403 2022/11/23 23:53:53 riastradh Exp $");
 
 #include "opt_ddb.h"
 #include "opt_pax.h"
@@ -1994,7 +1994,20 @@ uvm_map_findspace(struct vm_map *map, va
 	/* Try to find the space in the red-black tree */
 
 	/* Check slot before any entry */
-	hint = topdown ? entry->next->start - length : entry->end;
+	if (topdown) {
+		KASSERTMSG(entry->next->start >= vm_map_min(map),
+		"map=%p entry=%p entry->next=%p"
+		" entry->next->start=0x%"PRIxVADDR" min=0x%"PRIxVADDR,
+		map, entry, entry->next,
+		entry->next->start, vm_map_min(map));
+		if (length > entry->next->start - vm_map_min(map))
+			hint = vm_map_min(map); /* XXX goto wraparound? */
+		else
+			hint = entry->next->start - length;
+		KASSERT(hint >= vm_map_min(map));
+	} else {
+		hint = entry->end;
+	}
 	INVARIANTS();
 	avail = uvm_map_space_avail(, length, uoffset, align, flags,
 	topdown, entry);



CVS commit: src/sys/uvm

2022-11-23 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Nov 23 23:53:53 UTC 2022

Modified Files:
src/sys/uvm: uvm_map.c

Log Message:
mmap(2): Avoid arithmetic overflow in search for free space.

PR kern/56900

Reported-by: syzbot+3833ae1d38037a263...@syzkaller.appspotmail.com
https://syzkaller.appspot.com/bug?id=e542bcf59b2564cca1cb38c12f076fb08dcac37e


To generate a diff of this commit:
cvs rdiff -u -r1.402 -r1.403 src/sys/uvm/uvm_map.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/man4

2022-11-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov 23 23:49:23 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/bmx280thp.4

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

Modified files:

Index: src/share/man/man4/bmx280thp.4
diff -u src/share/man/man4/bmx280thp.4:1.3 src/share/man/man4/bmx280thp.4:1.4
--- src/share/man/man4/bmx280thp.4:1.3	Wed Nov 23 23:45:30 2022
+++ src/share/man/man4/bmx280thp.4	Wed Nov 23 23:49:23 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: bmx280thp.4,v 1.3 2022/11/23 23:45:30 brad Exp $
+.\" $NetBSD: bmx280thp.4,v 1.4 2022/11/23 23:49:23 wiz Exp $
 .\"
 .\" Copyright (c) 2022 Brad Spencer 
 .\"
@@ -60,10 +60,10 @@ to reach >= 75% of the step response.
 .It Li hw.bmx280thp0.waitfactor.h
 These control the wait multiplication factor for a measurement cycle.
 This factor is different for temperature, pressure and humidity and
-is based upon the values of osrs_t, osrs_p and osrs_h.  If the chip
-does not return the correct measurements for a given over sampling
-then the wait factors can be adjusted to allow more time for the
-measurement to complete successfully.
+is based upon the values of osrs_t, osrs_p and osrs_h.
+If the chip does not return the correct measurements for a given
+over sampling then the wait factors can be adjusted to allow more
+time for the measurement to complete successfully.
 .It Li hw.bmx280thp0.debug
 .It Li hw.bmx280thp0.dump_calibration
 If the driver is compiled with



CVS commit: src/share/man/man4

2022-11-23 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Nov 23 23:49:23 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4

Log Message:
New sentence, new line.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/share/man/man4/bmx280thp.4

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



CVS commit: src

2022-11-23 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Wed Nov 23 23:45:30 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4
src/sys/dev/i2c: bmx280.c bmx280var.h

Log Message:
Use kpause() instead of delay() in the measurement cycle.  Try and
derive the proper wait delay for the measurement based upon the over
sampling setting and allow the wait factor multiplier to be adjusted.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/bmx280thp.4
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/bmx280.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/bmx280var.h

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

Modified files:

Index: src/share/man/man4/bmx280thp.4
diff -u src/share/man/man4/bmx280thp.4:1.2 src/share/man/man4/bmx280thp.4:1.3
--- src/share/man/man4/bmx280thp.4:1.2	Mon Nov 21 23:51:10 2022
+++ src/share/man/man4/bmx280thp.4	Wed Nov 23 23:45:30 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: bmx280thp.4,v 1.2 2022/11/21 23:51:10 wiz Exp $
+.\" $NetBSD: bmx280thp.4,v 1.3 2022/11/23 23:45:30 brad Exp $
 .\"
 .\" Copyright (c) 2022 Brad Spencer 
 .\"
@@ -55,6 +55,15 @@ IRR is a filter that can be used to redu
 measurement.
 The value values are 1 (or off), 2, 5, 11 and 22 samples
 to reach >= 75% of the step response.
+.It Li hw.bmx280thp0.waitfactor.t
+.It Li hw.bmx280thp0.waitfactor.p
+.It Li hw.bmx280thp0.waitfactor.h
+These control the wait multiplication factor for a measurement cycle.
+This factor is different for temperature, pressure and humidity and
+is based upon the values of osrs_t, osrs_p and osrs_h.  If the chip
+does not return the correct measurements for a given over sampling
+then the wait factors can be adjusted to allow more time for the
+measurement to complete successfully.
 .It Li hw.bmx280thp0.debug
 .It Li hw.bmx280thp0.dump_calibration
 If the driver is compiled with

Index: src/sys/dev/i2c/bmx280.c
diff -u src/sys/dev/i2c/bmx280.c:1.2 src/sys/dev/i2c/bmx280.c:1.3
--- src/sys/dev/i2c/bmx280.c:1.2	Tue Nov 22 19:40:31 2022
+++ src/sys/dev/i2c/bmx280.c	Wed Nov 23 23:45:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bmx280.c,v 1.2 2022/11/22 19:40:31 brad Exp $	*/
+/*	$NetBSD: bmx280.c,v 1.3 2022/11/23 23:45:29 brad Exp $	*/
 
 /*
  * Copyright (c) 2022 Brad Spencer 
@@ -17,7 +17,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.2 2022/11/22 19:40:31 brad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1.3 2022/11/23 23:45:29 brad Exp $");
 
 /*
   Driver for the Bosch BMP280/BME280 temperature, humidity (sometimes) and
@@ -31,6 +31,7 @@ __KERNEL_RCSID(0, "$NetBSD: bmx280.c,v 1
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -349,7 +350,7 @@ bmx280_sysctl_init(struct bmx280_sc *sc)
 {
 	int error;
 	const struct sysctlnode *cnode;
-	int sysctlroot_num;
+	int sysctlroot_num, sysctlwait_num;
 
 	if ((error = sysctl_createv(>sc_bmx280log, 0, NULL, ,
 	0, CTLTYPE_NODE, device_xname(sc->sc_dev),
@@ -414,6 +415,36 @@ bmx280_sysctl_init(struct bmx280_sc *sc)
 	0, CTL_HW, sysctlroot_num, CTL_CREATE, CTL_EOL)) != 0)
 		return error;
 
+	if ((error = sysctl_createv(>sc_bmx280log, 0, NULL, ,
+	0, CTLTYPE_NODE, "waitfactor",
+	SYSCTL_DESCR("bmx280 wait factors"), NULL, 0, NULL, 0, CTL_HW,
+	sysctlroot_num, CTL_CREATE, CTL_EOL)) != 0)
+		return error;
+	sysctlwait_num = cnode->sysctl_num;
+
+	if ((error = sysctl_createv(>sc_bmx280log, 0, NULL, ,
+	CTLFLAG_READWRITE, CTLTYPE_INT, "t",
+	SYSCTL_DESCR("Temperature wait multiplier"),
+	bmx280_verify_sysctl, 0, >sc_waitfactor_t,
+	0, CTL_HW, sysctlroot_num, sysctlwait_num, CTL_CREATE, CTL_EOL)) != 0)
+		return error;
+
+	if ((error = sysctl_createv(>sc_bmx280log, 0, NULL, ,
+	CTLFLAG_READWRITE, CTLTYPE_INT, "p",
+	SYSCTL_DESCR("Pressure wait multiplier"),
+	bmx280_verify_sysctl, 0, >sc_waitfactor_p,
+	0, CTL_HW, sysctlroot_num, sysctlwait_num, CTL_CREATE, CTL_EOL)) != 0)
+		return error;
+
+	if (sc->sc_has_humidity) {
+		if ((error = sysctl_createv(>sc_bmx280log, 0, NULL, ,
+		CTLFLAG_READWRITE, CTLTYPE_INT, "h",
+		SYSCTL_DESCR("Humidity wait multiplier"),
+		bmx280_verify_sysctl, 0, >sc_waitfactor_h,
+		0, CTL_HW, sysctlroot_num, sysctlwait_num, CTL_CREATE, CTL_EOL)) != 0)
+			return error;
+	}
+
 	return 0;
 }
 
@@ -472,6 +503,9 @@ bmx280_attach(device_t parent, device_t 
 	sc->sc_osrs_h = 1;
 	sc->sc_irr_samples = 1;
 	sc->sc_previous_irr = 0xff;
+	sc->sc_waitfactor_t = 6;
+	sc->sc_waitfactor_p = 2;
+	sc->sc_waitfactor_h = 2;
 	sc->sc_sme = NULL;
 
 	aprint_normal("\n");
@@ -718,11 +752,24 @@ bmx280_set_control_and_trigger(struct bm
 		error = EINVAL;
 	}
 
-	/* Hmm... this delay is not documented well..  mostly just a guess...
-	 * If it is too short, you will get junk returned as it is possible to try
-	 * to ask for the data before the chip has even started... it seems...
+	/* The wait needed is not well documented, so this is somewhat of a guess.
+	 * 

CVS commit: src

2022-11-23 Thread Brad Spencer
Module Name:src
Committed By:   brad
Date:   Wed Nov 23 23:45:30 UTC 2022

Modified Files:
src/share/man/man4: bmx280thp.4
src/sys/dev/i2c: bmx280.c bmx280var.h

Log Message:
Use kpause() instead of delay() in the measurement cycle.  Try and
derive the proper wait delay for the measurement based upon the over
sampling setting and allow the wait factor multiplier to be adjusted.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/bmx280thp.4
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/i2c/bmx280.c
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/i2c/bmx280var.h

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



CVS commit: src/share/man/man3lua

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 19:20:34 UTC 2022

Modified Files:
src/share/man/man3lua: intro.3lua

Log Message:
Add links to libm (Phil Rulon)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man3lua/intro.3lua

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/man3lua/intro.3lua
diff -u src/share/man/man3lua/intro.3lua:1.9 src/share/man/man3lua/intro.3lua:1.10
--- src/share/man/man3lua/intro.3lua:1.9	Sat May  5 09:49:24 2018
+++ src/share/man/man3lua/intro.3lua	Wed Nov 23 14:20:34 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: intro.3lua,v 1.9 2018/05/05 13:49:24 sevan Exp $
+.\"	$NetBSD: intro.3lua,v 1.10 2022/11/23 19:20:34 christos Exp $
 .\"
 .\" Copyright (c) 2013, 2016 Marc Balmer .
 .\" All rights reserved.
@@ -28,7 +28,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"
-.Dd May 5, 2018
+.Dd November 23, 2022
 .Dt INTRO 3lua
 .Os
 .Sh NAME
@@ -51,6 +51,10 @@ functionality.
 Access
 .Xr gpio 4
 pins.
+.It Em libm
+Access
+.Xr math 3
+functionality.
 .It Em netpgp
 Access
 .Xr libnetpgp 3
@@ -69,6 +73,7 @@ functionality.
 .Xr luac 1 ,
 .Xr bozohttpd 3lua ,
 .Xr gpio 3lua ,
+.Xr libm 3lua ,
 .Xr netpgp 3lua ,
 .Xr sqlite 3lua ,
 .Xr syslog 3lua ,



CVS commit: src/share/man/man3lua

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 19:20:34 UTC 2022

Modified Files:
src/share/man/man3lua: intro.3lua

Log Message:
Add links to libm (Phil Rulon)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/share/man/man3lua/intro.3lua

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



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

2022-11-23 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 23 18:55:06 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rdvar.h

Log Message:
Remove now unused buffer members from softc prepared only for rdreset().


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hp300/dev/rdvar.h

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

Modified files:

Index: src/sys/arch/hp300/dev/rdvar.h
diff -u src/sys/arch/hp300/dev/rdvar.h:1.26 src/sys/arch/hp300/dev/rdvar.h:1.27
--- src/sys/arch/hp300/dev/rdvar.h:1.26	Fri Jul  9 17:05:33 2021
+++ src/sys/arch/hp300/dev/rdvar.h	Wed Nov 23 18:55:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rdvar.h,v 1.26 2021/07/09 17:05:33 tsutsui Exp $	*/
+/*	$NetBSD: rdvar.h,v 1.27 2022/11/23 18:55:06 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -72,9 +72,6 @@ struct	rd_softc {
 	struct	rd_iocmd sc_ioc;
 	struct	rd_rscmd sc_rsc;
 	struct	rd_stat sc_stat;
-	struct	rd_ssmcmd sc_ssmc;
-	struct	rd_srcmd sc_src;
-	struct	rd_clearcmd sc_clear;
 	struct	bufq_state *sc_tab;
 	int	sc_active;
 	int	sc_errcnt;



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

2022-11-23 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 23 18:55:06 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rdvar.h

Log Message:
Remove now unused buffer members from softc prepared only for rdreset().


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/hp300/dev/rdvar.h

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



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

2022-11-23 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 23 18:53:22 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.

- check not only stat value returned by C_QSTAT command against
  each punit but also desc.d_name returned by C_DESC command
  because it looks HPDisk responds to commands against punits supported
  but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
  probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/hp300/dev/rd.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/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.111 src/sys/arch/hp300/dev/rd.c:1.112
--- src/sys/arch/hp300/dev/rd.c:1.111	Mon Nov 21 16:22:37 2022
+++ src/sys/arch/hp300/dev/rd.c	Wed Nov 23 18:53:22 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.111 2022/11/21 16:22:37 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.112 2022/11/23 18:53:22 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.111 2022/11/21 16:22:37 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.112 2022/11/23 18:53:22 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -427,6 +427,7 @@ static const int numrdname2id = __arrayc
 static int	rdident(device_t, struct rd_softc *,
 		struct hpibbus_attach_args *);
 static void	rdreset(struct rd_softc *);
+static void	rdreset_unit(int, int, int);
 static void	rdustart(struct rd_softc *);
 static int	rdgetinfo(dev_t);
 static void	rdrestart(void *);
@@ -490,36 +491,8 @@ static int
 rdmatch(device_t parent, cfdata_t cf, void *aux)
 {
 	struct hpibbus_attach_args *ha = aux;
-	struct rd_clearcmd ccmd;
-	int ctlr, slave, punit;
-	int rv;
-	uint8_t stat;
-
-	rv = rdident(parent, NULL, ha);
-
-	if (rv == 0)
-		return 0;
-
-	/*
-	 * The supported device ID is probed.
-	 * Check if the specified physical unit is actually supported
-	 * by brandnew HP-IB emulator devices like HPDisk and HPDrive etc.
-	 */
-	ctlr  = device_unit(parent);
-	slave = ha->ha_slave;
-	punit = ha->ha_punit;
-	if (punit == 0)
-		return 1;
 
-	ccmd.c_unit = C_SUNIT(punit);
-	ccmd.c_cmd  = C_CLEAR;
-	hpibsend(ctlr, slave, C_TCMD, , sizeof(ccmd));
-	hpibswait(ctlr, slave);
-	hpibrecv(ctlr, slave, C_QSTAT, , sizeof(stat));
-	if (stat != 0)
-		return 0;
-
-	return 1;
+	return rdident(parent, NULL, ha);
 }
 
 static void
@@ -608,29 +581,45 @@ rdident(device_t parent, struct rd_softc
 		return 0;
 
 	/*
-	 * If we're just probing for the device, that's all the
-	 * work we need to do.
+	 * The supported dvice ID is probed.
+	 * Check if the specified physical unit is actually supported
+	 * by brandnew HP-IB emulator devices like HPDisk and HPDrive etc.
 	 */
-	if (sc == NULL)
-		return 1;
-
 	/*
 	 * Reset device and collect description
 	 */
-	rdreset(sc);
+	memset(, 0, sizeof(desc));
+	stat = 0;
+	rdreset_unit(ctlr, slave, ha->ha_punit);
 	cmd[0] = C_SUNIT(ha->ha_punit);
 	cmd[1] = C_SVOL(0);
 	cmd[2] = C_DESC;
 	hpibsend(ctlr, slave, C_CMD, cmd, sizeof(cmd));
 	hpibrecv(ctlr, slave, C_EXEC, , sizeof(desc));
 	hpibrecv(ctlr, slave, C_QSTAT, , sizeof(stat));
+
+	if (stat != 0 || desc.d_name == 0) {
+		/*
+		 * No valid response from the specified punit.
+		 *
+		 * Note it looks HPDisk responds to commands against
+		 * supported but not-configured punits at 1 to 3.
+		 */
+		return 0;
+	}
+
+	/*
+	 * If we're just probing for the device, that's all the
+	 * work we need to do.
+	 */
+	if (sc == NULL)
+		return 1;
+
 	memset(name, 0, sizeof(name));
-	if (stat == 0) {
-		n = desc.d_name;
-		for (i = 5; i >= 0; i--) {
-			name[i] = (n & 0xf) + '0';
-			n >>= 4;
-		}
+	n = desc.d_name;
+	for (i = 5; i >= 0; i--) {
+		name[i] = (n & 0xf) + '0';
+		n >>= 4;
 	}
 
 #ifdef DEBUG
@@ -711,36 +700,48 @@ rdident(device_t parent, struct rd_softc
 static void
 rdreset(struct rd_softc *sc)
 {
-	int ctlr = device_unit(device_parent(sc->sc_dev));
-	int slave = sc->sc_slave;
+	int ctlr, slave, punit;
+
+	ctlr = device_unit(device_parent(sc->sc_dev));
+	slave = sc->sc_slave;
+	punit = sc->sc_punit;
+	rdreset_unit(ctlr, slave, punit);
+#ifdef DEBUG
+	sc->sc_stats.rdresets++;
+#endif
+}
+
+static void
+rdreset_unit(int ctlr, int slave, int punit)
+{
+	struct rd_ssmcmd ssmc;
+	struct rd_srcmd src;
+	struct rd_clearcmd clear;
 	u_char stat;
 
-	sc->sc_clear.c_unit = C_SUNIT(sc->sc_punit);
-	sc->sc_clear.c_cmd = C_CLEAR;
-	hpibsend(ctlr, slave, C_TCMD, >sc_clear, sizeof(sc->sc_clear));
+	clear.c_unit = C_SUNIT(punit);
+	clear.c_cmd = C_CLEAR;
+	hpibsend(ctlr, slave, C_TCMD, , sizeof(clear));
 	

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

2022-11-23 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Nov 23 18:53:22 UTC 2022

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Fix "rd(4) at punits not configured on HPDisk are misprobed" problem.

- check not only stat value returned by C_QSTAT command against
  each punit but also desc.d_name returned by C_DESC command
  because it looks HPDisk responds to commands against punits supported
  but not-configured punits at 1-3
- prepare rdreset_unit() function to manage reset punit ops during
  probe without valid softc

The stragety is taken from OpenBSD with several modification.
Tested on 425t with real 9122D and HPDisk emulating two 7937H drives.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/hp300/dev/rd.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/lua/libm

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 18:18:57 UTC 2022

Modified Files:
src/tests/lib/lua/libm: h_lualibm.c lualibm.lua

Log Message:
fix vax


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/lua/libm/h_lualibm.c \
src/tests/lib/lua/libm/lualibm.lua

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/lua/libm/h_lualibm.c
diff -u src/tests/lib/lua/libm/h_lualibm.c:1.2 src/tests/lib/lua/libm/h_lualibm.c:1.3
--- src/tests/lib/lua/libm/h_lualibm.c:1.2	Tue Nov 22 10:57:03 2022
+++ src/tests/lib/lua/libm/h_lualibm.c	Wed Nov 23 13:18:57 2022
@@ -68,7 +68,10 @@ main(void)
 	TEST(log10(100.0));
 	TEST(log1p(M_PI));
 	TEST(nan(""));
+#ifdef notyet
+	// XXX: vax
 	TEST(nextafter(1.0e-14, 1.0));
+#endif
 	TEST(pow(M_SQRT2, 2.0));
 	TEST(remainder(M_PI, M_E));
 	TEST(rint(M_PI));
Index: src/tests/lib/lua/libm/lualibm.lua
diff -u src/tests/lib/lua/libm/lualibm.lua:1.2 src/tests/lib/lua/libm/lualibm.lua:1.3
--- src/tests/lib/lua/libm/lualibm.lua:1.2	Tue Nov 22 10:57:03 2022
+++ src/tests/lib/lua/libm/lualibm.lua	Wed Nov 23 13:18:57 2022
@@ -74,7 +74,7 @@ test("log(M_E)", lm.log(lm.M_E))
 test("log10(100.0)", lm.log10(100.0))
 test("log1p(M_PI)", lm.log1p(lm.M_PI))
 test("nan(\"\")", lm.nan(""))
-test("nextafter(1.0e-14, 1.0)", lm.nextafter(1.0e-14, 1.0))
+-- XXX vax test("nextafter(1.0e-14, 1.0)", lm.nextafter(1.0e-14, 1.0))
 test("pow(M_SQRT2, 2.0)", lm.pow(lm.M_SQRT2, 2.0))
 test("remainder(M_PI, M_E)", lm.remainder(lm.M_PI, lm.M_E))
 test("rint(M_PI)", lm.rint(lm.M_PI))



CVS commit: src/tests/lib/lua/libm

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 18:18:57 UTC 2022

Modified Files:
src/tests/lib/lua/libm: h_lualibm.c lualibm.lua

Log Message:
fix vax


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/lua/libm/h_lualibm.c \
src/tests/lib/lua/libm/lualibm.lua

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



CVS commit: src/lib/lua/libm

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 18:15:43 UTC 2022

Modified Files:
src/lib/lua/libm: libm.c

Log Message:
fix vax build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/lua/libm/libm.c

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



CVS commit: src/lib/lua/libm

2022-11-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Nov 23 18:15:43 UTC 2022

Modified Files:
src/lib/lua/libm: libm.c

Log Message:
fix vax build


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/lua/libm/libm.c

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

Modified files:

Index: src/lib/lua/libm/libm.c
diff -u src/lib/lua/libm/libm.c:1.1 src/lib/lua/libm/libm.c:1.2
--- src/lib/lua/libm/libm.c:1.1	Mon Nov 21 17:01:33 2022
+++ src/lib/lua/libm/libm.c	Wed Nov 23 13:15:43 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: libm.c,v 1.1 2022/11/21 22:01:33 christos Exp $	*/
+/* $NetBSD: libm.c,v 1.2 2022/11/23 18:15:43 christos Exp $	*/
 
 /*-
  * Copyright (c) 2022 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: libm.c,v 1.1 2022/11/21 22:01:33 christos Exp $");
+__RCSID("$NetBSD: libm.c,v 1.2 2022/11/23 18:15:43 christos Exp $");
 
 #include 
 #include 
@@ -140,7 +140,9 @@ DFUNC_DBL(lgamma)
 DFUNC_DBL(log)
 DFUNC_DBL(log10)
 DFUNC_DBL(log1p)
+#ifndef __vax__
 DFUNC_DBL_DBL(nextafter)
+#endif
 DFUNC_DBL_DBL(pow)
 DFUNC_DBL_DBL(remainder)
 DFUNC_DBL(rint)
@@ -277,7 +279,9 @@ static const struct luaL_Reg lualibm[] =
 	{ "log10", libm_log10 },
 	{ "log1p", libm_log1p },
 	{ "nan", libm_nan },
+#ifndef __vax__
 	{ "nextafter", libm_nextafter },
+#endif
 	{ "pow", libm_pow },
 	{ "remainder", libm_remainder },
 	{ "rint", libm_rint },



Vente de stores enrouleurs - dropshipping

2022-11-23 Thread Jean Girard
Bonjour,

Nous accompagnons les entrepreneurs depuis 20 ans grâce à notre système de 
vente dropshipping.

Nous recherchons des partenaires pour une coopération axée sur les bénéfices 
spécifiques de la vente de produits modernes sur la plate-forme Amazon ou sur 
un autre marché - sans avoir besoin d'avoir un entrepôt, d'acheter des 
marchandises en stock et de préparer les expéditions pour les clients.
 
Nous produisons sur mesure des volets roulants, tableaux, papiers peints et 
autres éléments décoratifs imprimés très appréciés des destinataires. En un 
mois seulement, la vente de volets roulants sur le marché allemand d'Amazon 
s'est élevée à 12 500 000 EUR.

Nous fournissons des produits de la plus haute qualité, un inventaire illimité, 
une logistique bien organisée dans toute l'Europe, du matériel de vente et le 
soutien d'un superviseur pendant la coopération.

Êtes-vous intéressé à discuter de la possibilité d'établir une coopération?


Salutations
Jean Girard