From 07d90ee0a62110e5161bb0b8a3a0b1b9d2beabad Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 14 Jun 2024 09:30:28 +0200 Subject: [PATCH 01/26] kvprintf(): Fix '+' conversion handling For example, printf("%+i", 1) prints "+1". However, kvprintf() did print just "1" for this example. According to PRINTF(3): A sign must always be placed before a number produced by a signed conversion. For "%+r" radix conversions, keep the "+" handling as it is, since this is a non-standard conversion. For "%+p" pointer conversions, continue to ignore the sign modifier to be in line with libc. This change allows to support the ' conversion modifier in the future. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1310 --- sys/kern/subr_prf.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 4dc989e2d1f1c0..8ecabdec18d585 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -660,9 +660,9 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis char *d; const char *p, *percent, *q; u_char *up; - int ch, n; + int ch, n, sign; uintmax_t num; - int base, lflag, qflag, tmp, width, ladjust, sharpflag, neg, sign, dot; + int base, lflag, qflag, tmp, width, ladjust, sharpflag, dot; int cflag, hflag, jflag, tflag, zflag; int bconv, dwidth, upper; char padc; @@ -690,7 +690,7 @@ kvprintf(char const *fmt, void (*func)(int, void*), void *arg, int radix, va_lis PCHAR(ch); } percent = fmt - 1; - qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; neg = 0; + qflag = 0; lflag = 0; ladjust = 0; sharpflag = 0; sign = 0; dot = 0; bconv = 0; dwidth = 0; upper = 0; cflag = 0; hflag = 0; jflag = 0; tflag = 0; zflag = 0; reswitch: switch (ch = (u_char)*fmt++) { @@ -701,7 +701,7 @@ reswitch: switch (ch = (u_char)*fmt++) { sharpflag = 1; goto reswitch; case '+': - sign = 1; + sign = '+'; goto reswitch; case '-': ladjust = 1; @@ -771,7 +771,6 @@ reswitch: switch (ch = (u_char)*fmt++) { case 'd': case 'i': base = 10; - sign = 1; goto handle_sign; case 'h': if (hflag) { @@ -824,8 +823,10 @@ reswitch: switch (ch = (u_char)*fmt++) { goto reswitch; case 'r': base = radix; - if (sign) + if (sign) { + sign = 0; goto handle_sign; + } goto handle_nosign; case 's': p = va_arg(ap, char *); @@ -862,13 +863,11 @@ reswitch: switch (ch = (u_char)*fmt++) { goto handle_nosign; case 'y': base = 16; - sign = 1; goto handle_sign; case 'z': zflag = 1; goto reswitch; handle_nosign: - sign = 0; if (jflag) num = va_arg(ap, uintmax_t); else if (qflag) @@ -907,11 +906,11 @@ reswitch: switch (ch = (u_char)*fmt++) { num = (signed char)va_arg(ap, int); else num = va_arg(ap, int); -number: - if (sign && (intmax_t)num < 0) { - neg = 1; + if ((intmax_t)num < 0) { + sign = '-'; num = -(intmax_t)num; } +number: p = ksprintn(nbuf, num, base, &n, upper); tmp = 0; if (sharpflag && num != 0) { @@ -920,7 +919,7 @@ reswitch: switch (ch = (u_char)*fmt++) { else if (base == 16) tmp += 2; } - if (neg) + if (sign) tmp++; if (!ladjust && padc == '0') @@ -930,8 +929,8 @@ reswitch: switch (ch = (u_char)*fmt++) { if (!ladjust) while (width-- > 0) PCHAR(' '); - if (neg) - PCHAR('-'); + if (sign) + PCHAR(sign); if (sharpflag && num != 0) { if (base == 8) { PCHAR('0'); From e152944f1a16a4ff33b4e20b813ce4a54b884b90 Mon Sep 17 00:00:00 2001 From: Ahmad Khalifa Date: Tue, 16 Jul 2024 20:38:12 +0300 Subject: [PATCH 02/26] usb: increase USB_PORT_RESET_RECOVERY 10ms seems to be too strict for some configurations, so increase to 20ms. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1327 --- sys/dev/usb/usb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 3d00cda27d18f6..a6c3c8030c734b 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -114,7 +114,7 @@ MALLOC_DECLARE(M_USBDEV); /* Allow for marginal and non-conforming devices. */ #define USB_PORT_RESET_DELAY 50 /* ms */ #define USB_PORT_ROOT_RESET_DELAY 200 /* ms */ -#define USB_PORT_RESET_RECOVERY 10 /* ms */ +#define USB_PORT_RESET_RECOVERY 20 /* ms */ #define USB_PORT_POWERUP_DELAY 300 /* ms */ #define USB_PORT_RESUME_DELAY (20*2) /* ms */ #define USB_SET_ADDRESS_SETTLE 10 /* ms */ From 71978fa41f2be0ecce7cb10d30242d29d4ccd844 Mon Sep 17 00:00:00 2001 From: Bram Date: Wed, 24 Jul 2024 22:01:56 +0200 Subject: [PATCH 03/26] du: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/du/du.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/du/du.c b/usr.bin/du/du.c index 96ad7c037dfd07..185a5cbe4465d6 100644 --- a/usr.bin/du/du.c +++ b/usr.bin/du/du.c @@ -55,6 +55,8 @@ #define UNITS_2 1 #define UNITS_SI 2 +#define DU_XO_VERSION "1" + static SLIST_HEAD(ignhead, ignentry) ignores; struct ignentry { char *mask; @@ -259,6 +261,8 @@ main(int argc, char *argv[]) if ((fts = fts_open(argv, ftsoptions, NULL)) == NULL) err(1, "fts_open"); + + xo_set_version(DU_XO_VERSION); xo_open_container("disk-usage-information"); xo_open_list("paths"); while (errno = 0, (p = fts_read(fts)) != NULL) { From a0d6f89e692a683fc7f558e9eb8a27d30069e949 Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 26 Jul 2024 21:34:08 +0200 Subject: [PATCH 04/26] lastlogin: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.sbin/lastlogin/lastlogin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.sbin/lastlogin/lastlogin.c b/usr.sbin/lastlogin/lastlogin.c index a1dcde3f60bf74..3a71693f757634 100644 --- a/usr.sbin/lastlogin/lastlogin.c +++ b/usr.sbin/lastlogin/lastlogin.c @@ -48,6 +48,8 @@ __RCSID("$NetBSD: lastlogin.c,v 1.4 1998/02/03 04:45:35 perry Exp $"); #include +#define LASTLOGIN_XO_VERSION "1" + int main(int, char **); static void output(struct utmpx *); static void usage(void); @@ -103,6 +105,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + xo_set_version(LASTLOGIN_XO_VERSION); xo_open_container("lastlogin-information"); xo_open_list("lastlogin"); From 31ac8806885f22d6b3a3948a8f660ba0cf24e9cf Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 26 Jul 2024 21:35:06 +0200 Subject: [PATCH 05/26] iscsictl: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/iscsictl/iscsictl.c | 1 + usr.bin/iscsictl/iscsictl.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/usr.bin/iscsictl/iscsictl.c b/usr.bin/iscsictl/iscsictl.c index d95cb9a1c09626..b75ff889a9a69f 100644 --- a/usr.bin/iscsictl/iscsictl.c +++ b/usr.bin/iscsictl/iscsictl.c @@ -746,6 +746,7 @@ main(int argc, char **argv) if (argc < 0) exit(1); + xo_set_version(ISCSICTL_XO_VERSION); xo_open_container("iscsictl"); while ((ch = getopt(argc, argv, "AMRLac:d:e:i:n:p:rt:u:s:vw:")) != -1) { diff --git a/usr.bin/iscsictl/iscsictl.h b/usr.bin/iscsictl/iscsictl.h index 2ac17890bb57f2..3bc69e4877a918 100644 --- a/usr.bin/iscsictl/iscsictl.h +++ b/usr.bin/iscsictl/iscsictl.h @@ -38,6 +38,8 @@ #define DEFAULT_CONFIG_PATH "/etc/iscsi.conf" #define DEFAULT_IQN "iqn.1994-09.org.freebsd:" +#define ISCSICTL_XO_VERSION "1" + #define MAX_NAME_LEN 223 #define AUTH_METHOD_UNSPECIFIED 0 From 5321a3547912acbeea7eaea8ec3ed85f07537469 Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 26 Jul 2024 21:35:57 +0200 Subject: [PATCH 06/26] w: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/w/w.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c index 8bce6d8427e625..47899d0b38e0ec 100644 --- a/usr.bin/w/w.c +++ b/usr.bin/w/w.c @@ -108,6 +108,8 @@ static struct entry { #define debugproc(p) *(&((struct kinfo_proc *)p)->ki_udata) +#define W_XO_VERSION "1" + #define W_DISPUSERSIZE 10 #define W_DISPLINESIZE 8 #define W_MAXHOSTSIZE 40 @@ -317,6 +319,7 @@ main(int argc, char *argv[]) if (fromwidth > W_MAXHOSTSIZE) fromwidth = W_MAXHOSTSIZE; + xo_set_version(W_XO_VERSION); xo_open_container("uptime-information"); if (header || wcmd == 0) { From 6e6da538988a5edb5cc7437f8a8647a350800724 Mon Sep 17 00:00:00 2001 From: Bram Date: Fri, 26 Jul 2024 21:36:18 +0200 Subject: [PATCH 07/26] wc: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/wc/wc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c index 4e8a2d8a8b59a0..7b83412f3c4250 100644 --- a/usr.bin/wc/wc.c +++ b/usr.bin/wc/wc.c @@ -51,6 +51,8 @@ #include #include +#define WC_XO_VERSION "1" + static const char *stdin_filename = "stdin"; static fileargs_t *fa; @@ -132,6 +134,8 @@ main(int argc, char *argv[]) doline = doword = dochar = true; stderr_handle = xo_create_to_file(stderr, XO_STYLE_TEXT, 0); + + xo_set_version(WC_XO_VERSION); xo_open_container("wc"); xo_open_list("file"); From 5c4f64bded0eb9453dc84bcce9a74f64adf57739 Mon Sep 17 00:00:00 2001 From: Bram Date: Tue, 27 Aug 2024 08:17:33 +0200 Subject: [PATCH 08/26] netstat: Add version information to libxo output Add version information to libxo output so that libxo content consumers can track changes. Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1350 --- usr.bin/netstat/main.c | 7 +++++++ usr.bin/netstat/netstat.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 2ed6eca4626e23..6d19851b61fc29 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -510,6 +510,7 @@ main(int argc, char *argv[]) #endif if (iflag && !sflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); intpr(NULL, af); xo_close_container("statistics"); xo_finish(); @@ -517,6 +518,7 @@ main(int argc, char *argv[]) } if (rflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (live) { kresolve_list(nl); @@ -530,6 +532,7 @@ main(int argc, char *argv[]) } if (oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhops_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -537,6 +540,7 @@ main(int argc, char *argv[]) } if (Oflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); nhgrp_print(fib, af); xo_close_container("statistics"); xo_finish(); @@ -547,6 +551,7 @@ main(int argc, char *argv[]) if (gflag) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (sflag) { if (af == AF_INET || af == AF_UNSPEC) mrt_stats(); @@ -569,6 +574,7 @@ main(int argc, char *argv[]) if (tp) { xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); printproto(tp, tp->pr_name, &first); if (!first) xo_close_list("socket"); @@ -578,6 +584,7 @@ main(int argc, char *argv[]) } xo_open_container("statistics"); + xo_set_version(NETSTAT_XO_VERSION); if (af == AF_INET || af == AF_UNSPEC) for (tp = protox; tp->pr_name; tp++) printproto(tp, tp->pr_name, &first); diff --git a/usr.bin/netstat/netstat.h b/usr.bin/netstat/netstat.h index c41862d9fbdd3e..7ebfc5180f4446 100644 --- a/usr.bin/netstat/netstat.h +++ b/usr.bin/netstat/netstat.h @@ -31,6 +31,8 @@ #include +#define NETSTAT_XO_VERSION "1" + #define satosin(sa) ((struct sockaddr_in *)(sa)) #define satosin6(sa) ((struct sockaddr_in6 *)(sa)) #define sin6tosa(sin6) ((struct sockaddr *)(sin6)) From 1f882a5834836b43d4689efeefbc3109fc169363 Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Thu, 1 Aug 2024 08:33:22 -0400 Subject: [PATCH 09/26] adduser.8: update log location + spdx Closes: 280538 Fixes: cf8a18 (back out logging to /var/log/adduser) MFC after: 3 days Reported by: Herbert Baerschneider Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1354 --- usr.sbin/adduser/adduser.8 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/adduser/adduser.8 b/usr.sbin/adduser/adduser.8 index ed67e21f9430dc..8ba623fedd9d4c 100644 --- a/usr.sbin/adduser/adduser.8 +++ b/usr.sbin/adduser/adduser.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 1995-1996 Wolfram Schneider . Berlin. .\" All rights reserved. .\" Copyright (c) 2002-2004 Michael Telahun Makonnen @@ -427,7 +430,7 @@ message file for .Nm .It Pa /usr/share/skel skeletal login directory -.It Pa /var/log/adduser +.It Pa /var/log/userlog logfile for .Nm .El From 5d889e60c15ce7856cb9a9bc258dab8aaeb94efe Mon Sep 17 00:00:00 2001 From: Wuyang Chung Date: Fri, 2 Aug 2024 14:44:38 +0800 Subject: [PATCH 10/26] amd64: move the right parenthesis to the right place Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/1356 --- sys/amd64/amd64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 025c3c365de51c..f4b3b9702e0026 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1382,7 +1382,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) */ for (x = 0; x < NGDT; x++) { if (x != GPROC0_SEL && x != (GPROC0_SEL + 1) && - x != GUSERLDT_SEL && x != (GUSERLDT_SEL) + 1) + x != GUSERLDT_SEL && x != (GUSERLDT_SEL + 1)) ssdtosd(&gdt_segs[x], &gdt[x]); } gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&pc->pc_common_tss; From 7b984d5043f2cab8ba05082366e48116e0d495a2 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Mon, 27 May 2024 17:46:29 +0200 Subject: [PATCH 11/26] wsp: Allow the trackpad to be used after a partially unreleased click. This provides functionality for a click which is partially unreleased and then allows the user to continue moving the mousepad as if were not invoked as a full click Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- share/man/man4/wsp.4 | 5 +++++ sys/dev/usb/input/wsp.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index 39660a53ee9a74..bcbbc1b8bb5dca 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -65,6 +65,11 @@ Pointer sensitivity can be controlled using the sysctl tunable Tap to left-click can be controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_clicks , set to 0 to disable single tap clicks or 1 to enable them (default). +Movement on the trackpad following a partially-released click can be +controlled using the sysctl tunable +.Nm hw.usb.wsp.enable_single_tap_movement , +set to 0 to disable the movement on the trackpad until a full release +or 1 to allow the continued movement (default). Z-Axis sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_factor . Z-Axis inversion can be controlled using the sysctl tunable diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index f1931c9e03c00f..4527278295caff 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -99,6 +99,7 @@ static struct wsp_tuning { int pressure_tap_threshold; int scr_hor_threshold; int enable_single_tap_clicks; + int enable_single_tap_movement; } wsp_tuning = { @@ -110,6 +111,7 @@ static struct wsp_tuning { .pressure_tap_threshold = 120, .scr_hor_threshold = 20, .enable_single_tap_clicks = 1, + .enable_single_tap_movement = 1, }; static void @@ -123,6 +125,7 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); + WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); } SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, @@ -141,6 +144,9 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, &wsp_tuning.enable_single_tap_clicks, 0, "enable single tap clicks"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_movement, CTLFLAG_RWTUN, + &wsp_tuning.enable_single_tap_movement, 0, "enable single tap movement"); + /* * Some tables, structures, definitions and constant values for the @@ -1149,8 +1155,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = sc->pos_x[0] - sc->pre_pos_x; dy = sc->pos_y[0] - sc->pre_pos_y; - /* Ignore movement during button is releasing */ - if (sc->ibtn != 0 && sc->sc_status.button == 0) + /* Optionally ignore movement during button is releasing */ + if (tun.enable_single_tap_movement != 1 && sc->ibtn != 0 && sc->sc_status.button == 0) dx = dy = 0; /* Ignore movement if ntouch changed */ From 62cf43dda897f33bb80a20630f34bfe204cb97ee Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Tue, 28 May 2024 02:20:19 +0200 Subject: [PATCH 12/26] wsp: Improve multi-finger touchpad usage and allow more configurations This patch allows scrolling with multiple fingers simultaneously, in line with how wsp trackpads function on MacOS. Two new tunables are added: hw.usb.wsp.max_finger_area and hw.usb.wsp.max_double_tap_distance. max_finger_area defines the maximum size which the driver registered an object on trackpad as a finger. Previously, this value was hardcoded as 1200, which was too low to register thumb-clicks. max_double_tap_distance defines the maximum distance between two fingers which will register as a double-click. Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- share/man/man4/wsp.4 | 6 +++ sys/dev/usb/input/wsp.c | 85 +++++++++++++++++++++++++++-------------- 2 files changed, 62 insertions(+), 29 deletions(-) diff --git a/share/man/man4/wsp.4 b/share/man/man4/wsp.4 index bcbbc1b8bb5dca..83a4421fa2ff3d 100644 --- a/share/man/man4/wsp.4 +++ b/share/man/man4/wsp.4 @@ -70,6 +70,12 @@ controlled using the sysctl tunable .Nm hw.usb.wsp.enable_single_tap_movement , set to 0 to disable the movement on the trackpad until a full release or 1 to allow the continued movement (default). +.Nm hw.usb.wsp.max_finger_area +defines the maximum area on the trackpad which is registered as a +finger (lower for greater palm detection). +.Nm hw.usb.wsp.max_double_tap_distance +defines the maximum distance between two finger clicks or taps which may +register as a double-click. Z-Axis sensitivity can be controlled using the sysctl tunable .Nm hw.usb.wsp.z_factor . Z-Axis inversion can be controlled using the sysctl tunable diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 4527278295caff..708a264983612b 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -98,6 +98,8 @@ static struct wsp_tuning { int pressure_untouch_threshold; int pressure_tap_threshold; int scr_hor_threshold; + int max_finger_area; + int max_double_tap_distance; int enable_single_tap_clicks; int enable_single_tap_movement; } @@ -110,6 +112,8 @@ static struct wsp_tuning { .pressure_untouch_threshold = 10, .pressure_tap_threshold = 120, .scr_hor_threshold = 20, + .max_finger_area = 1900, + .max_double_tap_distance = 2500, .enable_single_tap_clicks = 1, .enable_single_tap_movement = 1, }; @@ -123,6 +127,8 @@ wsp_runing_rangecheck(struct wsp_tuning *ptun) WSP_CLAMP(ptun->pressure_touch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_untouch_threshold, 1, 255); WSP_CLAMP(ptun->pressure_tap_threshold, 1, 255); + WSP_CLAMP(ptun->max_finger_area, 1, 2400); + WSP_CLAMP(ptun->max_double_tap_distance, 1, 16384); WSP_CLAMP(ptun->scr_hor_threshold, 1, 255); WSP_CLAMP(ptun->enable_single_tap_clicks, 0, 1); WSP_CLAMP(ptun->enable_single_tap_movement, 0, 1); @@ -140,6 +146,10 @@ SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_untouch_threshold, 0, "untouch pressure threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_finger_area, CTLFLAG_RWTUN, + &wsp_tuning.max_finger_area, 0, "maximum finger area"); +SYSCTL_INT(_hw_usb_wsp, OID_AUTO, max_double_tap_distance, CTLFLAG_RWTUN, + &wsp_tuning.max_double_tap_distance, 0, "maximum double-finger click distance"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold"); SYSCTL_INT(_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, @@ -573,13 +583,13 @@ struct wsp_softc { struct tp_finger *index[MAX_FINGERS]; /* finger index data */ int16_t pos_x[MAX_FINGERS]; /* position array */ int16_t pos_y[MAX_FINGERS]; /* position array */ + int16_t pre_pos_x[MAX_FINGERS]; /* previous position array */ + int16_t pre_pos_y[MAX_FINGERS]; /* previous position array */ u_int sc_touch; /* touch status */ #define WSP_UNTOUCH 0x00 #define WSP_FIRST_TOUCH 0x01 #define WSP_SECOND_TOUCH 0x02 #define WSP_TOUCHING 0x04 - int16_t pre_pos_x; /* previous position array */ - int16_t pre_pos_y; /* previous position array */ int dx_sum; /* x axis cumulative movement */ int dy_sum; /* y axis cumulative movement */ int dz_sum; /* z axis cumulative movement */ @@ -596,7 +606,6 @@ struct wsp_softc { #define WSP_TAP_THRESHOLD 3 #define WSP_TAP_MAX_COUNT 20 int distance; /* the distance of 2 fingers */ -#define MAX_DISTANCE 2500 /* the max allowed distance */ uint8_t ibtn; /* button status in tapping */ uint8_t ntaps; /* finger status in tapping */ uint8_t scr_mode; /* scroll status in movement */ @@ -1040,13 +1049,35 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) sc->sc_status.obutton = sc->sc_status.button; sc->sc_status.button = 0; + if (ntouch == 2) { + sc->distance = max(sc->distance, max( + abs(sc->pos_x[0] - sc->pos_x[1]), + abs(sc->pos_y[0] - sc->pos_y[1]))); + } + if (ibt != 0) { - if ((params->tp->caps & HAS_INTEGRATED_BUTTON) && ntouch == 2) - sc->sc_status.button |= MOUSE_BUTTON3DOWN; - else if ((params->tp->caps & HAS_INTEGRATED_BUTTON) && ntouch == 3) - sc->sc_status.button |= MOUSE_BUTTON2DOWN; - else + if (params->tp->caps & HAS_INTEGRATED_BUTTON) { + switch (ntouch) { + case 1: + sc->sc_status.button |= MOUSE_BUTTON1DOWN; + break; + case 2: + if (sc->distance < tun.max_double_tap_distance && abs(sc->dx_sum) < 5 && + abs(sc->dy_sum) < 5) + sc->sc_status.button |= MOUSE_BUTTON3DOWN; + else + sc->sc_status.button |= MOUSE_BUTTON1DOWN; + break; + case 3: + sc->sc_status.button |= MOUSE_BUTTON2DOWN; + break; + default: + break; + } + } else { sc->sc_status.button |= MOUSE_BUTTON1DOWN; + } + sc->ibtn = 1; } sc->intr_count++; @@ -1055,7 +1086,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) switch (ntouch) { case 1: if (sc->index[0]->touch_major > tun.pressure_tap_threshold && - sc->index[0]->tool_major <= 1200) + sc->index[0]->tool_major <= tun.max_finger_area) sc->ntaps = 1; break; case 2: @@ -1073,11 +1104,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) break; } } - if (ntouch == 2) { - sc->distance = max(sc->distance, max( - abs(sc->pos_x[0] - sc->pos_x[1]), - abs(sc->pos_y[0] - sc->pos_y[1]))); - } + if (sc->index[0]->touch_major < tun.pressure_untouch_threshold && sc->sc_status.button == 0) { sc->sc_touch = WSP_UNTOUCH; @@ -1098,7 +1125,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) case 2: DPRINTFN(WSP_LLEVEL_INFO, "sum_x=%5d, sum_y=%5d\n", sc->dx_sum, sc->dy_sum); - if (sc->distance < MAX_DISTANCE && abs(sc->dx_sum) < 5 && + if (sc->distance < tun.max_double_tap_distance && abs(sc->dx_sum) < 5 && abs(sc->dy_sum) < 5) { wsp_add_to_queue(sc, 0, 0, 0, MOUSE_BUTTON3DOWN); DPRINTFN(WSP_LLEVEL_INFO, "RIGHT CLICK!\n"); @@ -1144,16 +1171,16 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) } else if (sc->index[0]->touch_major >= tun.pressure_touch_threshold && sc->sc_touch == WSP_FIRST_TOUCH) { /* ignore second touch */ sc->sc_touch = WSP_SECOND_TOUCH; - DPRINTFN(WSP_LLEVEL_INFO, "Fist pre_x=%5d, pre_y=%5d\n", - sc->pre_pos_x, sc->pre_pos_y); + DPRINTFN(WSP_LLEVEL_INFO, "First pre_x[0]=%5d, pre_y[0]=%5d\n", + sc->pre_pos_x[0], sc->pre_pos_y[0]); } else { if (sc->sc_touch == WSP_SECOND_TOUCH) sc->sc_touch = WSP_TOUCHING; if (ntouch != 0 && sc->index[0]->touch_major >= tun.pressure_touch_threshold) { - dx = sc->pos_x[0] - sc->pre_pos_x; - dy = sc->pos_y[0] - sc->pre_pos_y; + dx = sc->pos_x[0] - sc->pre_pos_x[0]; + dy = sc->pos_y[0] - sc->pre_pos_y[0]; /* Optionally ignore movement during button is releasing */ if (tun.enable_single_tap_movement != 1 && sc->ibtn != 0 && sc->sc_status.button == 0) @@ -1163,8 +1190,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (sc->o_ntouch != ntouch) dx = dy = 0; - /* Ignore unexpeted movement when typing */ - if (ntouch == 1 && sc->index[0]->tool_major > 1200) + /* Ignore unexpected movement when typing (palm detection) */ + if (ntouch == 1 && sc->index[0]->tool_major > tun.max_finger_area) dx = dy = 0; if (sc->ibtn != 0 && ntouch == 1 && @@ -1173,8 +1200,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (ntouch == 2 && sc->sc_status.button != 0) { - dx = sc->pos_x[sc->finger] - sc->pre_pos_x; - dy = sc->pos_y[sc->finger] - sc->pre_pos_y; + dx = sc->pos_x[sc->finger] - sc->pre_pos_x[sc->finger]; + dy = sc->pos_y[sc->finger] - sc->pre_pos_y[sc->finger]; /* * Ignore movement of switch finger or @@ -1237,8 +1264,8 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (sc->dz_count == 0) dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); if (sc->scr_mode == WSP_SCR_HOR || - abs(sc->pos_x[0] - sc->pos_x[1]) > MAX_DISTANCE || - abs(sc->pos_y[0] - sc->pos_y[1]) > MAX_DISTANCE) + abs(sc->pos_x[0] - sc->pos_x[1]) > tun.max_finger_area || + abs(sc->pos_y[0] - sc->pos_y[1]) > tun.max_finger_area) dz = 0; } if (ntouch == 3) @@ -1262,12 +1289,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) sc->rdz = 0; } } - sc->pre_pos_x = sc->pos_x[0]; - sc->pre_pos_y = sc->pos_y[0]; + sc->pre_pos_x[0] = sc->pos_x[0]; + sc->pre_pos_y[0] = sc->pos_y[0]; if (ntouch == 2 && sc->sc_status.button != 0) { - sc->pre_pos_x = sc->pos_x[sc->finger]; - sc->pre_pos_y = sc->pos_y[sc->finger]; + sc->pre_pos_x[sc->finger] = sc->pos_x[sc->finger]; + sc->pre_pos_y[sc->finger] = sc->pos_y[sc->finger]; } sc->o_ntouch = ntouch; From 8aef1cd698f177986ee4f51ff6f63ea7b0b35098 Mon Sep 17 00:00:00 2001 From: Joshua Rogers Date: Mon, 10 Jun 2024 21:03:24 +0200 Subject: [PATCH 13/26] wsp: Use already-calculated distance of fingers for comparison. Also correctly use tun.max_double_tap_distance for maximum distance of fingers for vertical scrolling. Signed-off-by: Joshua Rogers Reviewed by: imp, wulf Pull Request: https://github.com/freebsd/freebsd-src/pull/1365 --- sys/dev/usb/input/wsp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/usb/input/wsp.c b/sys/dev/usb/input/wsp.c index 708a264983612b..a8d6c14c74214a 100644 --- a/sys/dev/usb/input/wsp.c +++ b/sys/dev/usb/input/wsp.c @@ -1263,9 +1263,7 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t error) dx = dy = 0; if (sc->dz_count == 0) dz = (sc->dz_sum / tun.z_factor) * (tun.z_invert ? -1 : 1); - if (sc->scr_mode == WSP_SCR_HOR || - abs(sc->pos_x[0] - sc->pos_x[1]) > tun.max_finger_area || - abs(sc->pos_y[0] - sc->pos_y[1]) > tun.max_finger_area) + if (sc->scr_mode == WSP_SCR_HOR || sc->distance > tun.max_double_tap_distance) dz = 0; } if (ntouch == 3) From 66145c3829c1753f3b5fa303c4e36bba172be553 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 9 Aug 2024 04:57:47 +0200 Subject: [PATCH 14/26] ntptime: Use time_t for tv_sec related variables The struct timespec tv_sec member is of type time_t. Make sure that all variables related to this member are of the type time_t. This is important for targets where long is a 32-bit type and time_t a 64-bit type. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1373 --- sys/kern/kern_ntptime.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/kern_ntptime.c b/sys/kern/kern_ntptime.c index d2a2761ed683af..65746021028be0 100644 --- a/sys/kern/kern_ntptime.c +++ b/sys/kern/kern_ntptime.c @@ -193,7 +193,7 @@ static l_fp pps_freq; /* scaled frequency offset (ns/s) */ static long pps_fcount; /* frequency accumulator */ static long pps_jitter; /* nominal jitter (ns) */ static long pps_stabil; /* nominal stability (scaled ns/s) */ -static long pps_lastsec; /* time at last calibration (s) */ +static time_t pps_lastsec; /* time at last calibration (s) */ static int pps_valid; /* signal watchdog counter */ static int pps_shift = PPS_FAVG; /* interval duration (s) (shift) */ static int pps_shiftmax = PPS_FAVGDEF; /* max interval duration (s) (shift) */ @@ -742,7 +742,8 @@ hardupdate(long offset /* clock offset (ns) */) void hardpps(struct timespec *tsp, long delta_nsec) { - long u_sec, u_nsec, v_nsec; /* temps */ + long u_nsec, v_nsec; /* temps */ + time_t u_sec; l_fp ftemp; NTP_LOCK(); From 3272054073720172ebae9c2c5c75e656f72a6df1 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Sat, 10 Aug 2024 17:46:23 +0000 Subject: [PATCH 15/26] ip6addrctl.8: Reference RFC 6724 instead Commit e695500d3cb945e62b4591cb68792601ed5c4b46 updated the policy table to match RFC 6724, which obsoletes RFC 3484. Add a reference to RFC 6724, and mark it up as a technical report (%R). MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 --- usr.sbin/ip6addrctl/ip6addrctl.8 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.8 b/usr.sbin/ip6addrctl/ip6addrctl.8 index f50da59aa2bb99..cf8f1db4a8bdc6 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.8 +++ b/usr.sbin/ip6addrctl/ip6addrctl.8 @@ -27,7 +27,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 25, 2001 +.Dd August 10, 2024 .Dt IP6ADDRCTL 8 .Os .\" @@ -107,9 +107,12 @@ comments and are ignored. .\" .Sh SEE ALSO .Rs +.%A "Dave Thaler" .%A "Richard Draves" -.%T "Default Address Selection for IPv6" -.%N RFC 3484 +.%A "Arifumi Matsumoto" +.%A "Tim Chown" +.%T "Default Address Selection for Internet Protocol Version 6 (IPv6)" +.%R RFC 6724 .Re .\" .Sh HISTORY From 6bfbfc8f4fdc6ccd200541ef738a90d1be3c1ab7 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Sun, 11 Aug 2024 03:06:12 +0000 Subject: [PATCH 16/26] ip6addrctl: Update the sample configuration file Update the sample ip6addrctl.conf.sample file to match the default policy, currently based on RFC 6724. MFC after: 3 days Signed-off-by: Jose Luis Duran Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 --- usr.sbin/ip6addrctl/ip6addrctl.conf.sample | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample index edcf77553f14f5..59c1f3db47e0d0 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.conf.sample +++ b/usr.sbin/ip6addrctl/ip6addrctl.conf.sample @@ -1,11 +1,15 @@ -# default policy table based on RFC 3484. +# default policy table based on RFC 6724. # usage: ip6addrctl install path_to_this_file # # #Format: #Prefix Precedence Label -::1/128 50 0 -::/0 40 1 -2002::/16 30 2 -::/96 20 3 -::ffff:0:0/96 10 4 +::1/128 50 0 +::/0 40 1 +::ffff:0:0/96 35 4 +2002::/16 30 2 +2001::/32 5 5 +fc00::/7 3 13 +::/96 1 3 +fec0::/10 1 11 +3ffe::/16 1 12 From 9cb98ab7ceeb97b70a4891a4a3a21372158ccf24 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Thu, 22 Aug 2024 14:19:44 +0000 Subject: [PATCH 17/26] getaddrinfo.{1,3}: Cross-reference ip6addrctl(8) Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375 --- lib/libc/net/getaddrinfo.3 | 3 ++- usr.bin/getaddrinfo/getaddrinfo.1 | 3 ++- usr.sbin/ip6addrctl/ip6addrctl.8 | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/libc/net/getaddrinfo.3 b/lib/libc/net/getaddrinfo.3 index 271ef8a0102b37..634786a8bd12c1 100644 --- a/lib/libc/net/getaddrinfo.3 +++ b/lib/libc/net/getaddrinfo.3 @@ -480,7 +480,8 @@ freeaddrinfo(res0); .Xr hosts 5 , .Xr resolv.conf 5 , .Xr services 5 , -.Xr hostname 7 +.Xr hostname 7 , +.Xr ip6addrctl 8 .Rs .%A R. Gilligan .%A S. Thomson diff --git a/usr.bin/getaddrinfo/getaddrinfo.1 b/usr.bin/getaddrinfo/getaddrinfo.1 index ff99cd1ea1eebc..fa9e8adce6a228 100644 --- a/usr.bin/getaddrinfo/getaddrinfo.1 +++ b/usr.bin/getaddrinfo/getaddrinfo.1 @@ -171,7 +171,8 @@ stream inet tcp 199.233.217.249 80 .Xr nsswitch.conf 5 , .Xr protocols 5 , .Xr resolv.conf 5 , -.Xr services 5 +.Xr services 5 , +.Xr ip6addrctl 8 .Sh HISTORY The .Nm diff --git a/usr.sbin/ip6addrctl/ip6addrctl.8 b/usr.sbin/ip6addrctl/ip6addrctl.8 index cf8f1db4a8bdc6..50245cef91eaaa 100644 --- a/usr.sbin/ip6addrctl/ip6addrctl.8 +++ b/usr.sbin/ip6addrctl/ip6addrctl.8 @@ -106,6 +106,8 @@ comments and are ignored. .Ex -std .\" .Sh SEE ALSO +.Xr getaddrinfo 1 , +.Xr getaddrinfo 3 .Rs .%A "Dave Thaler" .%A "Richard Draves" From 7b9c9f8004b17cda071537c9b2fdd259eec27d2a Mon Sep 17 00:00:00 2001 From: Val Packett Date: Sat, 10 Aug 2024 23:11:25 -0300 Subject: [PATCH 18/26] cross-build: fix fake_sysctl/tzsetup The error was always returned, even after handling the sysctl, breaking installworld under Linux. Sponsored by: https://www.patreon.com/valpackett Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1376 --- tools/build/cross-build/fake_sysctl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/build/cross-build/fake_sysctl.c b/tools/build/cross-build/fake_sysctl.c index 4f1b271f3858a6..c4e40ebb9e7208 100644 --- a/tools/build/cross-build/fake_sysctl.c +++ b/tools/build/cross-build/fake_sysctl.c @@ -53,6 +53,7 @@ __freebsd_sysctlbyname(const char *name, void *oldp, size_t *oldlenp, errx(EX_USAGE, "kern.vm_guest is read-only"); strlcpy(oldp, "none", *oldlenp); *oldlenp = strlen("none"); + return (0); } errx(EX_USAGE, "fatal: unknown sysctl %s\n", name); } From 7e3b6b249f54f5b22eae14dfa48ef7891bc4eac1 Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Sun, 11 Aug 2024 23:07:42 -0400 Subject: [PATCH 19/26] diskless.8: show in `apropos pxe` + tag SPDX MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1378 --- share/man/man8/diskless.8 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/share/man/man8/diskless.8 b/share/man/man8/diskless.8 index 8839e27e11ba15..cc49854ae85029 100644 --- a/share/man/man8/diskless.8 +++ b/share/man/man8/diskless.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-3-Clause +.\" .\" Copyright (c) 1994 Gordon W. Ross, Theo de Raadt .\" Updated by Luigi Rizzo, Robert Watson .\" All rights reserved. @@ -24,12 +27,12 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd May 3, 2020 +.Dd August 11, 2024 .Dt DISKLESS 8 .Os .Sh NAME .Nm diskless -.Nd booting a system over the network +.Nd booting a system over the network with PXE .Sh DESCRIPTION The ability to boot a machine over the network is useful for .Em diskless From 0d8effbd6e45643154c90942f210b7f7a6ecc61d Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Mon, 12 Aug 2024 05:39:03 -0400 Subject: [PATCH 20/26] growfs.8: align and alphabetize options MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1379 --- sbin/growfs/growfs.8 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sbin/growfs/growfs.8 b/sbin/growfs/growfs.8 index 9a6076017c740b..9b619613f30e59 100644 --- a/sbin/growfs/growfs.8 +++ b/sbin/growfs/growfs.8 @@ -61,16 +61,11 @@ The .Nm utility extends the size of the file system on the specified special file. The following options are available: -.Bl -tag -width indent +.Bl -tag -width "-s size" .It Fl N .Dq Test mode . Causes the new file system parameters to be printed out without actually enlarging the file system. -.It Fl y -Causes -.Nm -to assume yes -as the answer to all operator questions. .It Fl s Ar size Determines the .Ar size @@ -87,6 +82,11 @@ This value defaults to the size of the raw partition specified in (in other words, .Nm will enlarge the file system to the size of the entire partition). +.It Fl y +Causes +.Nm +to assume yes +as the answer to all operator questions. .El .Sh EXIT STATUS Exit status is 0 on success, and >= 1 on errors. From a5770eb54f7d13717098b5c34cc2dd51d2772021 Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Mon, 12 Aug 2024 05:59:21 -0400 Subject: [PATCH 21/26] geom.8: minor cleanup (markup, spdx, gsched) Fixes: 86c06f (Remove GEOM_SCHED class and gsched) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1380 --- sbin/geom/core/geom.8 | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sbin/geom/core/geom.8 b/sbin/geom/core/geom.8 index 124ea0f2be116a..7f0f0b2911b361 100644 --- a/sbin/geom/core/geom.8 +++ b/sbin/geom/core/geom.8 @@ -1,3 +1,6 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause +.\" .\" Copyright (c) 2004-2005 Pawel Jakub Dawidek .\" All rights reserved. .\" @@ -27,7 +30,7 @@ .Os .Sh NAME .Nm geom -.Nd "universal control utility for GEOM classes" +.Nd universal control utility for GEOM classes .Sh SYNOPSIS .Nm .Ar class @@ -66,7 +69,7 @@ which can be used for existing .Nm unaware classes. Here is the list of standard commands: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Cm help List all available commands for the given class. .It Cm list @@ -74,7 +77,7 @@ Print detailed information (within the given class) about all geoms (if no additional arguments were specified) or the given geoms. This command is only available if the given class exists in the kernel. Additional options include: -.Bl -tag -width ".Fl a" +.Bl -tag -width "-a" .It Fl a Print information for geoms without providers. .El @@ -84,9 +87,11 @@ Print general information (within the given class) about all geoms This command is only available if the given class exists in the kernel. .Pp Additional options include: -.Bl -tag -width ".Fl s" +.Bl -tag -width "-s" .It Fl a -When used with -g, print status for geoms without providers. +When used with +.Fl g , +print status for geoms without providers. .It Fl g Report statuses for geoms instead of providers. .It Fl s @@ -107,7 +112,7 @@ kernel module. .El .Pp Additional options include: -.Bl -tag -width ".Cm status" +.Bl -tag -width indent .It Fl p Ar provider-name Print detailed information about the geom which provides .Ar provider-name . @@ -170,7 +175,7 @@ VIRSTOR .Sh ENVIRONMENT The following environment variables affect the execution of .Nm : -.Bl -tag -width ".Ev GEOM_LIBRARY_PATH" +.Bl -tag -width "GEOM_LIBRARY_PATH" .It Ev GEOM_LIBRARY_PATH Specifies the path where shared libraries are stored instead of .Pa /lib/geom/ . @@ -213,7 +218,6 @@ geom md unload .Xr gnop 8 , .Xr gpart 8 , .Xr graid3 8 , -.Xr gsched 8 , .Xr gshsec 8 , .Xr gstripe 8 , .Xr gunion 8 , From fe830c3bdbb80545711d49b5bd6fd4ec28ed9f8e Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Tue, 13 Aug 2024 21:33:07 -0400 Subject: [PATCH 22/26] UPDATING: increase visibility of footnotes MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1382 --- UPDATING | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/UPDATING b/UPDATING index 1aae85df0a7033..01fbf9a30946fd 100644 --- a/UPDATING +++ b/UPDATING @@ -2022,6 +2022,8 @@ COMMON ITEMS: make -DALWAYS_CHECK_MAKE buildkernel KERNCONF=YOUR_KERNEL_HERE make -DALWAYS_CHECK_MAKE installkernel KERNCONF=YOUR_KERNEL_HERE + If you are running kernel modules from ports, see FOOTNOTE [1]. + To test a kernel once --------------------- If you just want to boot a kernel once (because you are not sure @@ -2038,8 +2040,7 @@ COMMON ITEMS: make buildworld make buildkernel KERNCONF=YOUR_KERNEL_HERE - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -2057,7 +2058,7 @@ COMMON ITEMS: make buildworld - make buildkernel KERNCONF=YOUR_KERNEL_HERE + make buildkernel KERNCONF=YOUR_KERNEL_HERE [1] make installworld DESTDIR=${CURRENT_ROOT} -DDB_FROM_SRC @@ -2076,8 +2077,7 @@ COMMON ITEMS: make buildworld [9] make buildkernel KERNCONF=YOUR_KERNEL_HERE [8] - make installkernel KERNCONF=YOUR_KERNEL_HERE - [1] + make installkernel KERNCONF=YOUR_KERNEL_HERE [1] [3] etcupdate -p [5] make installworld @@ -2097,8 +2097,10 @@ COMMON ITEMS: messages there. If in doubt, please track -stable which has much fewer pitfalls. - [1] If you have third party modules, such as vmware, you should disable - them at this point so they don't crash your system on +FOOTNOTES: + + [1] If you have third party modules, such as drm-kmod or vmware, you + should disable them at this point so they don't crash your system on reboot. Alternatively, you should rebuild all the modules you have in your system and install them as well. If you are running -current, you should seriously consider placing all sources to all the modules for From 4c72525953fdf618a3fc0a45f3ef3f071dcc0c52 Mon Sep 17 00:00:00 2001 From: Alexander Ziaee Date: Wed, 14 Aug 2024 02:50:18 -0400 Subject: [PATCH 23/26] ure.4: description consistencies + tag spdx + consistent document description languague with other USB-BaseT drivers + mention newly added adapters from 6ea4d9 + attempt to mention rgephy(4) phys feed into ure interfaces Fixes: 6ea4d9 (Move RTL8156 from cdce(4) to ure(4)) MFC after: 3 days Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1384 --- share/man/man4/ure.4 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/share/man/man4/ure.4 b/share/man/man4/ure.4 index 942764109dd8ff..f5452fa8463bd6 100644 --- a/share/man/man4/ure.4 +++ b/share/man/man4/ure.4 @@ -1,3 +1,5 @@ +.\"- +.\" SPDX-License-Identifier: BSD-2-Clause .\" .\" Copyright (c) 2015-2016 Kevin Lo .\" All rights reserved. @@ -23,12 +25,12 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 3, 2024 +.Dd September 3, 2024 .Dt URE 4 .Os .Sh NAME .Nm ure -.Nd "RealTek RTL8152/RTL8153/RTL8153B/RTL8156/RTL8156B USB to Ethernet controller driver" +.Nd RealTek RTL8152/RTL8153/RTL8156 USB Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -52,15 +54,20 @@ if_ure_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the RealTek -RealTek RTL8152 and RTL8153 USB Ethernet controllers. +RTL8152, RTL8153/RTL8153B, and RTL8156/RTL8156B USB Ethernet controllers, +as well as USB Ethernet PHYs provided by +.Xr rgephy 4 . .Pp -NICs based on the RTL8152 are capable of 10 and 100Mbps speeds. -NICs based on the RTL8153 are capable of 10, 100 and 1000Mbps operation. +NICs based on the RTL8152 are capable of 10 and 100Mbps. +NICs based on the RTL8153 or provided by +.Xr rgephy 4 +are capable of 10, 100, and 1000Mbps. +NICs based on the RTL8156 are capable of 10, 100, 1000, and 2500Mbps operation. .Pp The .Nm driver supports the following media types: -.Bl -tag -width ".Cm 10baseT/UTP" +.Bl -tag -width "10baseT/UTP" .It Cm autoselect Enable auto selection of the media type and options. The user can manually override @@ -86,7 +93,7 @@ or .Cm half-duplex modes. .It Cm 1000baseTX -Set 1000baseTX operation over twisted pair. +Set 1000baseTX (Gigabit Ethernet) operation over twisted pair. The RealTek gigE chips support 1000Mbps in .Cm full-duplex mode only. @@ -99,12 +106,12 @@ mode only. .Pp The .Nm -driver supports the following media options: -.Bl -tag -width ".Cm full-duplex" +driver supports the following media options for 10/100 operation: +.Bl -tag -width "full-duplex" .It Cm full-duplex -Force full duplex operation. +Force full-duplex operation. .It Cm half-duplex -Force half duplex operation. +Force half-duplex operation. .El .Pp For more information on configuring this device, see From 5e6bef460d9dc3a1ef567f9602b04a252b554b67 Mon Sep 17 00:00:00 2001 From: Tom Hukins Date: Sat, 17 Aug 2024 21:15:50 +0100 Subject: [PATCH 24/26] Fix "version introduced" in two manual pages Signed-off-by: Tom Hukins Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1385 --- share/man/man4/acpi_ged.4 | 2 +- share/man/man4/gve.4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/man/man4/acpi_ged.4 b/share/man/man4/acpi_ged.4 index c87c7b3e97c948..98baabdde79642 100644 --- a/share/man/man4/acpi_ged.4 +++ b/share/man/man4/acpi_ged.4 @@ -53,7 +53,7 @@ This may generate optionally ACPI notify for another device. The .Nm device driver first appeared in -.Fx 14.0 . +.Fx 13.3 . .Sh AUTHORS .An -nosplit The diff --git a/share/man/man4/gve.4 b/share/man/man4/gve.4 index 54e59b86108b0e..95c125507bd585 100644 --- a/share/man/man4/gve.4 +++ b/share/man/man4/gve.4 @@ -208,7 +208,7 @@ Please email gvnic-drivers@google.com with the specifics of the issue encountere The .Nm device driver first appeared in -.Fx 14.0 . +.Fx 13.3 . .Sh AUTHORS The .Nm From 3f0efe05432b1633991114ca4ca330102a561959 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Tue, 20 Aug 2024 11:58:00 +0000 Subject: [PATCH 25/26] libefivar: Fix AcpiEx print logic Add logic that checks if the code doesn't overflow ACPI_EXTENDED_HID_DEVICE_PATH node when searching for optional strings. If the string is not provided in the device path node default value of "\0" is used. Upstream PR: https://bugzilla.tianocore.org/show_bug.cgi?id=4555 Obtained from: https://github.com/tianocore/edk2/commit/96ed60dfd7d4818a532216d64ee87b13fae5c726 Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1388 --- lib/libefivar/efivar-dp-format.c | 72 ++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index d97603c41dcb85..72e024470a1182 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -478,23 +478,41 @@ DevPathToTextAcpiEx ( ) { ACPI_EXTENDED_HID_DEVICE_PATH *AcpiEx; - CHAR8 *HIDStr; - CHAR8 *UIDStr; - CHAR8 *CIDStr; char HIDText[11]; char CIDText[11]; - - AcpiEx = DevPath; - HIDStr = (CHAR8 *)(((UINT8 *)AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); - UIDStr = HIDStr + AsciiStrLen (HIDStr) + 1; - CIDStr = UIDStr + AsciiStrLen (UIDStr) + 1; + UINTN CurrentLength; + CHAR8 *CurrentPos; + UINTN NextStringOffset; + CHAR8 *Strings[3]; + UINT8 HidStrIndex; + UINT8 UidStrIndex; + UINT8 CidStrIndex; + UINT8 StrIndex; + + HidStrIndex = 0; + UidStrIndex = 1; + CidStrIndex = 2; + AcpiEx = DevPath; + Strings[HidStrIndex] = NULL; + Strings[UidStrIndex] = NULL; + Strings[CidStrIndex] = NULL; + CurrentLength = sizeof (ACPI_EXTENDED_HID_DEVICE_PATH); + CurrentPos = (CHAR8 *)(((UINT8 *)AcpiEx) + sizeof (ACPI_EXTENDED_HID_DEVICE_PATH)); + StrIndex = 0; + while (CurrentLength < AcpiEx->Header.Length[0] && StrIndex < ARRAY_SIZE (Strings)) { + Strings[StrIndex] = CurrentPos; + NextStringOffset = AsciiStrLen (CurrentPos) + 1; + CurrentLength += NextStringOffset; + CurrentPos += NextStringOffset; + StrIndex++; + } if (DisplayOnly) { if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A03) || ((EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A03) && (EISA_ID_TO_NUM (AcpiEx->HID) != 0x0A08))) { - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "PciRoot(%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "PciRoot(%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "PciRoot(0x%x)", AcpiEx->UID); } @@ -503,8 +521,8 @@ DevPathToTextAcpiEx ( } if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A08) || (EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A08)) { - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "PcieRoot(%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "PcieRoot(%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "PcieRoot(0x%x)", AcpiEx->UID); } @@ -535,7 +553,10 @@ DevPathToTextAcpiEx ( (AcpiEx->CID >> 16) & 0xFFFF ); - if ((*HIDStr == '\0') && (*CIDStr == '\0') && (*UIDStr != '\0')) { + if (((Strings[HidStrIndex] != NULL) && (*Strings[HidStrIndex] == '\0')) && + ((Strings[CidStrIndex] != NULL) && (*Strings[CidStrIndex] == '\0')) && + ((Strings[UidStrIndex] != NULL) && (*Strings[UidStrIndex] != '\0'))) + { // // use AcpiExp() // @@ -544,7 +565,7 @@ DevPathToTextAcpiEx ( Str, "AcpiExp(%s,0,%s)", HIDText, - UIDStr + Strings[UidStrIndex] ); } else { UefiDevicePathLibCatPrint ( @@ -552,28 +573,25 @@ DevPathToTextAcpiEx ( "AcpiExp(%s,%s,%s)", HIDText, CIDText, - UIDStr + Strings[UidStrIndex] ); } } else { if (DisplayOnly) { - // - // display only - // - if (AcpiEx->HID == 0) { - UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", HIDStr); + if (Strings[HidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", Strings[HidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "AcpiEx(%s,", HIDText); } - if (AcpiEx->CID == 0) { - UefiDevicePathLibCatPrint (Str, "%s,", CIDStr); + if (Strings[CidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "%s,", Strings[CidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "%s,", CIDText); } - if (AcpiEx->UID == 0) { - UefiDevicePathLibCatPrint (Str, "%s)", UIDStr); + if (Strings[UidStrIndex] != NULL) { + UefiDevicePathLibCatPrint (Str, "%s)", Strings[UidStrIndex]); } else { UefiDevicePathLibCatPrint (Str, "0x%x)", AcpiEx->UID); } @@ -584,9 +602,9 @@ DevPathToTextAcpiEx ( HIDText, CIDText, AcpiEx->UID, - HIDStr, - CIDStr, - UIDStr + Strings[HidStrIndex] != NULL ? Strings[HidStrIndex] : '\0', + Strings[CidStrIndex] != NULL ? Strings[CidStrIndex] : '\0', + Strings[UidStrIndex] != NULL ? Strings[UidStrIndex] : '\0' ); } } From 2b7f2890a812eb09dccaa8069483566a3b292338 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 29 Jul 2024 16:38:00 +0200 Subject: [PATCH 26/26] dummynet: fix pie Since 26b9e1f07fa codel was fixed but traffic was not flowing for pie too. Apply the same fix. MFC after: 1 week Sponsored by: OPNsense Differential Revision: https://reviews.freebsd.org/D46182 Also see: https://redmine.pfsense.org/issues/13996 Also see: https://forum.opnsense.org/index.php?topic=41827.0 Reviewed by: imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/1390 --- sys/netpfil/ipfw/dn_sched_fq_pie.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/netpfil/ipfw/dn_sched_fq_pie.c b/sys/netpfil/ipfw/dn_sched_fq_pie.c index 632bfd4b7152da..06700b0f93af28 100644 --- a/sys/netpfil/ipfw/dn_sched_fq_pie.c +++ b/sys/netpfil/ipfw/dn_sched_fq_pie.c @@ -744,6 +744,9 @@ pie_enqueue(struct fq_pie_flow *q, struct mbuf* m, struct fq_pie_si *si) } if (t != DROP) { + if (m->m_pkthdr.rcvif != NULL) + m_rcvif_serialize(m); + mq_append(&q->mq, m); fq_update_stats(q, si, len, 0); return 0;