diff --git a/LOCKS b/LOCKS index 1e2effd..ceebb8e 100644 --- a/LOCKS +++ b/LOCKS @@ -1,4 +1,3 @@ -$FreeBSD$ This file documents formal review/approval requirements that have been approved by core. diff --git a/MAINTAINERS b/MAINTAINERS index 09ee157..1445e3d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1,4 +1,3 @@ -$FreeBSD$ Please note that the content of this file is strictly advisory. No locks listed here are valid. The only strict review requirements diff --git a/README.OpenSource b/README.OpenSource index 4b7fb5a..2a5d21f 100644 --- a/README.OpenSource +++ b/README.OpenSource @@ -3,7 +3,7 @@ "Name" : "FreeBSD", "License" : "BSD 2-Clause License", "License File" : "COPYRIGHT", - "Version Number" : "13.2", + "Version Number" : "13.3", "Owner" : "tonghaoyang1@huawei.com", "Upstream URL" : "http://www.freebsd.org/", "Description" : "FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms." diff --git a/RELNOTES b/RELNOTES index 7bf18ff..2ed706b 100644 --- a/RELNOTES +++ b/RELNOTES @@ -10,6 +10,27 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +0644746d5091: + Add a new "syskrb5" mount option for Kerberized NFSv4.1/4.2 mounts. + Without this patch, a Kerberized NFSv4.1/4.2 mount must provide + a Kerberos credential for the client at mount time. + This patch uses a feature of NFSv4.1/4.2 called SP4_NONE, which + allows the state maintenance operations to be performed by any + authentication mechanism, so that these operations may be done via + AUTH_SYS instead of RPCSEC_GSS (KerberosV). As such, no Kerberos + credential is required at mount time. + See mount_nfs(8). + +b4805d577787 and many others: + Add support so that nfsd(8), nfsuserd(8), mountd(8), gssd(8) + and rpc.tlsservd(8) can be run in an appropriately configured + vnet prison. The vnet prison must be on its own file system, + have the "allow.nfsd" jail parameter set on it and enforce_statfs + cannot be set to "0". Use of UDP and pNFS server configurations + are not permitted. (ie. The nfsd command line options "-u", "-p" + and "-m" are not supported.) + See jail(8), nfsd(8) and mountd(8). + 68e86d5265bc,e58dfd0de589,59f5a5cb724e,6e272a78de36,4c4a4fd4a649,ba2ae2cca63a: sendmail has been updated to the latest upstream version (8.17.1). @@ -399,5 +420,3 @@ r347532: wirings (e.g., by mlock(2)). Kernel wirings no long count towards the global limit, which is renamed to vm.max_user_wired. bhyve -S allocates user-wired memory and is now subject to that limit. - -$FreeBSD$ diff --git a/UPDATING b/UPDATING index a3063ae..dd89cda 100644 --- a/UPDATING +++ b/UPDATING @@ -1,4 +1,4 @@ - Updating Information for FreeBSD stable/13 users. + Updating Information for users of FreeBSD stable/13. This file is maintained and copyrighted by M. Warner Losh . See end of file for further details. For commonly done items, please see the @@ -6,14 +6,58 @@ COMMON ITEMS: section later in the file. These instructions assume that you basically know what you are doing. If not, then please consult the FreeBSD handbook: - https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html + https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before updating system packages and/or ports. -20230411: - 13.2-RELEASE. +20240305: + 13.3-RELEASE. + +20240218: + Change 9b998db87c28 changed 'struct ieee80211vap' internals in net80211. + Given we do not have enough spares and the struct is allocated by + drivers, all wireless drivers have to be recompiled. + __FreeBSD_version is updated to 1303001 to track this change. + +20240207: + sendmail 8.18.1 has been imported and merged. This version enforces + stricter RFC compliance by default, especially with respect to line + endings. This may cause issues with receiving messages from + non-compliant MTAs; please see the first 8.18.1 release note in + contrib/sendmail/RELEASE_NOTES for mitigations. + +20230913: + Improvements to libtacplus(8) mean that tacplus.conf(5) now + follows POSIX shell syntax rules. This may cause TACACS+ + authentication to fail if the shared secret contains a single + quote, double quote, or backslash character which isn't + already properly quoted or escaped. + +20230619: + To enable pf rdr rules for connections initiated from the host, pf + filter rules can be optionally enabled for packets delivered + locally. This can change the behavior of rules which match packets + delivered to lo0. To enable this feature: + + sysctl net.pf.filter_local=1 + service pf restart + + When enabled, its best to ensure that packets delivered locally are not + filtered, e.g. by adding a 'skip on lo' rule. + +20230404: + llvm-objump is now always installed as objdump. Previously there was + no /usr/bin/objdump unless the WITH_LLVM_BINUTILS knob was used. + + Some LLVM objdump options have a different output format compared to + GNU objdump; readelf is available for inspecting ELF files, and GNU + objdump is available from the devel/binutils port or package. + +20230217: + Bump __FreeBSD_verion after various changes to LinuxKPI pci and 802.11 + in order to help out-of-tree consumers to deal accordingly. 20220701: LinuxKPI pm.h changes require an update to the latest drm-kmod version @@ -2558,5 +2602,3 @@ POSSIBILITY OF SUCH DAMAGE. Contact Warner Losh if you have any questions about your use of this document. - -$FreeBSD$ diff --git a/contrib/tcp_wrappers/strcasecmp.c b/contrib/tcp_wrappers/strcasecmp.c index 9dca050..ec79cbb 100644 --- a/contrib/tcp_wrappers/strcasecmp.c +++ b/contrib/tcp_wrappers/strcasecmp.c @@ -18,8 +18,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcasecmp.c 5.6 (Berkeley) 6/27/88"; #endif /* LIBC_SCCS and not lint */ -// #include -// #include + /* Some environments don't define u_char -- WZV */ #if 0 #include @@ -67,8 +66,7 @@ static u_char charmap[] = { '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', }; -int strcasecmp(s1, s2) - char *s1, *s2; +int strcasecmp(char *s1, char *s2) { register u_char *cm = charmap, *us1 = (u_char *)s1, @@ -80,9 +78,7 @@ int strcasecmp(s1, s2) return(cm[*us1] - cm[*--us2]); } -int strncasecmp(s1, s2, n) - char *s1, *s2; - register int n; +int strncasecmp(char *s1, char *s2, register int n) { register u_char *cm = charmap, *us1 = (u_char *)s1, diff --git a/include/fts.h b/include/fts.h index 12092de..24c1416 100644 --- a/include/fts.h +++ b/include/fts.h @@ -29,7 +29,6 @@ * SUCH DAMAGE. * * @(#)fts.h 8.3 (Berkeley) 8/14/94 - * $FreeBSD$ */ #ifndef _FTS_H_ diff --git a/lib/libc/aarch64/_fpmath.h b/lib/libc/aarch64/_fpmath.h index 71d0a71..0191725 100644 --- a/lib/libc/aarch64/_fpmath.h +++ b/lib/libc/aarch64/_fpmath.h @@ -23,8 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ union IEEEl2bits { diff --git a/lib/libc/aarch64/arith.h b/lib/libc/aarch64/arith.h index ecb1a33..9c695c7 100644 --- a/lib/libc/aarch64/arith.h +++ b/lib/libc/aarch64/arith.h @@ -1,7 +1,5 @@ /* * MD header for contrib/gdtoa - * - * $FreeBSD$ */ /* diff --git a/lib/libc/aarch64/gd_qnan.h b/lib/libc/aarch64/gd_qnan.h index 27e8d58..d4e3bae 100644 --- a/lib/libc/aarch64/gd_qnan.h +++ b/lib/libc/aarch64/gd_qnan.h @@ -3,8 +3,6 @@ * * This file can be generated by compiling and running contrib/gdtoa/qnan.c * on the target architecture after arith.h has been generated. - * - * $FreeBSD$ */ #define f_QNAN 0x7fc00000 diff --git a/lib/libc/arm/_fpmath.h b/lib/libc/arm/_fpmath.h index 2d91ba6..288dd4d 100644 --- a/lib/libc/arm/_fpmath.h +++ b/lib/libc/arm/_fpmath.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2002, 2003 David Schultz * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #if defined(__VFP_FP__) || defined(__ARM_EABI__) diff --git a/lib/libc/arm/arith.h b/lib/libc/arm/arith.h index 86121bf..46b2a7e 100644 --- a/lib/libc/arm/arith.h +++ b/lib/libc/arm/arith.h @@ -1,7 +1,5 @@ /* * MD header for contrib/gdtoa - * - * $FreeBSD$ */ /* diff --git a/lib/libc/arm/gd_qnan.h b/lib/libc/arm/gd_qnan.h index 8fa9edd..e5c4846 100644 --- a/lib/libc/arm/gd_qnan.h +++ b/lib/libc/arm/gd_qnan.h @@ -5,8 +5,6 @@ * on the target architecture after arith.h has been generated. * * XXX I don't have ARM hardware, so I just guessed. --das - * - * $FreeBSD$ */ #define f_QNAN 0x7fc00000 diff --git a/lib/libc/gdtoa/glue.c b/lib/libc/gdtoa/glue.c index 39e491a..2d09896 100644 --- a/lib/libc/gdtoa/glue.c +++ b/lib/libc/gdtoa/glue.c @@ -1,8 +1,6 @@ /* * Machine-independent glue to integrate David Gay's gdtoa * package into libc. - * - * $FreeBSD$ */ #include diff --git a/lib/libc/gen/arc4random.c b/lib/libc/gen/arc4random.c index 2f5a7a4..60f421e 100644 --- a/lib/libc/gen/arc4random.c +++ b/lib/libc/gen/arc4random.c @@ -1,3 +1,5 @@ +/* $OpenBSD: arc4random.c,v 1.58 2022/07/31 13:41:45 tb Exp $ */ + /* * Copyright (c) 1996, David Mazieres * Copyright (c) 2008, Damien Miller diff --git a/lib/libc/gen/arc4random.h b/lib/libc/gen/arc4random.h index a68caee..945dc76 100644 --- a/lib/libc/gen/arc4random.h +++ b/lib/libc/gen/arc4random.h @@ -1,3 +1,5 @@ +/* $OpenBSD: arc4random.h,v 1.4 2015/01/15 06:57:18 deraadt Exp $ */ + /* * Copyright (c) 1996, David Mazieres * Copyright (c) 2008, Damien Miller diff --git a/lib/libc/gen/arc4random_uniform.c b/lib/libc/gen/arc4random_uniform.c index ba1bda6..3ab9bcf 100644 --- a/lib/libc/gen/arc4random_uniform.c +++ b/lib/libc/gen/arc4random_uniform.c @@ -1,3 +1,5 @@ +/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */ + /* * Copyright (c) 2008, Damien Miller * diff --git a/lib/libc/include/fpmath.h b/lib/libc/include/fpmath.h index 268ec6e..507d708 100755 --- a/lib/libc/include/fpmath.h +++ b/lib/libc/include/fpmath.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2003 Mike Barcroft * Copyright (c) 2002 David Schultz @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _FPMATH_H_ diff --git a/lib/libc/stdlib/strtoimax.c b/lib/libc/stdlib/strtoimax.c index f974244..81d79ad 100644 --- a/lib/libc/stdlib/strtoimax.c +++ b/lib/libc/stdlib/strtoimax.c @@ -5,7 +5,7 @@ * The Regents of the University of California. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. + * * Portions of this software were developed by David Chisnall * under sponsorship from the FreeBSD Foundation. * diff --git a/lib/libc/stdlib/strtoul.c b/lib/libc/stdlib/strtoul.c index 4e43143..6a0c3c2 100644 --- a/lib/libc/stdlib/strtoul.c +++ b/lib/libc/stdlib/strtoul.c @@ -5,7 +5,7 @@ * The Regents of the University of California. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. + * * Portions of this software were developed by David Chisnall * under sponsorship from the FreeBSD Foundation. * diff --git a/lib/libc/stdlib/strtoumax.c b/lib/libc/stdlib/strtoumax.c index 7706454..64a1fbc 100644 --- a/lib/libc/stdlib/strtoumax.c +++ b/lib/libc/stdlib/strtoumax.c @@ -5,7 +5,7 @@ * The Regents of the University of California. All rights reserved. * * Copyright (c) 2011 The FreeBSD Foundation - * All rights reserved. + * * Portions of this software were developed by David Chisnall * under sponsorship from the FreeBSD Foundation. * diff --git a/lib/msun/ld128/e_lgammal_r.c b/lib/msun/ld128/e_lgammal_r.c index 53d3af1..e3d97b6 100644 --- a/lib/msun/ld128/e_lgammal_r.c +++ b/lib/msun/ld128/e_lgammal_r.c @@ -11,8 +11,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See e_lgamma_r.c for complete comments. * diff --git a/lib/msun/ld128/e_powl.c b/lib/msun/ld128/e_powl.c index 12b92a1..fd8b57b 100644 --- a/lib/msun/ld128/e_powl.c +++ b/lib/msun/ld128/e_powl.c @@ -60,8 +60,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include #include diff --git a/lib/msun/ld128/k_cosl.c b/lib/msun/ld128/k_cosl.c index 422357b..8280378 100644 --- a/lib/msun/ld128/k_cosl.c +++ b/lib/msun/ld128/k_cosl.c @@ -12,8 +12,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * ld128 version of k_cos.c. See ../src/k_cos.c for most comments. */ diff --git a/lib/msun/ld128/k_expl.h b/lib/msun/ld128/k_expl.h index 6f52052..fedcfc3 100644 --- a/lib/msun/ld128/k_expl.h +++ b/lib/msun/ld128/k_expl.h @@ -31,8 +31,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * ld128 version of k_expl.h. See ../ld80/s_expl.c for most comments. * diff --git a/lib/msun/ld128/k_sinl.c b/lib/msun/ld128/k_sinl.c index 09472d6..ca54f9f 100644 --- a/lib/msun/ld128/k_sinl.c +++ b/lib/msun/ld128/k_sinl.c @@ -12,8 +12,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * ld128 version of k_sin.c. See ../src/k_sin.c for most comments. */ diff --git a/lib/msun/ld128/s_erfl.c b/lib/msun/ld128/s_erfl.c index e29c969..43ba2f0 100644 --- a/lib/msun/ld128/s_erfl.c +++ b/lib/msun/ld128/s_erfl.c @@ -11,8 +11,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See s_erf.c for complete comments. * diff --git a/lib/msun/ld128/s_expl.c b/lib/msun/ld128/s_expl.c index 5fc4380..6dc3697 100644 --- a/lib/msun/ld128/s_expl.c +++ b/lib/msun/ld128/s_expl.c @@ -29,8 +29,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * ld128 version of s_expl.c. See ../ld80/s_expl.c for most comments. */ diff --git a/lib/msun/ld128/s_logl.c b/lib/msun/ld128/s_logl.c index 7afb7da..e1befea 100644 --- a/lib/msun/ld128/s_logl.c +++ b/lib/msun/ld128/s_logl.c @@ -27,8 +27,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /** * Implementation of the natural logarithm of x for 128-bit format. * diff --git a/lib/msun/src/e_acoshl.c b/lib/msun/src/e_acoshl.c index b9f3aed..8f3d396 100644 --- a/lib/msun/src/e_acoshl.c +++ b/lib/msun/src/e_acoshl.c @@ -14,8 +14,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See e_acosh.c for complete comments. * diff --git a/lib/msun/src/e_coshl.c b/lib/msun/src/e_coshl.c index 4e3b283..de54b81 100644 --- a/lib/msun/src/e_coshl.c +++ b/lib/msun/src/e_coshl.c @@ -12,8 +12,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See e_cosh.c for complete comments. * diff --git a/lib/msun/src/e_lgammal.c b/lib/msun/src/e_lgammal.c index ad1ad22..c369b5a 100644 --- a/lib/msun/src/e_lgammal.c +++ b/lib/msun/src/e_lgammal.c @@ -11,8 +11,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include "math.h" #include "math_private.h" diff --git a/lib/msun/src/e_sinhl.c b/lib/msun/src/e_sinhl.c index 38d3df1..121bace 100644 --- a/lib/msun/src/e_sinhl.c +++ b/lib/msun/src/e_sinhl.c @@ -12,8 +12,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See e_sinh.c for complete comments. * diff --git a/lib/msun/src/math_private.h b/lib/msun/src/math_private.h index 366fc16..eaa7838 100644 --- a/lib/msun/src/math_private.h +++ b/lib/msun/src/math_private.h @@ -11,7 +11,6 @@ /* * from: @(#)fdlibm.h 5.1 93/09/24 - * $FreeBSD$ */ #ifndef _MATH_PRIVATE_H_ diff --git a/lib/msun/src/s_asinhl.c b/lib/msun/src/s_asinhl.c index ba28f59..d804058 100644 --- a/lib/msun/src/s_asinhl.c +++ b/lib/msun/src/s_asinhl.c @@ -13,8 +13,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See s_asinh.c for complete comments. * diff --git a/lib/msun/src/s_frexpl.c b/lib/msun/src/s_frexpl.c index 66e284f..32f1264 100644 --- a/lib/msun/src/s_frexpl.c +++ b/lib/msun/src/s_frexpl.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2004-2005 David Schultz * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #include diff --git a/lib/msun/src/s_tanhl.c b/lib/msun/src/s_tanhl.c index b753186..3ee5b50 100644 --- a/lib/msun/src/s_tanhl.c +++ b/lib/msun/src/s_tanhl.c @@ -13,8 +13,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * See s_tanh.c for complete comments. * diff --git a/sbin/fsck_msdosfs/Makefile b/sbin/fsck_msdosfs/Makefile index bce4821..d5fe24b 100644 --- a/sbin/fsck_msdosfs/Makefile +++ b/sbin/fsck_msdosfs/Makefile @@ -1,5 +1,4 @@ # $NetBSD: Makefile,v 1.6 1997/05/08 21:11:11 gwr Exp $ -# $FreeBSD$ FSCK= ${.CURDIR:H}/fsck .PATH: ${FSCK} diff --git a/sbin/fsck_msdosfs/Makefile.depend b/sbin/fsck_msdosfs/Makefile.depend index 6cfaab1..84b8ddd 100644 --- a/sbin/fsck_msdosfs/Makefile.depend +++ b/sbin/fsck_msdosfs/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/sbin/fsck_msdosfs/boot.c b/sbin/fsck_msdosfs/boot.c index 887312e..f916094 100644 --- a/sbin/fsck_msdosfs/boot.c +++ b/sbin/fsck_msdosfs/boot.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (C) 1995, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann @@ -29,8 +29,6 @@ #include #ifndef lint __RCSID("$NetBSD: boot.c,v 1.22 2020/01/11 16:29:07 christos Exp $"); -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ #include diff --git a/sbin/fsck_msdosfs/check.c b/sbin/fsck_msdosfs/check.c index 9519315..f672a2a 100644 --- a/sbin/fsck_msdosfs/check.c +++ b/sbin/fsck_msdosfs/check.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann @@ -29,8 +29,6 @@ #include #ifndef lint __RCSID("$NetBSD: check.c,v 1.14 2006/06/05 16:51:18 christos Exp $"); -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ #ifdef HAVE_LIBUTIL_H diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index 471f6cc..be3d5dd 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2019 Google LLC * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank @@ -32,8 +32,6 @@ #include #ifndef lint __RCSID("$NetBSD: dir.c,v 1.20 2006/06/05 16:51:18 christos Exp $"); -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ #include diff --git a/sbin/fsck_msdosfs/dosfs.h b/sbin/fsck_msdosfs/dosfs.h index d89a086..a8da745 100644 --- a/sbin/fsck_msdosfs/dosfs.h +++ b/sbin/fsck_msdosfs/dosfs.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann @@ -26,7 +26,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * $NetBSD: dosfs.h,v 1.4 1997/01/03 14:32:48 ws Exp $ - * $FreeBSD$ */ #ifndef DOSFS_H diff --git a/sbin/fsck_msdosfs/ext.h b/sbin/fsck_msdosfs/ext.h index 532e840..d0f4dd6 100644 --- a/sbin/fsck_msdosfs/ext.h +++ b/sbin/fsck_msdosfs/ext.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank * Copyright (c) 1995 Martin Husemann @@ -24,7 +24,6 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * $NetBSD: ext.h,v 1.6 2000/04/25 23:02:51 jdolecek Exp $ - * $FreeBSD$ */ #ifndef EXT_H diff --git a/sbin/fsck_msdosfs/fat.c b/sbin/fsck_msdosfs/fat.c index 4d3c08f..715607e 100644 --- a/sbin/fsck_msdosfs/fat.c +++ b/sbin/fsck_msdosfs/fat.c @@ -30,8 +30,6 @@ #include #ifndef lint __RCSID("$NetBSD: fat.c,v 1.18 2006/06/05 16:51:18 christos Exp $"); -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ // #include diff --git a/sbin/fsck_msdosfs/fsck_msdosfs.8 b/sbin/fsck_msdosfs/fsck_msdosfs.8 index 602451b..963818e 100644 --- a/sbin/fsck_msdosfs/fsck_msdosfs.8 +++ b/sbin/fsck_msdosfs/fsck_msdosfs.8 @@ -23,8 +23,6 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd January 6, 2020 .Dt FSCK_MSDOSFS 8 .Os diff --git a/sbin/fsck_msdosfs/main.c b/sbin/fsck_msdosfs/main.c index b91fddd..ee5ccad 100644 --- a/sbin/fsck_msdosfs/main.c +++ b/sbin/fsck_msdosfs/main.c @@ -29,8 +29,6 @@ #include #ifndef lint __RCSID("$NetBSD: main.c,v 1.10 1997/10/01 02:18:14 enami Exp $"); -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ #include diff --git a/sbin/newfs_msdos/Makefile b/sbin/newfs_msdos/Makefile index 0123f4d..f4efc64 100644 --- a/sbin/newfs_msdos/Makefile +++ b/sbin/newfs_msdos/Makefile @@ -1,4 +1,3 @@ -# $FreeBSD$ .include diff --git a/sbin/newfs_msdos/Makefile.depend b/sbin/newfs_msdos/Makefile.depend index 6cfaab1..84b8ddd 100644 --- a/sbin/newfs_msdos/Makefile.depend +++ b/sbin/newfs_msdos/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/sbin/newfs_msdos/mkfs_msdos.c b/sbin/newfs_msdos/mkfs_msdos.c index 2a463a7..3af246d 100644 --- a/sbin/newfs_msdos/mkfs_msdos.c +++ b/sbin/newfs_msdos/mkfs_msdos.c @@ -25,11 +25,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - #include #ifdef MAKEFS /* In the makefs case we only want struct disklabel */ diff --git a/sbin/newfs_msdos/mkfs_msdos.h b/sbin/newfs_msdos/mkfs_msdos.h index b5e1a19..07d331e 100644 --- a/sbin/newfs_msdos/mkfs_msdos.h +++ b/sbin/newfs_msdos/mkfs_msdos.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* $NetBSD: mkfs_msdos.h,v 1.3 2015/10/16 17:38:17 christos Exp $ */ /*- diff --git a/sbin/newfs_msdos/newfs_msdos.8 b/sbin/newfs_msdos/newfs_msdos.8 index 0cdd384..2786125 100644 --- a/sbin/newfs_msdos/newfs_msdos.8 +++ b/sbin/newfs_msdos/newfs_msdos.8 @@ -23,8 +23,6 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $FreeBSD$ -.\" .Dd June 14, 2018 .Dt NEWFS_MSDOS 8 .Os diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c index 731bffd..ff5b381 100644 --- a/sbin/newfs_msdos/newfs_msdos.c +++ b/sbin/newfs_msdos/newfs_msdos.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 Robert Nordier * All rights reserved. @@ -27,11 +27,6 @@ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef lint -static const char rcsid[] = - "$FreeBSD$"; -#endif /* not lint */ - #include #include #include diff --git a/stand/kshim/bsd_busspace.c b/stand/kshim/bsd_busspace.c index 489d12f..9357cd6 100644 --- a/stand/kshim/bsd_busspace.c +++ b/stand/kshim/bsd_busspace.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. * diff --git a/stand/kshim/bsd_kernel.c b/stand/kshim/bsd_kernel.c index c3498e5..0317f02 100644 --- a/stand/kshim/bsd_kernel.c +++ b/stand/kshim/bsd_kernel.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. * diff --git a/stand/kshim/bsd_kernel.h b/stand/kshim/bsd_kernel.h index 5fa24a4..83bdad5 100644 --- a/stand/kshim/bsd_kernel.h +++ b/stand/kshim/bsd_kernel.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2011 Hans Petter Selasky. All rights reserved. * diff --git a/stand/usb/usb_busdma_loader.c b/stand/usb/usb_busdma_loader.c index 1295888..471fd50 100644 --- a/stand/usb/usb_busdma_loader.c +++ b/stand/usb/usb_busdma_loader.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. * diff --git a/sys/arm/arm/autoconf.c b/sys/arm/arm/autoconf.c index 00a9633..6d757f0 100644 --- a/sys/arm/arm/autoconf.c +++ b/sys/arm/arm/autoconf.c @@ -49,8 +49,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include #include "linux/module.h" #include "los_config.h" diff --git a/sys/arm/arm/in_cksum_arm.S b/sys/arm/arm/in_cksum_arm.S index 4183ff4..40f64f3 100644 --- a/sys/arm/arm/in_cksum_arm.S +++ b/sys/arm/arm/in_cksum_arm.S @@ -1,4 +1,5 @@ -/* $NetBSD: in_cksum_arm.S,v 1.2 2003/09/23 10:01:36 scw Exp $ */ +/* $NetBSD: in_cksum_arm.S,v 1.2 2003/09/23 10:01:36 scw Exp $ */ + /*- * Copyright 2003 Wasabi Systems, Inc. * All rights reserved. diff --git a/sys/arm/arm/nexus.c b/sys/arm/arm/nexus.c index a603dc5..bccf853 100644 --- a/sys/arm/arm/nexus.c +++ b/sys/arm/arm/nexus.c @@ -38,8 +38,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/sys/arm/include/_bus.h b/sys/arm/include/_bus.h index 803dda2..fb3bf9d 100644 --- a/sys/arm/include/_bus.h +++ b/sys/arm/include/_bus.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2005 M. Warner Losh * @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef ARM_INCLUDE__BUS_H diff --git a/sys/cam/scsi/scsi_all.h b/sys/cam/scsi/scsi_all.h index 67b9722..eb57c25 100644 --- a/sys/cam/scsi/scsi_all.h +++ b/sys/cam/scsi/scsi_all.h @@ -13,8 +13,10 @@ * functioning of this software in any circumstances. * * Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992 - * - * $FreeBSD$ + */ + +/* + * SCSI general interface description */ #ifndef __INCLUDE_SCSI_ALL_H diff --git a/sys/compat/linuxkpi/common/include/asm/atomic.h b/sys/compat/linuxkpi/common/include/asm/atomic.h index 474afa3..60a777d 100644 --- a/sys/compat/linuxkpi/common/include/asm/atomic.h +++ b/sys/compat/linuxkpi/common/include/asm/atomic.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_ASM_ATOMIC_H_ diff --git a/sys/compat/linuxkpi/common/include/asm/io.h b/sys/compat/linuxkpi/common/include/asm/io.h index 49eca70..5a2df71 100644 --- a/sys/compat/linuxkpi/common/include/asm/io.h +++ b/sys/compat/linuxkpi/common/include/asm/io.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_ASM_IO_H_ #define _LINUXKPI_ASM_IO_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/atomic.h b/sys/compat/linuxkpi/common/include/linux/atomic.h index 8a23987..28a66f6 100644 --- a/sys/compat/linuxkpi/common/include/linux/atomic.h +++ b/sys/compat/linuxkpi/common/include/linux/atomic.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_ATOMIC_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/compat.h b/sys/compat/linuxkpi/common/include/linux/compat.h index 4e2f54a..68a9bdd 100644 --- a/sys/compat/linuxkpi/common/include/linux/compat.h +++ b/sys/compat/linuxkpi/common/include/linux/compat.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef __LINUX_COMPAT_H__ #define __LINUX_COMPAT_H__ diff --git a/sys/compat/linuxkpi/common/include/linux/compiler.h b/sys/compat/linuxkpi/common/include/linux/compiler.h index f7bc100..4e068ff 100644 --- a/sys/compat/linuxkpi/common/include/linux/compiler.h +++ b/sys/compat/linuxkpi/common/include/linux/compiler.h @@ -26,8 +26,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_COMPILER_H_ #define _LINUXKPI_LINUX_COMPILER_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/completion.h b/sys/compat/linuxkpi/common/include/linux/completion.h index 955d87c..76609d0 100644 --- a/sys/compat/linuxkpi/common/include/linux/completion.h +++ b/sys/compat/linuxkpi/common/include/linux/completion.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_COMPLETION_H_ #define _LINUXKPI_LINUX_COMPLETION_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/delay.h b/sys/compat/linuxkpi/common/include/linux/delay.h index 6369a0a..89f7be5 100644 --- a/sys/compat/linuxkpi/common/include/linux/delay.h +++ b/sys/compat/linuxkpi/common/include/linux/delay.h @@ -26,8 +26,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_DELAY_H_ #define _LINUXKPI_LINUX_DELAY_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h index 8a58510..2b8c97f 100644 --- a/sys/compat/linuxkpi/common/include/linux/dma-mapping.h +++ b/sys/compat/linuxkpi/common/include/linux/dma-mapping.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_DMA_MAPPING_H_ #define _LINUXKPI_LINUX_DMA_MAPPING_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/errno.h b/sys/compat/linuxkpi/common/include/linux/errno.h index b548dbd..aee22d8 100644 --- a/sys/compat/linuxkpi/common/include/linux/errno.h +++ b/sys/compat/linuxkpi/common/include/linux/errno.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_ERRNO_H_ #define _LINUXKPI_LINUX_ERRNO_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/fs.h b/sys/compat/linuxkpi/common/include/linux/fs.h index 763b2d1..3484477 100644 --- a/sys/compat/linuxkpi/common/include/linux/fs.h +++ b/sys/compat/linuxkpi/common/include/linux/fs.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_FS_H_ #define _LINUXKPI_LINUX_FS_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/hrtimer.h b/sys/compat/linuxkpi/common/include/linux/hrtimer.h index f43ca90..2b763ea 100644 --- a/sys/compat/linuxkpi/common/include/linux/hrtimer.h +++ b/sys/compat/linuxkpi/common/include/linux/hrtimer.h @@ -21,8 +21,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_HRTIMER_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h index 2ea94b9..8678ecb 100644 --- a/sys/compat/linuxkpi/common/include/linux/interrupt.h +++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_INTERRUPT_H_ #define _LINUXKPI_LINUX_INTERRUPT_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h index 9730578..45b76ef 100644 --- a/sys/compat/linuxkpi/common/include/linux/io.h +++ b/sys/compat/linuxkpi/common/include/linux/io.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_IO_H_ #define _LINUXKPI_LINUX_IO_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/ioctl.h b/sys/compat/linuxkpi/common/include/linux/ioctl.h index e95378b..93866bf 100644 --- a/sys/compat/linuxkpi/common/include/linux/ioctl.h +++ b/sys/compat/linuxkpi/common/include/linux/ioctl.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_IOCTL_H_ #define _LINUXKPI_LINUX_IOCTL_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/jiffies.h b/sys/compat/linuxkpi/common/include/linux/jiffies.h index 07518e2..e33d086 100644 --- a/sys/compat/linuxkpi/common/include/linux/jiffies.h +++ b/sys/compat/linuxkpi/common/include/linux/jiffies.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_JIFFIES_H_ #define _LINUXKPI_LINUX_JIFFIES_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h index 7d446d2..88e073d 100644 --- a/sys/compat/linuxkpi/common/include/linux/kernel.h +++ b/sys/compat/linuxkpi/common/include/linux/kernel.h @@ -26,8 +26,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_KERNEL_H_ #define _LINUXKPI_LINUX_KERNEL_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/list.h b/sys/compat/linuxkpi/common/include/linux/list.h index c27d252..a8df48b 100644 --- a/sys/compat/linuxkpi/common/include/linux/list.h +++ b/sys/compat/linuxkpi/common/include/linux/list.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_LIST_H_ #define _LINUXKPI_LINUX_LIST_H_ @@ -47,7 +45,7 @@ extern "C" { #define LINUX_LIST_HEAD_INIT(name) { &(name), &(name) } #define LINUX_LIST_HEAD(name) \ - struct list_head name = LINUX_LIST_HEAD_INIT(name) + struct list_head name = LINUX_LIST_HEAD_INIT(name) #ifndef LIST_HEAD_DEF #define LIST_HEAD_DEF @@ -120,7 +118,7 @@ list_replace_init(struct list_head *old, struct list_head *new) static inline void linux_list_add(struct list_head *new, struct list_head *prev, - struct list_head *next) + struct list_head *next) { next->prev = new; @@ -165,44 +163,44 @@ list_del_init(struct list_head *entry) #define list_for_each_entry(p, h, field) \ for (p = list_entry((h)->next, typeof(*p), field); &(p)->field != (h); \ - p = list_entry((p)->field.next, typeof(*p), field)) + p = list_entry((p)->field.next, typeof(*p), field)) #define list_for_each_entry_safe(p, n, h, field) \ for (p = list_entry((h)->next, typeof(*p), field), \ - n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ - p = n, n = list_entry(n->field.next, typeof(*n), field)) + n = list_entry((p)->field.next, typeof(*p), field); &(p)->field != (h);\ + p = n, n = list_entry(n->field.next, typeof(*n), field)) #define list_for_each_entry_from(p, h, field) \ for ( ; &(p)->field != (h); \ - p = list_entry((p)->field.next, typeof(*p), field)) + p = list_entry((p)->field.next, typeof(*p), field)) #define list_for_each_entry_continue(p, h, field) \ for (p = list_next_entry((p), field); &(p)->field != (h); \ - p = list_next_entry((p), field)) + p = list_next_entry((p), field)) #define list_for_each_entry_safe_from(pos, n, head, member) \ for (n = list_entry((pos)->member.next, typeof(*pos), member); \ - &(pos)->member != (head); \ - pos = n, n = list_entry(n->member.next, typeof(*n), member)) + &(pos)->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) #define list_for_each_entry_reverse(p, h, field) \ for (p = list_entry((h)->prev, typeof(*p), field); &(p)->field != (h); \ - p = list_entry((p)->field.prev, typeof(*p), field)) + p = list_entry((p)->field.prev, typeof(*p), field)) #define list_for_each_entry_safe_reverse(p, n, h, field) \ for (p = list_entry((h)->prev, typeof(*p), field), \ - n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ - p = n, n = list_entry(n->field.prev, typeof(*n), field)) + n = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ + p = n, n = list_entry(n->field.prev, typeof(*n), field)) #define list_for_each_entry_continue_reverse(p, h, field) \ for (p = list_entry((p)->field.prev, typeof(*p), field); &(p)->field != (h); \ - p = list_entry((p)->field.prev, typeof(*p), field)) + p = list_entry((p)->field.prev, typeof(*p), field)) #define list_for_each_prev(p, h) for (p = (h)->prev; p != (h); p = (p)->prev) #define list_for_each_entry_from_reverse(p, h, field) \ for (; &p->field != (h); \ - p = list_prev_entry(p, field)) + p = list_prev_entry(p, field)) static inline void list_add(struct list_head *new, struct list_head *head) @@ -243,7 +241,7 @@ list_rotate_to_front(struct list_head *entry, struct list_head *head) static inline void list_bulk_move_tail(struct list_head *head, struct list_head *first, - struct list_head *last) + struct list_head *last) { first->prev->next = last->next; last->next->prev = first->prev; @@ -255,7 +253,7 @@ list_bulk_move_tail(struct list_head *head, struct list_head *first, static inline void linux_list_splice(const struct list_head *list, struct list_head *prev, - struct list_head *next) + struct list_head *next) { struct list_head *first = NULL; struct list_head *last = NULL; @@ -307,7 +305,6 @@ struct hlist_head { struct hlist_node { struct hlist_node *next, **pprev; }; - #define HLIST_HEAD_INIT { } #define HLIST_HEAD(name) struct hlist_head name = HLIST_HEAD_INIT #define INIT_HLIST_HEAD(head) (head)->first = NULL @@ -437,6 +434,20 @@ static inline int list_is_last(const struct list_head *list, return list->next == head; } +static inline size_t +list_count_nodes(const struct list_head *list) +{ + const struct list_head *lh; + size_t count; + + count = 0; + list_for_each(lh, list) { + count++; + } + + return (count); +} + #define hlist_entry(ptr, type, field) container_of(ptr, type, field) #define hlist_for_each(p, head) \ @@ -450,26 +461,30 @@ static inline int list_is_last(const struct list_head *list, #define hlist_for_each_entry(pos, head, member) \ for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member);\ - pos; \ - pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) + pos; \ + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) #define hlist_for_each_entry_continue(pos, member) \ for (pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member); \ - (pos); \ - pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) + (pos); \ + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) #define hlist_for_each_entry_from(pos, member) \ for (; (pos); \ - pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) + pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) #define hlist_for_each_entry_safe(pos, n, head, member) \ for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member); \ - (pos) && ({ n = (pos)->member.next; 1; }); \ - pos = hlist_entry_safe(n, typeof(*(pos)), member)) + (pos) && ({ n = (pos)->member.next; 1; }); \ + pos = hlist_entry_safe(n, typeof(*(pos)), member)) +#if defined(LINUXKPI_VERSION) && LINUXKPI_VERSION >= 51300 extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, - struct list_head *a, struct list_head *b)); - + const struct list_head *a, const struct list_head *b)); +#else +extern void list_sort(void *priv, struct list_head *head, int (*cmp)(void *priv, + struct list_head *a, struct list_head *b)); +#endif #ifdef __cplusplus #if __cplusplus diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h index fe22d6a..78c41ba 100644 --- a/sys/compat/linuxkpi/common/include/linux/module.h +++ b/sys/compat/linuxkpi/common/include/linux/module.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_MODULE_H_ #define _LINUXKPI_LINUX_MODULE_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/moduleparam.h b/sys/compat/linuxkpi/common/include/linux/moduleparam.h index d51980b..db9371b 100644 --- a/sys/compat/linuxkpi/common/include/linux/moduleparam.h +++ b/sys/compat/linuxkpi/common/include/linux/moduleparam.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef __LINUX_MODULEPARAM_H__ #define __LINUX_MODULEPARAM_H__ diff --git a/sys/compat/linuxkpi/common/include/linux/pagemap.h b/sys/compat/linuxkpi/common/include/linux/pagemap.h index b944c2a..2d3aa27 100644 --- a/sys/compat/linuxkpi/common/include/linux/pagemap.h +++ b/sys/compat/linuxkpi/common/include/linux/pagemap.h @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef __LINUX_PAGEMAP_H__ #define __LINUX_PAGEMAP_H__ diff --git a/sys/compat/linuxkpi/common/include/linux/rbtree.h b/sys/compat/linuxkpi/common/include/linux/rbtree.h index 7247a10..28552e5 100644 --- a/sys/compat/linuxkpi/common/include/linux/rbtree.h +++ b/sys/compat/linuxkpi/common/include/linux/rbtree.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_RBTREE_H_ #define _LINUXKPI_LINUX_RBTREE_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/rwsem.h b/sys/compat/linuxkpi/common/include/linux/rwsem.h index 572ecd9..5af167f 100644 --- a/sys/compat/linuxkpi/common/include/linux/rwsem.h +++ b/sys/compat/linuxkpi/common/include/linux/rwsem.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_RWSEM_H_ #define _LINUXKPI_LINUX_RWSEM_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/scatterlist.h b/sys/compat/linuxkpi/common/include/linux/scatterlist.h index e683b41..2ee1895 100644 --- a/sys/compat/linuxkpi/common/include/linux/scatterlist.h +++ b/sys/compat/linuxkpi/common/include/linux/scatterlist.h @@ -27,8 +27,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_SCATTERLIST_H_ #define _LINUXKPI_LINUX_SCATTERLIST_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/sched.h b/sys/compat/linuxkpi/common/include/linux/sched.h index 1177f47..9e062ea 100644 --- a/sys/compat/linuxkpi/common/include/linux/sched.h +++ b/sys/compat/linuxkpi/common/include/linux/sched.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_SCHED_H_ #define _LINUXKPI_LINUX_SCHED_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/semaphore.h b/sys/compat/linuxkpi/common/include/linux/semaphore.h index 98576ec..82b8b23 100644 --- a/sys/compat/linuxkpi/common/include/linux/semaphore.h +++ b/sys/compat/linuxkpi/common/include/linux/semaphore.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_SEMAPHORE_H_ #define _LINUXKPI_LINUX_SEMAPHORE_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h b/sys/compat/linuxkpi/common/include/linux/slab.h index 584c2be..b925b86 100644 --- a/sys/compat/linuxkpi/common/include/linux/slab.h +++ b/sys/compat/linuxkpi/common/include/linux/slab.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_SLAB_H_ #define _LINUXKPI_LINUX_SLAB_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h index ba157f2..9616698 100644 --- a/sys/compat/linuxkpi/common/include/linux/spinlock.h +++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_SPINLOCK_H_ #define _LINUXKPI_LINUX_SPINLOCK_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h index cbf3f85..fa35d57 100644 --- a/sys/compat/linuxkpi/common/include/linux/string.h +++ b/sys/compat/linuxkpi/common/include/linux/string.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef __LINUXKPI_LINUX_STRING_H__ #define __LINUXKPI_LINUX_STRING_H__ diff --git a/sys/compat/linuxkpi/common/include/linux/timer.h b/sys/compat/linuxkpi/common/include/linux/timer.h index 86f47b0..b4277cd 100644 --- a/sys/compat/linuxkpi/common/include/linux/timer.h +++ b/sys/compat/linuxkpi/common/include/linux/timer.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_TIMER_H_ #define _LINUXKPI_LINUX_TIMER_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/types.h b/sys/compat/linuxkpi/common/include/linux/types.h index 59b0cdf..4a02ad1 100644 --- a/sys/compat/linuxkpi/common/include/linux/types.h +++ b/sys/compat/linuxkpi/common/include/linux/types.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_TYPES_H_ #define _LINUXKPI_LINUX_TYPES_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/usb.h b/sys/compat/linuxkpi/common/include/linux/usb.h index 90cfe1c..61ac066 100644 --- a/sys/compat/linuxkpi/common/include/linux/usb.h +++ b/sys/compat/linuxkpi/common/include/linux/usb.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2007 Luigi Rizzo - Universita` di Pisa. All rights reserved. * Copyright (c) 2007 Hans Petter Selasky. All rights reserved. diff --git a/sys/compat/linuxkpi/common/include/linux/wait.h b/sys/compat/linuxkpi/common/include/linux/wait.h index 2c42715..bbf7116 100644 --- a/sys/compat/linuxkpi/common/include/linux/wait.h +++ b/sys/compat/linuxkpi/common/include/linux/wait.h @@ -26,8 +26,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_WAIT_H_ diff --git a/sys/compat/linuxkpi/common/include/linux/workqueue.h b/sys/compat/linuxkpi/common/include/linux/workqueue.h index 9ad1fb2..63d33f4 100644 --- a/sys/compat/linuxkpi/common/include/linux/workqueue.h +++ b/sys/compat/linuxkpi/common/include/linux/workqueue.h @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _LINUXKPI_LINUX_WORKQUEUE_H_ #define _LINUXKPI_LINUX_WORKQUEUE_H_ diff --git a/sys/compat/linuxkpi/common/src/linux_interrupt.c b/sys/compat/linuxkpi/common/src/linux_interrupt.c index 8744a47..6bcdff5 100644 --- a/sys/compat/linuxkpi/common/src/linux_interrupt.c +++ b/sys/compat/linuxkpi/common/src/linux_interrupt.c @@ -25,8 +25,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #include "linux/interrupt.h" diff --git a/sys/compat/linuxkpi/common/src/linux_usb.c b/sys/compat/linuxkpi/common/src/linux_usb.c index 5c612c2..d6a725a 100644 --- a/sys/compat/linuxkpi/common/src/linux_usb.c +++ b/sys/compat/linuxkpi/common/src/linux_usb.c @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /*- * Copyright (c) 2007 Luigi Rizzo - Universita` di Pisa. All rights reserved. * Copyright (c) 2007 Hans Petter Selasky. All rights reserved. diff --git a/sys/crypto/rijndael/rijndael-alg-fst.c b/sys/crypto/rijndael/rijndael-alg-fst.c index 5197e22..3cdbddf 100644 --- a/sys/crypto/rijndael/rijndael-alg-fst.c +++ b/sys/crypto/rijndael/rijndael-alg-fst.c @@ -25,8 +25,6 @@ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include -__FBSDID("$FreeBSD$"); - #include #include #ifdef _KERNEL diff --git a/sys/crypto/rijndael/rijndael-api-fst.c b/sys/crypto/rijndael/rijndael-api-fst.c index 8ae77eb..eebee38 100644 --- a/sys/crypto/rijndael/rijndael-api-fst.c +++ b/sys/crypto/rijndael/rijndael-api-fst.c @@ -16,7 +16,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include #include diff --git a/sys/crypto/rijndael/rijndael-api-fst.h b/sys/crypto/rijndael/rijndael-api-fst.h index e5f596a..71a2d71 100644 --- a/sys/crypto/rijndael/rijndael-api-fst.h +++ b/sys/crypto/rijndael/rijndael-api-fst.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* $KAME: rijndael-api-fst.h,v 1.6 2001/05/27 00:23:23 itojun Exp $ */ /* diff --git a/sys/crypto/rijndael/rijndael.h b/sys/crypto/rijndael/rijndael.h index 6a52bbc..a7b20e4 100644 --- a/sys/crypto/rijndael/rijndael.h +++ b/sys/crypto/rijndael/rijndael.h @@ -1,5 +1,4 @@ /* $KAME: rijndael.h,v 1.6 2003/08/28 08:36:32 itojun Exp $ */ -/* $FreeBSD$ */ /** * rijndael-alg-fst.h diff --git a/sys/crypto/rijndael/rijndael_local.h b/sys/crypto/rijndael/rijndael_local.h index 7c6dd60..0ccded4 100644 --- a/sys/crypto/rijndael/rijndael_local.h +++ b/sys/crypto/rijndael/rijndael_local.h @@ -1,5 +1,4 @@ /* $KAME: rijndael_local.h,v 1.5 2003/08/28 08:37:24 itojun Exp $ */ -/* $FreeBSD$ */ /* the file should not be used from outside */ typedef uint8_t u8; diff --git a/sys/crypto/sha2/sha256.h b/sys/crypto/sha2/sha256.h index bd31a62..60c417e 100644 --- a/sys/crypto/sha2/sha256.h +++ b/sys/crypto/sha2/sha256.h @@ -22,8 +22,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SHA256_H_ diff --git a/sys/crypto/sha2/sha256c.c b/sys/crypto/sha2/sha256c.c index d28820b..06c5758 100644 --- a/sys/crypto/sha2/sha256c.c +++ b/sys/crypto/sha2/sha256c.c @@ -25,8 +25,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include #include diff --git a/sys/dev/evdev/input-event-codes.h b/sys/dev/evdev/input-event-codes.h index a910ad2..5214599 100644 --- a/sys/dev/evdev/input-event-codes.h +++ b/sys/dev/evdev/input-event-codes.h @@ -23,8 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _EVDEV_INPUT_EVENT_CODES_H @@ -77,9 +75,9 @@ /* * Keys and buttons - */ - -/* + * + * Most of the keys/buttons are modeled after USB HUT 1.12 + * (see http://www.usb.org/developers/hidpage). * Abbreviations in the comments: * AC - Application Control * AL - Application Launch Button @@ -292,7 +290,8 @@ #define KEY_PAUSECD 201 #define KEY_PROG3 202 #define KEY_PROG4 203 -#define KEY_DASHBOARD 204 /* AL Dashboard */ +#define KEY_ALL_APPLICATIONS 204 /* AC Desktop Show All Applications */ +#define KEY_DASHBOARD KEY_ALL_APPLICATIONS #define KEY_SUSPEND 205 #define KEY_CLOSE 206 /* AC Close */ #define KEY_PLAY 207 @@ -529,6 +528,9 @@ #define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ #define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ #define KEY_IMAGES 0x1ba /* AL Image Browser */ +#define KEY_NOTIFICATION_CENTER 0x1bc /* Show/hide the notification center */ +#define KEY_PICKUP_PHONE 0x1bd /* Answer incoming call */ +#define KEY_HANGUP_PHONE 0x1be /* Decline incoming call */ #define KEY_DEL_EOL 0x1c0 #define KEY_DEL_EOS 0x1c1 @@ -556,6 +558,7 @@ #define KEY_FN_F 0x1e2 #define KEY_FN_S 0x1e3 #define KEY_FN_B 0x1e4 +#define KEY_FN_RIGHT_SHIFT 0x1e5 #define KEY_BRL_DOT1 0x1f1 #define KEY_BRL_DOT2 0x1f2 @@ -621,6 +624,11 @@ #define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ #define KEY_ASSISTANT 0x247 /* AL Context-aware desktop assistant */ #define KEY_KBD_LAYOUT_NEXT 0x248 /* AC Next Keyboard Layout Select */ +#define KEY_EMOJI_PICKER 0x249 /* Show/hide emoji picker (HUTRR101) */ +#define KEY_DICTATE 0x24a /* Start or Stop Voice Dictation Session (HUTRR99) */ +#define KEY_CAMERA_ACCESS_ENABLE 0x24b /* Enables programmatic access to camera devices. (HUTRR72) */ +#define KEY_CAMERA_ACCESS_DISABLE 0x24c /* Disables programmatic access to camera devices. (HUTRR72) */ +#define KEY_CAMERA_ACCESS_TOGGLE 0x24d /* Toggles the current state of the camera access control. (HUTRR72) */ #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ @@ -669,6 +677,27 @@ /* Select an area of screen to be copied */ #define KEY_SELECTIVE_SCREENSHOT 0x27a +/* Move the focus to the next or previous user controllable element within a UI container */ +#define KEY_NEXT_ELEMENT 0x27b +#define KEY_PREVIOUS_ELEMENT 0x27c + +/* Toggle Autopilot engagement */ +#define KEY_AUTOPILOT_ENGAGE_TOGGLE 0x27d + +/* Shortcut Keys */ +#define KEY_MARK_WAYPOINT 0x27e +#define KEY_SOS 0x27f +#define KEY_NAV_CHART 0x280 +#define KEY_FISHING_CHART 0x281 +#define KEY_SINGLE_RANGE_RADAR 0x282 +#define KEY_DUAL_RANGE_RADAR 0x283 +#define KEY_RADAR_OVERLAY 0x284 +#define KEY_TRADITIONAL_SONAR 0x285 +#define KEY_CLEARVU_SONAR 0x286 +#define KEY_SIDEVU_SONAR 0x287 +#define KEY_NAV_INFO 0x288 +#define KEY_BRIGHTNESS_MENU 0x289 + /* * Some keyboards have keys which do not have a defined meaning, these keys * are intended to be programmed / bound to macros by the user. For most @@ -848,6 +877,7 @@ #define ABS_TOOL_WIDTH 0x1c #define ABS_VOLUME 0x20 +#define ABS_PROFILE 0x21 #define ABS_MISC 0x28 diff --git a/sys/dev/mii/mii.h b/sys/dev/mii/mii.h index 11b2d11..37545e6 100644 --- a/sys/dev/mii/mii.h +++ b/sys/dev/mii/mii.h @@ -27,8 +27,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _DEV_MII_MII_H_ diff --git a/sys/dev/random/hash.c b/sys/dev/random/hash.c index 12a2734..00c9834 100644 --- a/sys/dev/random/hash.c +++ b/sys/dev/random/hash.c @@ -26,8 +26,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #ifdef _KERNEL #include #include diff --git a/sys/dev/random/hash.h b/sys/dev/random/hash.h index bd565b3..c38519d 100644 --- a/sys/dev/random/hash.h +++ b/sys/dev/random/hash.h @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef SYS_DEV_RANDOM_HASH_H_INCLUDED diff --git a/sys/dev/random/randomdev.h b/sys/dev/random/randomdev.h index db58903..d79b322 100644 --- a/sys/dev/random/randomdev.h +++ b/sys/dev/random/randomdev.h @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef SYS_DEV_RANDOM_RANDOMDEV_H_INCLUDED diff --git a/sys/dev/random/uint128.h b/sys/dev/random/uint128.h index dbdb575..5fdfd3e 100644 --- a/sys/dev/random/uint128.h +++ b/sys/dev/random/uint128.h @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef SYS_DEV_RANDOM_UINT128_H_INCLUDED diff --git a/sys/dev/random/unit_test.h b/sys/dev/random/unit_test.h index 6ffeabc..0f09c37 100644 --- a/sys/dev/random/unit_test.h +++ b/sys/dev/random/unit_test.h @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ diff --git a/sys/dev/usb/controller/ehci.c b/sys/dev/usb/controller/ehci.c index bed7683..7dd4eb4 100644 --- a/sys/dev/usb/controller/ehci.c +++ b/sys/dev/usb/controller/ehci.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 2004 The NetBSD Foundation, Inc. All rights reserved. diff --git a/sys/dev/usb/controller/ehci.h b/sys/dev/usb/controller/ehci.h index d102a22..f66b30e 100644 --- a/sys/dev/usb/controller/ehci.h +++ b/sys/dev/usb/controller/ehci.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -320,8 +319,8 @@ union ehci_hub_desc { typedef struct ehci_softc { struct ehci_hw_softc sc_hw; struct usb_bus sc_bus; /* base device */ - struct callout sc_tmo_pcd; - struct callout sc_tmo_poll; + struct usb_callout sc_tmo_pcd; + struct usb_callout sc_tmo_poll; union ehci_hub_desc sc_hub_desc; struct usb_device *sc_devices[EHCI_MAX_DEVICES]; @@ -337,7 +336,7 @@ typedef struct ehci_softc { bus_space_handle_t sc_io_hdl; uint32_t sc_terminate_self; /* TD short packet termination pointer */ - uint32_t sc_eintrs; /* Interrupt mask */ + uint32_t sc_eintrs; uint16_t sc_intr_stat[EHCI_VIRTUAL_FRAMELIST_COUNT]; uint16_t sc_id_vendor; /* vendor ID for root hub */ @@ -361,7 +360,9 @@ typedef struct ehci_softc { char sc_vendor[16]; /* vendor string for root hub */ void (*sc_vendor_post_reset)(struct ehci_softc *sc); - uint16_t (*sc_vendor_get_port_speed)(struct ehci_softc *sc, uint16_t index); + uint16_t (*sc_vendor_get_port_speed)(struct ehci_softc *sc, + uint16_t index); + } ehci_softc_t; #define EREAD1(sc, a) bus_space_read_1((sc)->sc_io_tag, (sc)->sc_io_hdl, (a)) diff --git a/sys/dev/usb/controller/ehci_pci.c b/sys/dev/usb/controller/ehci_pci.c index 7017fc2..fb6770c 100644 --- a/sys/dev/usb/controller/ehci_pci.c +++ b/sys/dev/usb/controller/ehci_pci.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -31,8 +31,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * USB Enhanced Host Controller Driver, a.k.a. USB 2.0 controller. * diff --git a/sys/dev/usb/controller/ehcireg.h b/sys/dev/usb/controller/ehcireg.h index ae06944..c33309e 100644 --- a/sys/dev/usb/controller/ehcireg.h +++ b/sys/dev/usb/controller/ehcireg.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c index 8a54ff8..7e7e39a 100644 --- a/sys/dev/usb/controller/usb_controller.c +++ b/sys/dev/usb/controller/usb_controller.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -160,7 +159,7 @@ usb_detach(device_t dev) return (0); } /* Stop power watchdog */ - callout_drain(&bus->power_wdog); + usb_callout_drain(&bus->power_wdog); #if USB_HAVE_ROOT_MOUNT_HOLD /* Let the USB explore process detach all devices. */ @@ -852,7 +851,7 @@ usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, mtx_init(&bus->bus_spin_lock, device_get_nameunit(bus->parent), "usb_spin_mtx", MTX_SPIN | MTX_RECURSE); - callout_init_mtx(&bus->power_wdog, + usb_callout_init_mtx(&bus->power_wdog, &bus->bus_mtx, 0); TAILQ_INIT(&bus->intr_q.head); diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index b33e57d..bb779f7 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010-2022 Hans Petter Selasky * diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index ee4fb3c..158dd2f 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -1,7 +1,6 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010-2022 Hans Petter Selasky * @@ -466,7 +465,7 @@ struct xhci_softc { /* configure message */ struct usb_bus_msg sc_config_msg[2]; - struct callout sc_callout; + struct usb_callout sc_callout; xhci_port_route_t *sc_port_route; diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index 805f9ec..a924280 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010-2022 Hans Petter Selasky * @@ -26,7 +26,6 @@ */ #include "implementation/global_implementation.h" -__FBSDID("$FreeBSD$"); #include "controller/xhci.h" #include "controller/xhcireg.h" @@ -125,7 +124,7 @@ xhci_pci_attach(device_t self) device_printf(self, "Could not initialize softc\n"); goto error; } - callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); + usb_callout_init_mtx(&sc->sc_callout, &sc->sc_bus.bus_mtx, 0); usb_debug("add child to usbus\n"); sc->sc_bus.bdev = device_add_child(self, "usbus", -1); @@ -171,7 +170,7 @@ xhci_pci_detach(device_t self) /* during module unload there are lots of children leftover */ (void)device_delete_children(self); - callout_drain(&sc->sc_callout); + usb_callout_drain(&sc->sc_callout); (void)xhci_halt_controller(sc); (void)xhci_reset_controller(sc); diff --git a/sys/dev/usb/controller/xhcireg.h b/sys/dev/usb/controller/xhcireg.h index b49bc09..9d0b6e2 100644 --- a/sys/dev/usb/controller/xhcireg.h +++ b/sys/dev/usb/controller/xhcireg.h @@ -1,7 +1,6 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. * @@ -124,6 +123,10 @@ #define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ #define XHCI_PS_PP 0x00000200 /* RW - port power */ #define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ +#define XHCI_PS_SPEED_FULL 0x1 /* Full Speed USB */ +#define XHCI_PS_SPEED_LOW 0x2 /* Low Speed USB */ +#define XHCI_PS_SPEED_HIGH 0x3 /* High Speed USB */ +#define XHCI_PS_SPEED_SS 0x4 /* Super Speed USB */ #define XHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ #define XHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ #define XHCI_PS_LWS 0x00010000 /* RW - port link state write strobe */ diff --git a/sys/dev/usb/input/uhid.c b/sys/dev/usb/input/uhid.c index 2672cb6..ad6ceae 100644 --- a/sys/dev/usb/input/uhid.c +++ b/sys/dev/usb/input/uhid.c @@ -5,10 +5,8 @@ */ #include -__FBSDID("$FreeBSD$"); - /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/input/usb_rdesc.h b/sys/dev/usb/input/usb_rdesc.h index 00eea12..85c0886 100644 --- a/sys/dev/usb/input/usb_rdesc.h +++ b/sys/dev/usb/input/usb_rdesc.h @@ -1,11 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2000 Nick Hibma - * All rights reserved. - * - * Copyright (c) 2005 Ed Schouten - * All rights reserved. + * Copyright (c) 2020 Vladimir Kondratyev * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -28,9 +24,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD$ - * - * This file contains replacements for broken HID report descriptors. + * This a proxy file for replacements for broken HID report descriptors. */ #define UHID_GRAPHIRE_REPORT_DESCR(...) \ diff --git a/sys/dev/usb/net/if_axe.c b/sys/dev/usb/net/if_axe.c index df60d46..da6b106 100644 --- a/sys/dev/usb/net/if_axe.c +++ b/sys/dev/usb/net/if_axe.c @@ -33,8 +33,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /* * ASIX Electronics AX88172/AX88178/AX88778 USB 2.0 ethernet driver. * Used in the LinkSys USB200M and various other adapters. diff --git a/sys/dev/usb/net/if_axereg.h b/sys/dev/usb/net/if_axereg.h index 46cffcc..33b59cb 100644 --- a/sys/dev/usb/net/if_axereg.h +++ b/sys/dev/usb/net/if_axereg.h @@ -30,8 +30,6 @@ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ /* @@ -68,270 +66,270 @@ #define AXE_LINK_MASK 0x20 -#define AXE_CMD_IS_WRITE(x) (((x) & 0x0F00) >> 8) -#define AXE_CMD_LEN(x) (((x) & 0xF000) >> 12) -#define AXE_CMD_CMD(x) ((x) & 0x00FF) +#define AXE_CMD_IS_WRITE(x) (((x) & 0x0F00) >> 8) +#define AXE_CMD_LEN(x) (((x) & 0xF000) >> 12) +#define AXE_CMD_CMD(x) ((x) & 0x00FF) -#define AXE_172_CMD_READ_RXTX_SRAM 0x2002 -#define AXE_182_CMD_READ_RXTX_SRAM 0x8002 -#define AXE_172_CMD_WRITE_RX_SRAM 0x0103 -#define AXE_182_CMD_WRITE_RXTX_SRAM 0x8103 -#define AXE_172_CMD_WRITE_TX_SRAM 0x0104 -#define AXE_CMD_MII_OPMODE_SW 0x0106 -#define AXE_CMD_MII_READ_REG 0x2007 -#define AXE_CMD_MII_WRITE_REG 0x2108 -#define AXE_CMD_MII_READ_OPMODE 0x1009 -#define AXE_CMD_MII_OPMODE_HW 0x010A -#define AXE_CMD_SROM_READ 0x200B -#define AXE_CMD_SROM_WRITE 0x010C -#define AXE_CMD_SROM_WR_ENABLE 0x010D -#define AXE_CMD_SROM_WR_DISABLE 0x010E -#define AXE_CMD_RXCTL_READ 0x200F -#define AXE_CMD_RXCTL_WRITE 0x0110 -#define AXE_CMD_READ_IPG012 0x3011 -#define AXE_172_CMD_WRITE_IPG0 0x0112 -#define AXE_178_CMD_WRITE_IPG012 0x0112 -#define AXE_172_CMD_WRITE_IPG1 0x0113 -#define AXE_178_CMD_READ_NODEID 0x6013 -#define AXE_172_CMD_WRITE_IPG2 0x0114 -#define AXE_178_CMD_WRITE_NODEID 0x6114 -#define AXE_CMD_READ_MCAST 0x8015 -#define AXE_CMD_WRITE_MCAST 0x8116 -#define AXE_172_CMD_READ_NODEID 0x6017 -#define AXE_172_CMD_WRITE_NODEID 0x6118 +#define AXE_172_CMD_READ_RXTX_SRAM 0x2002 +#define AXE_182_CMD_READ_RXTX_SRAM 0x8002 +#define AXE_172_CMD_WRITE_RX_SRAM 0x0103 +#define AXE_182_CMD_WRITE_RXTX_SRAM 0x8103 +#define AXE_172_CMD_WRITE_TX_SRAM 0x0104 +#define AXE_CMD_MII_OPMODE_SW 0x0106 +#define AXE_CMD_MII_READ_REG 0x2007 +#define AXE_CMD_MII_WRITE_REG 0x2108 +#define AXE_CMD_MII_READ_OPMODE 0x1009 +#define AXE_CMD_MII_OPMODE_HW 0x010A +#define AXE_CMD_SROM_READ 0x200B +#define AXE_CMD_SROM_WRITE 0x010C +#define AXE_CMD_SROM_WR_ENABLE 0x010D +#define AXE_CMD_SROM_WR_DISABLE 0x010E +#define AXE_CMD_RXCTL_READ 0x200F +#define AXE_CMD_RXCTL_WRITE 0x0110 +#define AXE_CMD_READ_IPG012 0x3011 +#define AXE_172_CMD_WRITE_IPG0 0x0112 +#define AXE_178_CMD_WRITE_IPG012 0x0112 +#define AXE_172_CMD_WRITE_IPG1 0x0113 +#define AXE_178_CMD_READ_NODEID 0x6013 +#define AXE_172_CMD_WRITE_IPG2 0x0114 +#define AXE_178_CMD_WRITE_NODEID 0x6114 +#define AXE_CMD_READ_MCAST 0x8015 +#define AXE_CMD_WRITE_MCAST 0x8116 +#define AXE_172_CMD_READ_NODEID 0x6017 +#define AXE_172_CMD_WRITE_NODEID 0x6118 -#define AXE_CMD_READ_PHYID 0x2019 -#define AXE_172_CMD_READ_MEDIA 0x101A -#define AXE_178_CMD_READ_MEDIA 0x201A -#define AXE_CMD_WRITE_MEDIA 0x011B -#define AXE_CMD_READ_MONITOR_MODE 0x101C -#define AXE_CMD_WRITE_MONITOR_MODE 0x011D -#define AXE_CMD_READ_GPIO 0x101E -#define AXE_CMD_WRITE_GPIO 0x011F +#define AXE_CMD_READ_PHYID 0x2019 +#define AXE_172_CMD_READ_MEDIA 0x101A +#define AXE_178_CMD_READ_MEDIA 0x201A +#define AXE_CMD_WRITE_MEDIA 0x011B +#define AXE_CMD_READ_MONITOR_MODE 0x101C +#define AXE_CMD_WRITE_MONITOR_MODE 0x011D +#define AXE_CMD_READ_GPIO 0x101E +#define AXE_CMD_WRITE_GPIO 0x011F -#define AXE_CMD_SW_RESET_REG 0x0120 -#define AXE_CMD_SW_PHY_STATUS 0x0021 -#define AXE_CMD_SW_PHY_SELECT 0x0122 +#define AXE_CMD_SW_RESET_REG 0x0120 +#define AXE_CMD_SW_PHY_STATUS 0x0021 +#define AXE_CMD_SW_PHY_SELECT 0x0122 /* AX88772A and AX88772B only. */ -#define AXE_CMD_READ_VLAN_CTRL 0x4027 -#define AXE_CMD_WRITE_VLAN_CTRL 0x4028 +#define AXE_CMD_READ_VLAN_CTRL 0x4027 +#define AXE_CMD_WRITE_VLAN_CTRL 0x4028 -#define AXE_772B_CMD_RXCTL_WRITE_CFG 0x012A -#define AXE_772B_CMD_READ_RXCSUM 0x002B -#define AXE_772B_CMD_WRITE_RXCSUM 0x012C -#define AXE_772B_CMD_READ_TXCSUM 0x002D -#define AXE_772B_CMD_WRITE_TXCSUM 0x012E +#define AXE_772B_CMD_RXCTL_WRITE_CFG 0x012A +#define AXE_772B_CMD_READ_RXCSUM 0x002B +#define AXE_772B_CMD_WRITE_RXCSUM 0x012C +#define AXE_772B_CMD_READ_TXCSUM 0x002D +#define AXE_772B_CMD_WRITE_TXCSUM 0x012E -#define AXE_SW_RESET_CLEAR 0x00 -#define AXE_SW_RESET_RR 0x01 -#define AXE_SW_RESET_RT 0x02 -#define AXE_SW_RESET_PRTE 0x04 -#define AXE_SW_RESET_PRL 0x08 -#define AXE_SW_RESET_BZ 0x10 -#define AXE_SW_RESET_IPRL 0x20 -#define AXE_SW_RESET_IPPD 0x40 +#define AXE_SW_RESET_CLEAR 0x00 +#define AXE_SW_RESET_RR 0x01 +#define AXE_SW_RESET_RT 0x02 +#define AXE_SW_RESET_PRTE 0x04 +#define AXE_SW_RESET_PRL 0x08 +#define AXE_SW_RESET_BZ 0x10 +#define AXE_SW_RESET_IPRL 0x20 +#define AXE_SW_RESET_IPPD 0x40 /* AX88178 documentation says to always write this bit... */ -#define AXE_178_RESET_MAGIC 0x40 +#define AXE_178_RESET_MAGIC 0x40 -#define AXE_178_MEDIA_GMII 0x0001 -#define AXE_MEDIA_FULL_DUPLEX 0x0002 -#define AXE_172_MEDIA_TX_ABORT_ALLOW 0x0004 +#define AXE_178_MEDIA_GMII 0x0001 +#define AXE_MEDIA_FULL_DUPLEX 0x0002 +#define AXE_172_MEDIA_TX_ABORT_ALLOW 0x0004 /* AX88178/88772 documentation says to always write 1 to bit 2 */ -#define AXE_178_MEDIA_MAGIC 0x0004 +#define AXE_178_MEDIA_MAGIC 0x0004 /* AX88772 documentation says to always write 0 to bit 3 */ -#define AXE_178_MEDIA_ENCK 0x0008 -#define AXE_172_MEDIA_FLOW_CONTROL_EN 0x0010 -#define AXE_178_MEDIA_RXFLOW_CONTROL_EN 0x0010 -#define AXE_178_MEDIA_TXFLOW_CONTROL_EN 0x0020 -#define AXE_178_MEDIA_JUMBO_EN 0x0040 -#define AXE_178_MEDIA_LTPF_ONLY 0x0080 -#define AXE_178_MEDIA_RX_EN 0x0100 -#define AXE_178_MEDIA_100TX 0x0200 -#define AXE_178_MEDIA_SBP 0x0800 -#define AXE_178_MEDIA_SUPERMAC 0x1000 +#define AXE_178_MEDIA_ENCK 0x0008 +#define AXE_172_MEDIA_FLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_RXFLOW_CONTROL_EN 0x0010 +#define AXE_178_MEDIA_TXFLOW_CONTROL_EN 0x0020 +#define AXE_178_MEDIA_JUMBO_EN 0x0040 +#define AXE_178_MEDIA_LTPF_ONLY 0x0080 +#define AXE_178_MEDIA_RX_EN 0x0100 +#define AXE_178_MEDIA_100TX 0x0200 +#define AXE_178_MEDIA_SBP 0x0800 +#define AXE_178_MEDIA_SUPERMAC 0x1000 -#define AXE_RXCMD_PROMISC 0x0001 -#define AXE_RXCMD_ALLMULTI 0x0002 -#define AXE_172_RXCMD_UNICAST 0x0004 -#define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 -#define AXE_RXCMD_BROADCAST 0x0008 -#define AXE_RXCMD_MULTICAST 0x0010 -#define AXE_RXCMD_ACCEPT_RUNT 0x0040 /* AX88772B */ -#define AXE_RXCMD_ENABLE 0x0080 -#define AXE_178_RXCMD_MFB_MASK 0x0300 -#define AXE_178_RXCMD_MFB_2048 0x0000 -#define AXE_178_RXCMD_MFB_4096 0x0100 -#define AXE_178_RXCMD_MFB_8192 0x0200 -#define AXE_178_RXCMD_MFB_16384 0x0300 -#define AXE_772B_RXCMD_HDR_TYPE_0 0x0000 -#define AXE_772B_RXCMD_HDR_TYPE_1 0x0100 -#define AXE_772B_RXCMD_IPHDR_ALIGN 0x0200 -#define AXE_772B_RXCMD_ADD_CHKSUM 0x0400 -#define AXE_RXCMD_LOOPBACK 0x1000 /* AX88772A/AX88772B */ +#define AXE_RXCMD_PROMISC 0x0001 +#define AXE_RXCMD_ALLMULTI 0x0002 +#define AXE_172_RXCMD_UNICAST 0x0004 +#define AXE_178_RXCMD_KEEP_INVALID_CRC 0x0004 +#define AXE_RXCMD_BROADCAST 0x0008 +#define AXE_RXCMD_MULTICAST 0x0010 +#define AXE_RXCMD_ACCEPT_RUNT 0x0040 /* AX88772B */ +#define AXE_RXCMD_ENABLE 0x0080 +#define AXE_178_RXCMD_MFB_MASK 0x0300 +#define AXE_178_RXCMD_MFB_2048 0x0000 +#define AXE_178_RXCMD_MFB_4096 0x0100 +#define AXE_178_RXCMD_MFB_8192 0x0200 +#define AXE_178_RXCMD_MFB_16384 0x0300 +#define AXE_772B_RXCMD_HDR_TYPE_0 0x0000 +#define AXE_772B_RXCMD_HDR_TYPE_1 0x0100 +#define AXE_772B_RXCMD_IPHDR_ALIGN 0x0200 +#define AXE_772B_RXCMD_ADD_CHKSUM 0x0400 +#define AXE_RXCMD_LOOPBACK 0x1000 /* AX88772A/AX88772B */ -#define AXE_PHY_SEL_PRI 1 -#define AXE_PHY_SEL_SEC 0 -#define AXE_PHY_TYPE_MASK 0xE0 -#define AXE_PHY_TYPE_SHIFT 5 -#define AXE_PHY_TYPE(x) \ - (((x) & AXE_PHY_TYPE_MASK) >> AXE_PHY_TYPE_SHIFT) +#define AXE_PHY_SEL_PRI 1 +#define AXE_PHY_SEL_SEC 0 +#define AXE_PHY_TYPE_MASK 0xE0 +#define AXE_PHY_TYPE_SHIFT 5 +#define AXE_PHY_TYPE(x) \ + (((x) & AXE_PHY_TYPE_MASK) >> AXE_PHY_TYPE_SHIFT) -#define PHY_TYPE_100_HOME 0 /* 10/100 or 1M HOME PHY */ -#define PHY_TYPE_GIG 1 /* Gigabit PHY */ -#define PHY_TYPE_SPECIAL 4 /* Special case */ -#define PHY_TYPE_RSVD 5 /* Reserved */ -#define PHY_TYPE_NON_SUP 7 /* Non-supported PHY */ +#define PHY_TYPE_100_HOME 0 /* 10/100 or 1M HOME PHY */ +#define PHY_TYPE_GIG 1 /* Gigabit PHY */ +#define PHY_TYPE_SPECIAL 4 /* Special case */ +#define PHY_TYPE_RSVD 5 /* Reserved */ +#define PHY_TYPE_NON_SUP 7 /* Non-supported PHY */ -#define AXE_PHY_NO_MASK 0x1F -#define AXE_PHY_NO(x) ((x) & AXE_PHY_NO_MASK) +#define AXE_PHY_NO_MASK 0x1F +#define AXE_PHY_NO(x) ((x) & AXE_PHY_NO_MASK) -#define AXE_772_PHY_NO_EPHY 0x10 /* Embedded 10/100 PHY of AX88772 */ +#define AXE_772_PHY_NO_EPHY 0x10 /* Embedded 10/100 PHY of AX88772 */ -#define AXE_GPIO0_EN 0x01 -#define AXE_GPIO0 0x02 -#define AXE_GPIO1_EN 0x04 -#define AXE_GPIO1 0x08 -#define AXE_GPIO2_EN 0x10 -#define AXE_GPIO2 0x20 -#define AXE_GPIO_RELOAD_EEPROM 0x80 +#define AXE_GPIO0_EN 0x01 +#define AXE_GPIO0 0x02 +#define AXE_GPIO1_EN 0x04 +#define AXE_GPIO1 0x08 +#define AXE_GPIO2_EN 0x10 +#define AXE_GPIO2 0x20 +#define AXE_GPIO_RELOAD_EEPROM 0x80 -#define AXE_PHY_MODE_MARVELL 0x00 -#define AXE_PHY_MODE_CICADA 0x01 -#define AXE_PHY_MODE_AGERE 0x02 -#define AXE_PHY_MODE_CICADA_V2 0x05 -#define AXE_PHY_MODE_AGERE_GMII 0x06 -#define AXE_PHY_MODE_CICADA_V2_ASIX 0x09 -#define AXE_PHY_MODE_REALTEK_8211CL 0x0C -#define AXE_PHY_MODE_REALTEK_8211BN 0x0D -#define AXE_PHY_MODE_REALTEK_8251CL 0x0E -#define AXE_PHY_MODE_ATTANSIC 0x40 +#define AXE_PHY_MODE_MARVELL 0x00 +#define AXE_PHY_MODE_CICADA 0x01 +#define AXE_PHY_MODE_AGERE 0x02 +#define AXE_PHY_MODE_CICADA_V2 0x05 +#define AXE_PHY_MODE_AGERE_GMII 0x06 +#define AXE_PHY_MODE_CICADA_V2_ASIX 0x09 +#define AXE_PHY_MODE_REALTEK_8211CL 0x0C +#define AXE_PHY_MODE_REALTEK_8211BN 0x0D +#define AXE_PHY_MODE_REALTEK_8251CL 0x0E +#define AXE_PHY_MODE_ATTANSIC 0x40 /* AX88772A/AX88772B only. */ -#define AXE_SW_PHY_SELECT_EXT 0x0000 -#define AXE_SW_PHY_SELECT_EMBEDDED 0x0001 -#define AXE_SW_PHY_SELECT_AUTO 0x0002 -#define AXE_SW_PHY_SELECT_SS_MII 0x0004 -#define AXE_SW_PHY_SELECT_SS_RVRS_MII 0x0008 -#define AXE_SW_PHY_SELECT_SS_RVRS_RMII 0x000C -#define AXE_SW_PHY_SELECT_SS_ENB 0x0010 +#define AXE_SW_PHY_SELECT_EXT 0x0000 +#define AXE_SW_PHY_SELECT_EMBEDDED 0x0001 +#define AXE_SW_PHY_SELECT_AUTO 0x0002 +#define AXE_SW_PHY_SELECT_SS_MII 0x0004 +#define AXE_SW_PHY_SELECT_SS_RVRS_MII 0x0008 +#define AXE_SW_PHY_SELECT_SS_RVRS_RMII 0x000C +#define AXE_SW_PHY_SELECT_SS_ENB 0x0010 /* AX88772A/AX88772B VLAN control. */ -#define AXE_VLAN_CTRL_ENB 0x00001000 -#define AXE_VLAN_CTRL_STRIP 0x00002000 -#define AXE_VLAN_CTRL_VID1_MASK 0x00000FFF -#define AXE_VLAN_CTRL_VID2_MASK 0x0FFF0000 +#define AXE_VLAN_CTRL_ENB 0x00001000 +#define AXE_VLAN_CTRL_STRIP 0x00002000 +#define AXE_VLAN_CTRL_VID1_MASK 0x00000FFF +#define AXE_VLAN_CTRL_VID2_MASK 0x0FFF0000 -#define AXE_RXCSUM_IP 0x0001 -#define AXE_RXCSUM_IPVE 0x0002 -#define AXE_RXCSUM_IPV6E 0x0004 -#define AXE_RXCSUM_TCP 0x0008 -#define AXE_RXCSUM_UDP 0x0010 -#define AXE_RXCSUM_ICMP 0x0020 -#define AXE_RXCSUM_IGMP 0x0040 -#define AXE_RXCSUM_ICMP6 0x0080 -#define AXE_RXCSUM_TCPV6 0x0100 -#define AXE_RXCSUM_UDPV6 0x0200 -#define AXE_RXCSUM_ICMPV6 0x0400 -#define AXE_RXCSUM_IGMPV6 0x0800 -#define AXE_RXCSUM_ICMP6V6 0x1000 -#define AXE_RXCSUM_FOPC 0x8000 +#define AXE_RXCSUM_IP 0x0001 +#define AXE_RXCSUM_IPVE 0x0002 +#define AXE_RXCSUM_IPV6E 0x0004 +#define AXE_RXCSUM_TCP 0x0008 +#define AXE_RXCSUM_UDP 0x0010 +#define AXE_RXCSUM_ICMP 0x0020 +#define AXE_RXCSUM_IGMP 0x0040 +#define AXE_RXCSUM_ICMP6 0x0080 +#define AXE_RXCSUM_TCPV6 0x0100 +#define AXE_RXCSUM_UDPV6 0x0200 +#define AXE_RXCSUM_ICMPV6 0x0400 +#define AXE_RXCSUM_IGMPV6 0x0800 +#define AXE_RXCSUM_ICMP6V6 0x1000 +#define AXE_RXCSUM_FOPC 0x8000 -#define AXE_RXCSUM_64TE 0x0100 -#define AXE_RXCSUM_PPPOE 0x0200 -#define AXE_RXCSUM_RPCE 0x8000 +#define AXE_RXCSUM_64TE 0x0100 +#define AXE_RXCSUM_PPPOE 0x0200 +#define AXE_RXCSUM_RPCE 0x8000 -#define AXE_TXCSUM_IP 0x0001 -#define AXE_TXCSUM_TCP 0x0002 -#define AXE_TXCSUM_UDP 0x0004 -#define AXE_TXCSUM_ICMP 0x0008 -#define AXE_TXCSUM_IGMP 0x0010 -#define AXE_TXCSUM_ICMP6 0x0020 -#define AXE_TXCSUM_TCPV6 0x0100 -#define AXE_TXCSUM_UDPV6 0x0200 -#define AXE_TXCSUM_ICMPV6 0x0400 -#define AXE_TXCSUM_IGMPV6 0x0800 -#define AXE_TXCSUM_ICMP6V6 0x1000 +#define AXE_TXCSUM_IP 0x0001 +#define AXE_TXCSUM_TCP 0x0002 +#define AXE_TXCSUM_UDP 0x0004 +#define AXE_TXCSUM_ICMP 0x0008 +#define AXE_TXCSUM_IGMP 0x0010 +#define AXE_TXCSUM_ICMP6 0x0020 +#define AXE_TXCSUM_TCPV6 0x0100 +#define AXE_TXCSUM_UDPV6 0x0200 +#define AXE_TXCSUM_ICMPV6 0x0400 +#define AXE_TXCSUM_IGMPV6 0x0800 +#define AXE_TXCSUM_ICMP6V6 0x1000 -#define AXE_TXCSUM_64TE 0x0001 -#define AXE_TXCSUM_PPPOE 0x0002 +#define AXE_TXCSUM_64TE 0x0001 +#define AXE_TXCSUM_PPPOE 0x0002 -#define AXE_BULK_BUF_SIZE 16384 /* bytes */ +#define AXE_BULK_BUF_SIZE 16384 /* bytes */ -#define AXE_CTL_READ 0x01 -#define AXE_CTL_WRITE 0x02 +#define AXE_CTL_READ 0x01 +#define AXE_CTL_WRITE 0x02 -#define AXE_CONFIG_IDX 0 /* config number 1 */ -#define AXE_IFACE_IDX 0 +#define AXE_CONFIG_IDX 0 /* config number 1 */ +#define AXE_IFACE_IDX 0 /* EEPROM Map. */ -#define AXE_EEPROM_772B_NODE_ID 0x04 -#define AXE_EEPROM_772B_PHY_PWRCFG 0x18 +#define AXE_EEPROM_772B_NODE_ID 0x04 +#define AXE_EEPROM_772B_PHY_PWRCFG 0x18 struct ax88772b_mfb { - int byte_cnt; - int threshold; - int size; + int byte_cnt; + int threshold; + int size; }; -#define AX88772B_MFB_2K 0 -#define AX88772B_MFB_4K 1 -#define AX88772B_MFB_6K 2 -#define AX88772B_MFB_8K 3 -#define AX88772B_MFB_16K 4 -#define AX88772B_MFB_20K 5 -#define AX88772B_MFB_24K 6 -#define AX88772B_MFB_32K 7 +#define AX88772B_MFB_2K 0 +#define AX88772B_MFB_4K 1 +#define AX88772B_MFB_6K 2 +#define AX88772B_MFB_8K 3 +#define AX88772B_MFB_16K 4 +#define AX88772B_MFB_20K 5 +#define AX88772B_MFB_24K 6 +#define AX88772B_MFB_32K 7 struct axe_sframe_hdr { uint16_t len; -#define AXE_HDR_LEN_MASK 0xFFFF +#define AXE_HDR_LEN_MASK 0xFFFF uint16_t ilen; } __packed; -#define AXE_TX_CSUM_PSEUDO_HDR 0x4000 -#define AXE_TX_CSUM_DIS 0x8000 +#define AXE_TX_CSUM_PSEUDO_HDR 0x4000 +#define AXE_TX_CSUM_DIS 0x8000 /* * When RX checksum offloading is enabled, AX88772B uses new RX header - * format and it's not compatible with previous RX header format. In + * format and it's not compatible with previous RX header format. In * addition, IP header align option should be enabled to get correct - * frame size including RX header. Total transferred size including + * frame size including RX header. Total transferred size including * the RX header is multiple of 4 and controller will pad necessary * bytes if the length is not multiple of 4. * This driver does not enable partial checksum feature which will - * compute 16bit checksum from 14th byte to the end of the frame. If + * compute 16bit checksum from 14th byte to the end of the frame. If * this feature is enabled, computed checksum value is embedded into * RX header which in turn means it uses different RX header format. */ struct axe_csum_hdr { uint16_t len; -#define AXE_CSUM_HDR_LEN_MASK 0x07FF -#define AXE_CSUM_HDR_CRC_ERR 0x1000 -#define AXE_CSUM_HDR_MII_ERR 0x2000 -#define AXE_CSUM_HDR_RUNT 0x4000 -#define AXE_CSUM_HDR_BMCAST 0x8000 +#define AXE_CSUM_HDR_LEN_MASK 0x07FF +#define AXE_CSUM_HDR_CRC_ERR 0x1000 +#define AXE_CSUM_HDR_MII_ERR 0x2000 +#define AXE_CSUM_HDR_RUNT 0x4000 +#define AXE_CSUM_HDR_BMCAST 0x8000 uint16_t ilen; uint16_t cstatus; -#define AXE_CSUM_HDR_VLAN_MASK 0x0007 -#define AXE_CSUM_HDR_VLAN_STRIP 0x0008 -#define AXE_CSUM_HDR_VLAN_PRI_MASK 0x0070 -#define AXE_CSUM_HDR_L4_CSUM_ERR 0x0100 -#define AXE_CSUM_HDR_L3_CSUM_ERR 0x0200 -#define AXE_CSUM_HDR_L4_TYPE_UDP 0x0400 -#define AXE_CSUM_HDR_L4_TYPE_ICMP 0x0800 -#define AXE_CSUM_HDR_L4_TYPE_IGMP 0x0C00 -#define AXE_CSUM_HDR_L4_TYPE_TCP 0x1000 -#define AXE_CSUM_HDR_L4_TYPE_TCPV6 0x1400 -#define AXE_CSUM_HDR_L4_TYPE_MASK 0x1C00 -#define AXE_CSUM_HDR_L3_TYPE_IPV4 0x2000 -#define AXE_CSUM_HDR_L3_TYPE_IPV6 0x4000 +#define AXE_CSUM_HDR_VLAN_MASK 0x0007 +#define AXE_CSUM_HDR_VLAN_STRIP 0x0008 +#define AXE_CSUM_HDR_VLAN_PRI_MASK 0x0070 +#define AXE_CSUM_HDR_L4_CSUM_ERR 0x0100 +#define AXE_CSUM_HDR_L3_CSUM_ERR 0x0200 +#define AXE_CSUM_HDR_L4_TYPE_UDP 0x0400 +#define AXE_CSUM_HDR_L4_TYPE_ICMP 0x0800 +#define AXE_CSUM_HDR_L4_TYPE_IGMP 0x0C00 +#define AXE_CSUM_HDR_L4_TYPE_TCP 0x1000 +#define AXE_CSUM_HDR_L4_TYPE_TCPV6 0x1400 +#define AXE_CSUM_HDR_L4_TYPE_MASK 0x1C00 +#define AXE_CSUM_HDR_L3_TYPE_IPV4 0x2000 +#define AXE_CSUM_HDR_L3_TYPE_IPV6 0x4000 #ifdef AXE_APPEND_PARTIAL_CSUM /* * These members present only when partial checksum - * offloading is enabled. The checksum value is simple + * offloading is enabled. The checksum value is simple * 16bit sum of received frame starting at offset 14 of * the frame to the end of the frame excluding FCS bytes. */ @@ -340,9 +338,9 @@ struct axe_csum_hdr { #endif } __packed; -#define AXE_CSUM_RXBYTES(x) ((x) & AXE_CSUM_HDR_LEN_MASK) +#define AXE_CSUM_RXBYTES(x) ((x) & AXE_CSUM_HDR_LEN_MASK) -#define GET_MII(sc) uether_getmii(&(sc)->sc_ue) +#define GET_MII(sc) uether_getmii(&(sc)->sc_ue) /* The interrupt endpoint is currently unused by the ASIX part. */ enum { @@ -352,38 +350,37 @@ enum { }; struct axe_softc { - struct usb_ether sc_ue; - struct mtx sc_mtx; - struct usb_xfer *sc_xfer[AXE_N_TRANSFER]; - int sc_phyno; + struct usb_ether sc_ue; + struct mtx sc_mtx; + struct usb_xfer *sc_xfer[AXE_N_TRANSFER]; + int sc_phyno; unsigned int sc_flags; uint16_t sc_link_status; -#define AXE_FLAG_LINK 0x0001 -#define AXE_FLAG_STD_FRAME 0x0010 -#define AXE_FLAG_CSUM_FRAME 0x0020 -#define AXE_FLAG_772 0x1000 /* AX88772 */ -#define AXE_FLAG_772A 0x2000 /* AX88772A */ -#define AXE_FLAG_772B 0x4000 /* AX88772B */ -#define AXE_FLAG_178 0x8000 /* AX88178 */ +#define AXE_FLAG_LINK 0x0001 +#define AXE_FLAG_STD_FRAME 0x0010 +#define AXE_FLAG_CSUM_FRAME 0x0020 +#define AXE_FLAG_772 0x1000 /* AX88772 */ +#define AXE_FLAG_772A 0x2000 /* AX88772A */ +#define AXE_FLAG_772B 0x4000 /* AX88772B */ +#define AXE_FLAG_178 0x8000 /* AX88178 */ - uint8_t sc_ipgs[3]; - uint8_t sc_phyaddrs[2]; - uint16_t sc_pwrcfg; - uint16_t sc_lenmask; + uint8_t sc_ipgs[3]; + uint8_t sc_phyaddrs[2]; + uint16_t sc_pwrcfg; + uint16_t sc_lenmask; uint8_t rx_chklink_cnt; #define EVENT_LINK 0x00000001 }; -#define AXE_IS_178_FAMILY(sc) \ - ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B | \ - AXE_FLAG_178)) +#define AXE_IS_178_FAMILY(sc) \ + ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B | \ + AXE_FLAG_178)) -#define AXE_IS_772(sc) \ - ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B)) - -#define AXE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define AXE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define AXE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) +#define AXE_IS_772(sc) \ + ((sc)->sc_flags & (AXE_FLAG_772 | AXE_FLAG_772A | AXE_FLAG_772B)) +#define AXE_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define AXE_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define AXE_LOCK_ASSERT(_sc, t) mtx_assert(&(_sc)->sc_mtx, t) #endif diff --git a/sys/dev/usb/net/if_axge.c b/sys/dev/usb/net/if_axge.c index 3b0f199..ff2f34c 100644 --- a/sys/dev/usb/net/if_axge.c +++ b/sys/dev/usb/net/if_axge.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. @@ -27,10 +27,9 @@ */ #include -__FBSDID("$FreeBSD$"); - /* - * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + * ASIX Electronics AX88178A/AX88179/AX88179A USB 2.0/3.0 gigabit ethernet + * driver. */ #include diff --git a/sys/dev/usb/net/if_axgereg.h b/sys/dev/usb/net/if_axgereg.h index b2e4c4c..5e0d111 100644 --- a/sys/dev/usb/net/if_axgereg.h +++ b/sys/dev/usb/net/if_axgereg.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013-2014 Kevin Lo * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #define AXE_FLAG_178A 0x10000 /* AX88178A */ @@ -36,10 +34,14 @@ #define AXGE_ACCESS_EEPROM 0x04 #define AXGE_ACCESS_EFUSE 0x05 #define AXGE_RELOAD_EEPROM_EFUSE 0x06 +#define AXGE_FW_MODE 0x08 #define AXGE_WRITE_EFUSE_EN 0x09 #define AXGE_WRITE_EFUSE_DIS 0x0A #define AXGE_ACCESS_MFAB 0x10 +#define AXGE_FW_MODE_178A179 0x0000 +#define AXGE_FW_MODE_179A 0x0001 + /* Physical link status register */ #define AXGE_PLSR 0x02 #define PLSR_USB_FS 0x01 diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c index 341d78f..97d91bf 100644 --- a/sys/dev/usb/net/if_cdce.c +++ b/sys/dev/usb/net/if_cdce.c @@ -48,7 +48,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include "los_crc32.h" diff --git a/sys/dev/usb/net/if_cdcereg.h b/sys/dev/usb/net/if_cdcereg.h index 7150d67..0796a32 100644 --- a/sys/dev/usb/net/if_cdcereg.h +++ b/sys/dev/usb/net/if_cdcereg.h @@ -30,8 +30,6 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _USB_IF_CDCEREG_H_ diff --git a/sys/dev/usb/net/if_urndis.c b/sys/dev/usb/net/if_urndis.c index 300edbc..5755850 100644 --- a/sys/dev/usb/net/if_urndis.c +++ b/sys/dev/usb/net/if_urndis.c @@ -21,7 +21,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include #include diff --git a/sys/dev/usb/net/if_urndisreg.h b/sys/dev/usb/net/if_urndisreg.h index d908fcf..3da57c2 100644 --- a/sys/dev/usb/net/if_urndisreg.h +++ b/sys/dev/usb/net/if_urndisreg.h @@ -1,4 +1,3 @@ -/* $FreeBSD$ */ /* $OpenBSD: if_urndisreg.h,v 1.19 2013/11/21 14:08:05 mpi Exp $ */ /* diff --git a/sys/dev/usb/net/usb_ethernet.c b/sys/dev/usb/net/usb_ethernet.c index 12e80f1..16cb391 100644 --- a/sys/dev/usb/net/usb_ethernet.c +++ b/sys/dev/usb/net/usb_ethernet.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009 Andrew Thompson (thompsa@FreeBSD.org) * @@ -27,7 +26,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include @@ -289,7 +287,7 @@ ue_attach_post_task(struct usb_proc_msg *_task) UE_UNLOCK(ue); - callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0); + usb_callout_init_mtx(&ue->ue_watchdog, ue->ue_mtx, 0); error = 0; sc = if_alloc(); @@ -360,7 +358,7 @@ uether_ifdetach(struct usb_ether *ue) UE_UNLOCK(ue); /* drain any callouts */ - callout_drain(&ue->ue_watchdog); + usb_callout_drain(&ue->ue_watchdog); /* detach ethernet */ for (;;) { @@ -431,7 +429,7 @@ ue_start_task(struct usb_proc_msg *_task) return; if (ue->ue_methods->ue_tick != NULL) - callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); + usb_callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); } static void @@ -443,7 +441,7 @@ ue_stop_task(struct usb_proc_msg *_task) UE_LOCK_ASSERT(ue, MA_OWNED); - callout_stop(&ue->ue_watchdog); + usb_callout_stop(&ue->ue_watchdog); ue->ue_methods->ue_stop(ue); } @@ -503,7 +501,7 @@ ue_watchdog(void *arg) &ue->ue_tick_task[0].hdr, &ue->ue_tick_task[1].hdr); - callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); + usb_callout_reset(&ue->ue_watchdog, hz, ue_watchdog, ue); } static void diff --git a/sys/dev/usb/net/usb_ethernet.h b/sys/dev/usb/net/usb_ethernet.h index 65f3a9e..2ae512c 100644 --- a/sys/dev/usb/net/usb_ethernet.h +++ b/sys/dev/usb/net/usb_ethernet.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -24,8 +23,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _USB_ETHERNET_H_ @@ -118,7 +115,7 @@ struct usb_ether { struct usb_process ue_tq; struct ifqueue ue_rxq; struct ifqueue ue_txq; - struct callout ue_watchdog; + struct usb_callout ue_watchdog; struct usb_ether_cfg_task ue_sync_task[2]; struct usb_ether_cfg_task ue_media_task[2]; struct usb_ether_cfg_task ue_multi_task[2]; diff --git a/sys/dev/usb/quirk/usb_quirk.c b/sys/dev/usb/quirk/usb_quirk.c index 4114b2d..ee012bd 100644 --- a/sys/dev/usb/quirk/usb_quirk.c +++ b/sys/dev/usb/quirk/usb_quirk.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. @@ -622,7 +621,7 @@ usb_test_quirk_by_info(const struct usbd_lookup_info *info, uint16_t quirk) if (quirk == UQ_NONE) goto done; - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); for (x = 0; x != USB_DEV_QUIRKS_MAX; x++) { /* see if quirk information does not match */ @@ -646,15 +645,13 @@ usb_test_quirk_by_info(const struct usbd_lookup_info *info, uint16_t quirk) /* lookup quirk */ for (y = 0; y != USB_SUB_QUIRKS_MAX; y++) { if (usb_quirks[x].quirks[y] == quirk) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); DPRINTF("Found quirk '%s'.\n", usb_quirkstr(quirk)); return (1); } } - /* no quirk found */ - break; } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); done: return (0); /* no quirk match */ } @@ -665,7 +662,7 @@ usb_quirk_get_entry(uint16_t vid, uint16_t pid, { uint16_t x; - mtx_assert(&usb_quirk_mtx, MA_OWNED); + USB_MTX_ASSERT(&usb_quirk_mtx, MA_OWNED); if ((vid | pid | lo_rev | hi_rev) == 0) { /* all zero - special case */ @@ -735,7 +732,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, if (y >= USB_DEV_QUIRKS_MAX) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); /* copy out data */ pgq->vid = usb_quirks[y].vid; pgq->pid = usb_quirks[y].pid; @@ -744,7 +741,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, (void)strlcpy(pgq->quirkname, usb_quirkstr(usb_quirks[y].quirks[x]), sizeof(pgq->quirkname)); - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ case USB_QUIRK_NAME_GET: @@ -777,11 +774,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 1); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -790,7 +787,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, break; } } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); if (x == USB_SUB_QUIRKS_MAX) { return (ENOMEM); } @@ -815,11 +812,11 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, if (y == UQ_NONE) { return (EINVAL); } - mtx_lock(&usb_quirk_mtx); + USB_MTX_LOCK(&usb_quirk_mtx); pqe = usb_quirk_get_entry(pgq->vid, pgq->pid, pgq->bcdDeviceLow, pgq->bcdDeviceHigh, 0); if (pqe == NULL) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (EINVAL); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -829,7 +826,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, } } if (x == USB_SUB_QUIRKS_MAX) { - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (ENOMEM); } for (x = 0; x != USB_SUB_QUIRKS_MAX; x++) { @@ -841,7 +838,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr_t data, /* all quirk entries are unused - release */ (void)memset_s(pqe, sizeof(*pqe), 0, sizeof(*pqe)); } - mtx_unlock(&usb_quirk_mtx); + USB_MTX_UNLOCK(&usb_quirk_mtx); return (0); /* success */ default: diff --git a/sys/dev/usb/quirk/usb_quirk.h b/sys/dev/usb/quirk/usb_quirk.h index 92e49e7..fd9135f 100644 --- a/sys/dev/usb/quirk/usb_quirk.h +++ b/sys/dev/usb/quirk/usb_quirk.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/serial/u3g.c b/sys/dev/usb/serial/u3g.c index fe74646..33cc180 100644 --- a/sys/dev/usb/serial/u3g.c +++ b/sys/dev/usb/serial/u3g.c @@ -15,8 +15,6 @@ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * $FreeBSD$ */ /* diff --git a/sys/dev/usb/serial/usb_serial.c b/sys/dev/usb/serial/usb_serial.c index ddbaeda..5b4cb9d 100644 --- a/sys/dev/usb/serial/usb_serial.c +++ b/sys/dev/usb/serial/usb_serial.c @@ -1,7 +1,7 @@ /* $NetBSD: ucom.c,v 1.40 2001/11/13 06:24:54 lukem Exp $ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001-2003, 2005, 2008 * Shunsuke Akiyama . @@ -30,8 +30,6 @@ */ #include -__FBSDID("$FreeBSD$"); - /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/serial/usb_serial.h b/sys/dev/usb/serial/usb_serial.h index c925fda..0d7b41a 100644 --- a/sys/dev/usb/serial/usb_serial.h +++ b/sys/dev/usb/serial/usb_serial.h @@ -1,8 +1,7 @@ /* $NetBSD: ucomvar.h,v 1.9 2001/01/23 21:56:17 augustss Exp $ */ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD AND BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2001-2002, Shunsuke Akiyama . * All rights reserved. @@ -96,23 +95,23 @@ struct tty{ * while it is open! */ struct ucom_callback { - void (*ucom_cfg_get_status) (struct ucom_softc *, uint8_t *plsr, uint8_t *pmsr); - void (*ucom_cfg_set_dtr) (struct ucom_softc *, uint8_t); - void (*ucom_cfg_set_rts) (struct ucom_softc *, uint8_t); - void (*ucom_cfg_set_break) (struct ucom_softc *, uint8_t); - void (*ucom_cfg_set_ring) (struct ucom_softc *, uint8_t); - void (*ucom_cfg_param) (struct ucom_softc *, struct termios *); - void (*ucom_cfg_open) (struct ucom_softc *); - void (*ucom_cfg_close) (struct ucom_softc *); - int (*ucom_pre_open) (struct ucom_softc *); - int (*ucom_pre_param) (struct ucom_softc *, struct termios *); - int (*ucom_ioctl) (struct ucom_softc *, uint32_t, caddr_t, int, struct thread *); - void (*ucom_start_read) (struct ucom_softc *); - void (*ucom_stop_read) (struct ucom_softc *); - void (*ucom_start_write) (struct ucom_softc *); - void (*ucom_stop_write) (struct ucom_softc *); - void (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t unit, uint16_t subunit); - void (*ucom_poll) (struct ucom_softc *); + void (*ucom_cfg_get_status) (struct ucom_softc *, uint8_t *plsr, uint8_t *pmsr); + void (*ucom_cfg_set_dtr) (struct ucom_softc *, uint8_t); + void (*ucom_cfg_set_rts) (struct ucom_softc *, uint8_t); + void (*ucom_cfg_set_break) (struct ucom_softc *, uint8_t); + void (*ucom_cfg_set_ring) (struct ucom_softc *, uint8_t); + void (*ucom_cfg_param) (struct ucom_softc *, struct termios *); + void (*ucom_cfg_open) (struct ucom_softc *); + void (*ucom_cfg_close) (struct ucom_softc *); + int (*ucom_pre_open) (struct ucom_softc *); + int (*ucom_pre_param) (struct ucom_softc *, struct termios *); + int (*ucom_ioctl) (struct ucom_softc *, uint32_t, caddr_t, int, struct thread *); + void (*ucom_start_read) (struct ucom_softc *); + void (*ucom_stop_read) (struct ucom_softc *); + void (*ucom_start_write) (struct ucom_softc *); + void (*ucom_stop_write) (struct ucom_softc *); + void (*ucom_tty_name) (struct ucom_softc *, char *pbuf, uint16_t buflen, uint16_t unit, uint16_t subunit); + void (*ucom_poll) (struct ucom_softc *); void (*ucom_free) (struct ucom_softc *); }; @@ -207,9 +206,9 @@ struct ucom_softc { uint8_t sc_jitterbuf[UCOM_JITTERBUF_SIZE]; }; -#define UCOM_MTX_ASSERT(sc, what) mtx_assert((sc)->sc_mtx, what) -#define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx) -#define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx) +#define UCOM_MTX_ASSERT(sc, what) USB_MTX_ASSERT((sc)->sc_mtx, what) +#define UCOM_MTX_LOCK(sc) USB_MTX_LOCK((sc)->sc_mtx) +#define UCOM_MTX_UNLOCK(sc) USB_MTX_UNLOCK((sc)->sc_mtx) #define UCOM_UNLOAD_DRAIN(x) #define ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \ diff --git a/sys/dev/usb/storage/umass.c b/sys/dev/usb/storage/umass.c index 1bf5300..d172d96 100644 --- a/sys/dev/usb/storage/umass.c +++ b/sys/dev/usb/storage/umass.c @@ -1,8 +1,6 @@ #include -__FBSDID("$FreeBSD$"); - /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1999 MAEKAWA Masahide , * Nick Hibma @@ -28,8 +26,6 @@ __FBSDID("$FreeBSD$"); * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ * $NetBSD: umass.c,v 1.28 2000/04/02 23:46:53 augustss Exp $ */ diff --git a/sys/dev/usb/usb.h b/sys/dev/usb/usb.h index fb24520..120d43b 100644 --- a/sys/dev/usb/usb.h +++ b/sys/dev/usb/usb.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. @@ -440,7 +439,9 @@ typedef struct usb_interface_assoc_descriptor usb_interface_assoc_descriptor_t; #define UISUBCLASS_ETHERNET_EMULATION_MODEL 12 #define UISUBCLASS_NETWORK_CONTROL_MODEL 13 +#define UIPROTO_CDC_NONE 0 #define UIPROTO_CDC_AT 1 +#define UIPROTO_CDC_EEM 7 #define UICLASS_HID 0x03 #define UISUBCLASS_BOOT 1 diff --git a/sys/dev/usb/usb_bus.h b/sys/dev/usb/usb_bus.h index 4f821b7..0a18a91 100644 --- a/sys/dev/usb/usb_bus.h +++ b/sys/dev/usb/usb_bus.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved. * @@ -89,7 +88,7 @@ struct usb_bus { struct mtx bus_mtx; struct mtx bus_spin_lock; struct usb_xfer_queue intr_q; - struct callout power_wdog; /* power management */ + struct usb_callout power_wdog; /* power management */ device_t parent; device_t bdev; /* filled by HC driver */ diff --git a/sys/dev/usb/usb_busdma.h b/sys/dev/usb/usb_busdma.h index 0740cf7..27310c8 100644 --- a/sys/dev/usb/usb_busdma.h +++ b/sys/dev/usb/usb_busdma.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_cdc.h b/sys/dev/usb/usb_cdc.h index 0bc1bdc..70aff65 100644 --- a/sys/dev/usb/usb_cdc.h +++ b/sys/dev/usb/usb_cdc.h @@ -1,8 +1,7 @@ /* $NetBSD: usbcdc.h,v 1.9 2004/10/23 13:24:24 augustss Exp $ */ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/usb_controller.h b/sys/dev/usb/usb_controller.h index b27881a..70f5fca 100644 --- a/sys/dev/usb/usb_controller.h +++ b/sys/dev/usb/usb_controller.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -188,13 +187,13 @@ struct usb_hw_ep_profile { extern int hi_xhci_take_controller(device_t self); /* prototypes */ -void usb_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); -uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb); -void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); +void usb_bus_mem_flush_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); +uint8_t usb_bus_mem_alloc_all(struct usb_bus *bus, bus_dma_tag_t dmat, usb_bus_mem_cb_t *cb); +void usb_bus_mem_free_all(struct usb_bus *bus, usb_bus_mem_cb_t *cb); uint16_t usb_isoc_time_expand(struct usb_bus *bus, uint16_t isoc_time_curr); -void usb_bus_reset_async_locked(struct usb_bus *bus); +void usb_bus_reset_async_locked(struct usb_bus *bus); #if USB_HAVE_TT_SUPPORT -uint8_t usbd_fs_isoc_schedule_alloc_slot(struct usb_xfer *isoc_xfer, uint16_t isoc_time); +uint8_t usbd_fs_isoc_schedule_alloc_slot(struct usb_xfer *isoc_xfer, uint16_t isoc_time); #endif #endif /* _USB_CONTROLLER_H_ */ diff --git a/sys/dev/usb/usb_core.c b/sys/dev/usb/usb_core.c index 0df6c30..a4c800b 100644 --- a/sys/dev/usb/usb_core.c +++ b/sys/dev/usb/usb_core.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_core.h b/sys/dev/usb/usb_core.h index 2ac4532..af0a476 100644 --- a/sys/dev/usb/usb_core.h +++ b/sys/dev/usb/usb_core.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -41,18 +40,20 @@ USB_MODE_DEVICE ? (((xfer)->endpointno & UE_DIR_IN) ? 0 : 1) : \ (((xfer)->endpointno & UE_DIR_IN) ? 1 : 0)) -/* macros */ +/* locking wrappers for BUS lock */ +#define USB_BUS_LOCK(_b) USB_MTX_LOCK(&(_b)->bus_mtx) +#define USB_BUS_UNLOCK(_b) USB_MTX_UNLOCK(&(_b)->bus_mtx) +#define USB_BUS_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_mtx, _t) -#define USB_BUS_LOCK(_b) (void)mtx_lock(&(_b)->bus_mtx) -#define USB_BUS_UNLOCK(_b) (void)mtx_unlock(&(_b)->bus_mtx) +/* locking wrappers for BUS spin lock */ +#define USB_BUS_SPIN_LOCK(_b) USB_MTX_LOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_UNLOCK(_b) USB_MTX_UNLOCK_SPIN(&(_b)->bus_spin_lock) +#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) USB_MTX_ASSERT(&(_b)->bus_spin_lock, _t) -#define USB_BUS_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_mtx, _t) -#define USB_BUS_SPIN_LOCK(_b) mtx_lock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_UNLOCK(_b) mtx_unlock_spin(&(_b)->bus_spin_lock) -#define USB_BUS_SPIN_LOCK_ASSERT(_b, _t) mtx_assert(&(_b)->bus_spin_lock, _t) -#define USB_XFER_LOCK(_x) (void)mtx_lock((_x)->xroot->xfer_mtx) -#define USB_XFER_UNLOCK(_x) (void)mtx_unlock((_x)->xroot->xfer_mtx) -#define USB_XFER_LOCK_ASSERT(_x, _t) mtx_assert((_x)->xroot->xfer_mtx, _t) +/* locking wrappers for XFER lock */ +#define USB_XFER_LOCK(_x) USB_MTX_LOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_UNLOCK(_x) USB_MTX_UNLOCK((_x)->xroot->xfer_mtx) +#define USB_XFER_LOCK_ASSERT(_x, _t) USB_MTX_ASSERT((_x)->xroot->xfer_mtx, _t) /* helper for converting pointers to integers */ #define USB_P2U(ptr) \ @@ -128,7 +129,7 @@ struct usb_xfer_flags_int { * The following structure defines an USB transfer. */ struct usb_xfer { - struct callout timeout_handle; + struct usb_callout timeout_handle; TAILQ_ENTRY(usb_xfer) wait_entry; /* used at various places */ struct usb_page_cache *buf_fixup; /* fixup buffer(s) */ diff --git a/sys/dev/usb/usb_debug.c b/sys/dev/usb/usb_debug.c index 3742c0b..9039fde 100644 --- a/sys/dev/usb/usb_debug.c +++ b/sys/dev/usb/usb_debug.c @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2022 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/usb/usb_debug.h b/sys/dev/usb/usb_debug.h index bee4102..b8548a4 100644 --- a/sys/dev/usb/usb_debug.h +++ b/sys/dev/usb/usb_debug.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_dev.c b/sys/dev/usb/usb_dev.c index bbe5390..db7c67c 100644 --- a/sys/dev/usb/usb_dev.c +++ b/sys/dev/usb/usb_dev.c @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2006-2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2006-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/usb/usb_dev.h b/sys/dev/usb/usb_dev.h index 2426b32..4f982a9 100644 --- a/sys/dev/usb/usb_dev.h +++ b/sys/dev/usb/usb_dev.h @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/usb/usb_device.c b/sys/dev/usb/usb_device.c index e9ba632..6c81850 100644 --- a/sys/dev/usb/usb_device.c +++ b/sys/dev/usb/usb_device.c @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -1439,13 +1438,13 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) /* Change lock */ USB_BUS_UNLOCK(udev->bus); - mtx_lock(&udev->device_mtx); + USB_MTX_LOCK(&udev->device_mtx); /* Start clear stall callback */ usbd_transfer_start(udev->ctrl_xfer[1]); /* Change lock */ - mtx_unlock(&udev->device_mtx); + USB_MTX_UNLOCK(&udev->device_mtx); USB_BUS_LOCK(udev->bus); } diff --git a/sys/dev/usb/usb_device.h b/sys/dev/usb/usb_device.h index 0b1dd32..2c9898e 100644 --- a/sys/dev/usb/usb_device.h +++ b/sys/dev/usb/usb_device.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008-2019 Hans Petter Selasky. All rights reserved. * @@ -302,6 +301,7 @@ struct usb_device *usb_alloc_device(device_t parent_dev, struct usb_bus *bus, struct usb_fs_privdata *usb_make_dev(struct usb_device *, const char *, int, int, int, uid_t, gid_t, int); void usb_destroy_dev(struct usb_fs_privdata *); +void usb_destroy_dev_sync(struct usb_fs_privdata *); #endif usb_error_t usb_probe_and_attach(struct usb_device *udev, uint8_t iface_index); @@ -321,7 +321,13 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_device *udev, struct usb_en void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); +#if USB_HAVE_UGEN +uint8_t usbd_enum_lock_sig(struct usb_device *); +#endif void usbd_enum_unlock(struct usb_device *); void usbd_sr_lock(struct usb_device *); void usbd_sr_unlock(struct usb_device *); diff --git a/sys/dev/usb/usb_dynamic.c b/sys/dev/usb/usb_dynamic.c index efbde3b..3b9fbda 100644 --- a/sys/dev/usb/usb_dynamic.c +++ b/sys/dev/usb/usb_dynamic.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_dynamic.h b/sys/dev/usb/usb_dynamic.h index 9644e94..15327f5 100644 --- a/sys/dev/usb/usb_dynamic.h +++ b/sys/dev/usb/usb_dynamic.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -44,11 +43,13 @@ typedef uint8_t (usb_test_quirk_t)(const struct usbd_lookup_info *info, typedef int (usb_quirk_ioctl_t)(unsigned long cmd, caddr_t data, int fflag, struct thread *td); typedef void (usb_temp_unsetup_t)(struct usb_device *udev); +typedef void (usb_linux_free_device_t)(struct usb_device *udev); /* global function pointers */ extern usb_handle_req_t *usb_temp_get_desc_p; extern usb_temp_setup_by_index_t *usb_temp_setup_by_index_p; +extern usb_linux_free_device_t *usb_linux_free_device_p; extern usb_temp_unsetup_t *usb_temp_unsetup_p; extern usb_test_quirk_t *usb_test_quirk_p; extern usb_quirk_ioctl_t *usb_quirk_ioctl_p; @@ -56,6 +57,7 @@ extern devclass_t usb_devclass_ptr; /* function prototypes */ +void usb_linux_unload(void *); void usb_temp_unload(void *); void usb_quirk_unload(void *); void usb_bus_unload(void *); diff --git a/sys/dev/usb/usb_endian.h b/sys/dev/usb/usb_endian.h index a35f5fc..115eb4b 100644 --- a/sys/dev/usb/usb_endian.h +++ b/sys/dev/usb/usb_endian.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /* - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_error.c b/sys/dev/usb/usb_error.c index c487fd4..342c44e 100644 --- a/sys/dev/usb/usb_error.c +++ b/sys/dev/usb/usb_error.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_freebsd_loader.h b/sys/dev/usb/usb_freebsd_loader.h index fddac3c..70d8ca4 100644 --- a/sys/dev/usb/usb_freebsd_loader.h +++ b/sys/dev/usb/usb_freebsd_loader.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2013 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_generic.c b/sys/dev/usb/usb_generic.c index cd5597f..9eed682 100644 --- a/sys/dev/usb/usb_generic.c +++ b/sys/dev/usb/usb_generic.c @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2008-2022 Hans Petter Selasky + * Copyright (c) 2008-2023 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/sys/dev/usb/usb_generic.h b/sys/dev/usb/usb_generic.h index fe59310..9b93b22 100644 --- a/sys/dev/usb/usb_generic.h +++ b/sys/dev/usb/usb_generic.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_handle_request.c b/sys/dev/usb/usb_handle_request.c index 677164d..0f11a3c 100644 --- a/sys/dev/usb/usb_handle_request.c +++ b/sys/dev/usb/usb_handle_request.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_hid.c b/sys/dev/usb/usb_hid.c index bf413ce..f6f16d4 100644 --- a/sys/dev/usb/usb_hid.c +++ b/sys/dev/usb/usb_hid.c @@ -1,7 +1,6 @@ -/* $FreeBSD$ */ /* $NetBSD: hid.c,v 1.17 2001/11/13 06:24:53 lukem Exp $ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index db1f116..b4108cb 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. diff --git a/sys/dev/usb/usb_hub.h b/sys/dev/usb/usb_hub.h index 3d4e083..ffeabc7 100644 --- a/sys/dev/usb/usb_hub.h +++ b/sys/dev/usb/usb_hub.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_ioctl.h b/sys/dev/usb/usb_ioctl.h index 7f45c5c..712a3ea 100644 --- a/sys/dev/usb/usb_ioctl.h +++ b/sys/dev/usb/usb_ioctl.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. diff --git a/sys/dev/usb/usb_lookup.c b/sys/dev/usb/usb_lookup.c index a909f8d..41ff301 100644 --- a/sys/dev/usb/usb_lookup.c +++ b/sys/dev/usb/usb_lookup.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_mbuf.c b/sys/dev/usb/usb_mbuf.c index a7e53ab..0c54d88 100644 --- a/sys/dev/usb/usb_mbuf.c +++ b/sys/dev/usb/usb_mbuf.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_mbuf.h b/sys/dev/usb/usb_mbuf.h index 2466e2e..16fbe87 100644 --- a/sys/dev/usb/usb_mbuf.h +++ b/sys/dev/usb/usb_mbuf.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_parse.c b/sys/dev/usb/usb_parse.c index ac13f3c..66945ea 100644 --- a/sys/dev/usb/usb_parse.c +++ b/sys/dev/usb/usb_parse.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008-2020 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_process.c b/sys/dev/usb/usb_process.c index 51fd592..f265cae 100644 --- a/sys/dev/usb/usb_process.c +++ b/sys/dev/usb/usb_process.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -68,7 +67,7 @@ usb_process_thread(UINTPTR para) sched_prio(td, up->up_prio); thread_unlock(td); - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); up->up_curtd = td; while (1) { @@ -151,7 +150,7 @@ usb_process_thread(UINTPTR para) up->up_ptr = NULL; (void)cv_signal(&up->up_cv); - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); USB_THREAD_EXIT(0); return NULL; } @@ -433,7 +432,7 @@ usb_proc_drain(struct usb_process *up) mtx_assert(up->up_mtx, MA_NOTOWNED); } - mtx_lock(up->up_mtx); + USB_MTX_LOCK(up->up_mtx); /* Set the gone flag */ @@ -458,7 +457,7 @@ usb_proc_drain(struct usb_process *up) DPRINTF("WARNING: Someone is waiting " "for USB process drain!\n"); } - mtx_unlock(up->up_mtx); + USB_MTX_UNLOCK(up->up_mtx); } /*------------------------------------------------------------------------* diff --git a/sys/dev/usb/usb_request.c b/sys/dev/usb/usb_request.c index 501e607..361b783 100644 --- a/sys/dev/usb/usb_request.c +++ b/sys/dev/usb/usb_request.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. * Copyright (c) 1998 Lennart Augustsson. All rights reserved. diff --git a/sys/dev/usb/usb_request.h b/sys/dev/usb/usb_request.h index 7c65313..56a4003 100644 --- a/sys/dev/usb/usb_request.h +++ b/sys/dev/usb/usb_request.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_transfer.c b/sys/dev/usb/usb_transfer.c index de7b3f1..f223b5b 100644 --- a/sys/dev/usb/usb_transfer.c +++ b/sys/dev/usb/usb_transfer.c @@ -1,8 +1,7 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2008-2021 Hans Petter Selasky. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -298,7 +297,10 @@ usbd_transfer_setup_sub_malloc(struct usb_setup_params *parm, pc->page_start = pg; USB_MTX_LOCK(pc->tag_parent->mtx); - (void)usb_pc_load_mem(pc, size, 1 /* synchronous */ ); + if (usb_pc_load_mem(pc, size, 1 /* synchronous */ )) { + USB_MTX_UNLOCK(pc->tag_parent->mtx); + return (1); /* failure */ + } USB_MTX_UNLOCK(pc->tag_parent->mtx); } } @@ -1039,7 +1041,7 @@ usbd_transfer_setup(struct usb_device *udev, xfer->priv_sc = priv_sc; xfer->xroot = info; - callout_init_mtx(&xfer->timeout_handle, + usb_callout_init_mtx(&xfer->timeout_handle, &udev->bus->bus_mtx, 0); } else { /* @@ -1349,7 +1351,7 @@ usbd_transfer_unsetup(struct usb_xfer **pxfer, uint16_t n_setup) xfer->endpoint->refcount_alloc--; USB_BUS_UNLOCK(info->bus); - callout_drain(&xfer->timeout_handle); + usb_callout_drain(&xfer->timeout_handle); USB_BUS_LOCK(info->bus); @@ -2484,7 +2486,7 @@ usbd_transfer_done(struct usb_xfer *xfer, usb_error_t error) xfer->error = error; /* stop any callouts */ - callout_stop(&xfer->timeout_handle); + usb_callout_stop(&xfer->timeout_handle); /* * If we are waiting on a queue, just remove the USB transfer @@ -2744,7 +2746,7 @@ usbd_transfer_timeout_ms(struct usb_xfer *xfer, USB_BUS_LOCK_ASSERT(xfer->xroot->bus, MA_OWNED); /* defer delay */ - callout_reset(&xfer->timeout_handle, + usb_callout_reset(&xfer->timeout_handle, USB_MS_TO_TICKS(ms) + USB_CALLOUT_ZERO_TICKS, cb, xfer); } diff --git a/sys/dev/usb/usb_transfer.h b/sys/dev/usb/usb_transfer.h index 52647eb..5869d3d 100644 --- a/sys/dev/usb/usb_transfer.h +++ b/sys/dev/usb/usb_transfer.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usb_util.c b/sys/dev/usb/usb_util.c index 16a4318..b0eb931 100644 --- a/sys/dev/usb/usb_util.c +++ b/sys/dev/usb/usb_util.c @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008-2022 Hans Petter Selasky * diff --git a/sys/dev/usb/usb_util.h b/sys/dev/usb/usb_util.h index 1bb20b8..711a6b8 100644 --- a/sys/dev/usb/usb_util.h +++ b/sys/dev/usb/usb_util.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * diff --git a/sys/dev/usb/usbdi.h b/sys/dev/usb/usbdi.h index b9fadff..89451bc 100644 --- a/sys/dev/usb/usbdi.h +++ b/sys/dev/usb/usbdi.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009 Andrew Thompson * @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _USB_USBDI_H_ #define _USB_USBDI_H_ @@ -433,7 +431,25 @@ struct usb_attach_arg { * The following is a wrapper for the callout structure to ease * porting the code to other platforms. */ - +struct usb_callout { + struct callout co; +}; +#define usb_callout_init_mtx(c,m,f) callout_init_mtx(&(c)->co,m,f) +#define usb_callout_reset(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_reset_sbt(c,...) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) \ + callout_reset_sbt(&(c)->co, __VA_ARGS__); \ +} while (0) +#define usb_callout_stop(c) do { \ + if (!USB_IN_POLLING_MODE_FUNC()) { \ + callout_stop(&(c)->co); \ + } \ +} while (0) +#define usb_callout_drain(c) callout_drain(&(c)->co) +#define usb_callout_pending(c) callout_pending(&(c)->co) /* USB transfer states */ diff --git a/sys/dev/usb/usbdi_util.h b/sys/dev/usb/usbdi_util.h index 45bbca4..7816d29 100644 --- a/sys/dev/usb/usbdi_util.h +++ b/sys/dev/usb/usbdi_util.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2009 Andrew Thompson * @@ -22,8 +22,6 @@ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _USB_USBDI_UTIL_H_ #define _USB_USBDI_UTIL_H_ diff --git a/sys/dev/usb/usbhid.h b/sys/dev/usb/usbhid.h index 3eaac41..f48f464 100644 --- a/sys/dev/usb/usbhid.h +++ b/sys/dev/usb/usbhid.h @@ -1,6 +1,5 @@ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-NetBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * Copyright (c) 1998 The NetBSD Foundation, Inc. All rights reserved. diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 8a925a2..9904943 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -37,7 +37,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include #include diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 992ff2b..5e7119f 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1997,1998,2003 Doug Rabson * All rights reserved. @@ -27,7 +27,6 @@ */ #include -__FBSDID("$FreeBSD$"); #include #include diff --git a/sys/kern/subr_kobj.c b/sys/kern/subr_kobj.c index b1adc7d..2b17a17 100644 --- a/sys/kern/subr_kobj.c +++ b/sys/kern/subr_kobj.c @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2000,2003 Doug Rabson * All rights reserved. @@ -27,8 +27,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include #include #include diff --git a/sys/libkern/explicit_bzero.c b/sys/libkern/explicit_bzero.c index e89f0b1..321625c 100644 --- a/sys/libkern/explicit_bzero.c +++ b/sys/libkern/explicit_bzero.c @@ -5,8 +5,6 @@ */ #include -__FBSDID("$FreeBSD$"); - #include __attribute__((weak)) void __explicit_bzero_hook(void *, size_t); diff --git a/sys/net/ppp_defs.h b/sys/net/ppp_defs.h index 49dc6ff..4b00049 100644 --- a/sys/net/ppp_defs.h +++ b/sys/net/ppp_defs.h @@ -24,8 +24,6 @@ * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, * OR MODIFICATIONS. - * - * $FreeBSD$ */ #ifndef _PPP_DEFS_H_ diff --git a/sys/sys/_callout.h b/sys/sys/_callout.h index 1a388d4..8ec2708 100644 --- a/sys/sys/_callout.h +++ b/sys/sys/_callout.h @@ -34,7 +34,6 @@ * SUCH DAMAGE. * * @(#)callout.h 8.2 (Berkeley) 1/21/94 - * $FreeBSD$ */ #ifndef _SYS__CALLOUT_H diff --git a/sys/sys/bus.h b/sys/sys/bus.h index f7a9c5e..7de4dff 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1997,1998,2003 Doug Rabson * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_BUS_H_ diff --git a/sys/sys/callout.h b/sys/sys/callout.h index f5675d1..f61e8ee 100644 --- a/sys/sys/callout.h +++ b/sys/sys/callout.h @@ -34,7 +34,6 @@ * SUCH DAMAGE. * * @(#)callout.h 8.2 (Berkeley) 1/21/94 - * $FreeBSD$ */ #ifndef _SYS_CALLOUT_H_ diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h index a1e417c..1a67f22 100644 --- a/sys/sys/cdefs.h +++ b/sys/sys/cdefs.h @@ -32,12 +32,15 @@ * SUCH DAMAGE. * * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 - * $FreeBSD$ */ #ifndef _SYS_CDEFS_H_ #define _SYS_CDEFS_H_ +#if defined(_KERNEL) && defined(_STANDALONE) +#error "_KERNEL and _STANDALONE are mutually exclusive" +#endif + /* * Testing against Clang-specific extensions. */ @@ -71,9 +74,9 @@ * having a compiler-agnostic source tree. */ -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) -#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) +#if __GNUC__ >= 3 #define __GNUCLIKE_ASM 3 #define __GNUCLIKE_MATH_BUILTIN_CONSTANTS #else @@ -83,15 +86,9 @@ #define __GNUCLIKE___OFFSETOF 1 #define __GNUCLIKE___SECTION 1 -#ifndef __INTEL_COMPILER #define __GNUCLIKE_CTOR_SECTION_HANDLING 1 -#endif #define __GNUCLIKE_BUILTIN_CONSTANT_P 1 -#if defined(__INTEL_COMPILER) && defined(__cplusplus) && \ - __INTEL_COMPILER < 800 -#undef __GNUCLIKE_BUILTIN_CONSTANT_P -#endif #if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) #define __GNUCLIKE_BUILTIN_VARARGS 1 @@ -99,21 +96,15 @@ #define __GNUCLIKE_BUILTIN_VAALIST 1 #endif -#if defined(__GNUC__) #define __GNUC_VA_LIST_COMPATIBILITY 1 -#endif /* * Compiler memory barriers, specific to gcc and clang. */ -#if defined(__GNUC__) #define __compiler_membar() __asm __volatile(" " : : : "memory") -#endif -#ifndef __INTEL_COMPILER #define __GNUCLIKE_BUILTIN_NEXT_ARG 1 #define __GNUCLIKE_MATH_BUILTIN_RELOPS -#endif #define __GNUCLIKE_BUILTIN_MEMCPY 1 @@ -129,12 +120,12 @@ #define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ /* * Macro to test if we're using a specific version of gcc or later. */ -#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define __GNUC_PREREQ__(ma, mi) \ (__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi)) #else @@ -207,31 +198,19 @@ * for a given compiler, let the compile fail if it is told to use * a feature that we cannot live without. */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __alloc_align(x) -#define __alloc_size(x) -#define __alloc_size2(n, x) -#define __section(x) -#define __weak_symbol -#else #define __weak_symbol __attribute__((__weak__)) -#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 5) #define __dead2 #define __pure2 #define __unused #endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) +#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused /* XXX Find out what to do for __packed, __aligned and __section */ #endif -#if __GNUC_PREREQ__(2, 7) || defined(__INTEL_COMPILER) +#if __GNUC_PREREQ__(2, 7) #define __dead2 __attribute__((__noreturn__)) #define __pure2 __attribute__((__const__)) #define __unused __attribute__((__unused__)) @@ -252,7 +231,6 @@ #else #define __alloc_align(x) #endif -#endif /* lint */ #if !__GNUC_PREREQ__(2, 95) #define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) @@ -281,7 +259,7 @@ #endif #if !defined(__cplusplus) && !__has_extension(c_atomic) && \ - !__has_extension(cxx_atomic) + !__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 7) /* * No native support for _Atomic(). Place object in structure to prevent * most forms of direct non-atomic access. @@ -328,6 +306,9 @@ * __generic(). Unlike _Generic(), this macro can only distinguish * between a single type, so it requires nested invocations to * distinguish multiple cases. + * + * Note that the comma operator is used to force expr to decay in + * order to match _Generic(). */ #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \ @@ -337,7 +318,7 @@ #elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) #define __generic(expr, t, yes, no) \ __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(expr), t), yes, no) + __builtin_types_compatible_p(__typeof((0, (expr))), t), yes, no) #endif /* @@ -363,7 +344,7 @@ #define __pure #endif -#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) +#if __GNUC_PREREQ__(3, 1) #define __always_inline __attribute__((__always_inline__)) #else #define __always_inline @@ -396,11 +377,11 @@ #endif /* XXX: should use `#if __STDC_VERSION__ < 199901'. */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define __func__ NULL #endif -#if (defined(__INTEL_COMPILER) || (defined(__GNUC__) && __GNUC__ >= 2)) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 +#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901 #define __LONG_LONG_SUPPORTED #endif @@ -416,17 +397,15 @@ #endif /* - * GCC 2.95 provides `__restrict' as an extension to C90 to support the - * C99-specific `restrict' type qualifier. We happen to use `__restrict' as - * a way to define the `restrict' type qualifier without disturbing older - * software that is unaware of C99 keywords. + * We use `__restrict' as a way to define the `restrict' type qualifier + * without disturbing older software that is unaware of C99 keywords. + * GCC also provides `__restrict' as an extension to support C99-style + * restricted pointers in other language modes. */ -#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 -#define __restrict -#else +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901 #define __restrict restrict -#endif +#elif !__GNUC_PREREQ__(2, 95) +#define __restrict #endif /* @@ -484,7 +463,7 @@ #else #ifndef __cplusplus #define __offsetof(type, field) \ - ((__size_t)(uintptr_t)((const volatile void *)&((type *)0)->field)) + ((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field)) #else #define __offsetof(type, field) \ (__offsetof__ (reinterpret_cast <__size_t> \ @@ -517,7 +496,7 @@ * that are known to support the features properly (old versions of gcc-2 * didn't permit keeping the keywords out of the application namespace). */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) +#if !__GNUC_PREREQ__(2, 7) #define __printflike(fmtarg, firstvararg) #define __scanflike(fmtarg, firstvararg) #define __format_arg(fmtarg) @@ -537,18 +516,16 @@ /* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ #if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ - defined(__GNUC__) && !defined(__INTEL_COMPILER) + defined(__GNUC__) #define __printf0like(fmtarg, firstvararg) \ __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) #else #define __printf0like(fmtarg, firstvararg) #endif -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#ifndef __INTEL_COMPILER +#if defined(__GNUC__) #define __strong_reference(sym,aliassym) \ extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) -#endif #ifdef __STDC__ #define __weak_reference(sym,alias) \ __asm__(".weak " #alias); \ @@ -560,7 +537,7 @@ #define __sym_compat(sym,impl,verid) \ __asm__(".symver " #impl ", " #sym "@" #verid) #define __sym_default(sym,impl,verid) \ - __asm__(".symver " #impl ", " #sym "@@" #verid) + __asm__(".symver " #impl ", " #sym "@@@" #verid) #else #define __weak_reference(sym,alias) \ __asm__(".weak alias"); \ @@ -572,14 +549,14 @@ #define __sym_compat(sym,impl,verid) \ __asm__(".symver impl, sym@verid") #define __sym_default(impl,sym,verid) \ - __asm__(".symver impl, sym@@verid") + __asm__(".symver impl, sym@@@verid") #endif /* __STDC__ */ -#endif /* __GNUC__ || __INTEL_COMPILER */ +#endif /* __GNUC__ */ -#define __GLOBL1(sym) __asm__(".globl " #sym) -#define __GLOBL(sym) __GLOBL1(sym) +#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym)) +#define __WEAK(sym) __asm__(".weak " __XSTRING(sym)) -#if defined(__GNUC__) || defined(__INTEL_COMPILER) +#if defined(__GNUC__) #define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"") #else /* @@ -595,7 +572,6 @@ * Embed the rcs id of a source file in the resulting library. Note that in * more recent ELF binutils, we use .ident allowing the ID to be stripped. * Usage: - * __FBSDID("$FreeBSD$"); */ #ifndef __FBSDID #if !defined(STRIP_FBSDID) @@ -731,6 +707,17 @@ #define __POSIX_VISIBLE 198808 #define __ISO_C_VISIBLE 0 #endif /* _POSIX_C_SOURCE */ +/* + * Both glibc and OpenBSD enable c11 features when _ISOC11_SOURCE is defined, or + * when compiling with -stdc=c11. A strict reading of the standard would suggest + * doing it only for the former. However, a strict reading also requires C99 + * mode only, so building with C11 is already undefined. Follow glibc's and + * OpenBSD's lead for this non-standard configuration for maximum compatibility. + */ +#if _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +#undef __ISO_C_VISIBLE +#define __ISO_C_VISIBLE 2011 +#endif #else /*- * Deal with _ANSI_SOURCE: @@ -781,10 +768,6 @@ #endif #endif /* __STDC_WANT_LIB_EXT1__ */ -#if defined(__mips) || defined(__powerpc64__) || defined(__riscv__) -#define __NO_TLS 1 -#endif - /* * Old versions of GCC use non-standard ARM arch symbols; acle-compat.h * translates them to __ARM_ARCH and the modern feature symbols defined by ARM. @@ -879,10 +862,49 @@ /* Function should not be analyzed. */ #define __no_lock_analysis __lock_annotate(no_thread_safety_analysis) +/* + * Function or variable should not be sanitized, e.g., by AddressSanitizer. + * GCC has the nosanitize attribute, but as a function attribute only, and + * warns on use as a variable attribute. + */ +#if __has_attribute(no_sanitize) && defined(__clang__) +#ifdef _KERNEL +#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address"))) +#define __nosanitizememory __attribute__((no_sanitize("kernel-memory"))) +#else +#define __nosanitizeaddress __attribute__((no_sanitize("address"))) +#define __nosanitizememory __attribute__((no_sanitize("memory"))) +#endif +#define __nosanitizethread __attribute__((no_sanitize("thread"))) +#else +#define __nosanitizeaddress +#define __nosanitizememory +#define __nosanitizethread +#endif + /* Guard variables and structure members by lock. */ #define __guarded_by(x) __lock_annotate(guarded_by(x)) #define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x)) +/* Alignment builtins for better type checking and improved code generation. */ +/* Provide fallback versions for other compilers (GCC/Clang < 10): */ +#if !__has_builtin(__builtin_is_aligned) +#define __builtin_is_aligned(x, align) \ + (((__uintptr_t)x & ((align) - 1)) == 0) +#endif +#if !__has_builtin(__builtin_align_up) +#define __builtin_align_up(x, align) \ + ((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1)))) +#endif +#if !__has_builtin(__builtin_align_down) +#define __builtin_align_down(x, align) \ + ((__typeof__(x))((x)&(~((align)-1)))) +#endif + +#define __align_up(x, y) __builtin_align_up(x, y) +#define __align_down(x, y) __builtin_align_down(x, y) +#define __is_aligned(x, y) __builtin_is_aligned(x, y) + #ifdef LOSCFG_LIBC_NEWLIB #undef _SYS_CDEFS_H_ #include_next diff --git a/sys/sys/condvar.h b/sys/sys/condvar.h index cf9d78b..fc60838 100644 --- a/sys/sys/condvar.h +++ b/sys/sys/condvar.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2000 Jake Burkholder . * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_CONDVAR_H_ diff --git a/sys/sys/kernel.h b/sys/sys/kernel.h index 1fdc9fc..ce6f80d 100644 --- a/sys/sys/kernel.h +++ b/sys/sys/kernel.h @@ -41,7 +41,6 @@ * SUCH DAMAGE. * * @(#)kernel.h 8.3 (Berkeley) 1/21/94 - * $FreeBSD$ */ #ifndef _SYS_KERNEL_H_ diff --git a/sys/sys/kobj.h b/sys/sys/kobj.h index ad5d58d..7d6f6e9 100644 --- a/sys/sys/kobj.h +++ b/sys/sys/kobj.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2000,2003 Doug Rabson * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_KOBJ_H_ diff --git a/sys/sys/linker_set.h b/sys/sys/linker_set.h index aa0efca..5c9fb9b 100644 --- a/sys/sys/linker_set.h +++ b/sys/sys/linker_set.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1999 John D. Polstra * Copyright (c) 1999,2001 Peter Wemm @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_LINKER_SET_H_ @@ -51,8 +49,6 @@ #define __MAKE_SET_CONST const #endif -#define __GLOBL1(sym) __asm__(".globl " #sym) -#define __GLOBL(sym) __GLOBL1(sym) /* * Function or variable should not be sanitized, i.e. by AddressSanitizer. * GCC has the nosanitize attribute, but as a function attribute only, and diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 30f7ba4..4bc1be1 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -31,7 +31,6 @@ * SUCH DAMAGE. * * @(#)malloc.h 8.5 (Berkeley) 5/3/95 - * $FreeBSD$ */ #ifndef _SYS_MALLOC_H_ diff --git a/sys/sys/module.h b/sys/sys/module.h index b383e42..f77b013 100644 --- a/sys/sys/module.h +++ b/sys/sys/module.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1997 Doug Rabson * All rights reserved. @@ -24,8 +24,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_MODULE_H_ diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 573ffbf..3bfadb9 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -28,7 +28,6 @@ * SUCH DAMAGE. * * from BSDI $Id: mutex.h,v 2.7.2.35 2000/04/27 03:10:26 cp Exp $ - * $FreeBSD$ */ #ifndef _SYS_MUTEX_H_ diff --git a/sys/sys/priv.h b/sys/sys/priv.h index bd09354..eb08bf0 100644 --- a/sys/sys/priv.h +++ b/sys/sys/priv.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2006 nCircle Network Security, Inc. * All rights reserved. @@ -27,8 +27,6 @@ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ */ /* diff --git a/sys/sys/queue.h b/sys/sys/queue.h index ca45ef6..2407fc6 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -29,7 +29,6 @@ * SUCH DAMAGE. * * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $FreeBSD$ */ #ifndef _SYS_QUEUE_H_ diff --git a/sys/sys/sema.h b/sys/sys/sema.h index bd8b3ee..0cc6744 100644 --- a/sys/sys/sema.h +++ b/sys/sys/sema.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (C) 2001 Jason Evans . All rights reserved. * @@ -25,8 +25,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_SEMA_H_ diff --git a/sys/sys/serial.h b/sys/sys/serial.h index 1f6eda4..f237357 100644 --- a/sys/sys/serial.h +++ b/sys/sys/serial.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2004 Poul-Henning Kamp * All rights reserved. @@ -28,8 +28,6 @@ * This file contains definitions which pertain to serial ports as such, * (both async and sync), but which do not necessarily have anything to * do with tty processing. - * - * $FreeBSD$ */ #ifndef _SYS_SERIAL_H_ @@ -89,4 +87,5 @@ typedef int serdev_intr_t(void*); #endif #endif /* _KERNEL */ + #endif /* !_SYS_SERIAL_H_ */ diff --git a/sys/sys/sx.h b/sys/sys/sx.h index cb635ab..c7c4f3a 100644 --- a/sys/sys/sx.h +++ b/sys/sys/sx.h @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2007 Attilio Rao * Copyright (c) 2001 Jason Evans @@ -27,8 +27,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH * DAMAGE. - * - * $FreeBSD$ */ #ifndef _SYS_SX_H_ diff --git a/sys/sys/systm.h b/sys/sys/systm.h index f5761b8..96395f6 100644 --- a/sys/sys/systm.h +++ b/sys/sys/systm.h @@ -34,7 +34,6 @@ * SUCH DAMAGE. * * @(#)systm.h 8.7 (Berkeley) 3/29/95 - * $FreeBSD$ */ #ifndef _SYS_SYSTM_H_ diff --git a/sys/sys/tree.h b/sys/sys/tree.h index c207c5c..99d9037 100644 --- a/sys/sys/tree.h +++ b/sys/sys/tree.h @@ -1,9 +1,8 @@ /* $NetBSD: tree.h,v 1.8 2004/03/28 19:38:30 provos Exp $ */ /* $OpenBSD: tree.h,v 1.7 2002/10/17 21:51:54 art Exp $ */ -/* $FreeBSD$ */ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * SPDX-License-Identifier: BSD-2-Clause * * Copyright 2002 Niels Provos * All rights reserved.