From c1d0febac8382de39c7ecc6c3a21885d8ec687da Mon Sep 17 00:00:00 2001 From: purplerain Date: Thu, 23 May 2024 16:36:12 +0000 Subject: [PATCH] sync with OpenBSD -current --- games/cribbage/cribbage.h | 3 +- lib/libcrypto/evp/e_chacha20poly1305.c | 6 +- lib/libcrypto/man/X509v3_get_ext_by_NID.3 | 25 +-- lib/libcrypto/x509/x509_v3.c | 137 +++++++++-------- .../man/SSL_COMP_add_compression_method.3 | 6 +- libexec/snmpd/snmpd_metrics/mib.c | 42 ++--- .../lib/libcrypto/wycheproof/wycheproof.go | 145 +++++++++++++++++- regress/usr.bin/ssh/rekey.sh | 4 +- share/man/man4/umb.4 | 5 +- share/man/man4/umsm.4 | 5 +- sys/arch/amd64/include/i82093var.h | 7 +- sys/arch/amd64/include/isa_machdep.h | 11 +- sys/arch/amd64/include/rbus_machdep.h | 4 +- sys/arch/arm64/arm64/acpi_machdep.c | 3 +- sys/arch/arm64/arm64/db_interface.c | 8 +- sys/arch/arm64/include/db_machdep.h | 4 +- sys/arch/armv7/omap/ommmc.c | 4 +- sys/arch/i386/i386/ipifuncs.c | 6 +- sys/arch/i386/include/gdt.h | 3 +- sys/arch/i386/include/i82093var.h | 4 +- sys/arch/i386/include/rbus_machdep.h | 4 +- sys/dev/ic/ufshci.c | 10 +- sys/dev/ic/ufshcireg.h | 10 +- sys/dev/pci/if_mwx.c | 75 ++++++++- sys/dev/pci/if_mwxreg.h | 5 + sys/dev/pci/pcidevs | 3 +- sys/dev/pci/pcidevs.h | 1 + sys/dev/pci/pcidevs_data.h | 4 + sys/dev/usb/ehci.c | 3 +- sys/dev/usb/fido.c | 9 +- sys/dev/usb/if_athn_usb.c | 6 +- sys/dev/usb/if_atu.c | 5 +- sys/dev/usb/if_aue.c | 4 +- sys/dev/usb/if_axe.c | 4 +- sys/dev/usb/if_axen.c | 4 +- sys/dev/usb/if_bwfm_usb.c | 12 +- sys/dev/usb/if_cdce.c | 4 +- sys/dev/usb/if_cue.c | 4 +- sys/dev/usb/if_kue.c | 4 +- sys/dev/usb/if_mos.c | 5 +- sys/dev/usb/if_mtw.c | 5 +- sys/dev/usb/if_mue.c | 4 +- sys/dev/usb/if_otus.c | 5 +- sys/dev/usb/if_ral.c | 6 +- sys/dev/usb/if_rsu.c | 5 +- sys/dev/usb/if_rum.c | 6 +- sys/dev/usb/if_run.c | 5 +- sys/dev/usb/if_smsc.c | 4 +- sys/dev/usb/if_uaq.c | 5 +- sys/dev/usb/if_uath.c | 6 +- sys/dev/usb/if_udav.c | 4 +- sys/dev/usb/if_ugl.c | 5 +- sys/dev/usb/if_umb.c | 6 +- sys/dev/usb/if_upgt.c | 5 +- sys/dev/usb/if_upl.c | 5 +- sys/dev/usb/if_ure.c | 4 +- sys/dev/usb/if_url.c | 4 +- sys/dev/usb/if_urndis.c | 8 +- sys/dev/usb/if_urtw.c | 5 +- sys/dev/usb/if_urtwn.c | 8 +- sys/dev/usb/if_wi_usb.c | 12 +- sys/dev/usb/if_zyd.c | 5 +- sys/dev/usb/moscom.c | 4 +- sys/dev/usb/uark.c | 4 +- sys/dev/usb/ubcmtp.c | 4 +- sys/dev/usb/uberry.c | 10 +- sys/dev/usb/ubsa.c | 6 +- sys/dev/usb/uchcom.c | 4 +- sys/dev/usb/ucom.c | 4 +- sys/dev/usb/ucrcom.c | 4 +- sys/dev/usb/ucycom.c | 5 +- sys/dev/usb/udcf.c | 4 +- sys/dev/usb/udl.c | 3 +- sys/dev/usb/uftdi.c | 5 +- sys/dev/usb/ugen.c | 4 +- sys/dev/usb/ugold.c | 3 +- sys/dev/usb/uhid.c | 7 +- sys/dev/usb/uhidev.c | 6 +- sys/dev/usb/uhidpp.c | 3 +- sys/dev/usb/uhub.c | 3 +- sys/dev/usb/uipaq.c | 5 +- sys/dev/usb/ujoy.c | 9 +- sys/dev/usb/ukbd.c | 4 +- sys/dev/usb/umass.c | 6 +- sys/dev/usb/umass_quirks.c | 3 +- sys/dev/usb/umass_scsi.c | 7 +- sys/dev/usb/umbg.c | 5 +- sys/dev/usb/umcs.c | 4 +- sys/dev/usb/umct.c | 6 +- sys/dev/usb/umidi.c | 6 +- sys/dev/usb/umidi_quirks.c | 12 +- sys/dev/usb/umodem.c | 4 +- sys/dev/usb/ums.c | 4 +- sys/dev/usb/umsm.c | 5 +- sys/dev/usb/umstc.c | 4 +- sys/dev/usb/umt.c | 5 +- sys/dev/usb/uoak_subr.c | 5 +- sys/dev/usb/uoaklux.c | 4 +- sys/dev/usb/uoakrh.c | 4 +- sys/dev/usb/uoakv.c | 4 +- sys/dev/usb/uonerng.c | 5 +- sys/dev/usb/uow.c | 4 +- sys/dev/usb/upd.c | 5 +- sys/dev/usb/uplcom.c | 6 +- sys/dev/usb/urng.c | 3 +- sys/dev/usb/usb.c | 6 +- sys/dev/usb/usb.h | 3 +- sys/dev/usb/usb_mem.c | 4 +- sys/dev/usb/usb_subr.c | 3 +- sys/dev/usb/usbdevs | 3 +- sys/dev/usb/usbdevs.h | 5 +- sys/dev/usb/usbdevs_data.h | 8 +- sys/dev/usb/usbdi.c | 3 +- sys/dev/usb/usbdi_util.c | 3 +- sys/dev/usb/uscom.c | 5 +- sys/dev/usb/uslcom.c | 4 +- sys/dev/usb/uslhcom.c | 5 +- sys/dev/usb/usps.c | 5 +- sys/dev/usb/uthum.c | 5 +- sys/dev/usb/uticom.c | 4 +- sys/dev/usb/utpms.c | 5 +- sys/dev/usb/utrh.c | 5 +- sys/dev/usb/uts.c | 10 +- sys/dev/usb/utvfu.c | 3 +- sys/dev/usb/utwitch.c | 5 +- sys/dev/usb/uvideo.c | 8 +- sys/dev/usb/uvisor.c | 5 +- sys/dev/usb/uvscom.c | 9 +- sys/dev/usb/uxrcom.c | 4 +- sys/dev/usb/xhci.c | 3 +- sys/kern/kern_resource.c | 6 +- sys/kern/kern_sig.c | 7 +- sys/kern/kern_synch.c | 4 +- sys/net80211/ieee80211_input.c | 6 +- usr.bin/ssh/Makefile.inc | 4 +- usr.sbin/bgpctl/bgpctl.c | 10 +- usr.sbin/bgpctl/output.c | 4 +- usr.sbin/bgpctl/output_json.c | 4 +- usr.sbin/bgpd/config.c | 7 +- usr.sbin/bgpd/mrt.c | 4 +- usr.sbin/bgpd/parse.y | 8 +- usr.sbin/bgpd/printconf.c | 6 +- usr.sbin/bgpd/rde.c | 29 ++-- usr.sbin/bgpd/rde.h | 4 +- usr.sbin/bgpd/rde_peer.c | 4 +- usr.sbin/bgpd/session.c | 13 +- usr.sbin/fw_update/patterns.c | 3 +- usr.sbin/smtpd/smtpd-tables.7 | 12 +- usr.sbin/smtpd/table_proc.c | 5 +- 149 files changed, 556 insertions(+), 649 deletions(-) diff --git a/games/cribbage/cribbage.h b/games/cribbage/cribbage.h index fad3be1fa..608242fc0 100644 --- a/games/cribbage/cribbage.h +++ b/games/cribbage/cribbage.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cribbage.h,v 1.12 2015/12/31 18:10:19 mestre Exp $ */ +/* $OpenBSD: cribbage.h,v 1.13 2024/05/23 00:45:08 jsg Exp $ */ /* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */ /* @@ -60,7 +60,6 @@ extern bool explain; /* player mistakes explained */ extern bool muggins; /* player mistakes exploited */ extern bool rflag; /* if all cuts random */ extern bool quiet; /* if suppress random mess */ -extern bool playing; /* currently playing game */ extern char expl_string[128]; /* string for explanation */ diff --git a/lib/libcrypto/evp/e_chacha20poly1305.c b/lib/libcrypto/evp/e_chacha20poly1305.c index cc2e0157e..816a8aa21 100644 --- a/lib/libcrypto/evp/e_chacha20poly1305.c +++ b/lib/libcrypto/evp/e_chacha20poly1305.c @@ -1,4 +1,4 @@ -/* $OpenBSD: e_chacha20poly1305.c,v 1.35 2024/04/09 13:52:41 beck Exp $ */ +/* $OpenBSD: e_chacha20poly1305.c,v 1.36 2024/05/22 14:02:08 tb Exp $ */ /* * Copyright (c) 2022 Joel Sing @@ -493,6 +493,8 @@ chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, /* Update with AD or plaintext/ciphertext. */ if (in != NULL) { + if (!ctx->encrypt || out == NULL) + CRYPTO_poly1305_update(&cpx->poly1305, in, len); if (out == NULL) { cpx->ad_len += len; cpx->in_ad = 1; @@ -502,8 +504,6 @@ chacha20_poly1305_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, } if (ctx->encrypt && out != NULL) CRYPTO_poly1305_update(&cpx->poly1305, out, len); - else - CRYPTO_poly1305_update(&cpx->poly1305, in, len); return len; } diff --git a/lib/libcrypto/man/X509v3_get_ext_by_NID.3 b/lib/libcrypto/man/X509v3_get_ext_by_NID.3 index 54e4b583f..8c7c159f8 100644 --- a/lib/libcrypto/man/X509v3_get_ext_by_NID.3 +++ b/lib/libcrypto/man/X509v3_get_ext_by_NID.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.13 2021/07/12 14:54:00 schwarze Exp $ +.\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.15 2024/05/22 09:44:10 tb Exp $ .\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100 .\" .\" This file was written by Dr. Stephen Henson . @@ -48,7 +48,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED .\" OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: July 12 2021 $ +.Dd $Mdocdate: May 22 2024 $ .Dt X509V3_GET_EXT_BY_NID 3 .Os .Sh NAME @@ -248,7 +248,7 @@ from The index .Fa loc can take any value from 0 to -.Fn X509_get_ext_count x No - 1 . +.Fn X509_get_ext_count x No \- 1 . The returned extension is an internal pointer which must not be freed up by the application. .Pp @@ -265,9 +265,9 @@ The search starts from the extension after .Fa lastpos or from the beginning if .Fa lastpos -is -1. -If the extension is found, its index is returned; otherwise, -1 is -returned. +is \-1. +If the extension is found, its index is returned; otherwise, a negative +value is returned. .Pp .Fn X509v3_get_ext_by_critical is similar to @@ -300,7 +300,7 @@ at position .Fa loc . If .Fa loc -is -1, the new extension is added to the end. +is \-1, the new extension is added to the end. If .Pf * Fa x is @@ -358,7 +358,7 @@ These search functions start from the extension .Em after the .Fa lastpos -parameter, so it should initially be set to -1. +parameter, so it should initially be set to \-1. If it is set to 0, the initial extension will not be checked. .Sh RETURN VALUES .Fn X509v3_get_ext_count @@ -378,7 +378,13 @@ if an error occurs. .Fn X509v3_get_ext_by_OBJ , and .Fn X509v3_get_ext_by_critical -return the extension index or -1 if an error occurs. +return the extension index or \-1 if an error occurs. +In addition, +.Fn X509v3_get_ext_by_NID +returns \-2 if +.Xr OBJ_nid2obj 3 +fails on the requested +.Fa nid . .Pp .Fn X509v3_add_ext returns a stack of extensions or @@ -388,6 +394,7 @@ on error. .Fn X509_add_ext returns 1 on success or 0 on error. .Sh SEE ALSO +.Xr OBJ_nid2obj 3 , .Xr X509_CRL_new 3 , .Xr X509_EXTENSION_new 3 , .Xr X509_new 3 , diff --git a/lib/libcrypto/x509/x509_v3.c b/lib/libcrypto/x509/x509_v3.c index 3dee31e19..fcc689737 100644 --- a/lib/libcrypto/x509/x509_v3.c +++ b/lib/libcrypto/x509/x509_v3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_v3.c,v 1.22 2024/05/16 13:19:09 tb Exp $ */ +/* $OpenBSD: x509_v3.c,v 1.30 2024/05/23 02:00:38 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -69,23 +69,24 @@ #include "x509_local.h" int -X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x) +X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *sk) { - if (x == NULL) + if (sk == NULL) return 0; - return sk_X509_EXTENSION_num(x); + + return sk_X509_EXTENSION_num(sk); } LCRYPTO_ALIAS(X509v3_get_ext_count); int -X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid, int lastpos) +X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *sk, int nid, int lastpos) { - ASN1_OBJECT *obj; + const ASN1_OBJECT *obj; - obj = OBJ_nid2obj(nid); - if (obj == NULL) + if ((obj = OBJ_nid2obj(nid)) == NULL) return -2; - return X509v3_get_ext_by_OBJ(x, obj, lastpos); + + return X509v3_get_ext_by_OBJ(sk, obj, lastpos); } LCRYPTO_ALIAS(X509v3_get_ext_by_NID); @@ -94,7 +95,7 @@ X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, const ASN1_OBJECT *obj, int lastpos) { int n; - X509_EXTENSION *ex; + X509_EXTENSION *ext; if (sk == NULL) return -1; @@ -103,8 +104,8 @@ X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk, lastpos = 0; n = sk_X509_EXTENSION_num(sk); for (; lastpos < n; lastpos++) { - ex = sk_X509_EXTENSION_value(sk, lastpos); - if (OBJ_cmp(ex->object, obj) == 0) + ext = sk_X509_EXTENSION_value(sk, lastpos); + if (OBJ_cmp(ext->object, obj) == 0) return lastpos; } return -1; @@ -116,7 +117,7 @@ X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, int lastpos) { int n; - X509_EXTENSION *ex; + X509_EXTENSION *ext; if (sk == NULL) return -1; @@ -125,9 +126,9 @@ X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, lastpos = 0; n = sk_X509_EXTENSION_num(sk); for (; lastpos < n; lastpos++) { - ex = sk_X509_EXTENSION_value(sk, lastpos); - if ((ex->critical > 0 && crit) || - (ex->critical <= 0 && !crit)) + ext = sk_X509_EXTENSION_value(sk, lastpos); + if ((ext->critical > 0 && crit) || + (ext->critical <= 0 && !crit)) return lastpos; } return -1; @@ -135,31 +136,29 @@ X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *sk, int crit, LCRYPTO_ALIAS(X509v3_get_ext_by_critical); X509_EXTENSION * -X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc) +X509v3_get_ext(const STACK_OF(X509_EXTENSION) *sk, int loc) { - if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0) + if (sk == NULL || sk_X509_EXTENSION_num(sk) <= loc || loc < 0) return NULL; - else - return sk_X509_EXTENSION_value(x, loc); + + return sk_X509_EXTENSION_value(sk, loc); } LCRYPTO_ALIAS(X509v3_get_ext); X509_EXTENSION * -X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc) +X509v3_delete_ext(STACK_OF(X509_EXTENSION) *sk, int loc) { - X509_EXTENSION *ret; - - if (x == NULL || sk_X509_EXTENSION_num(x) <= loc || loc < 0) + if (sk == NULL || sk_X509_EXTENSION_num(sk) <= loc || loc < 0) return NULL; - ret = sk_X509_EXTENSION_delete(x, loc); - return ret; + + return sk_X509_EXTENSION_delete(sk, loc); } LCRYPTO_ALIAS(X509v3_delete_ext); STACK_OF(X509_EXTENSION) * -X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc) +X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ext, int loc) { - X509_EXTENSION *new_ex = NULL; + X509_EXTENSION *new_ext = NULL; int n; STACK_OF(X509_EXTENSION) *sk = NULL; @@ -180,19 +179,19 @@ X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, X509_EXTENSION *ex, int loc) else if (loc < 0) loc = n; - if ((new_ex = X509_EXTENSION_dup(ex)) == NULL) + if ((new_ext = X509_EXTENSION_dup(ext)) == NULL) goto err2; - if (!sk_X509_EXTENSION_insert(sk, new_ex, loc)) + if (!sk_X509_EXTENSION_insert(sk, new_ext, loc)) goto err; if (*x == NULL) *x = sk; return sk; -err: + err: X509error(ERR_R_MALLOC_FAILURE); -err2: - if (new_ex != NULL) - X509_EXTENSION_free(new_ex); + err2: + if (new_ext != NULL) + X509_EXTENSION_free(new_ext); if (sk != NULL && x != NULL && sk != *x) sk_X509_EXTENSION_free(sk); return NULL; @@ -200,7 +199,7 @@ err2: LCRYPTO_ALIAS(X509v3_add_ext); X509_EXTENSION * -X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, +X509_EXTENSION_create_by_NID(X509_EXTENSION **ext, int nid, int crit, ASN1_OCTET_STRING *data) { ASN1_OBJECT *obj; @@ -211,7 +210,7 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, X509error(X509_R_UNKNOWN_NID); return NULL; } - ret = X509_EXTENSION_create_by_OBJ(ex, obj, crit, data); + ret = X509_EXTENSION_create_by_OBJ(ext, obj, crit, data); if (ret == NULL) ASN1_OBJECT_free(obj); return ret; @@ -219,18 +218,18 @@ X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid, int crit, LCRYPTO_ALIAS(X509_EXTENSION_create_by_NID); X509_EXTENSION * -X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj, +X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ext, const ASN1_OBJECT *obj, int crit, ASN1_OCTET_STRING *data) { X509_EXTENSION *ret; - if (ex == NULL || *ex == NULL) { + if (ext == NULL || *ext == NULL) { if ((ret = X509_EXTENSION_new()) == NULL) { X509error(ERR_R_MALLOC_FAILURE); return NULL; } } else - ret= *ex; + ret= *ext; if (!X509_EXTENSION_set_object(ret, obj)) goto err; @@ -239,76 +238,78 @@ X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, const ASN1_OBJECT *obj, if (!X509_EXTENSION_set_data(ret, data)) goto err; - if (ex != NULL && *ex == NULL) - *ex = ret; + if (ext != NULL && *ext == NULL) + *ext = ret; return ret; -err: - if (ex == NULL || ret != *ex) + err: + if (ext == NULL || ret != *ext) X509_EXTENSION_free(ret); return NULL; } LCRYPTO_ALIAS(X509_EXTENSION_create_by_OBJ); int -X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj) +X509_EXTENSION_set_object(X509_EXTENSION *ext, const ASN1_OBJECT *obj) { - if (ex == NULL || obj == NULL) + if (ext == NULL || obj == NULL) return 0; - ASN1_OBJECT_free(ex->object); - ex->object = OBJ_dup(obj); - return ex->object != NULL; + + ASN1_OBJECT_free(ext->object); + ext->object = OBJ_dup(obj); + + return ext->object != NULL; } LCRYPTO_ALIAS(X509_EXTENSION_set_object); int -X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit) +X509_EXTENSION_set_critical(X509_EXTENSION *ext, int crit) { - if (ex == NULL) + if (ext == NULL) return 0; - ex->critical = crit ? 0xFF : -1; + + ext->critical = crit ? 0xFF : -1; + return 1; } LCRYPTO_ALIAS(X509_EXTENSION_set_critical); int -X509_EXTENSION_set_data(X509_EXTENSION *ex, ASN1_OCTET_STRING *data) +X509_EXTENSION_set_data(X509_EXTENSION *ext, ASN1_OCTET_STRING *data) { - int i; + if (ext == NULL) + return 0; - if (ex == NULL) - return 0; - i = ASN1_STRING_set(ex->value, data->data, data->length); - if (!i) - return 0; - return 1; + return ASN1_STRING_set(ext->value, data->data, data->length); } LCRYPTO_ALIAS(X509_EXTENSION_set_data); ASN1_OBJECT * -X509_EXTENSION_get_object(X509_EXTENSION *ex) +X509_EXTENSION_get_object(X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return NULL; - return ex->object; + + return ext->object; } LCRYPTO_ALIAS(X509_EXTENSION_get_object); ASN1_OCTET_STRING * -X509_EXTENSION_get_data(X509_EXTENSION *ex) +X509_EXTENSION_get_data(X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return NULL; - return ex->value; + + return ext->value; } LCRYPTO_ALIAS(X509_EXTENSION_get_data); int -X509_EXTENSION_get_critical(const X509_EXTENSION *ex) +X509_EXTENSION_get_critical(const X509_EXTENSION *ext) { - if (ex == NULL) + if (ext == NULL) return 0; - if (ex->critical > 0) + if (ext->critical > 0) return 1; return 0; } diff --git a/lib/libssl/man/SSL_COMP_add_compression_method.3 b/lib/libssl/man/SSL_COMP_add_compression_method.3 index 99e3f87ed..a18c9cd2b 100644 --- a/lib/libssl/man/SSL_COMP_add_compression_method.3 +++ b/lib/libssl/man/SSL_COMP_add_compression_method.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.5 2019/06/12 09:36:30 schwarze Exp $ +.\" $OpenBSD: SSL_COMP_add_compression_method.3,v 1.6 2024/05/23 06:49:55 tb Exp $ .\" .\" Copyright (c) 2016 Ingo Schwarze .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: June 12 2019 $ +.Dd $Mdocdate: May 23 2024 $ .Dt SSL_COMP_ADD_COMPRESSION_METHOD 3 .Os .Sh NAME @@ -24,7 +24,7 @@ .Sh SYNOPSIS .In openssl/ssl.h .Ft int -.Fn SSL_COMP_add_compression_method "int id" "COMP_METHOD *cm" +.Fn SSL_COMP_add_compression_method "int id" "void *cm" .Ft STACK_OF(SSL_COMP) * .Fn SSL_COMP_get_compression_methods void .Sh DESCRIPTION diff --git a/libexec/snmpd/snmpd_metrics/mib.c b/libexec/snmpd/snmpd_metrics/mib.c index f3baed1a8..78ccf8abb 100644 --- a/libexec/snmpd/snmpd_metrics/mib.c +++ b/libexec/snmpd/snmpd_metrics/mib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.c,v 1.8 2024/04/28 16:42:53 florian Exp $ */ +/* $OpenBSD: mib.c,v 1.9 2024/05/22 08:44:02 martijn Exp $ */ /* * Copyright (c) 2022 Martijn van Duren @@ -296,29 +296,31 @@ mib_hrsystemdate(struct agentx_varbind *vb) int tzoffset; unsigned short year; - memset(s, 0, sizeof(s)); (void)time(&now); ptm = localtime(&now); - if (ptm != NULL) { - year = htons(ptm->tm_year + 1900); - memcpy(s, &year, 2); - s[2] = ptm->tm_mon + 1; - s[3] = ptm->tm_mday; - s[4] = ptm->tm_hour; - s[5] = ptm->tm_min; - s[6] = ptm->tm_sec; - s[7] = 0; - - tzoffset = ptm->tm_gmtoff; - if (tzoffset < 0) - s[8] = '-'; - else - s[8] = '+'; - - s[9] = abs(tzoffset) / 3600; - s[10] = (abs(tzoffset) - (s[9] * 3600)) / 60; + if (ptm == NULL) { + log_warnx("localtime"); + agentx_varbind_error(vb); + return; } + year = htons(ptm->tm_year + 1900); + memcpy(s, &year, 2); + s[2] = ptm->tm_mon + 1; + s[3] = ptm->tm_mday; + s[4] = ptm->tm_hour; + s[5] = ptm->tm_min; + s[6] = ptm->tm_sec; + s[7] = 0; + + tzoffset = ptm->tm_gmtoff; + if (tzoffset < 0) + s[8] = '-'; + else + s[8] = '+'; + + s[9] = abs(tzoffset) / 3600; + s[10] = (abs(tzoffset) - (s[9] * 3600)) / 60; agentx_varbind_nstring(vb, s, sizeof(s)); } diff --git a/regress/lib/libcrypto/wycheproof/wycheproof.go b/regress/lib/libcrypto/wycheproof/wycheproof.go index b158c142a..ddd37030d 100644 --- a/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/regress/lib/libcrypto/wycheproof/wycheproof.go @@ -1,7 +1,7 @@ -/* $OpenBSD: wycheproof.go,v 1.159 2023/11/07 21:22:34 tb Exp $ */ +/* $OpenBSD: wycheproof.go,v 1.160 2024/05/22 14:03:24 tb Exp $ */ /* * Copyright (c) 2018,2023 Joel Sing - * Copyright (c) 2018,2019,2022,2023 Theo Buehler + * Copyright (c) 2018,2019,2022-2024 Theo Buehler * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -1215,6 +1215,138 @@ func runChaCha20Poly1305Test(algorithm string, wt *wycheproofTestAead) bool { return openSuccess && sealSuccess } +func runEvpChaCha20Poly1305Test(ctx *C.EVP_CIPHER_CTX, algorithm string, wt *wycheproofTestAead) bool { + var aead *C.EVP_CIPHER + switch algorithm { + case "CHACHA20-POLY1305": + aead = C.EVP_chacha20_poly1305() + case "XCHACHA20-POLY1305": + return true + } + + key, _ := mustDecodeHexString(wt.Key, "key") + iv, ivLen := mustDecodeHexString(wt.IV, "iv") + aad, aadLen := mustDecodeHexString(wt.AAD, "aad") + msg, msgLen := mustDecodeHexString(wt.Msg, "msg") + + ct, err := hex.DecodeString(wt.CT) + if err != nil { + log.Fatalf("Failed to decode ct %q: %v", wt.CT, err) + } + tag, err := hex.DecodeString(wt.Tag) + if err != nil { + log.Fatalf("Failed to decode tag %q: %v", wt.Tag, err) + } + ctLen, tagLen := len(ct), len(tag) + + if C.EVP_EncryptInit_ex(ctx, aead, nil, nil, nil) != 1 { + log.Fatal("Failed to initialize EVP_CIPHER_CTX with cipher") + } + if C.EVP_CIPHER_CTX_ctrl(ctx, C.EVP_CTRL_AEAD_SET_IVLEN, C.int(ivLen), nil) != 1 { + log.Fatal("Failed EVP_CTRL_AEAD_SET_IVLEN") + } + if C.EVP_EncryptInit_ex(ctx, nil, nil, (*C.uchar)(unsafe.Pointer(&key[0])), nil) != 1 { + log.Fatal("Failed EVP_EncryptInit_ex key") + } + if C.EVP_EncryptInit_ex(ctx, nil, nil, nil, (*C.uchar)(unsafe.Pointer(&iv[0]))) != 1 { + log.Fatal("Failed EVP_EncryptInit_ex iv") + } + + var len C.int + + if C.EVP_EncryptUpdate(ctx, nil, (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(&aad[0]), (C.int)(aadLen)) != 1 { + log.Fatal("Failed EVP_EncryptUpdate aad") + } + + sealed := make([]byte, ctLen + tagLen) + copy(sealed, msg) + if C.EVP_EncryptUpdate(ctx, (*C.uchar)(unsafe.Pointer(&sealed[0])), (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(unsafe.Pointer(&sealed[0])), (C.int)(msgLen)) != 1 { + log.Fatal("Failed EVP_EncryptUpdate msg") + } + outLen := len + if C.EVP_EncryptFinal_ex(ctx, (*C.uchar)(unsafe.Pointer(&sealed[outLen])), (*C.int)(unsafe.Pointer(&len))) != 1 { + log.Fatal("Failed EVP_EncryptFinal msg") + } + outLen += len + if C.EVP_CIPHER_CTX_ctrl(ctx, C.EVP_CTRL_AEAD_GET_TAG, (C.int)(tagLen), unsafe.Pointer(&sealed[outLen])) != 1 { + log.Fatal("Failed EVP_CTRL_AEAD_GET_TAG") + } + outLen += (C.int)(tagLen) + + if (C.int)(ctLen + tagLen) != outLen { + fmt.Printf("%s\n", wt) + } + + sealSuccess := false + ctMatch := bytes.Equal(ct, sealed[:ctLen]) + tagMatch := bytes.Equal(tag, sealed[ctLen:]) + if (ctMatch && tagMatch) == (wt.Result != "invalid") { + sealSuccess = true + } else { + fmt.Printf("%s - ct match: %t tag match: %t\n", wt, ctMatch, tagMatch) + } + + if C.EVP_DecryptInit_ex(ctx, aead, nil, nil, nil) != 1 { + log.Fatal("Failed to initialize EVP_CIPHER_CTX with cipher") + } + if C.EVP_DecryptInit_ex(ctx, nil, nil, (*C.uchar)(unsafe.Pointer(&key[0])), nil) != 1 { + log.Fatal("Failed EVP_EncryptInit_ex key") + } + + if C.EVP_CIPHER_CTX_ctrl(ctx, C.EVP_CTRL_AEAD_SET_IVLEN, C.int(ivLen), nil) != 1 { + log.Fatal("Failed EVP_CTRL_AEAD_SET_IVLEN") + } + if C.EVP_DecryptInit_ex(ctx, nil, nil, nil, (*C.uchar)(unsafe.Pointer(&iv[0]))) != 1 { + log.Fatal("Failed EVP_EncryptInit_ex iv") + } + + if C.EVP_CIPHER_CTX_ctrl(ctx, C.EVP_CTRL_AEAD_SET_TAG, (C.int)(tagLen), unsafe.Pointer(&tag[0])) != 1 { + log.Fatal("Failed EVP_CTRL_AEAD_SET_TAG") + } + + if ctLen == 0 { + ct = append(ct, 0) + } + + opened := make([]byte, msgLen + tagLen) + copy(opened, ct) + if msgLen + aadLen == 0 { + opened = append(opened, 0) + } + + if C.EVP_DecryptUpdate(ctx, nil, (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(unsafe.Pointer(&aad[0])), C.int(aadLen)) != 1 { + log.Fatal("Failed EVP_EncryptUpdate msg") + } + + if C.EVP_DecryptUpdate(ctx, (*C.uchar)(unsafe.Pointer(&opened[0])), (*C.int)(unsafe.Pointer(&len)), (*C.uchar)(unsafe.Pointer(&opened[0])), (C.int)(ctLen)) != 1 { + log.Fatal("Failed EVP_EncryptUpdate msg") + } + outLen = len + + var ret C.int + if wt.Result != "invalid" { + ret = 1 + } + + if C.EVP_DecryptFinal_ex(ctx, (*C.uchar)(unsafe.Pointer(&opened[outLen])), (*C.int)(unsafe.Pointer(&len))) != ret { + log.Fatalf("Failed EVP_EncryptFinal msg %s\n", wt) + } + outLen += len + + openSuccess := true + if (C.int)(msgLen) != outLen { + openSuccess = false + fmt.Printf("%s\n", wt) + } + + if wt.Result != "invalid" && !bytes.Equal(opened[:outLen], msg[:msgLen]) { + fmt.Printf("failed %s\n", wt) + openSuccess = false + } + + return sealSuccess && openSuccess +} + func (wtg *wycheproofTestGroupChaCha) run(algorithm string, variant testVariant) bool { // ChaCha20-Poly1305 currently only supports nonces of length 12 (96 bits) if algorithm == "CHACHA20-POLY1305" && wtg.IVSize != 96 { @@ -1223,11 +1355,20 @@ func (wtg *wycheproofTestGroupChaCha) run(algorithm string, variant testVariant) fmt.Printf("Running %v test group %v with IV size %d, key size %d, tag size %d...\n", algorithm, wtg.Type, wtg.IVSize, wtg.KeySize, wtg.TagSize) + ctx := C.EVP_CIPHER_CTX_new() + if ctx == nil { + log.Fatal("EVP_CIPHER_CTX_new() failed") + } + defer C.EVP_CIPHER_CTX_free(ctx) + success := true for _, wt := range wtg.Tests { if !runChaCha20Poly1305Test(algorithm, wt) { success = false } + if !runEvpChaCha20Poly1305Test(ctx, algorithm, wt) { + success = false + } } return success } diff --git a/regress/usr.bin/ssh/rekey.sh b/regress/usr.bin/ssh/rekey.sh index 61723cd86..8005a86ad 100644 --- a/regress/usr.bin/ssh/rekey.sh +++ b/regress/usr.bin/ssh/rekey.sh @@ -1,4 +1,4 @@ -# $OpenBSD: rekey.sh,v 1.19 2021/07/19 05:08:54 dtucker Exp $ +# $OpenBSD: rekey.sh,v 1.20 2024/05/22 04:20:00 djm Exp $ # Placed in the Public Domain. tid="rekey" @@ -14,7 +14,7 @@ ssh_data_rekeying() { _kexopt=$1 ; shift _opts="$@" - if ! test -z "$_kexopts" ; then + if ! test -z "$_kexopt" ; then cp $OBJ/sshd_proxy_bak $OBJ/sshd_proxy echo "$_kexopt" >> $OBJ/sshd_proxy _opts="$_opts -o$_kexopt" diff --git a/share/man/man4/umb.4 b/share/man/man4/umb.4 index c51a11346..c7ff19e16 100644 --- a/share/man/man4/umb.4 +++ b/share/man/man4/umb.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: umb.4,v 1.18 2024/04/15 06:12:46 jmc Exp $ +.\" $OpenBSD: umb.4,v 1.19 2024/05/23 08:06:22 kevlo Exp $ .\" .\" Copyright (c) 2016 genua mbH .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 15 2024 $ +.Dd $Mdocdate: May 23 2024 $ .Dt UMB 4 .Os .Sh NAME @@ -56,6 +56,7 @@ The following devices should work: .\" .It Huawei ME906s -- attaches but needs more work .It Medion Mobile S4222 (MediaTek OEM) .It Quectel EC25 +.It Quectel EM060K .It Quectel RM500Q .It SIMCom SIM7600 .It SIMCom SIM8262E-M2 diff --git a/share/man/man4/umsm.4 b/share/man/man4/umsm.4 index 2c0a9f87f..3f7d93e63 100644 --- a/share/man/man4/umsm.4 +++ b/share/man/man4/umsm.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: umsm.4,v 1.96 2021/05/18 14:23:03 kevlo Exp $ +.\" $OpenBSD: umsm.4,v 1.97 2024/05/23 08:06:22 kevlo Exp $ .\" .\" Copyright (c) 2006 Jonathan Gray .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 18 2021 $ +.Dd $Mdocdate: May 23 2024 $ .Dt UMSM 4 .Os .Sh NAME @@ -101,6 +101,7 @@ driver: .It Li "Option iCON 505" Ta "USB" .It Li "Option GlobeTrotter HSUPA 380E" Ta "PCI Express Mini Card" .It Li "Quectel EC25" Ta "PCI Express Mini Card" +.It Li "Quectel EM060K" Ta "M.2" .It Li "Sierra Wireless MC8755" Ta "PCI Express Mini Card" .It Li "Sierra Wireless MC8775" Ta "PCI Express Mini Card" .It Li "Sierra Wireless MC8790" Ta "PCI Express Mini Card" diff --git a/sys/arch/amd64/include/i82093var.h b/sys/arch/amd64/include/i82093var.h index 56da27eb5..260d16e82 100644 --- a/sys/arch/amd64/include/i82093var.h +++ b/sys/arch/amd64/include/i82093var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82093var.h,v 1.5 2016/05/04 14:30:00 kettenis Exp $ */ +/* $OpenBSD: i82093var.h,v 1.6 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: i82093var.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ /*- @@ -81,16 +81,11 @@ struct ioapic_softc { #define APIC_IRQ_ISLEGACY(x) (!((x) & APIC_INT_VIA_APIC)) #define APIC_IRQ_LEGACY_IRQ(x) ((x) & 0xff) -void *apic_intr_establish(int, int, int, int (*)(void *), void *); -void apic_intr_disestablish(void *); - void ioapic_print_redir(struct ioapic_softc *, char *, int); -void ioapic_format_redir(char *, char *, int, u_int32_t, u_int32_t); struct ioapic_softc *ioapic_find(int); struct ioapic_softc *ioapic_find_bybase(int); void ioapic_enable(void); -void lapic_vectorset(void); /* XXX */ extern int ioapic_bsp_id; extern int nioapics; diff --git a/sys/arch/amd64/include/isa_machdep.h b/sys/arch/amd64/include/isa_machdep.h index 43d6e5848..75810b4bf 100644 --- a/sys/arch/amd64/include/isa_machdep.h +++ b/sys/arch/amd64/include/isa_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: isa_machdep.h,v 1.10 2024/05/13 00:16:09 jsg Exp $ */ +/* $OpenBSD: isa_machdep.h,v 1.11 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: isa_machdep.h,v 1.2 2003/05/09 23:51:28 fvdl Exp $ */ /*- @@ -107,18 +107,9 @@ int isa_intr_alloc(isa_chipset_tag_t, int, int, int *); void *isa_intr_establish(isa_chipset_tag_t ic, int irq, int type, int level, int (*ih_fun)(void *), void *ih_arg, char *); void isa_intr_disestablish(isa_chipset_tag_t ic, void *handler); -int isa_mem_alloc(bus_space_tag_t, bus_size_t, bus_size_t, - bus_addr_t, int, bus_addr_t *, bus_space_handle_t *); -void isa_mem_free(bus_space_tag_t, bus_space_handle_t, bus_size_t); int isa_intr_check(isa_chipset_tag_t, int, int); -/* - * for ACPI code - */ - -void isa_reinit_irq(void); - /* * ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED * BY PORTABLE CODE. diff --git a/sys/arch/amd64/include/rbus_machdep.h b/sys/arch/amd64/include/rbus_machdep.h index 7e5dc1e58..7986f50d8 100644 --- a/sys/arch/amd64/include/rbus_machdep.h +++ b/sys/arch/amd64/include/rbus_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rbus_machdep.h,v 1.7 2011/03/23 16:54:34 pirofti Exp $ */ +/* $OpenBSD: rbus_machdep.h,v 1.8 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: rbus_machdep.h,v 1.2 1999/10/15 06:43:05 haya Exp $ */ /* @@ -42,8 +42,6 @@ rbus_tag_t rbus_pccbb_parent_io(struct device *, rbus_tag_t rbus_pccbb_parent_mem(struct device *, struct pci_attach_args *); -bus_addr_t rbus_min_start_hint(void); - void pccbb_attach_hook(struct device *, struct device *, struct pci_attach_args *); diff --git a/sys/arch/arm64/arm64/acpi_machdep.c b/sys/arch/arm64/arm64/acpi_machdep.c index 425fe8c18..5ca2a4c75 100644 --- a/sys/arch/arm64/arm64/acpi_machdep.c +++ b/sys/arch/arm64/arm64/acpi_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi_machdep.c,v 1.21 2022/11/26 17:23:15 tobhe Exp $ */ +/* $OpenBSD: acpi_machdep.c,v 1.22 2024/05/22 05:51:49 jsg Exp $ */ /* * Copyright (c) 2018 Mark Kettenis * @@ -40,7 +40,6 @@ int pwr_action = 1; int acpi_fdt_match(struct device *, void *, void *); void acpi_fdt_attach(struct device *, struct device *, void *); -void acpi_attach(struct device *, struct device *, void *); const struct cfattach acpi_fdt_ca = { sizeof(struct acpi_softc), acpi_fdt_match, acpi_fdt_attach diff --git a/sys/arch/arm64/arm64/db_interface.c b/sys/arch/arm64/arm64/db_interface.c index a7ed1e1db..4ca0499ef 100644 --- a/sys/arch/arm64/arm64/db_interface.c +++ b/sys/arch/arm64/arm64/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.15 2024/02/23 18:19:03 cheloha Exp $ */ +/* $OpenBSD: db_interface.c,v 1.16 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: db_interface.c,v 1.34 2003/10/26 23:11:15 chris Exp $ */ /* @@ -56,12 +56,6 @@ #include #include - -int db_access_und_sp (struct db_variable *, db_expr_t *, int); -int db_access_abt_sp (struct db_variable *, db_expr_t *, int); -int db_access_irq_sp (struct db_variable *, db_expr_t *, int); -u_int db_fetch_reg (int, db_regs_t *); - int db_trapper (vaddr_t, u_int, trapframe_t *, int); struct db_variable db_regs[] = { diff --git a/sys/arch/arm64/include/db_machdep.h b/sys/arch/arm64/include/db_machdep.h index 2f53bc2cb..8d519947f 100644 --- a/sys/arch/arm64/include/db_machdep.h +++ b/sys/arch/arm64/include/db_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: db_machdep.h,v 1.5 2021/08/30 08:11:12 jasper Exp $ */ +/* $OpenBSD: db_machdep.h,v 1.6 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: db_machdep.h,v 1.5 2001/11/22 18:00:00 thorpej Exp $ */ /* @@ -87,8 +87,6 @@ void db_machine_init (void); #define branch_taken(ins, pc, fun, regs) \ db_branch_taken((ins), (pc), (regs)) -void db_show_frame_cmd(db_expr_t, int, db_expr_t, char *); - #define DDB_STATE_NOT_RUNNING 0 #define DDB_STATE_RUNNING 1 #define DDB_STATE_EXITING 2 diff --git a/sys/arch/armv7/omap/ommmc.c b/sys/arch/armv7/omap/ommmc.c index 381064c0e..ed03d5b56 100644 --- a/sys/arch/armv7/omap/ommmc.c +++ b/sys/arch/armv7/omap/ommmc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ommmc.c,v 1.40 2021/10/24 17:52:27 mpi Exp $ */ +/* $OpenBSD: ommmc.c,v 1.41 2024/05/22 05:51:49 jsg Exp $ */ /* * Copyright (c) 2009 Dale Rahn @@ -206,8 +206,6 @@ struct ommmc_softc { /* Host controller functions called by the attachment driver. */ -int ommmc_host_found(struct ommmc_softc *, bus_space_tag_t, - bus_space_handle_t, bus_size_t, int); void ommmc_power(int, void *); void ommmc_shutdown(void *); int ommmc_intr(void *); diff --git a/sys/arch/i386/i386/ipifuncs.c b/sys/arch/i386/i386/ipifuncs.c index 55b564b99..7a529884a 100644 --- a/sys/arch/i386/i386/ipifuncs.c +++ b/sys/arch/i386/i386/ipifuncs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipifuncs.c,v 1.35 2023/10/30 12:50:59 mvs Exp $ */ +/* $OpenBSD: ipifuncs.c,v 1.36 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: ipifuncs.c,v 1.1.2.3 2000/06/26 02:04:06 sommerfeld Exp $ */ /*- @@ -73,11 +73,7 @@ void (*ipifunc[I386_NIPI])(struct cpu_info *) = i386_ipi_flush_fpu, i386_ipi_synch_fpu, i386_ipi_reload_mtrr, -#if 0 - gdt_reload_cpu, -#else NULL, -#endif #ifdef DDB i386_ipi_db, #else diff --git a/sys/arch/i386/include/gdt.h b/sys/arch/i386/include/gdt.h index 5ecc4565d..97a4fd02e 100644 --- a/sys/arch/i386/include/gdt.h +++ b/sys/arch/i386/include/gdt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt.h,v 1.17 2018/04/11 15:44:08 bluhm Exp $ */ +/* $OpenBSD: gdt.h,v 1.18 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: gdt.h,v 1.7.10.6 2002/08/19 01:22:36 sommerfeld Exp $ */ /*- @@ -39,6 +39,5 @@ struct pmap; void gdt_alloc_cpu(struct cpu_info *); void gdt_init(void); void gdt_init_cpu(struct cpu_info *); -void gdt_reload_cpu(/* XXX struct cpu_info * */ void); void setgdt(int, void *, size_t, int, int, int, int); #endif diff --git a/sys/arch/i386/include/i82093var.h b/sys/arch/i386/include/i82093var.h index 9d14bb40d..dd05bdd32 100644 --- a/sys/arch/i386/include/i82093var.h +++ b/sys/arch/i386/include/i82093var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: i82093var.h,v 1.11 2011/05/21 15:14:57 kettenis Exp $ */ +/* $OpenBSD: i82093var.h,v 1.12 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: i82093var.h,v 1.1 2003/02/26 21:26:10 fvdl Exp $ */ /*- @@ -86,12 +86,10 @@ void *apic_intr_establish(int, int, int, int (*)(void *), void *, void apic_intr_disestablish(void *); void ioapic_print_redir(struct ioapic_softc *, char *, int); -void ioapic_format_redir(char *, char *, int, u_int32_t, u_int32_t); struct ioapic_softc *ioapic_find(int); struct ioapic_softc *ioapic_find_bybase(int); void ioapic_enable(void); -void lapic_vectorset(void); /* XXX */ extern int ioapic_bsp_id; extern int nioapics; diff --git a/sys/arch/i386/include/rbus_machdep.h b/sys/arch/i386/include/rbus_machdep.h index b8c1d54e7..c3b5aa81f 100644 --- a/sys/arch/i386/include/rbus_machdep.h +++ b/sys/arch/i386/include/rbus_machdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rbus_machdep.h,v 1.9 2011/03/23 16:54:35 pirofti Exp $ */ +/* $OpenBSD: rbus_machdep.h,v 1.10 2024/05/22 05:51:49 jsg Exp $ */ /* $NetBSD: rbus_machdep.h,v 1.2 1999/10/15 06:43:05 haya Exp $ */ /* @@ -42,8 +42,6 @@ rbus_tag_t rbus_pccbb_parent_io(struct device *, rbus_tag_t rbus_pccbb_parent_mem(struct device *, struct pci_attach_args *); -bus_addr_t rbus_min_start_hint(void); - void pccbb_attach_hook(struct device *, struct device *, struct pci_attach_args *); diff --git a/sys/dev/ic/ufshci.c b/sys/dev/ic/ufshci.c index 15f95f730..065886cbc 100644 --- a/sys/dev/ic/ufshci.c +++ b/sys/dev/ic/ufshci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufshci.c,v 1.29 2024/05/21 18:19:22 mglocker Exp $ */ +/* $OpenBSD: ufshci.c,v 1.30 2024/05/22 11:46:06 mglocker Exp $ */ /* * Copyright (c) 2022 Marcus Glocker @@ -55,7 +55,7 @@ struct cfdriver ufshci_cd = { }; int ufshci_reset(struct ufshci_softc *); -int ufshci_uccs_poll(struct ufshci_softc *); +int ufshci_is_poll(struct ufshci_softc *, uint32_t); struct ufshci_dmamem *ufshci_dmamem_alloc(struct ufshci_softc *, size_t); void ufshci_dmamem_free(struct ufshci_softc *, struct ufshci_dmamem *); @@ -269,7 +269,7 @@ ufshci_reset(struct ufshci_softc *sc) } int -ufshci_uccs_poll(struct ufshci_softc *sc) +ufshci_is_poll(struct ufshci_softc *sc, uint32_t type) { uint32_t status; int i, retry = 25; @@ -278,7 +278,7 @@ ufshci_uccs_poll(struct ufshci_softc *sc) for (i = 0; i < retry; i++) { status = UFSHCI_READ_4(sc, UFSHCI_REG_IS); - if (status & UFSHCI_REG_IS_UCCS) + if (status & type) break; delay(10); } @@ -369,7 +369,7 @@ ufshci_init(struct ufshci_softc *sc) /* 7.1.1 Host Controller Initialization: 6) */ UFSHCI_WRITE_4(sc, UFSHCI_REG_UICCMD, UFSHCI_REG_UICCMD_CMDOP_DME_LINKSTARTUP); - if (ufshci_uccs_poll(sc) != 0) + if (ufshci_is_poll(sc, UFSHCI_REG_IS_UCCS) != 0) return -1; /* diff --git a/sys/dev/ic/ufshcireg.h b/sys/dev/ic/ufshcireg.h index bb1991ed7..702b60468 100644 --- a/sys/dev/ic/ufshcireg.h +++ b/sys/dev/ic/ufshcireg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ufshcireg.h,v 1.10 2024/05/20 20:08:04 mglocker Exp $ */ +/* $OpenBSD: ufshcireg.h,v 1.11 2024/05/22 18:10:00 mglocker Exp $ */ /* * Copyright (c) 2022 Marcus Glocker @@ -99,10 +99,10 @@ #define UFSHCI_REG_IE_UTRCE (1 << 0) /* RW */ /* Host Controller Status */ #define UFSHCI_REG_HCS 0x30 -#define UFSHCI_REG_HCS_TLUNUTPE(x) ((x << 24) & 0xff000000) /* RO */ -#define UFSHCI_REG_HCS_TTAGUTPE(x) ((x << 16) & 0x00ff0000) /* RO */ -#define UFSHCI_REG_HCS_UTPEC(x) ((x << 12) & 0x0000f000) /* RO */ -#define UFSHCI_REG_HCS_UPMCRS(x) ((x << 8) & 0x00000700) /* RO */ +#define UFSHCI_REG_HCS_TLUNUTPE(x) ((x >> 24) & 0x000000ff) /* RO */ +#define UFSHCI_REG_HCS_TTAGUTPE(x) ((x >> 16) & 0x000000ff) /* RO */ +#define UFSHCI_REG_HCS_UTPEC(x) ((x >> 12) & 0x0000000f) /* RO */ +#define UFSHCI_REG_HCS_UPMCRS(x) ((x >> 8) & 0x00000007) /* RO */ #define UFSHCI_REG_HCS_UCRDY (1 << 3) /* RO */ #define UFSHCI_REG_HCS_UTMRLRDY (1 << 2) /* RO */ #define UFSHCI_REG_HCS_UTRLRDY (1 << 1) /* RO */ diff --git a/sys/dev/pci/if_mwx.c b/sys/dev/pci/if_mwx.c index 9b3466abc..bf90d00da 100644 --- a/sys/dev/pci/if_mwx.c +++ b/sys/dev/pci/if_mwx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mwx.c,v 1.3 2024/05/20 21:22:43 martijn Exp $ */ +/* $OpenBSD: if_mwx.c,v 1.5 2024/05/22 16:24:59 martijn Exp $ */ /* * Copyright (c) 2022 Claudio Jeker * Copyright (c) 2021 MediaTek Inc. @@ -52,6 +52,7 @@ static const struct pci_matchid mwx_devices[] = { { PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7921 }, { PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7921K }, + { PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7922 }, }; #define MWX_DEBUG 1 @@ -158,10 +159,17 @@ struct mwx_vif { uint8_t scan_seq_num; }; +enum mwx_hw_type { + MWX_HW_MT7921, + MWX_HW_MT7922, +}; + struct mwx_softc { struct device sc_dev; struct ieee80211com sc_ic; + enum mwx_hw_type sc_hwtype; + struct mwx_queue sc_txq; struct mwx_queue sc_txmcuq; struct mwx_queue sc_txfwdlq; @@ -375,6 +383,8 @@ int mwx_mcu_wait_resp_msg(struct mwx_softc *, uint32_t, int, int mt7921_dma_disable(struct mwx_softc *sc, int force); void mt7921_dma_enable(struct mwx_softc *sc); +int mt7921_e_mcu_fw_pmctrl(struct mwx_softc *); +int mt7921_e_mcu_drv_pmctrl(struct mwx_softc *); int mt7921_wfsys_reset(struct mwx_softc *sc); uint32_t mt7921_reg_addr(struct mwx_softc *, uint32_t); int mt7921_init_hardware(struct mwx_softc *); @@ -1179,6 +1189,10 @@ mwx_attach(struct device *parent, struct device *self, void *aux) sc->sc_pc = pa->pa_pc; sc->sc_tag = pa->pa_tag; sc->sc_dmat = pa->pa_dmat; + if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_MEDIATEK_MT7922) + sc->sc_hwtype = MWX_HW_MT7922; + else + sc->sc_hwtype = MWX_HW_MT7921; memtype = pci_mapreg_type(pa->pa_pc, pa->pa_tag, PCI_MAPREG_START); if (pci_mapreg_map(pa, PCI_MAPREG_START, memtype, 0, @@ -1207,6 +1221,10 @@ mwx_attach(struct device *parent, struct device *self, void *aux) sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_NET, mwx_intr, sc, DEVNAME(sc)); + if (mt7921_e_mcu_fw_pmctrl(sc) != 0 || + mt7921_e_mcu_drv_pmctrl(sc) != 0) + goto fail; + if ((error = mwx_txwi_alloc(sc, MWX_TXWI_MAX)) != 0) { printf("%s: failed to allocate DMA resources %d\n", DEVNAME(sc), error); @@ -2590,6 +2608,46 @@ mt7921_dma_enable(struct mwx_softc *sc) mwx_write(sc, MT_PCIE_MAC_INT_ENABLE, 0xff); } +int +mt7921_e_mcu_fw_pmctrl(struct mwx_softc *sc) +{ + int i; + + for (i = 0; i < MT7921_MCU_INIT_RETRY_COUNT; i++) { + mwx_write(sc, MT_CONN_ON_LPCTL, PCIE_LPCR_HOST_SET_OWN); + if (mwx_poll(sc, MT_CONN_ON_LPCTL, PCIE_LPCR_HOST_OWN_SYNC, + 4, 50) == 0) + break; + } + + if (i == MT7921_MCU_INIT_RETRY_COUNT) { + printf("%s: firmware own failed\n", DEVNAME(sc)); + return EIO; + } + + return 0; +} + +int +mt7921_e_mcu_drv_pmctrl(struct mwx_softc *sc) +{ + int i; + + for (i = 0; i < MT7921_MCU_INIT_RETRY_COUNT; i++) { + mwx_write(sc, MT_CONN_ON_LPCTL, PCIE_LPCR_HOST_CLR_OWN); + if (mwx_poll(sc, MT_CONN_ON_LPCTL, 0, + PCIE_LPCR_HOST_OWN_SYNC, 50) == 0) + break; + } + + if (i == MT7921_MCU_INIT_RETRY_COUNT) { + printf("%s: driver own failed\n", DEVNAME(sc)); + return EIO; + } + + return 0; +} + int mt7921_wfsys_reset(struct mwx_softc *sc) { @@ -2802,6 +2860,7 @@ mt7921_load_firmware(struct mwx_softc *sc) { struct mt7921_patch_hdr *hdr; struct mt7921_fw_trailer *fwhdr; + const char *rompatch, *fw; u_char *buf, *fwbuf, *dl; size_t buflen, fwlen, offset = 0; uint32_t reg, override = 0, option = 0; @@ -2813,8 +2872,18 @@ mt7921_load_firmware(struct mwx_softc *sc) return 0; } - if ((rv = loadfirmware(MT7921_ROM_PATCH, &buf, &buflen)) != 0 || - (rv = loadfirmware(MT7921_FIRMWARE_WM, &fwbuf, &fwlen)) != 0) { + switch (sc->sc_hwtype) { + case MWX_HW_MT7921: + rompatch = MT7921_ROM_PATCH; + fw = MT7921_FIRMWARE_WM; + break; + case MWX_HW_MT7922: + rompatch = MT7922_ROM_PATCH; + fw = MT7922_FIRMWARE_WM; + break; + } + if ((rv = loadfirmware(rompatch, &buf, &buflen)) != 0 || + (rv= loadfirmware(fw, &fwbuf, &fwlen)) != 0) { printf("%s: loadfirmware error %d\n", DEVNAME(sc), rv); return rv; } diff --git a/sys/dev/pci/if_mwxreg.h b/sys/dev/pci/if_mwxreg.h index efa5e2d29..0468a2f3a 100644 --- a/sys/dev/pci/if_mwxreg.h +++ b/sys/dev/pci/if_mwxreg.h @@ -300,6 +300,11 @@ #define MT_CONN_ON_MISC 0x7c0600f0 #define MT_TOP_MISC2_FW_N9_RDY 0x3 +#define MT_CONN_ON_LPCTL 0x7c060010 +#define PCIE_LPCR_HOST_SET_OWN (1U << 0) +#define PCIE_LPCR_HOST_CLR_OWN (1U << 1) +#define PCIE_LPCR_HOST_OWN_SYNC (1U << 2) + #define MT_WFSYS_SW_RST_B 0x18000140 #define WFSYS_SW_RST_B (1U << 0) #define WFSYS_SW_INIT_DONE (1U << 4) diff --git a/sys/dev/pci/pcidevs b/sys/dev/pci/pcidevs index 733f751d4..2981aa6e2 100644 --- a/sys/dev/pci/pcidevs +++ b/sys/dev/pci/pcidevs @@ -1,4 +1,4 @@ -$OpenBSD: pcidevs,v 1.2075 2024/05/21 07:03:55 jsg Exp $ +$OpenBSD: pcidevs,v 1.2076 2024/05/22 16:24:59 martijn Exp $ /* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */ /* @@ -7552,6 +7552,7 @@ product MATROX MARV_G200_SD 0xff04 MGA Marvel G200 SD /* MediaTek products */ product MEDIATEK MT7921K 0x0608 MT7921K +product MEDIATEK MT7922 0x0616 MT7922 product MEDIATEK MT7921 0x7961 MT7921 /* Meinberg Funkuhren */ diff --git a/sys/dev/pci/pcidevs.h b/sys/dev/pci/pcidevs.h index 67f880028..8a90a3f32 100644 --- a/sys/dev/pci/pcidevs.h +++ b/sys/dev/pci/pcidevs.h @@ -7557,6 +7557,7 @@ /* MediaTek products */ #define PCI_PRODUCT_MEDIATEK_MT7921K 0x0608 /* MT7921K */ +#define PCI_PRODUCT_MEDIATEK_MT7922 0x0616 /* MT7922 */ #define PCI_PRODUCT_MEDIATEK_MT7921 0x7961 /* MT7921 */ /* Meinberg Funkuhren */ diff --git a/sys/dev/pci/pcidevs_data.h b/sys/dev/pci/pcidevs_data.h index 32dad94c9..fabd8f541 100644 --- a/sys/dev/pci/pcidevs_data.h +++ b/sys/dev/pci/pcidevs_data.h @@ -27335,6 +27335,10 @@ static const struct pci_known_product pci_known_products[] = { PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7921K, "MT7921K", }, + { + PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7922, + "MT7922", + }, { PCI_VENDOR_MEDIATEK, PCI_PRODUCT_MEDIATEK_MT7921, "MT7921", diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index cd787b4fd..380de12de 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.219 2022/04/12 19:41:11 naddy Exp $ */ +/* $OpenBSD: ehci.c,v 1.220 2024/05/23 03:21:08 jsg Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -57,7 +57,6 @@ #include #include -#include #include #include #include diff --git a/sys/dev/usb/fido.c b/sys/dev/usb/fido.c index edec714d3..af9cef6bf 100644 --- a/sys/dev/usb/fido.c +++ b/sys/dev/usb/fido.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fido.c,v 1.5 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: fido.c,v 1.6 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2019 Reyk Floeter @@ -20,22 +20,15 @@ #include #include -#include -#include -#include #include #include #include #include -#include -#include #include #include -#include #include -#include #include #include diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c index d6b470f62..4f2601b21 100644 --- a/sys/dev/usb/if_athn_usb.c +++ b/sys/dev/usb/if_athn_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_usb.c,v 1.65 2022/07/10 21:13:41 bluhm Exp $ */ +/* $OpenBSD: if_athn_usb.c,v 1.66 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2011 Damien Bergamini @@ -26,11 +26,8 @@ #include #include #include -#include -#include #include #include -#include #include #include @@ -58,7 +55,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/if_atu.c b/sys/dev/usb/if_atu.c index 5e460b9b3..ae09cb80d 100644 --- a/sys/dev/usb/if_atu.c +++ b/sys/dev/usb/if_atu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_atu.c,v 1.134 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_atu.c,v 1.135 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2003, 2004 * Daan Vreeken . All rights reserved. @@ -50,10 +50,7 @@ #include #include #include -#include -#include #include -#include #include #include diff --git a/sys/dev/usb/if_aue.c b/sys/dev/usb/if_aue.c index b77a11ec5..08d40515e 100644 --- a/sys/dev/usb/if_aue.c +++ b/sys/dev/usb/if_aue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_aue.c,v 1.112 2021/08/09 07:21:48 jmatthew Exp $ */ +/* $OpenBSD: if_aue.c,v 1.113 2024/05/23 03:21:08 jsg Exp $ */ /* $NetBSD: if_aue.c,v 1.82 2003/03/05 17:37:36 shiba Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -84,8 +84,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_axe.c b/sys/dev/usb/if_axe.c index 6887c4849..7f66a4ca5 100644 --- a/sys/dev/usb/if_axe.c +++ b/sys/dev/usb/if_axe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axe.c,v 1.142 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_axe.c,v 1.143 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2005, 2006, 2007 Jonathan Gray @@ -94,8 +94,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_axen.c b/sys/dev/usb/if_axen.c index 0fe4e76bd..6e407f7ea 100644 --- a/sys/dev/usb/if_axen.c +++ b/sys/dev/usb/if_axen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_axen.c,v 1.32 2024/01/04 08:41:59 kevlo Exp $ */ +/* $OpenBSD: if_axen.c,v 1.33 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2013 Yojiro UO @@ -28,8 +28,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_bwfm_usb.c b/sys/dev/usb/if_bwfm_usb.c index d627d9372..bfd701bc6 100644 --- a/sys/dev/usb/if_bwfm_usb.c +++ b/sys/dev/usb/if_bwfm_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_bwfm_usb.c,v 1.20 2021/11/05 11:38:51 mpi Exp $ */ +/* $OpenBSD: if_bwfm_usb.c,v 1.21 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2010-2016 Broadcom Corporation * Copyright (c) 2016,2017 Patrick Wildt @@ -16,22 +16,13 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "bpfilter.h" - #include #include -#include -#include #include #include #include -#include -#if NBPFILTER > 0 -#include -#endif #include -#include #include #include @@ -43,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/sys/dev/usb/if_cdce.c b/sys/dev/usb/if_cdce.c index ddb8a132f..45af757c6 100644 --- a/sys/dev/usb/if_cdce.c +++ b/sys/dev/usb/if_cdce.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cdce.c,v 1.82 2024/01/04 08:41:59 kevlo Exp $ */ +/* $OpenBSD: if_cdce.c,v 1.83 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul @@ -46,8 +46,6 @@ #include #include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_cue.c b/sys/dev/usb/if_cue.c index 561841402..c4e4cfcea 100644 --- a/sys/dev/usb/if_cue.c +++ b/sys/dev/usb/if_cue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_cue.c,v 1.80 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_cue.c,v 1.81 2024/05/23 03:21:08 jsg Exp $ */ /* $NetBSD: if_cue.c,v 1.40 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -62,8 +62,6 @@ #include #include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_kue.c b/sys/dev/usb/if_kue.c index 5b09c42a6..facadffb5 100644 --- a/sys/dev/usb/if_kue.c +++ b/sys/dev/usb/if_kue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_kue.c,v 1.92 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_kue.c,v 1.93 2024/05/23 03:21:08 jsg Exp $ */ /* $NetBSD: if_kue.c,v 1.50 2002/07/16 22:00:31 augustss Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -77,8 +77,6 @@ #include #include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_mos.c b/sys/dev/usb/if_mos.c index 7a0faa99f..8a18fbd34 100644 --- a/sys/dev/usb/if_mos.c +++ b/sys/dev/usb/if_mos.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mos.c,v 1.43 2020/07/31 10:49:32 mglocker Exp $ */ +/* $OpenBSD: if_mos.c,v 1.44 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2008 Johann Christian Rode @@ -77,8 +77,6 @@ #include #include #include -#include -#include #include @@ -99,7 +97,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/usb/if_mtw.c b/sys/dev/usb/if_mtw.c index 28f3fcda8..10482afd1 100644 --- a/sys/dev/usb/if_mtw.c +++ b/sys/dev/usb/if_mtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mtw.c,v 1.10 2024/04/14 03:26:25 jsg Exp $ */ +/* $OpenBSD: if_mtw.c,v 1.11 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2008-2010 Damien Bergamini * Copyright (c) 2013-2014 Kevin Lo @@ -26,11 +26,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_mue.c b/sys/dev/usb/if_mue.c index 46093ca0c..cea3b253d 100644 --- a/sys/dev/usb/if_mue.c +++ b/sys/dev/usb/if_mue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mue.c,v 1.11 2021/07/25 06:43:04 mglocker Exp $ */ +/* $OpenBSD: if_mue.c,v 1.12 2024/05/23 03:21:08 jsg Exp $ */ /* * Copyright (c) 2018 Kevin Lo @@ -25,8 +25,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_otus.c b/sys/dev/usb/if_otus.c index 7f38503b9..ae07f5cc7 100644 --- a/sys/dev/usb/if_otus.c +++ b/sys/dev/usb/if_otus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_otus.c,v 1.72 2023/03/08 04:43:08 guenther Exp $ */ +/* $OpenBSD: if_otus.c,v 1.73 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini @@ -25,11 +25,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index b6884645d..e5c7483dd 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.149 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_ral.c,v 1.150 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -27,11 +27,8 @@ #include #include #include -#include -#include #include #include -#include #include #include @@ -53,7 +50,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/if_rsu.c b/sys/dev/usb/if_rsu.c index c441397fe..3d2945426 100644 --- a/sys/dev/usb/if_rsu.c +++ b/sys/dev/usb/if_rsu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rsu.c,v 1.52 2023/03/08 04:43:08 guenther Exp $ */ +/* $OpenBSD: if_rsu.c,v 1.53 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -25,11 +25,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index fe08e053b..cb4cf3388 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.128 2024/04/14 03:26:25 jsg Exp $ */ +/* $OpenBSD: if_rum.c,v 1.129 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2005-2007 Damien Bergamini @@ -27,11 +27,8 @@ #include #include #include -#include -#include #include #include -#include #include #include @@ -53,7 +50,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/if_run.c b/sys/dev/usb/if_run.c index 88fc1db2c..bd66e7239 100644 --- a/sys/dev/usb/if_run.c +++ b/sys/dev/usb/if_run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_run.c,v 1.139 2024/04/14 03:26:25 jsg Exp $ */ +/* $OpenBSD: if_run.c,v 1.140 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2008-2010 Damien Bergamini @@ -27,11 +27,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_smsc.c b/sys/dev/usb/if_smsc.c index 084c71607..a8b9b05a9 100644 --- a/sys/dev/usb/if_smsc.c +++ b/sys/dev/usb/if_smsc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_smsc.c,v 1.38 2022/01/09 05:43:00 jsg Exp $ */ +/* $OpenBSD: if_smsc.c,v 1.39 2024/05/23 03:21:08 jsg Exp $ */ /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */ /*- * Copyright (c) 2012 @@ -65,8 +65,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_uaq.c b/sys/dev/usb/if_uaq.c index f02c0f498..a0e01ede4 100644 --- a/sys/dev/usb/if_uaq.c +++ b/sys/dev/usb/if_uaq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uaq.c,v 1.5 2022/09/01 17:07:09 mlarkin Exp $ */ +/* $OpenBSD: if_uaq.c,v 1.6 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2021 Jonathan Matthew * All rights reserved. @@ -31,10 +31,7 @@ #include #include #include -#include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_uath.c b/sys/dev/usb/if_uath.c index 5c105d4a4..f7cbc705e 100644 --- a/sys/dev/usb/if_uath.c +++ b/sys/dev/usb/if_uath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_uath.c,v 1.88 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_uath.c,v 1.89 2024/05/23 03:21:08 jsg Exp $ */ /*- * Copyright (c) 2006 @@ -31,11 +31,8 @@ #include #include #include -#include -#include #include #include -#include #include #include @@ -58,7 +55,6 @@ #include #include #include /* needs_reattach() */ -#include #include #include diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c index 6b4f6e31f..f9fdcf995 100644 --- a/sys/dev/usb/if_udav.c +++ b/sys/dev/usb/if_udav.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_udav.c,v 1.85 2021/08/09 07:21:48 jmatthew Exp $ */ +/* $OpenBSD: if_udav.c,v 1.86 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: if_udav.c,v 1.3 2004/04/23 17:25:25 itojun Exp $ */ /* $nabe: if_udav.c,v 1.3 2003/08/21 16:57:19 nabe Exp $ */ /* @@ -51,8 +51,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_ugl.c b/sys/dev/usb/if_ugl.c index 83055849d..8322c37e4 100644 --- a/sys/dev/usb/if_ugl.c +++ b/sys/dev/usb/if_ugl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ugl.c,v 1.27 2021/08/09 07:21:48 jmatthew Exp $ */ +/* $OpenBSD: if_ugl.c,v 1.28 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2013 SASANO Takayoshi @@ -58,8 +58,6 @@ #include #include #include -#include -#include #include @@ -74,7 +72,6 @@ #include #include -#include #include #define UGL_INTR_PKTLEN 8 diff --git a/sys/dev/usb/if_umb.c b/sys/dev/usb/if_umb.c index 14057edae..9cd890735 100644 --- a/sys/dev/usb/if_umb.c +++ b/sys/dev/usb/if_umb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_umb.c,v 1.57 2024/04/13 23:44:11 jsg Exp $ */ +/* $OpenBSD: if_umb.c,v 1.58 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2016 genua mbH @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -44,12 +43,9 @@ #include #include -#include #ifdef INET6 -#include #include -#include #include #include #endif diff --git a/sys/dev/usb/if_upgt.c b/sys/dev/usb/if_upgt.c index 3b5ea0049..4a1135793 100644 --- a/sys/dev/usb/if_upgt.c +++ b/sys/dev/usb/if_upgt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upgt.c,v 1.89 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_upgt.c,v 1.90 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -21,11 +21,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_upl.c b/sys/dev/usb/if_upl.c index 296d5bde4..cf313727c 100644 --- a/sys/dev/usb/if_upl.c +++ b/sys/dev/usb/if_upl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_upl.c,v 1.79 2021/08/09 07:21:48 jmatthew Exp $ */ +/* $OpenBSD: if_upl.c,v 1.80 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: if_upl.c,v 1.19 2002/07/11 21:14:26 augustss Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -41,8 +41,6 @@ #include #include #include -#include -#include #include @@ -58,7 +56,6 @@ #include #include -#include #include /* diff --git a/sys/dev/usb/if_ure.c b/sys/dev/usb/if_ure.c index 3fb897f82..01a25297e 100644 --- a/sys/dev/usb/if_ure.c +++ b/sys/dev/usb/if_ure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ure.c,v 1.34 2024/04/13 23:44:11 jsg Exp $ */ +/* $OpenBSD: if_ure.c,v 1.35 2024/05/23 03:21:09 jsg Exp $ */ /*- * Copyright (c) 2015, 2016, 2019 Kevin Lo * Copyright (c) 2020 Jonathon Fletcher @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_url.c b/sys/dev/usb/if_url.c index a368914b0..0160f2c02 100644 --- a/sys/dev/usb/if_url.c +++ b/sys/dev/usb/if_url.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_url.c,v 1.89 2021/08/09 07:21:48 jmatthew Exp $ */ +/* $OpenBSD: if_url.c,v 1.90 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: if_url.c,v 1.6 2002/09/29 10:19:21 martin Exp $ */ /* * Copyright (c) 2001, 2002 @@ -48,8 +48,6 @@ #include #include #include -#include -#include #include diff --git a/sys/dev/usb/if_urndis.c b/sys/dev/usb/if_urndis.c index 551197fbf..4a65f470e 100644 --- a/sys/dev/usb/if_urndis.c +++ b/sys/dev/usb/if_urndis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urndis.c,v 1.73 2021/11/05 11:38:52 mpi Exp $ */ +/* $OpenBSD: if_urndis.c,v 1.74 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2010 Jonathan Armani @@ -24,17 +24,13 @@ #include #include #include -#include #include -#include -#include #include #include #include -#include #if NBPFILTER > 0 #include @@ -45,8 +41,6 @@ #include #include -#include -#include #include #include diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 52960b3f4..c9577ca21 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtw.c,v 1.72 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_urtw.c,v 1.73 2024/05/23 03:21:09 jsg Exp $ */ /*- * Copyright (c) 2009 Martynas Venckus @@ -22,11 +22,8 @@ #include #include #include -#include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index 3bfa0756c..f6075bd9f 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.109 2024/05/06 05:02:25 jsg Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.110 2024/05/23 03:21:09 jsg Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini @@ -26,13 +26,9 @@ #include "bpfilter.h" #include -#include #include -#include -#include #include #include -#include #include #include @@ -43,7 +39,6 @@ #include #endif #include -#include #include #include @@ -56,7 +51,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c index 7a2b54105..5752685b7 100644 --- a/sys/dev/usb/if_wi_usb.c +++ b/sys/dev/usb/if_wi_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_usb.c,v 1.76 2022/01/09 05:43:00 jsg Exp $ */ +/* $OpenBSD: if_wi_usb.c,v 1.77 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2003 Dale Rahn. All rights reserved. @@ -27,19 +27,13 @@ * Agency (DARPA) and Air Force Research Laboratory, Air Force * Materiel Command, USAF, under agreement number F30602-01-2-0537. */ -#include "bpfilter.h" #include #include -#include -#include #include -#include -#include #include #include #include -#include #include #include @@ -57,10 +51,6 @@ #include #include -#if NBPFILTER > 0 -#include -#endif - #include #include diff --git a/sys/dev/usb/if_zyd.c b/sys/dev/usb/if_zyd.c index 9c80c388e..0972bc7c4 100644 --- a/sys/dev/usb/if_zyd.c +++ b/sys/dev/usb/if_zyd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_zyd.c,v 1.128 2022/04/21 21:03:03 stsp Exp $ */ +/* $OpenBSD: if_zyd.c,v 1.129 2024/05/23 03:21:09 jsg Exp $ */ /*- * Copyright (c) 2006 by Damien Bergamini @@ -26,12 +26,9 @@ #include #include #include -#include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/moscom.c b/sys/dev/usb/moscom.c index 924c124b1..2d694bfa8 100644 --- a/sys/dev/usb/moscom.c +++ b/sys/dev/usb/moscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: moscom.c,v 1.25 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: moscom.c,v 1.26 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -18,13 +18,11 @@ #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uark.c b/sys/dev/usb/uark.c index d42415333..6b0e13998 100644 --- a/sys/dev/usb/uark.c +++ b/sys/dev/usb/uark.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uark.c,v 1.25 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uark.c,v 1.26 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -18,13 +18,11 @@ #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/ubcmtp.c b/sys/dev/usb/ubcmtp.c index fd53f5228..554bc3fb3 100644 --- a/sys/dev/usb/ubcmtp.c +++ b/sys/dev/usb/ubcmtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubcmtp.c,v 1.25 2023/07/02 21:44:04 bru Exp $ */ +/* $OpenBSD: ubcmtp.c,v 1.26 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2013-2014, joshua stein @@ -27,9 +27,7 @@ #include #include -#include #include -#include #include #include diff --git a/sys/dev/usb/uberry.c b/sys/dev/usb/uberry.c index 714f7cca4..13109eec6 100644 --- a/sys/dev/usb/uberry.c +++ b/sys/dev/usb/uberry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uberry.c,v 1.24 2016/11/06 12:58:01 mpi Exp $ */ +/* $OpenBSD: uberry.c,v 1.25 2024/05/23 03:21:09 jsg Exp $ */ /*- * Copyright (c) 2006 Theo de Raadt @@ -17,18 +17,10 @@ */ #include -#include -#include -#include -#include #include -#include -#include #include -#include #include -#include #include #include diff --git a/sys/dev/usb/ubsa.c b/sys/dev/usb/ubsa.c index 072e69a7d..f9c168ad3 100644 --- a/sys/dev/usb/ubsa.c +++ b/sys/dev/usb/ubsa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ubsa.c,v 1.69 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: ubsa.c,v 1.70 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ubsa.c,v 1.5 2002/11/25 00:51:33 fvdl Exp $ */ /*- * Copyright (c) 2002, Alexander Kabaev . @@ -56,12 +56,8 @@ #include #include -#include #include #include -#include -#include -#include #include #include diff --git a/sys/dev/usb/uchcom.c b/sys/dev/usb/uchcom.c index 96a71fadc..c620ea9f4 100644 --- a/sys/dev/usb/uchcom.c +++ b/sys/dev/usb/uchcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uchcom.c,v 1.35 2024/05/15 01:41:19 kevlo Exp $ */ +/* $OpenBSD: uchcom.c,v 1.36 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uchcom.c,v 1.1 2007/09/03 17:57:37 tshiozak Exp $ */ /* @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -46,7 +45,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/usb/ucom.c b/sys/dev/usb/ucom.c index 336d3a3a4..f0fcc822c 100644 --- a/sys/dev/usb/ucom.c +++ b/sys/dev/usb/ucom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucom.c,v 1.78 2023/10/06 16:06:11 krw Exp $ */ +/* $OpenBSD: ucom.c,v 1.79 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ucom.c,v 1.49 2003/01/01 00:10:25 thorpej Exp $ */ /* @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -51,7 +50,6 @@ #include #include #include -#include #include diff --git a/sys/dev/usb/ucrcom.c b/sys/dev/usb/ucrcom.c index 34654197a..2e72873b1 100644 --- a/sys/dev/usb/ucrcom.c +++ b/sys/dev/usb/ucrcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucrcom.c,v 1.2 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: ucrcom.c,v 1.3 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2019 Mark Kettenis @@ -18,13 +18,11 @@ #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/ucycom.c b/sys/dev/usb/ucycom.c index 0eb2455e3..d3ffaacdc 100644 --- a/sys/dev/usb/ucycom.c +++ b/sys/dev/usb/ucycom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ucycom.c,v 1.41 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: ucycom.c,v 1.42 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ucycom.c,v 1.3 2005/08/05 07:27:47 skrll Exp $ */ /* @@ -40,8 +40,6 @@ #include #include -#include -#include #include #include #include @@ -50,7 +48,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/udcf.c b/sys/dev/usb/udcf.c index 3e1021ba7..fd4e97013 100644 --- a/sys/dev/usb/udcf.c +++ b/sys/dev/usb/udcf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udcf.c,v 1.65 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: udcf.c,v 1.66 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006, 2007, 2008 Marc Balmer @@ -18,7 +18,6 @@ #include #include -#include #include #include #include @@ -26,7 +25,6 @@ #include #include -#include #include #ifdef UDCF_DEBUG diff --git a/sys/dev/usb/udl.c b/sys/dev/usb/udl.c index d61d6e2c7..da7eea766 100644 --- a/sys/dev/usb/udl.c +++ b/sys/dev/usb/udl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udl.c,v 1.99 2023/05/10 18:28:04 miod Exp $ */ +/* $OpenBSD: udl.c,v 1.100 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2009 Marcus Glocker @@ -30,7 +30,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/uftdi.c b/sys/dev/usb/uftdi.c index 971059232..134f3bf76 100644 --- a/sys/dev/usb/uftdi.c +++ b/sys/dev/usb/uftdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uftdi.c,v 1.78 2022/12/30 00:54:09 kevlo Exp $ */ +/* $OpenBSD: uftdi.c,v 1.79 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uftdi.c,v 1.14 2003/02/23 04:20:07 simonb Exp $ */ /* @@ -41,15 +41,12 @@ #include #include -#include #include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 72085f336..08b786dda 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.117 2022/12/19 15:10:40 visa Exp $ */ +/* $OpenBSD: ugen.c,v 1.118 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -35,7 +35,6 @@ #include #include -#include #include #include #include @@ -50,7 +49,6 @@ #include #include #include -#include #ifdef UGEN_DEBUG #define DPRINTF(x) do { if (ugendebug) printf x; } while (0) diff --git a/sys/dev/usb/ugold.c b/sys/dev/usb/ugold.c index 243188bb3..93068b621 100644 --- a/sys/dev/usb/ugold.c +++ b/sys/dev/usb/ugold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugold.c,v 1.27 2023/12/21 19:40:47 miod Exp $ */ +/* $OpenBSD: ugold.c,v 1.28 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2013 Takayoshi SASANO @@ -26,7 +26,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c index d672b28f8..31d880e8c 100644 --- a/sys/dev/usb/uhid.c +++ b/sys/dev/usb/uhid.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhid.c,v 1.90 2023/04/20 10:49:57 brynet Exp $ */ +/* $OpenBSD: uhid.c,v 1.91 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -40,21 +40,16 @@ #include #include -#include #include -#include #include -#include #include #include #include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c index c0664fbf2..37f60cb8b 100644 --- a/sys/dev/usb/uhidev.c +++ b/sys/dev/usb/uhidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidev.c,v 1.109 2023/08/12 20:47:06 miod Exp $ */ +/* $OpenBSD: uhidev.c,v 1.110 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -37,12 +37,8 @@ #include #include -#include #include -#include #include -#include -#include #include diff --git a/sys/dev/usb/uhidpp.c b/sys/dev/usb/uhidpp.c index 163e4f2e7..a95716b1e 100644 --- a/sys/dev/usb/uhidpp.c +++ b/sys/dev/usb/uhidpp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhidpp.c,v 1.43 2023/01/08 06:54:51 anton Exp $ */ +/* $OpenBSD: uhidpp.c,v 1.44 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2021 Anton Lindqvist @@ -18,7 +18,6 @@ #include #include -#include #include #include #include diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index d9f944f46..80ed1c956 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhub.c,v 1.97 2022/09/04 08:42:39 mglocker Exp $ */ +/* $OpenBSD: uhub.c,v 1.98 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uhub.c,v 1.64 2003/02/08 03:32:51 ichiro Exp $ */ /* $FreeBSD: src/sys/dev/usb/uhub.c,v 1.18 1999/11/17 22:33:43 n_hibma Exp $ */ @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/uipaq.c b/sys/dev/usb/uipaq.c index 3acadc679..979d294e0 100644 --- a/sys/dev/usb/uipaq.c +++ b/sys/dev/usb/uipaq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipaq.c,v 1.28 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uipaq.c,v 1.29 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -42,9 +42,7 @@ #include #include -#include #include -#include #include #include @@ -52,7 +50,6 @@ #include /*UCDC_* stuff */ #include -#include #include #include diff --git a/sys/dev/usb/ujoy.c b/sys/dev/usb/ujoy.c index 8728e4b21..9d7d48ced 100644 --- a/sys/dev/usb/ujoy.c +++ b/sys/dev/usb/ujoy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ujoy.c,v 1.4 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: ujoy.c,v 1.5 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2021 Thomas Frohwein @@ -19,23 +19,16 @@ #include #include -#include -#include -#include #include #include #include #include -#include -#include #include #include #include -#include #include -#include #include #include diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c index bb2542262..9d0e80d10 100644 --- a/sys/dev/usb/ukbd.c +++ b/sys/dev/usb/ukbd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukbd.c,v 1.89 2023/12/05 20:49:31 miod Exp $ */ +/* $OpenBSD: ukbd.c,v 1.90 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -53,9 +53,7 @@ #include #include #include -#include #include -#include #include diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 59ef30909..70af5f922 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass.c,v 1.81 2022/08/23 15:58:57 anton Exp $ */ +/* $OpenBSD: umass.c,v 1.82 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umass.c,v 1.116 2004/06/30 05:53:46 mycroft Exp $ */ /* @@ -126,11 +126,7 @@ #include #include -#include -#include -#include #include -#include #include #include diff --git a/sys/dev/usb/umass_quirks.c b/sys/dev/usb/umass_quirks.c index d19fc5a41..562841c72 100644 --- a/sys/dev/usb/umass_quirks.c +++ b/sys/dev/usb/umass_quirks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_quirks.c,v 1.34 2020/08/26 13:57:20 krw Exp $ */ +/* $OpenBSD: umass_quirks.c,v 1.35 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umass_quirks.c,v 1.67 2004/06/28 07:49:16 mycroft Exp $ */ /* @@ -33,7 +33,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/usb/umass_scsi.c b/sys/dev/usb/umass_scsi.c index 16f466baa..1d563716a 100644 --- a/sys/dev/usb/umass_scsi.c +++ b/sys/dev/usb/umass_scsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umass_scsi.c,v 1.64 2023/05/10 15:28:26 krw Exp $ */ +/* $OpenBSD: umass_scsi.c,v 1.65 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umass_scsipi.c,v 1.9 2003/02/16 23:14:08 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -32,11 +32,7 @@ #include #include -#include -#include -#include #include -#include #include #include @@ -48,7 +44,6 @@ #include #include -#include #include struct umass_scsi_softc { diff --git a/sys/dev/usb/umbg.c b/sys/dev/usb/umbg.c index 2ddebc4df..1a7c70230 100644 --- a/sys/dev/usb/umbg.c +++ b/sys/dev/usb/umbg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umbg.c,v 1.28 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: umbg.c,v 1.29 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2007 Marc Balmer @@ -18,8 +18,6 @@ #include #include -#include -#include #include #include #include @@ -27,7 +25,6 @@ #include #include -#include #include #ifdef UMBG_DEBUG diff --git a/sys/dev/usb/umcs.c b/sys/dev/usb/umcs.c index 1929f9e50..be37e0f8f 100644 --- a/sys/dev/usb/umcs.c +++ b/sys/dev/usb/umcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umcs.c,v 1.11 2023/04/10 12:11:22 jsg Exp $ */ +/* $OpenBSD: umcs.c,v 1.12 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umcs.c,v 1.8 2014/08/23 21:37:56 martin Exp $ */ /* $FreeBSD: head/sys/dev/usb/serial/umcs.c 260559 2014-01-12 11:44:28Z hselasky $ */ @@ -42,7 +42,6 @@ #include #include -#include #include #include #include @@ -50,7 +49,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/umct.c b/sys/dev/usb/umct.c index 31e9fac33..a419da9bf 100644 --- a/sys/dev/usb/umct.c +++ b/sys/dev/usb/umct.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umct.c,v 1.50 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: umct.c,v 1.51 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umct.c,v 1.10 2003/02/23 04:20:07 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -37,10 +37,7 @@ #include #include -#include #include -#include -#include #include #include @@ -48,7 +45,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/umidi.c b/sys/dev/usb/umidi.c index 4a81772e9..24df798d9 100644 --- a/sys/dev/usb/umidi.c +++ b/sys/dev/usb/umidi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi.c,v 1.56 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: umidi.c,v 1.57 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umidi.c,v 1.16 2002/07/11 21:14:32 augustss Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -31,16 +31,12 @@ #include #include -#include #include #include -#include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/umidi_quirks.c b/sys/dev/usb/umidi_quirks.c index 9f1e5d722..97e07b775 100644 --- a/sys/dev/usb/umidi_quirks.c +++ b/sys/dev/usb/umidi_quirks.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umidi_quirks.c,v 1.17 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: umidi_quirks.c,v 1.18 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umidi_quirks.c,v 1.4 2002/06/19 13:55:30 tshiozak Exp $ */ /* @@ -32,18 +32,8 @@ #include #include -#include -#include -#include -#include - -#include -#include -#include #include -#include -#include #include /* diff --git a/sys/dev/usb/umodem.c b/sys/dev/usb/umodem.c index b1b249200..a6ed9827c 100644 --- a/sys/dev/usb/umodem.c +++ b/sys/dev/usb/umodem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umodem.c,v 1.69 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: umodem.c,v 1.70 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: umodem.c,v 1.45 2002/09/23 05:51:23 simonb Exp $ */ /* @@ -46,8 +46,6 @@ #include #include -#include -#include #include #include diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c index c217e9bcb..239e853fa 100644 --- a/sys/dev/usb/ums.c +++ b/sys/dev/usb/ums.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ums.c,v 1.51 2021/11/22 11:29:17 anton Exp $ */ +/* $OpenBSD: ums.c,v 1.52 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: ums.c,v 1.60 2003/03/11 16:44:00 augustss Exp $ */ /* @@ -37,9 +37,7 @@ #include #include -#include #include -#include #include #include diff --git a/sys/dev/usb/umsm.c b/sys/dev/usb/umsm.c index 7c6ee1603..0cfd870d9 100644 --- a/sys/dev/usb/umsm.c +++ b/sys/dev/usb/umsm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umsm.c,v 1.125 2023/04/02 23:57:57 dlg Exp $ */ +/* $OpenBSD: umsm.c,v 1.127 2024/05/23 08:06:22 kevlo Exp $ */ /* * Copyright (c) 2008 Yojiro UO @@ -21,10 +21,8 @@ #include #include -#include #include #include -#include #include #include @@ -179,6 +177,7 @@ static const struct umsm_type umsm_devs[] = { {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EG95 }, 0}, {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_BG96 }, 0}, {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EG06 }, 0}, + {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EM060K }, 0}, {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_AG15 }, 0}, {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_AG35 }, 0}, {{ USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_AG520R }, 0}, diff --git a/sys/dev/usb/umstc.c b/sys/dev/usb/umstc.c index 832556ef4..3b77f1358 100644 --- a/sys/dev/usb/umstc.c +++ b/sys/dev/usb/umstc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umstc.c,v 1.7 2021/11/22 11:29:18 anton Exp $ */ +/* $OpenBSD: umstc.c,v 1.8 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2020 joshua stein @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -36,7 +35,6 @@ #include #include -#include #include #include "audio.h" diff --git a/sys/dev/usb/umt.c b/sys/dev/usb/umt.c index d3cab557e..aea4412e5 100644 --- a/sys/dev/usb/umt.c +++ b/sys/dev/usb/umt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: umt.c,v 1.6 2024/05/13 01:15:53 jsg Exp $ */ +/* $OpenBSD: umt.c,v 1.7 2024/05/23 03:21:09 jsg Exp $ */ /* * USB multitouch touchpad driver for devices conforming to * Windows Precision Touchpad standard @@ -22,15 +22,12 @@ #include #include -#include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uoak_subr.c b/sys/dev/usb/uoak_subr.c index 020d16906..af049e6fb 100644 --- a/sys/dev/usb/uoak_subr.c +++ b/sys/dev/usb/uoak_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoak_subr.c,v 1.10 2022/01/09 05:43:01 jsg Exp $ */ +/* $OpenBSD: uoak_subr.c,v 1.11 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -21,16 +21,13 @@ #include #include -#include #include -#include #include #include #include #include #include -#include #include #include "uoak.h" diff --git a/sys/dev/usb/uoaklux.c b/sys/dev/usb/uoaklux.c index 597b3e23e..adfe99e21 100644 --- a/sys/dev/usb/uoaklux.c +++ b/sys/dev/usb/uoaklux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoaklux.c,v 1.17 2022/04/09 20:09:03 naddy Exp $ */ +/* $OpenBSD: uoaklux.c,v 1.18 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -21,10 +21,8 @@ #include #include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/uoakrh.c b/sys/dev/usb/uoakrh.c index 14206daa2..3de18e8fd 100644 --- a/sys/dev/usb/uoakrh.c +++ b/sys/dev/usb/uoakrh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoakrh.c,v 1.19 2022/04/09 20:09:03 naddy Exp $ */ +/* $OpenBSD: uoakrh.c,v 1.20 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -21,10 +21,8 @@ #include #include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/uoakv.c b/sys/dev/usb/uoakv.c index 221b659e0..8052c2bd7 100644 --- a/sys/dev/usb/uoakv.c +++ b/sys/dev/usb/uoakv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uoakv.c,v 1.17 2022/04/09 20:09:03 naddy Exp $ */ +/* $OpenBSD: uoakv.c,v 1.18 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2012 Yojiro UO @@ -21,10 +21,8 @@ #include #include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/uonerng.c b/sys/dev/usb/uonerng.c index 31f008b59..35b5a8456 100644 --- a/sys/dev/usb/uonerng.c +++ b/sys/dev/usb/uonerng.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uonerng.c,v 1.6 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: uonerng.c,v 1.7 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (C) 2015 Devin Reade * Copyright (C) 2015 Sean Levy @@ -33,14 +33,11 @@ #include #include #include -#include #include #include #include #include -#include -#include #include #include diff --git a/sys/dev/usb/uow.c b/sys/dev/usb/uow.c index fdb267eeb..7cfc6b490 100644 --- a/sys/dev/usb/uow.c +++ b/sys/dev/usb/uow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uow.c,v 1.37 2020/07/31 10:49:33 mglocker Exp $ */ +/* $OpenBSD: uow.c,v 1.38 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Alexander Yurchenko @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -31,7 +30,6 @@ #include #include #include -#include #include diff --git a/sys/dev/usb/upd.c b/sys/dev/usb/upd.c index c65ef9f54..9fa5fd73a 100644 --- a/sys/dev/usb/upd.c +++ b/sys/dev/usb/upd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: upd.c,v 1.31 2021/11/15 15:36:24 anton Exp $ */ +/* $OpenBSD: upd.c,v 1.32 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2015 David Higgs @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -32,10 +31,8 @@ #include #include -#include #include #include -#include #ifdef UPD_DEBUG #define DPRINTF(x) do { printf x; } while (0) diff --git a/sys/dev/usb/uplcom.c b/sys/dev/usb/uplcom.c index 603bfb3cd..78fb44635 100644 --- a/sys/dev/usb/uplcom.c +++ b/sys/dev/usb/uplcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uplcom.c,v 1.80 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: uplcom.c,v 1.81 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uplcom.c,v 1.29 2002/09/23 05:51:23 simonb Exp $ */ /* * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -39,10 +39,7 @@ #include #include -#include #include -#include -#include #include #include @@ -50,7 +47,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/urng.c b/sys/dev/usb/urng.c index 566e227a9..2708c6ea2 100644 --- a/sys/dev/usb/urng.c +++ b/sys/dev/usb/urng.c @@ -1,4 +1,4 @@ -/* $OpenBSD: urng.c,v 1.10 2020/05/29 04:42:25 deraadt Exp $ */ +/* $OpenBSD: urng.c,v 1.11 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2017 Jasper Lievisse Adriaanse @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index 2d9c26e69..87ca505bb 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.c,v 1.130 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: usb.c,v 1.131 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */ /* @@ -42,20 +42,16 @@ #include #include -#include #include #include -#include #include #include #include -#include #include #include #include #include -#include #include diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index 859f47c67..edfe21fab 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb.h,v 1.62 2021/01/27 17:28:19 mglocker Exp $ */ +/* $OpenBSD: usb.h,v 1.63 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usb.h,v 1.69 2002/09/22 23:20:50 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $ */ @@ -37,7 +37,6 @@ #define _USB_H_ #include -#include #include diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c index d0b37e547..6dec6d527 100644 --- a/sys/dev/usb/usb_mem.c +++ b/sys/dev/usb/usb_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_mem.c,v 1.34 2020/03/21 12:08:31 patrick Exp $ */ +/* $OpenBSD: usb_mem.c,v 1.35 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */ /* @@ -40,10 +40,8 @@ #include #include -#include #include #include -#include #include /* for usbdivar.h */ #include diff --git a/sys/dev/usb/usb_subr.c b/sys/dev/usb/usb_subr.c index 44c028aaa..413149693 100644 --- a/sys/dev/usb/usb_subr.c +++ b/sys/dev/usb/usb_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_subr.c,v 1.162 2023/10/06 16:06:11 krw Exp $ */ +/* $OpenBSD: usb_subr.c,v 1.163 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usb_subr.c,v 1.103 2003/01/10 11:19:13 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -34,7 +34,6 @@ #include #include -#include #include #include #include diff --git a/sys/dev/usb/usbdevs b/sys/dev/usb/usbdevs index 6ac839921..88e5949ce 100644 --- a/sys/dev/usb/usbdevs +++ b/sys/dev/usb/usbdevs @@ -1,4 +1,4 @@ -$OpenBSD: usbdevs,v 1.764 2024/05/21 07:13:29 jsg Exp $ +$OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp $ /* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */ /* @@ -3726,6 +3726,7 @@ product QUECTEL EG91 0x0191 EG91 product QUECTEL EG95 0x0195 EG95 product QUECTEL BG96 0x0296 BG96 product QUECTEL EG06 0x0306 EG06/EP06/EM06 +product QUECTEL EM060K 0x030b EM060K product QUECTEL AG15 0x0415 AG15 product QUECTEL AG35 0x0435 AG35 product QUECTEL AG520R 0x0452 AG520R diff --git a/sys/dev/usb/usbdevs.h b/sys/dev/usb/usbdevs.h index 175e56ce2..1be572907 100644 --- a/sys/dev/usb/usbdevs.h +++ b/sys/dev/usb/usbdevs.h @@ -1,10 +1,10 @@ -/* $OpenBSD: usbdevs.h,v 1.776 2024/05/21 07:14:20 jsg Exp $ */ +/* $OpenBSD: usbdevs.h,v 1.777 2024/05/23 08:06:45 kevlo Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * OpenBSD: usbdevs,v 1.764 2024/05/21 07:13:29 jsg Exp + * OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp */ /* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */ @@ -3733,6 +3733,7 @@ #define USB_PRODUCT_QUECTEL_EG95 0x0195 /* EG95 */ #define USB_PRODUCT_QUECTEL_BG96 0x0296 /* BG96 */ #define USB_PRODUCT_QUECTEL_EG06 0x0306 /* EG06/EP06/EM06 */ +#define USB_PRODUCT_QUECTEL_EM060K 0x030b /* EM060K */ #define USB_PRODUCT_QUECTEL_AG15 0x0415 /* AG15 */ #define USB_PRODUCT_QUECTEL_AG35 0x0435 /* AG35 */ #define USB_PRODUCT_QUECTEL_AG520R 0x0452 /* AG520R */ diff --git a/sys/dev/usb/usbdevs_data.h b/sys/dev/usb/usbdevs_data.h index 7efe52577..77a1ca1f7 100644 --- a/sys/dev/usb/usbdevs_data.h +++ b/sys/dev/usb/usbdevs_data.h @@ -1,10 +1,10 @@ -/* $OpenBSD: usbdevs_data.h,v 1.770 2024/05/21 07:14:20 jsg Exp $ */ +/* $OpenBSD: usbdevs_data.h,v 1.771 2024/05/23 08:06:45 kevlo Exp $ */ /* * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. * * generated from: - * OpenBSD: usbdevs,v 1.764 2024/05/21 07:13:29 jsg Exp + * OpenBSD: usbdevs,v 1.765 2024/05/23 08:06:22 kevlo Exp */ /* $NetBSD: usbdevs,v 1.322 2003/05/10 17:47:14 hamajima Exp $ */ @@ -9245,6 +9245,10 @@ const struct usb_known_product usb_known_products[] = { USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EG06, "EG06/EP06/EM06", }, + { + USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_EM060K, + "EM060K", + }, { USB_VENDOR_QUECTEL, USB_PRODUCT_QUECTEL_AG15, "AG15", diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 1483faf72..7fdb9bbeb 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi.c,v 1.110 2021/02/03 11:34:24 mglocker Exp $ */ +/* $OpenBSD: usbdi.c,v 1.111 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */ @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/usbdi_util.c b/sys/dev/usb/usbdi_util.c index efb3ad72a..2bc4e5a23 100644 --- a/sys/dev/usb/usbdi_util.c +++ b/sys/dev/usb/usbdi_util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usbdi_util.c,v 1.46 2021/02/24 03:54:05 jsg Exp $ */ +/* $OpenBSD: usbdi_util.c,v 1.47 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: usbdi_util.c,v 1.40 2002/07/11 21:14:36 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usbdi_util.c,v 1.14 1999/11/17 22:33:50 n_hibma Exp $ */ @@ -34,7 +34,6 @@ #include #include -#include #include #include diff --git a/sys/dev/usb/uscom.c b/sys/dev/usb/uscom.c index 801aeb498..c4341e337 100644 --- a/sys/dev/usb/uscom.c +++ b/sys/dev/usb/uscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uscom.c,v 1.8 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uscom.c,v 1.9 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -18,14 +18,11 @@ #include #include -#include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uslcom.c b/sys/dev/usb/uslcom.c index 7e2f4a824..d67c30779 100644 --- a/sys/dev/usb/uslcom.c +++ b/sys/dev/usb/uslcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uslcom.c,v 1.44 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uslcom.c,v 1.45 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -18,13 +18,11 @@ #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uslhcom.c b/sys/dev/usb/uslhcom.c index 9e45cfdf5..4990666a3 100644 --- a/sys/dev/usb/uslhcom.c +++ b/sys/dev/usb/uslhcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uslhcom.c,v 1.9 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uslhcom.c,v 1.10 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2015 SASANO Takayoshi @@ -22,15 +22,12 @@ #include #include -#include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/usps.c b/sys/dev/usb/usps.c index 75ced27aa..3a535fa35 100644 --- a/sys/dev/usb/usps.c +++ b/sys/dev/usb/usps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usps.c,v 1.11 2024/05/15 04:36:28 jsg Exp $ */ +/* $OpenBSD: usps.c,v 1.12 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2011 Yojiro UO @@ -20,15 +20,12 @@ #include #include -#include #include #include -#include #include #include #include -#include #include #ifdef USPS_DEBUG diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c index ce118a5e5..fe62a41c7 100644 --- a/sys/dev/usb/uthum.c +++ b/sys/dev/usb/uthum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthum.c,v 1.39 2023/12/04 05:28:25 mglocker Exp $ */ +/* $OpenBSD: uthum.c,v 1.40 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2009, 2010 Yojiro UO @@ -20,15 +20,12 @@ #include #include -#include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uticom.c b/sys/dev/usb/uticom.c index b2964acae..92d83077f 100644 --- a/sys/dev/usb/uticom.c +++ b/sys/dev/usb/uticom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uticom.c,v 1.35 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uticom.c,v 1.36 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2005 Dmitry Komissaroff . * @@ -26,10 +26,8 @@ #include #include -#include #include #include -#include #include #include diff --git a/sys/dev/usb/utpms.c b/sys/dev/usb/utpms.c index 27acdb6a5..9debe3cb1 100644 --- a/sys/dev/usb/utpms.c +++ b/sys/dev/usb/utpms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utpms.c,v 1.13 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: utpms.c,v 1.14 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2005, Johan Wallén @@ -107,10 +107,7 @@ #include #include #include - -#include #include -#include #include #include diff --git a/sys/dev/usb/utrh.c b/sys/dev/usb/utrh.c index a77f2ed8e..315279eba 100644 --- a/sys/dev/usb/utrh.c +++ b/sys/dev/usb/utrh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utrh.c,v 1.26 2022/01/09 05:43:02 jsg Exp $ */ +/* $OpenBSD: utrh.c,v 1.27 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2009 Yojiro UO @@ -20,16 +20,13 @@ #include #include -#include #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uts.c b/sys/dev/usb/uts.c index dda8e6fbe..a01be522c 100644 --- a/sys/dev/usb/uts.c +++ b/sys/dev/usb/uts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uts.c,v 1.44 2023/04/26 08:38:51 bentley Exp $ */ +/* $OpenBSD: uts.c,v 1.45 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2007 Robert Nagy @@ -17,22 +17,14 @@ */ #include -#include -#include -#include -#include #include #include -#include -#include #include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/utvfu.c b/sys/dev/usb/utvfu.c index 34844e6b6..6ccc41f3c 100644 --- a/sys/dev/usb/utvfu.c +++ b/sys/dev/usb/utvfu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utvfu.c,v 1.19 2022/10/28 15:02:20 kn Exp $ */ +/* $OpenBSD: utvfu.c,v 1.20 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2013 Lubomir Rintel * Copyright (c) 2013 Federico Simoncelli @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/sys/dev/usb/utwitch.c b/sys/dev/usb/utwitch.c index 1a1ff0cbc..4cf6a747f 100644 --- a/sys/dev/usb/utwitch.c +++ b/sys/dev/usb/utwitch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utwitch.c,v 1.22 2021/11/15 15:36:24 anton Exp $ */ +/* $OpenBSD: utwitch.c,v 1.23 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2010 Yojiro UO @@ -21,16 +21,13 @@ #include #include -#include #include #include -#include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c index b92955704..0ec04d8cc 100644 --- a/sys/dev/usb/uvideo.c +++ b/sys/dev/usb/uvideo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvideo.c,v 1.219 2022/10/21 18:29:37 kn Exp $ */ +/* $OpenBSD: uvideo.c,v 1.220 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2008 Robert Nagy @@ -19,15 +19,9 @@ #include #include -#include #include #include -#include -#include -#include -#include #include -#include #include #include diff --git a/sys/dev/usb/uvisor.c b/sys/dev/usb/uvisor.c index a7e48dc04..35387bddf 100644 --- a/sys/dev/usb/uvisor.c +++ b/sys/dev/usb/uvisor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvisor.c,v 1.53 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uvisor.c,v 1.54 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uvisor.c,v 1.21 2003/08/03 21:59:26 nathanw Exp $ */ /* @@ -37,15 +37,12 @@ #include #include -#include #include -#include #include #include #include -#include #include #include diff --git a/sys/dev/usb/uvscom.c b/sys/dev/usb/uvscom.c index 66003c7b5..22d29725d 100644 --- a/sys/dev/usb/uvscom.c +++ b/sys/dev/usb/uvscom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvscom.c,v 1.42 2022/07/02 08:50:42 visa Exp $ */ +/* $OpenBSD: uvscom.c,v 1.43 2024/05/23 03:21:09 jsg Exp $ */ /* $NetBSD: uvscom.c,v 1.9 2003/02/12 15:36:20 ichiro Exp $ */ /*- * Copyright (c) 2001-2002, Shunsuke Akiyama . @@ -37,19 +37,12 @@ #include #include -#include #include -#include -#include #include -#include #include #include -#include - #include -#include #include #include diff --git a/sys/dev/usb/uxrcom.c b/sys/dev/usb/uxrcom.c index 5d9868ee8..1f4b3b143 100644 --- a/sys/dev/usb/uxrcom.c +++ b/sys/dev/usb/uxrcom.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uxrcom.c,v 1.3 2022/04/09 20:07:44 naddy Exp $ */ +/* $OpenBSD: uxrcom.c,v 1.4 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2006 Jonathan Gray @@ -18,14 +18,12 @@ #include #include -#include #include #include #include #include #include -#include #include #include diff --git a/sys/dev/usb/xhci.c b/sys/dev/usb/xhci.c index 324bc0162..cf9ef254b 100644 --- a/sys/dev/usb/xhci.c +++ b/sys/dev/usb/xhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xhci.c,v 1.130 2023/07/20 09:43:00 claudio Exp $ */ +/* $OpenBSD: xhci.c,v 1.131 2024/05/23 03:21:09 jsg Exp $ */ /* * Copyright (c) 2014-2015 Martin Pieuchot @@ -18,7 +18,6 @@ #include #include -#include #include #include #include diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c index fa2e808c0..d589948a5 100644 --- a/sys/kern/kern_resource.c +++ b/sys/kern/kern_resource.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_resource.c,v 1.82 2024/05/20 10:32:20 claudio Exp $ */ +/* $OpenBSD: kern_resource.c,v 1.83 2024/05/22 09:20:22 claudio Exp $ */ /* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */ /*- @@ -213,11 +213,11 @@ donice(struct proc *curp, struct process *chgpr, int n) return (EACCES); chgpr->ps_nice = n; mtx_enter(&chgpr->ps_mtx); + SCHED_LOCK(s); TAILQ_FOREACH(p, &chgpr->ps_threads, p_thr_link) { - SCHED_LOCK(s); setpriority(p, p->p_estcpu, n); - SCHED_UNLOCK(s); } + SCHED_UNLOCK(s); mtx_leave(&chgpr->ps_mtx); return (0); } diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 35c8bdc37..6b7e341ca 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.328 2024/05/20 10:32:20 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.329 2024/05/22 09:22:55 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1106,8 +1106,9 @@ ptsignal(struct proc *p, int signum, enum signal_type type) */ if (prop & SA_TTYSTOP && pr->ps_pgrp->pg_jobc == 0) { - SCHED_UNLOCK(s); - return; + mask = 0; + prop = 0; + goto out; } } } diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 44fe89745..21ee0c6fb 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.203 2024/05/20 10:32:20 claudio Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.204 2024/05/22 09:24:11 claudio Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -521,6 +521,7 @@ unsleep(struct proc *p) if (p->p_wchan != NULL) { TAILQ_REMOVE(&slpque[LOOKUP(p->p_wchan)], p, p_runq); p->p_wchan = NULL; + p->p_wmesg = NULL; TRACEPOINT(sched, unsleep, p->p_tid + THREAD_PID_OFFSET, p->p_p->ps_pid); } @@ -551,6 +552,7 @@ wakeup_n(const volatile void *ident, int n) if (p->p_wchan == ident) { TAILQ_REMOVE(qp, p, p_runq); p->p_wchan = NULL; + p->p_wmesg = NULL; TAILQ_INSERT_TAIL(&wakeq, p, p_runq); --n; } diff --git a/sys/net80211/ieee80211_input.c b/sys/net80211/ieee80211_input.c index 1f05f270e..28736a725 100644 --- a/sys/net80211/ieee80211_input.c +++ b/sys/net80211/ieee80211_input.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ieee80211_input.c,v 1.253 2024/05/13 01:15:53 jsg Exp $ */ +/* $OpenBSD: ieee80211_input.c,v 1.254 2024/05/23 11:19:13 stsp Exp $ */ /* $NetBSD: ieee80211_input.c,v 1.24 2004/05/31 11:12:24 dyoung Exp $ */ /*- @@ -189,8 +189,10 @@ ieee80211_input_hwdecrypt(struct ieee80211com *ic, struct ieee80211_node *ni, */ break; } - if (ieee80211_ccmp_get_pn(&pn, &prsc, m, k) != 0) + if (ieee80211_ccmp_get_pn(&pn, &prsc, m, k) != 0) { + ic->ic_stats.is_ccmp_dec_errs++; return NULL; + } if (rxi->rxi_flags & IEEE80211_RXI_HWDEC_SAME_PN) { if (pn < *prsc) { ic->ic_stats.is_ccmp_replays++; diff --git a/usr.bin/ssh/Makefile.inc b/usr.bin/ssh/Makefile.inc index ae7814a28..7c350905e 100644 --- a/usr.bin/ssh/Makefile.inc +++ b/usr.bin/ssh/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.90 2024/05/17 00:30:23 djm Exp $ +# $OpenBSD: Makefile.inc,v 1.92 2024/05/22 15:24:55 naddy Exp $ .include @@ -23,9 +23,9 @@ CDIAGFLAGS+= -Widiomatic-parentheses -Wparentheses .if ${COMPILER_VERSION:L} != "gcc3" CDIAGFLAGS+= -Wstrict-aliasing=2 CDIAGFLAGS+= -Wold-style-definition +CDIAGFLAGS+= -Werror .endif -CDIAGFLAGS+= -Werror #CDIAGFLAGS+= -fno-common #DEBUG=-g #INSTALL_STRIP= diff --git a/usr.sbin/bgpctl/bgpctl.c b/usr.sbin/bgpctl/bgpctl.c index bea30afc3..1dd4c7a67 100644 --- a/usr.sbin/bgpctl/bgpctl.c +++ b/usr.sbin/bgpctl/bgpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpctl.c,v 1.305 2024/02/01 11:37:10 claudio Exp $ */ +/* $OpenBSD: bgpctl.c,v 1.306 2024/05/22 08:42:34 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -1548,15 +1548,16 @@ show_mrt_capabilities(struct ibuf *b) static void show_mrt_open(struct ibuf *b) { + struct in_addr ina; + uint32_t bgpid; uint16_t short_as, holdtime; uint8_t version, optparamlen; - struct in_addr bgpid; /* length check up to optparamlen already happened */ if (ibuf_get_n8(b, &version) == -1 || ibuf_get_n16(b, &short_as) == -1 || ibuf_get_n16(b, &holdtime) == -1 || - ibuf_get(b, &bgpid, sizeof(bgpid)) == -1 || + ibuf_get_n32(b, &bgpid) == -1 || ibuf_get_n8(b, &optparamlen) == -1) { trunc: printf("truncated message"); @@ -1564,8 +1565,9 @@ show_mrt_open(struct ibuf *b) } printf("\n "); + ina.s_addr = htonl(bgpid); printf("Version: %d AS: %u Holdtime: %u BGP Id: %s Paramlen: %u", - version, short_as, holdtime, inet_ntoa(bgpid), optparamlen); + version, short_as, holdtime, inet_ntoa(ina), optparamlen); if (optparamlen != ibuf_size(b)) { /* XXX missing support for RFC9072 */ printf("optional parameter length mismatch"); diff --git a/usr.sbin/bgpctl/output.c b/usr.sbin/bgpctl/output.c index d4a5fb9c6..247a66d37 100644 --- a/usr.sbin/bgpctl/output.c +++ b/usr.sbin/bgpctl/output.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output.c,v 1.50 2024/01/31 11:23:20 claudio Exp $ */ +/* $OpenBSD: output.c,v 1.51 2024/05/22 08:42:34 claudio Exp $ */ /* * Copyright (c) 2003 Henning Brauer @@ -299,7 +299,7 @@ show_neighbor_full(struct peer *p, struct parse_result *res) printf("\n"); if (p->state == STATE_ESTABLISHED) { - ina.s_addr = p->remote_bgpid; + ina.s_addr = htonl(p->remote_bgpid); printf(" BGP version 4, remote router-id %s", inet_ntoa(ina)); printf("%s\n", fmt_auth_method(p->auth.method)); diff --git a/usr.sbin/bgpctl/output_json.c b/usr.sbin/bgpctl/output_json.c index 98e78a51a..e0190966e 100644 --- a/usr.sbin/bgpctl/output_json.c +++ b/usr.sbin/bgpctl/output_json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output_json.c,v 1.43 2024/04/24 10:42:09 claudio Exp $ */ +/* $OpenBSD: output_json.c,v 1.44 2024/05/22 08:42:34 claudio Exp $ */ /* * Copyright (c) 2020 Claudio Jeker @@ -324,7 +324,7 @@ json_neighbor(struct peer *p, struct parse_result *res) log_addr(&p->conf.remote_addr), p->conf.remote_masklen); if (p->state == STATE_ESTABLISHED) { struct in_addr ina; - ina.s_addr = p->remote_bgpid; + ina.s_addr = htonl(p->remote_bgpid); json_do_string("bgpid", inet_ntoa(ina)); } json_do_string("state", statenames[p->state]); diff --git a/usr.sbin/bgpd/config.c b/usr.sbin/bgpd/config.c index 057dc8634..789431986 100644 --- a/usr.sbin/bgpd/config.c +++ b/usr.sbin/bgpd/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.108 2023/08/16 08:26:35 claudio Exp $ */ +/* $OpenBSD: config.c,v 1.109 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -466,7 +466,7 @@ get_bgpid(void) struct ifaddrs *ifap, *ifa; uint32_t ip = 0, cur, localnet; - localnet = htonl(INADDR_LOOPBACK & IN_CLASSA_NET); + localnet = INADDR_LOOPBACK & IN_CLASSA_NET; if (getifaddrs(&ifap) == -1) fatal("getifaddrs"); @@ -476,9 +476,10 @@ get_bgpid(void) ifa->ifa_addr->sa_family != AF_INET) continue; cur = ((struct sockaddr_in *)ifa->ifa_addr)->sin_addr.s_addr; + cur = ntohl(cur); if ((cur & localnet) == localnet) /* skip 127/8 */ continue; - if (ntohl(cur) > ntohl(ip)) + if (cur > ip) ip = cur; } freeifaddrs(ifap); diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c index c6ce7ff50..4e328d1a8 100644 --- a/usr.sbin/bgpd/mrt.c +++ b/usr.sbin/bgpd/mrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mrt.c,v 1.116 2023/07/14 10:30:53 claudio Exp $ */ +/* $OpenBSD: mrt.c,v 1.117 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker @@ -824,7 +824,7 @@ mrt_dump_v2_hdr(struct mrt *mrt, struct bgpd_config *conf) return (-1); } - if (ibuf_add(buf, &conf->bgpid, sizeof(conf->bgpid)) == -1) + if (ibuf_add_n32(buf, conf->bgpid) == -1) goto fail; nlen = strlen(mrt->rib); if (nlen > 0) diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 6919e2278..fa8047d5b 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.462 2024/04/24 10:41:34 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.463 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -742,7 +742,7 @@ conf_main : AS as4number { yyerror("router-id must be an IPv4 address"); YYERROR; } - conf->bgpid = $2.v4.s_addr; + conf->bgpid = ntohl($2.v4.s_addr); } | HOLDTIME NUMBER { if ($2 < MIN_HOLDTIME || $2 > USHRT_MAX) { @@ -2236,14 +2236,14 @@ peeropts : REMOTEAS as4number { YYERROR; } if ((conf->flags & BGPD_FLAG_REFLECTOR) && - conf->clusterid != $2.v4.s_addr) { + conf->clusterid != ntohl($2.v4.s_addr)) { yyerror("only one route reflector " "cluster allowed"); YYERROR; } conf->flags |= BGPD_FLAG_REFLECTOR; curpeer->conf.reflector_client = 1; - conf->clusterid = $2.v4.s_addr; + conf->clusterid = ntohl($2.v4.s_addr); } | DEPEND ON STRING { if (strlcpy(curpeer->conf.if_depend, $3, diff --git a/usr.sbin/bgpd/printconf.c b/usr.sbin/bgpd/printconf.c index cdac0d8d8..13a73208c 100644 --- a/usr.sbin/bgpd/printconf.c +++ b/usr.sbin/bgpd/printconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: printconf.c,v 1.172 2024/04/24 10:41:34 claudio Exp $ */ +/* $OpenBSD: printconf.c,v 1.173 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -383,7 +383,7 @@ print_mainconf(struct bgpd_config *conf) printf("AS %s", log_as(conf->as)); if (conf->as > USHRT_MAX && conf->short_as != AS_TRANS) printf(" %u", conf->short_as); - ina.s_addr = conf->bgpid; + ina.s_addr = htonl(conf->bgpid); printf("\nrouter-id %s\n", inet_ntoa(ina)); printf("socket \"%s\"\n", conf->csock); @@ -800,7 +800,7 @@ print_peer(struct peer_config *p, struct bgpd_config *conf, const char *c) if (conf->clusterid == 0) printf("%s\troute-reflector\n", c); else { - ina.s_addr = conf->clusterid; + ina.s_addr = htonl(conf->clusterid); printf("%s\troute-reflector %s\n", c, inet_ntoa(ina)); } diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 73dce0a5b..558d851f5 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.624 2024/03/20 09:35:46 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.625 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -2647,48 +2647,49 @@ rde_reflector(struct rde_peer *peer, struct rde_aspath *asp) /* check for originator id if eq router_id drop */ if ((a = attr_optget(asp, ATTR_ORIGINATOR_ID)) != NULL) { - if (memcmp(&conf->bgpid, a->data, sizeof(conf->bgpid)) == 0) { + id = htonl(conf->bgpid); + if (memcmp(&id, a->data, sizeof(id)) == 0) { /* this is coming from myself */ asp->flags |= F_ATTR_LOOP; return; } } else if (conf->flags & BGPD_FLAG_REFLECTOR) { if (peer->conf.ebgp) - id = conf->bgpid; + id = htonl(conf->bgpid); else id = htonl(peer->remote_bgpid); if (attr_optadd(asp, ATTR_OPTIONAL, ATTR_ORIGINATOR_ID, - &id, sizeof(uint32_t)) == -1) + &id, sizeof(id)) == -1) fatalx("attr_optadd failed but impossible"); } /* check for own id in the cluster list */ if (conf->flags & BGPD_FLAG_REFLECTOR) { + id = htonl(conf->clusterid); if ((a = attr_optget(asp, ATTR_CLUSTER_LIST)) != NULL) { - for (len = 0; len < a->len; - len += sizeof(conf->clusterid)) + for (len = 0; len < a->len; len += sizeof(id)) /* check if coming from my cluster */ - if (memcmp(&conf->clusterid, a->data + len, - sizeof(conf->clusterid)) == 0) { + if (memcmp(&id, a->data + len, + sizeof(id)) == 0) { asp->flags |= F_ATTR_LOOP; return; } /* prepend own clusterid by replacing attribute */ - len = a->len + sizeof(conf->clusterid); + len = a->len + sizeof(id); if (len < a->len) fatalx("rde_reflector: cluster-list overflow"); if ((p = malloc(len)) == NULL) fatal("rde_reflector"); - memcpy(p, &conf->clusterid, sizeof(conf->clusterid)); - memcpy(p + sizeof(conf->clusterid), a->data, a->len); + memcpy(p, &id, sizeof(id)); + memcpy(p + sizeof(id), a->data, a->len); attr_free(asp, a); if (attr_optadd(asp, ATTR_OPTIONAL, ATTR_CLUSTER_LIST, p, len) == -1) fatalx("attr_optadd failed but impossible"); free(p); } else if (attr_optadd(asp, ATTR_OPTIONAL, ATTR_CLUSTER_LIST, - &conf->clusterid, sizeof(conf->clusterid)) == -1) + &id, sizeof(id)) == -1) fatalx("attr_optadd failed but impossible"); } } @@ -3584,11 +3585,11 @@ rde_reload_done(void) nconf = NULL; /* sync peerself with conf */ - peerself->remote_bgpid = ntohl(conf->bgpid); + peerself->remote_bgpid = conf->bgpid; peerself->conf.local_as = conf->as; peerself->conf.remote_as = conf->as; peerself->conf.remote_addr.aid = AID_INET; - peerself->conf.remote_addr.v4.s_addr = conf->bgpid; + peerself->conf.remote_addr.v4.s_addr = htonl(conf->bgpid); peerself->conf.remote_masklen = 32; peerself->short_as = conf->short_as; diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 8849ec3e0..d0bfb5d2d 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.301 2024/05/19 03:31:05 jsg Exp $ */ +/* $OpenBSD: rde.h,v 1.302 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker and @@ -90,7 +90,7 @@ struct rde_peer { struct prefix_tree withdraws[AID_MAX]; struct filter_head *out_rules; time_t staletime[AID_MAX]; - uint32_t remote_bgpid; /* host byte order! */ + uint32_t remote_bgpid; uint32_t path_id_tx; unsigned int local_if_scope; enum peer_state state; diff --git a/usr.sbin/bgpd/rde_peer.c b/usr.sbin/bgpd/rde_peer.c index 00d12f9af..9ddd69226 100644 --- a/usr.sbin/bgpd/rde_peer.c +++ b/usr.sbin/bgpd/rde_peer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_peer.c,v 1.36 2024/03/20 09:35:46 claudio Exp $ */ +/* $OpenBSD: rde_peer.c,v 1.37 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2019 Claudio Jeker @@ -422,7 +422,7 @@ peer_up(struct rde_peer *peer, struct session_up *sup) peer->stats.prefix_out_cnt = 0; peer->state = PEER_DOWN; } - peer->remote_bgpid = ntohl(sup->remote_bgpid); + peer->remote_bgpid = sup->remote_bgpid; peer->short_as = sup->short_as; peer->remote_addr = sup->remote_addr; peer->local_v4_addr = sup->local_v4_addr; diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 43c61adb0..2658e44f4 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.477 2024/05/20 10:01:52 claudio Exp $ */ +/* $OpenBSD: session.c,v 1.478 2024/05/22 08:41:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer @@ -1602,7 +1602,7 @@ session_open(struct peer *p) errs += ibuf_add_n16(buf->buf, p->conf.local_short_as); errs += ibuf_add_n16(buf->buf, holdtime); /* is already in network byte order */ - errs += ibuf_add(buf->buf, &conf->bgpid, sizeof(conf->bgpid)); + errs += ibuf_add_n32(buf->buf, conf->bgpid); errs += ibuf_add_n8(buf->buf, optparamlen); if (extlen) { @@ -2228,8 +2228,7 @@ parse_open(struct peer *peer) change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN); return (-1); } - /* strore remote_bgpid in network byte order */ - peer->remote_bgpid = htonl(bgpid); + peer->remote_bgpid = bgpid; if (optparamlen != 0) { struct ibuf oparams, op; @@ -2332,8 +2331,10 @@ parse_open(struct peer *peer) /* on iBGP sessions check for bgpid collision */ if (!peer->conf.ebgp && peer->remote_bgpid == conf->bgpid) { - log_peer_warnx(&peer->conf, "peer BGPID %u conflicts with ours", - ntohl(bgpid)); + struct in_addr ina; + ina.s_addr = htonl(bgpid); + log_peer_warnx(&peer->conf, "peer BGPID %s conflicts with ours", + inet_ntoa(ina)); session_notification(peer, ERR_OPEN, ERR_OPEN_BGPID, NULL); change_state(peer, STATE_IDLE, EVNT_RCVD_OPEN); return (-1); diff --git a/usr.sbin/fw_update/patterns.c b/usr.sbin/fw_update/patterns.c index c510ad1fd..5a6c2d0d2 100644 --- a/usr.sbin/fw_update/patterns.c +++ b/usr.sbin/fw_update/patterns.c @@ -1,4 +1,4 @@ -/* $OpenBSD: patterns.c,v 1.12 2024/03/04 17:03:06 deraadt Exp $ */ +/* $OpenBSD: patterns.c,v 1.13 2024/05/22 12:33:07 claudio Exp $ */ /* * Copyright (c) 1995, 1996 Christopher G. Demetriou. All rights reserved. @@ -110,6 +110,7 @@ main(void) printf("%s\n", "iwx"); printf("%s\n", "malo"); printf("%s\n", "mtw"); + printf("%s\n", "mwx"); printf("%s\n", "ogx"); printf("%s\n", "otus"); printf("%s\n", "pgt"); diff --git a/usr.sbin/smtpd/smtpd-tables.7 b/usr.sbin/smtpd/smtpd-tables.7 index a7f1dc436..2ecf72f23 100644 --- a/usr.sbin/smtpd/smtpd-tables.7 +++ b/usr.sbin/smtpd/smtpd-tables.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: smtpd-tables.7,v 1.1 2024/05/07 12:13:43 op Exp $ +.\" $OpenBSD: smtpd-tables.7,v 1.2 2024/05/22 08:39:50 op Exp $ .\" .\" Copyright (c) 2008 Janne Johansson .\" Copyright (c) 2009 Jacek Masiulaniec @@ -18,7 +18,7 @@ .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" .\" -.Dd $Mdocdate: May 7 2024 $ +.Dd $Mdocdate: May 22 2024 $ .Dt SMTPD-TABLES 7 .Os .Sh NAME @@ -167,7 +167,7 @@ if not found, or .Sq error upon an error. .It Cm fetch Ar service id -Fetch the next item from the table. +Fetch the next item from the table, eventually wrapping around. It is only supported for the .Ic source and @@ -177,7 +177,7 @@ The result is .Sq found and the value if found, .Sq not-found -if not found, or +if the table is empty, or .Sq error upon an error. .El @@ -255,14 +255,14 @@ A series of .Cm fetch requests for the .Cm source -service: +service that wraps around: .Bd -literal -offset indent table|0.1|1713795116.227321|devs|fetch|source|189bd3ee lookup-result|189bd3ee|found|192.168.1.7 table|0.1|1713795120.162438|devs|fetch|source|9e4c56d4 lookup-result|9e4c56d4|found|10.0.0.8 table|0.1|1713795122.930928|devs|fetch|source|f2c8b906 -lookup-result|f2c8b906|not-found +lookup-result|f2c8b906|found|192.168.1.7 .Ed .Sh SEE ALSO .Xr smtpd 8 diff --git a/usr.sbin/smtpd/table_proc.c b/usr.sbin/smtpd/table_proc.c index b823707eb..07cabf073 100644 --- a/usr.sbin/smtpd/table_proc.c +++ b/usr.sbin/smtpd/table_proc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_proc.c,v 1.19 2024/05/14 13:28:08 op Exp $ */ +/* $OpenBSD: table_proc.c,v 1.20 2024/05/22 08:41:02 op Exp $ */ /* * Copyright (c) 2024 Omar Polo @@ -48,8 +48,7 @@ table_proc_nextid(struct table *table) struct table_proc_priv *priv = table->t_handle; int r; - r = snprintf(priv->lastid, sizeof(priv->lastid), "%lld", - (unsigned long long)arc4random()); + r = snprintf(priv->lastid, sizeof(priv->lastid), "%08x", arc4random()); if (r < 0 || (size_t)r >= sizeof(priv->lastid)) fatal("table-proc: snprintf");