]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
21 months agosnp(4): implement detach
Konstantin Belousov [Sun, 25 Sep 2022 11:34:17 +0000 (14:34 +0300)]
snp(4): implement detach

PR: 257964

(cherry picked from commit 550e01c552474babae468011191ecc5130cc153e)

21 months agosnp(4): properly report detached/revoked ttys
Konstantin Belousov [Sat, 24 Sep 2022 20:23:31 +0000 (23:23 +0300)]
snp(4): properly report detached/revoked ttys

PR: 257964

(cherry picked from commit bb4be76cf358246ef04ea8a67f38ff2a25b6c580)

21 months agomakefs: whitespace cleanup (remove space before tab)
Ed Maste [Tue, 20 Sep 2022 14:26:24 +0000 (10:26 -0400)]
makefs: whitespace cleanup (remove space before tab)

MFC after: 1 week

(cherry picked from commit 06a400d76be90bc0ccf6110a1e614d60bafb0f6c)

21 months agoclang: remove as(1) cross-reference from man page
Ed Maste [Tue, 20 Sep 2022 14:02:45 +0000 (10:02 -0400)]
clang: remove as(1) cross-reference from man page

PR: 265232
Reviewed by: dim
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differntial Revision: https://reviews.freebsd.org/D36634

(cherry picked from commit 61957f3a6f154592a079a4aa8e10c037878311ea)

21 months agoRemove obsolete SystemV dir from BSD.usr.dist
Ed Maste [Thu, 29 Sep 2022 15:56:25 +0000 (11:56 -0400)]
Remove obsolete SystemV dir from BSD.usr.dist

/usr/share/zoneinfo/SystemV is removed via ObsoleteFiles as of commits
da038df8c92b and 57338837aef5, so do not create it in the first place.

PR: 266666
Fixes: da038df8c92b ("share/zoneinfo: don't build obsolete...")
MFC after: 3 days

(cherry picked from commit b4d15fdd53d7a30ea7ce7e6903ed547f00200719)

21 months agorb_tree: reduce duplication in balancing code
Doug Moore [Thu, 8 Sep 2022 04:46:19 +0000 (23:46 -0500)]
rb_tree: reduce duplication in balancing code

Change RB_INSERT_COLOR and RB_REMOVE_COLOR so that the blocks of code
that are identical except for left and right being exchanged are made
only one block with a variable to indicate left- or right-handedness.

Rename RB macros so that those not intended for external use begin
with an underscore.

Add comments to the balancing code so that another might understand it.

Reviewed by: alc, kib
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36393

(cherry picked from commit d0354fa7b6b1931afe1806bd0bfe3ba83e2aeb00)

21 months agorb_tree: silence unused function warnings
Doug Moore [Sun, 18 Sep 2022 08:34:47 +0000 (03:34 -0500)]
rb_tree: silence unused function warnings

With DIAGNOSTIC set a kernel build generates warnings about the
defined-but-unused RB_RANK method. Don't set _RB_DIAGNOSTIC
automatically, to silence these warnings.

Reported by: mjguzik@gmail.com
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D36617

(cherry picked from commit 14696d81f163dacfcdaf42171556ebfd15416fb9)

21 months agorb_tree: test rank balance
Doug Moore [Thu, 8 Sep 2022 02:40:05 +0000 (21:40 -0500)]
rb_tree: test rank balance

With _RB_DIAGNOSTIC defined, provide an RB_RANK method to compute the
rank of a node in an rb-tree, if the subtree rooted at that node is
rank-balanced, and -1 otherwise.

In rb_test, rewrite a bit to avoid malloc/free and nondeterministic
running times because of randomness. Allocate all the nodes on the
stack, and shuffle a set of keys to get randomness for the testing.

Add a rank-balance check for the completed tree.

Reviewed by: markj
MFC after: 3 weeks
Differential Revision: https://reviews.freebsd.org/D36484

(cherry picked from commit 2c545cf3b06310e248dd4427f31e73f0bc1ad504)

21 months agosched_4bsd: Fix a racy thread state modification
Mark Johnston [Fri, 23 Sep 2022 23:41:30 +0000 (19:41 -0400)]
sched_4bsd: Fix a racy thread state modification

When a thread switching off-CPU is migrating to a remote CPU,
sched_switch() may trigger a rescheduling of the thread currently
running on that CPU.  When doing so, it must ensure that that thread is
locked before modifying thread state.  If the thread's lock is not the
scheduler lock, then the thread is in the process of switching off-CPU
and no extra effort is needed, and the initiator does not hold the
thread's lock and thus should not modify any thread state.

Reported and tested by: Steve Kargl

(cherry picked from commit c2d27b0ec7000d28b4f31148005ccfe371f47db3)

21 months agoarm64: Ignore 1GB mappings in pmap_advise()
Mark Johnston [Sat, 24 Sep 2022 13:26:54 +0000 (09:26 -0400)]
arm64: Ignore 1GB mappings in pmap_advise()

For the same reason as commit 4c224f8e5f36cfad5a9af8db7c7acdecc3d4c7b5.

(cherry picked from commit 89a2ef4d5226135deb89cececdf32d55812d84fd)

21 months agoamd64: Ignore 1GB mappings in pmap_advise()
Mark Johnston [Sat, 24 Sep 2022 13:20:48 +0000 (09:20 -0400)]
amd64: Ignore 1GB mappings in pmap_advise()

This assertion can be triggered by usermode since vm_map_madvise()
doesn't force advice to be applied to an entire largepage mapping.  I
can't see any reason not to permit it, however, since MADV_DONTNEED and
_FREE are advisory and we can simply do nothing when a 1GB mapping is
encountered.

Reviewed by: alc, kib

(cherry picked from commit 4551cbbe9906812556501c541fef0d88b0398b27)

21 months agoamd64: Handle 1GB mappings in pmap_enter_quick_locked()
Mark Johnston [Sat, 24 Sep 2022 13:20:29 +0000 (09:20 -0400)]
amd64: Handle 1GB mappings in pmap_enter_quick_locked()

This code path can be triggered by applying MADV_WILLNEED to a 1GB
mapping.

Reviewed by: alc, kib

(cherry picked from commit 6c2e9f4c32a44f3c239aba346322d871097eaed0)

21 months agorpc.tlsclntd.8: Fix the RFC number now that it exists
Rick Macklem [Fri, 23 Sep 2022 23:59:29 +0000 (16:59 -0700)]
rpc.tlsclntd.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

(cherry picked from commit 7652321b7909002877cabcaee56dc996814070e8)

21 months agorpc.tlsservd.8: Fix the RFC number now that it exists
Rick Macklem [Fri, 23 Sep 2022 23:53:36 +0000 (16:53 -0700)]
rpc.tlsservd.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

(cherry picked from commit 423387bee26a1eda29f378a5829845e5fa975918)

21 months agomount_nfs.8: Fix the RFC number now that it exists
Rick Macklem [Sat, 24 Sep 2022 22:05:21 +0000 (15:05 -0700)]
mount_nfs.8: Fix the RFC number now that it exists

The RFC for this finally got published and, therefore,
now has a number.  This patch puts this RFC number
in the man page.

This is a content change.

(cherry picked from commit 0083eef31cecf57df1157833d63ec766c77dd949)

21 months agounbound: Vendor import 1.16.3
Cy Schubert [Thu, 29 Sep 2022 14:21:04 +0000 (07:21 -0700)]
unbound: Vendor import 1.16.3

Fixes CVE-2022-3204 'Non-Responsive Delegation Attack'.

Security: CVE-2022-3204
Security: https://nlnetlabs.nl/downloads/unbound/CVE-2022-3204.txt
Changelog: https://nlnetlabs.nl/news/2022/Sep/21/unbound-1.16.3-released/

Merge commit '0dde6f4f8e604df8c6fbdab8b4aadb5ddf80c76f' into unbound/main

(cherry picked from commit 4f5c8956cff4b18674006e6ac88bed0d04020723)

21 months agoTrack removal of Tokenring and FDDI media types from devd.cc.
Pau Amma [Thu, 22 Sep 2022 19:55:11 +0000 (19:55 +0000)]
Track removal of Tokenring and FDDI media types from devd.cc.

Fixes: eec02418d83b Remove support for FDDI and token ring media types in userland utilities.

Reviewed by: brooks, gjb, imp

Approved by: brooks (src), gjb (mentor, src), imp (src)

Differential Revision: https://reviews.freebsd.org/D36668

(cherry picked from commit f968cb140fcfa7b548abb5930dee81ba987ec503)

21 months agoFix CVE-2020-10188
Cy Schubert [Wed, 21 Sep 2022 21:38:08 +0000 (14:38 -0700)]
Fix CVE-2020-10188

Reviewed by: emaste
Obtained from: NetBSD 6cc1539c8028b
Differential Revision: https://reviews.freebsd.org/D36732

(cherry picked from commit 5760cb266e0ab04c221c2acdb4b6c4c141130ecd)

21 months agovm/vm.h: cleanup
Konstantin Belousov [Fri, 16 Sep 2022 22:44:39 +0000 (01:44 +0300)]
vm/vm.h: cleanup

(cherry picked from commit 55c5216582f42c31c74e47b924d2b787d1383878)

21 months agojemalloc: Define SWAP_RESERVE_* if not provided by the system headers
Konstantin Belousov [Fri, 16 Sep 2022 21:08:03 +0000 (00:08 +0300)]
jemalloc: Define SWAP_RESERVE_* if not provided by the system headers

(cherry picked from commit 0e2af3b59a1517521e9fb3aab61fa06e5ce25c2c)

21 months agortld: teach LD_SHOW_AUXV about AT_USRSTACK*
Konstantin Belousov [Thu, 15 Sep 2022 10:16:30 +0000 (13:16 +0300)]
rtld: teach LD_SHOW_AUXV about AT_USRSTACK*

(cherry picked from commit daa85548d5cfc65e4beb7a211a155ae9b9fc41d9)

21 months agolibthr: extract code to get main stack base and size into helpers
Konstantin Belousov [Tue, 13 Sep 2022 22:14:24 +0000 (01:14 +0300)]
libthr: extract code to get main stack base and size into helpers

(cherry picked from commit e03c7f50054182549e097f9fbd9387d8c55ef521)

21 months agolibc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") and get_rl...
Konstantin Belousov [Mon, 12 Sep 2022 19:45:21 +0000 (22:45 +0300)]
libc, libthr: use AT_USRSTACK{BASE,LIM} instead of sysctl("kern.usrstack") and get_rlimit(RLIMIT_STACK)

(cherry picked from commit e2879ece4314eed2d22fe484bd4adfcbb1009685)

21 months agolibthr: use nitems() for mib length
Konstantin Belousov [Mon, 12 Sep 2022 20:24:55 +0000 (23:24 +0300)]
libthr: use nitems() for mib length

(cherry picked from commit ebf7a01594eeb8c2897d1b310069df35da112413)

21 months agojemalloc: use auxv ELF_BSDF_VMNOOVERCOMMIT instead of sysctl("vm.overcommit")
Konstantin Belousov [Mon, 12 Sep 2022 19:44:37 +0000 (22:44 +0300)]
jemalloc: use auxv ELF_BSDF_VMNOOVERCOMMIT instead of sysctl("vm.overcommit")

(cherry picked from commit 0ae364adcd8d34bda3fe1a32e86025ba96df058a)

21 months agoauxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIM
Konstantin Belousov [Thu, 15 Sep 2022 10:08:59 +0000 (13:08 +0300)]
auxv.3: Document AT_USRSTACKBASE and AT_USRSTACKLIM

(cherry picked from commit 62b4fb22df04c286fafa198a9ac91fd89454dfab)

21 months agoprocstat(1): print AT_USRSTACKBASE and AT_USRSTACKLIM
Konstantin Belousov [Thu, 15 Sep 2022 10:14:17 +0000 (13:14 +0300)]
procstat(1): print AT_USRSTACKBASE and AT_USRSTACKLIM

(cherry picked from commit 1d280f21427f560c696476366cfeb74d93629293)

21 months ago_elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}
Konstantin Belousov [Mon, 12 Sep 2022 19:36:24 +0000 (22:36 +0300)]
_elf_aux_info(3): add support for AT_USRSTACK{BASE,LIM}

(cherry picked from commit 8f2668b0605e26b04a103f63096cfcc856d950c1)

21 months agoAdd AT_USRSTACK{BASE, LIM} AT vectors, and ELF_BSDF_VMNOOVERCOMMIT flag
Konstantin Belousov [Mon, 12 Sep 2022 19:32:02 +0000 (22:32 +0300)]
Add AT_USRSTACK{BASE, LIM} AT vectors, and ELF_BSDF_VMNOOVERCOMMIT flag

(cherry picked from commit ff41239f587f2c2850c10639bd0ab8b5422b33fa)

21 months agojemalloc: use symbolic definitions for bits in vm_overcommit
Konstantin Belousov [Thu, 15 Sep 2022 09:59:42 +0000 (12:59 +0300)]
jemalloc: use symbolic definitions for bits in vm_overcommit

(cherry picked from commit 87384c51e047349fdbcf4f07fe52d900ce108040)

21 months agoswap_pager: style, wrap long lines
Konstantin Belousov [Tue, 13 Sep 2022 10:03:11 +0000 (13:03 +0300)]
swap_pager: style, wrap long lines

(cherry picked from commit 26eed2aa06a2e523ffd4191ac67818242d5035e7)

21 months agovm_overcommit: put into __read_mostly section
Konstantin Belousov [Tue, 13 Sep 2022 10:00:12 +0000 (13:00 +0300)]
vm_overcommit: put into __read_mostly section

(cherry picked from commit ccdaa1ab1c5fec116d02cad37626d13fbdf77352)

21 months agovm: make vm.overcommit available externally
Konstantin Belousov [Mon, 12 Sep 2022 19:31:30 +0000 (22:31 +0300)]
vm: make vm.overcommit available externally

(cherry picked from commit a6cc4c6e98eb65d7cc15c16262ad6053763fe18a)

21 months agotelnetd: fix two-byte input crash
Brooks Davis [Mon, 26 Sep 2022 17:56:51 +0000 (18:56 +0100)]
telnetd: fix two-byte input crash

Move initialization of the slc table earlier so it doesn't get
accessed before that happens.

For details on the issue, see:
https://pierrekim.github.io/blog/2022-08-24-2-byte-dos-freebsd-netbsd-telnetd-netkit-telnetd-inetutils-telnetd-kerberos-telnetd.html

Reviewed by: cy
Obtained from: NetBSD via cy
Differential Revision: https://reviews.freebsd.org/D36680

(cherry picked from commit 6914ffef4e2318ca1d0ead28eafb6f06055ce0f8)

21 months agox86/mp: don't create empty cpu groups
Corvin Köhne [Mon, 30 May 2022 09:19:14 +0000 (11:19 +0200)]
x86/mp: don't create empty cpu groups

When some APICs are disabled by tunables, some cpu groups could end up
empty. An empty cpu group causes the system to panic because not all
functions handle them correctly. Additionally, it's wasted time to
handle and inspect empty cpu groups. Therefore, just don't create them.

Reviewed by: kib, avg, cem
Sponsored by: Beckhoff Automation GmbH & Co. KG
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24927

(cherry picked from commit 7468332f5518c1a725cd0067c35490f82ef781bd)

21 months agoldd: remove '[preloaded]' marker for the preloaded objects
Konstantin Belousov [Sun, 18 Sep 2022 00:49:30 +0000 (03:49 +0300)]
ldd: remove '[preloaded]' marker for the preloaded objects

PR: 265750

(cherry picked from commit 2f72ee987d492b3dc9116c5cf49777edd2474b11)

21 months agodebugnet: Fix parameter order in the calls to m_get()
Zhenlei Huang [Wed, 21 Sep 2022 10:55:20 +0000 (06:55 -0400)]
debugnet: Fix parameter order in the calls to m_get()

Reviewed by: markj

(cherry picked from commit 440217b0af5ffa08086829f5902b01a92e7a6790)

21 months agofile: upgrade to 5.43.
Xin LI [Sun, 25 Sep 2022 02:16:39 +0000 (19:16 -0700)]
file: upgrade to 5.43.

(cherry picked from commit a2dfb7224ec9933ee804cae54d51848dce938b6b)

21 months agocontrib/tzdata: import tzdata 2022d
Philip Paeps [Sun, 25 Sep 2022 05:50:36 +0000 (13:50 +0800)]
contrib/tzdata: import tzdata 2022d

Changes: https://github.com/eggert/tz/blob/2022d/NEWS

The /usr/share/zoneinfo/SystemV directory has been empty on FreeBSD
since 2006.  The upstream source file was removed in 2020.  Also stop
passing yearisdate to zic(8).  This has not been necessary for years.
The script has been removed upstream since 2020.

(cherry picked from commit 1576451a39487b982c961f32bbab71c71890dc0c)
(cherry picked from commit da038df8c92b71060965bdc5dc400db54de35587)
(cherry picked from commit 57338837aef51923ebafc3656e38d4be5c50a60d)

21 months agoHandle NULL return from localtime(3) in ls(1) and find(1)
Kirk McKusick [Fri, 9 Sep 2022 21:29:53 +0000 (14:29 -0700)]
Handle NULL return from localtime(3) in ls(1) and find(1)

(cherry picked from commit 927f8d8bbbed70f6c88d05c19b5b366f8e7532c9)

21 months agopfctl: fix recrusive printing of anchors
Kristof Provost [Thu, 1 Sep 2022 08:16:24 +0000 (10:16 +0200)]
pfctl: fix recrusive printing of anchors

Fix a couple of problems with printing of anchors, in particular recursive
printing, both of inline anchors and when requested explicitly with a '*'
in the anchor.
- Correct recursive printing of wildcard anchors (recurse into child anchors
rather than rules, which don't exist)
- Print multi-part anchor paths correctly (pr6065)
- Fix comments and prevent users from specifying multi-component names for
inline anchors.

tested by phessler
ok henning

Also fix the relevant pfctl test case to reflect the new (and now
correct) behaviour).

MFC after: 3 weeks
Obtained from: OpenBSD (mcbride, f9a568a27c740528301ca3419316c85a9fc7f1de)
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D36416

(cherry picked from commit 585a5ed0bef4a0b874c8fa495ae53901799759c3)

21 months agosqlite3: Vendor import of sqlite3 3.39.3
Cy Schubert [Tue, 20 Sep 2022 03:07:59 +0000 (20:07 -0700)]
sqlite3: Vendor import of sqlite3 3.39.3

Changes at https://www.sqlite.org/releaselog/3_39_3.html.

Obtained from:  https://www.sqlite.org/2022/sqlite-autoconf-3390300.tar.gz

(cherry picked from commit 51952914523c5a447395f2d9dbd410cb2b28e72c)

21 months agocpuset(9): Refer to CPU_SETSIZE not MAXCPU
Brooks Davis [Fri, 23 Sep 2022 20:20:52 +0000 (21:20 +0100)]
cpuset(9): Refer to CPU_SETSIZE not MAXCPU

The maximum CPU number of a cpuset_t is determined by CPU_SETSIZE. In
the kernel this is MAXCPU, but in userspace it is CPU_MAXSIZE unless
CPU_SETSIZE is defined before including sys/_cpuset.h. CPU_MAXSIZE is
256 and in userspace MAXCPU is generally 1 because it being set to a
larger MD value is gated on SMP being defined (not generally the case in
userspace).

Reported by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Reviewed by: cem, jhb
Differential Revision: https://reviews.freebsd.org/D36679

(cherry picked from commit 8232a1eddadd6e70ce7bee085344b182517d44a7)

21 months agoDeprecate telnet daemon
Brooks Davis [Wed, 21 Sep 2022 15:17:04 +0000 (16:17 +0100)]
Deprecate telnet daemon

The telnetd codebase is old, unmaintained, and has a number of quality
issues.  Users wishing to provide telnetd service should find a
maintained implementation.  The telnet client is NOT deprecated as it
is lower risk.

Reviewed by: pauamma, kevans, kp, melifaro
Differential Revision: https://reviews.freebsd.org/D36619

(cherry picked from commit 24e1824e4646237c5ab8e63f59fa38e076f18ba7)

21 months agodma: use canonical getline() loop
Ed Maste [Thu, 3 Feb 2022 18:51:06 +0000 (13:51 -0500)]
dma: use canonical getline() loop

getline() returns -1 on erorr or EOF, so use that condition instead of
feof() and check that there was no error after the loop exits.

Reviewed by: bapt, kevans (both earlier)
MFC after: 3 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34159

(cherry picked from commit d21e71efce3963b068ccaa807a099b591dc220e9)

21 months agoigc: Don't start in promiscious mode by default
Hubert Mazur [Fri, 16 Sep 2022 11:37:12 +0000 (13:37 +0200)]
igc: Don't start in promiscious mode by default

The igc driver always sets the promiscious mode during initialization,
ignoring what is set in ifp.
Fix this by checking the interface flags and setting mode appropriately.

Reviewed by: grehan
Obtained from: Semihalf
Sponsored by: Stormshield
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D36591

(cherry picked from commit 55760984d56bb1a4c6bc8040ae022353667258e2)

21 months agortld-elf/libmap.c: correct comment
Konstantin Belousov [Sun, 18 Sep 2022 22:16:52 +0000 (01:16 +0300)]
rtld-elf/libmap.c: correct comment

(cherry picked from commit 1251cf8a30ac496e8c672948dabb9291a17ad71a)

21 months agortld-elf/libmap.h: style declarations
Konstantin Belousov [Sun, 18 Sep 2022 22:06:33 +0000 (01:06 +0300)]
rtld-elf/libmap.h: style declarations

(cherry picked from commit 1fd4dec26e6e31cfe14c849d3b88d8f37560a70d)

21 months agortld-elf/libmap.h: add include guard
Konstantin Belousov [Sun, 18 Sep 2022 22:05:06 +0000 (01:05 +0300)]
rtld-elf/libmap.h: add include guard

(cherry picked from commit 3aed5ddb8b25af59ffe4f1d50f0d13e49a01e816)

21 months agotcp: fix cwnd restricted SACK retransmission loop
Richard Scheffenegger [Thu, 22 Sep 2022 10:55:25 +0000 (12:55 +0200)]
tcp: fix cwnd restricted SACK retransmission loop

While doing the initial SACK retransmission segment while heavily cwnd
constrained, tcp_ouput can erroneously send out the entire sendbuffer
again. This may happen after an retransmission timeout, which resets
snd_nxt to snd_una while the SACK scoreboard is still populated.

Reviewed By: tuexen, #transport
PR: 264257
PR: 263445
PR: 260393
MFC after: 3 days
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D36637

(cherry picked from commit a743fc8826fa348b09d219632594c537f8e5690e)

21 months agotcp: send ACKs when requested
Michael Tuexen [Thu, 22 Sep 2022 10:12:11 +0000 (12:12 +0200)]
tcp: send ACKs when requested

When doing Limited Transmit send an ACK when needed by the protocol
processing (like sending ACKs with a DSACK block).

PR: 264257
PR: 263445
PR: 260393
Reviewed by: rscheff@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36631

(cherry picked from commit 5ae83e0d871bc7cbe4dcc9a33d37eb689e631efe)

21 months agotcp: fix computation of offset
Michael Tuexen [Mon, 19 Sep 2022 10:42:43 +0000 (12:42 +0200)]
tcp: fix computation of offset

Only update the offset if actually retransmitting from the
scoreboard. If not done correctly, this may result in
trying to (re)-transmit data not being being in the socket
buffe and therefore resulting in a panic.

PR: 264257
PR: 263445
PR: 260393
Reviewed by: rscheff@
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D36626

(cherry picked from commit 6d9e911fbadf3b409802a211c1dae9b47cb5a2b8)

21 months agoUpdate SEE ALSO sections for resolver.{3,5} and hosts.5
Gordon Bergling [Thu, 15 Sep 2022 13:24:28 +0000 (15:24 +0200)]
Update SEE ALSO sections for resolver.{3,5} and hosts.5

The mentioned document "Name Server Operations Guide for BIND" is
outdated, so remove it from the SEE ALSO section of hosts.5
and resolver.{3,5}.

PR: 266360
Reported by: Graham Perrin <grahamperrin at FreeBSD dot org>
Reviewed by: karels
Differential Revision: https://reviews.freebsd.org/D36557

(cherry picked from commit 0090d18235269cc5f9582712a42fb5641d5b6f71)

21 months agoman5/{hosts,resolver}.5: note that IPv6 addresses are allowed.
Ceri Davies [Tue, 25 May 2021 15:16:24 +0000 (16:16 +0100)]
man5/{hosts,resolver}.5: note that IPv6 addresses are allowed.

The patch in the PR largely no longer applied due to age, but
thanks to Evgeniy Khramtsov for the patches in the PR.

PR: 120024
Reported by: bcran
Approved by: blackend (mentor)
Obtained from: Evgeniy Khramtsov <evgeniy@khramtsov.org> (partly)

(cherry picked from commit a23b08cf98d92ff82adeebc84673e9bd3cd0a6da)

21 months agoman: Remove obsolete info from hosts man page
Warner Losh [Thu, 11 Mar 2021 18:46:10 +0000 (11:46 -0700)]
man: Remove obsolete info from hosts man page

The NIC no longer provides a host database, and hasn't for quite some
time. Remove that paragraph, it's not been relevant for many years. Also, hosts
appeared in 4.1c, not 4.2, so correct that too.

Noticed by: Henry Bent

(cherry picked from commit c22076b5283970908e74b3abece53efc4670e87d)

21 months agoBump .Dd for recently modified manual pages
Fernando Apesteguía [Mon, 27 Jun 2022 16:11:24 +0000 (18:11 +0200)]
Bump .Dd for recently modified manual pages

During the removal of named(8) references, some pages were modified but their
.Dd where not updated accordingly.

Reported by: lwhsu@
Fixes: 942e234d868d

(cherry picked from commit 4a3c598f352064cc4d2de588bf0058a7417f2402)

21 months agogetnetent(3): Add missing reentrant functions
Fernando Apesteguía [Fri, 21 May 2021 15:25:25 +0000 (17:25 +0200)]
getnetent(3): Add missing reentrant functions

Add documentation for gethostbyname_r, gethostbyname2_r and gethostbyaddr_r

Create proper MLINKs for the new functions.

PR: 249154
Reported by: asomers@
Approved by: manpages (0mp@), Pau Amma
Differential Revision:  https://reviews.freebsd.org/D30469

(cherry picked from commit dc68997328ec6cec41ad3b818c1846c8217e0c68)

21 months agoRemove references to named(8)
Fernando Apesteguía [Wed, 22 Jun 2022 16:39:30 +0000 (18:39 +0200)]
Remove references to named(8)

named(8) hasn't been in base for some time. Remove all references to it in
manual pages.

Approved by: manpages (Pau Amma)
Differential Revision: https://reviews.freebsd.org/D35586

(cherry picked from commit 942e234d868ddc64a11b6af0ee78d47ccb44de1f)

21 months agoctime.3: Add a note about a possible return value of localtime(3)
Gordon Bergling [Fri, 16 Sep 2022 18:38:58 +0000 (20:38 +0200)]
ctime.3: Add a note about a possible return value of localtime(3)

The localtime(3) function returns a NULL pointer, if the passed in-time
translates to a year that will not fit in an integer type. It is stricly
recommended to check the return value to avoid garage output.

Reported by: mckusick
Reviewed by: mckusick, imp, rpokala
Differential Revision: https://reviews.freebsd.org/D36515

(cherry picked from commit 30cfb3c8ee3d3fc79644541207c81d20c72176ce)

21 months agouname.1: Clarify the -r option
Gordon Bergling [Fri, 16 Sep 2022 11:27:54 +0000 (13:27 +0200)]
uname.1: Clarify the -r option

It is some times hard to understand the difference between
kernel version and userland version. So clarify the -r option
of uname(1) in terms of a printed kernel version.

While here, add some cross references:

- cross reference freebsd-version(1) in uname(1)
- cross reference freebsd-version(1) and uname(1) in freebsd-update(8)

PR: 265594
Reported by: rwatson
Reviewed by: gbe, imp
Differential Revision: https://reviews.freebsd.org/D36516

(cherry picked from commit 8f98a937ed726399b89e87e95769a9adc809281a)

21 months agoMFV 66082b6c88b9: libbsdxml (expat) 2.4.9
Xin LI [Wed, 21 Sep 2022 06:54:38 +0000 (23:54 -0700)]
MFV 66082b6c88b9: libbsdxml (expat) 2.4.9

(cherry picked from commit 71f0c44a045421bed4f27fefdb3caf30e1b54fe4)

21 months agorc.d/var_run: Add needed "shutdown" keyword
Cy Schubert [Tue, 20 Sep 2022 18:44:11 +0000 (11:44 -0700)]
rc.d/var_run: Add needed "shutdown" keyword

The "shutdown" keyword invokes rcorder with the -k flag, for rc scripts
with the keyword at shutdown.

Reported by: bdrewery
Fixes: 27b9777c28b4

(cherry picked from commit b77b3099685f27fa1da89cb5b8f376bef87b05ec)

21 months agomsun: correct comment
Steve Kargl [Mon, 19 Sep 2022 18:38:48 +0000 (21:38 +0300)]
msun: correct comment

PR: 266503

(cherry picked from commit 620d855faca136d661a86dfa4cf74dd4f8794740)

21 months agodevstat: Remove DTrace io probes lacking a BIO reference
Mark Johnston [Mon, 29 Aug 2022 17:22:36 +0000 (13:22 -0400)]
devstat: Remove DTrace io probes lacking a BIO reference

The io:::start and end probes trace individual I/O requests.

Also remove the unimplemented wait-start and wait-done probes.

PR: 266098

(cherry picked from commit 32faf071bd54c0e2e1ac07700f7ea5a3d6fa8d51)

21 months agoLinuxKPI: netdev: expose napi state
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:35:41 +0000 (23:35 +0000)]
LinuxKPI: netdev: expose napi state

There are drivers directly accessing napi->state testing for bits
(NAPI_STATE_SCHED encountered so far).  Rename the internal _flags
struct field to state and expose our internal state flag bits along
with the one official aliased.

As I left in a comment, I wished Linux would hide these accesses
behind inline functions or by other means and not public expose
the implementation details.

(cherry picked from commit ac07a3b8b6ec14059136f87a1aba0bf4e3333361)

21 months agonet80211: update (parts of) Action field categories
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:28:13 +0000 (23:28 +0000)]
net80211: update (parts of) Action field categories

Update to the full list of action field category values based on
802.11-2020 with 11ax extensions and remove one value Reserved nowadays.
While here annotate them with descriptions.

Also add Spectrum Management and Radio Measurement action field values
needed in LinuxKPI.

No functional changes.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit c994352a8841eb4533c587bc524f2d1de659a20a)

21 months agoLinuxKPI, dev: 80211 update mac80211 KPI
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:38:54 +0000 (23:38 +0000)]
LinuxKPI, dev: 80211 update mac80211 KPI

Update the mac80211 ops KPI for (*conf_tx), (*assign_vif_chanctx),
(*unassign_vif_chanctx), (*start_ap), and (*stop_ap), as well as
ieee80211_beacon_get_tim() and ieee80211_beacon_get_template().

Update in-tree drivers iwlwifi and rtw88 accordingly based on upstream
changes (as well as out-of-tree ones).  This was triggered by trying to
synchronize more drivers to a common state.

(cherry picked from commit 549198b1ab95139fb26470cf22ce894907c361b8)

21 months agoLinuxKPI: firmware: add request_partial_firmware_into_buf()
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:33:45 +0000 (23:33 +0000)]
LinuxKPI: firmware: add request_partial_firmware_into_buf()

A (so far out-of-tree) driver update needs
request_partial_firmware_into_buf().  Given we load the full .ko file
using firmware(9) just do that and copy the requeste data into the
buffer (rather than poissibly only reading portions of the firmware
file).

(cherry picked from commit fb3c549738bfed0607d95120e5dbf03a62e61b49)

21 months agoLinuxKPI: 80211: add ieee80211_stop_tx_ba_session()
Bjoern A. Zeeb [Fri, 9 Sep 2022 16:30:00 +0000 (16:30 +0000)]
LinuxKPI: 80211: add ieee80211_stop_tx_ba_session()

rtw89 needs ieee80211_stop_tx_ba_session().
Add the skeleton function for now so we can implement BA functions all
together.

(cherry picked from commit d6d687daaa4531c4a84b82cde46c9906c3c02f55)

21 months agonet80211: update (parts of) frame types and subtypes and annotate
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:26:28 +0000 (22:26 +0000)]
net80211: update (parts of) frame types and subtypes and annotate

Update to the full list of frame type and subtype values based on
802.11-2020 with 11ax and 11ay extensions. This includes the 4th type
"Extension" (IEEE80211_FC0_TYPE_EXT).
While here annotate them with descriptions which should help matching
names (as at times things get confusing with LinuxKPI).
Also remove some 802.11-1997 values Reserved nowadays.

No functional changes.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36410

(cherry picked from commit fb47649ebc5a667739e8bd834b993af3c8d1b89f)

21 months agoLinuxKPI: 80211 / iwlwifi: improve queue management
Bjoern A. Zeeb [Mon, 5 Sep 2022 21:03:03 +0000 (21:03 +0000)]
LinuxKPI: 80211 / iwlwifi: improve queue management

For one initialise vif->hw_queues later set in lkpi_80211_txq_tx_one()
for drivers using them.  This may still need slightly more cleanup once
we get QUEUE_CONTROL-supporting drivers into the tree.

For the other rework and improve how we deal with tid/ac/txq in
lkpi_80211_txq_tx_one() and cleanup old comments and unused code.
This seems to reduce (remove) "Invalid TXQ id" reports from iwlwifi.
(The assumption is that the frame(s) triggering this WARN_ONCE or the
added FreeBSD specific logging were sent with lkpi_80211_mo_tx()).

Adjust the one logging from e674ddec0b4138274539587fe9336b577ff1242a
to IWL_DEBUG_TX so that now this is fixed it is also not always logged
anymore but leave it in case we need to further debug queues in the
future.

Tested by: pstef, Kevin Oberman (rkoberman gmail.com)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit e3a0b1202bf63f4b412e02eb6edc0fb1f64313de)

21 months agoiwlwifi: add FreeBSD specific debugging
Bjoern A. Zeeb [Wed, 17 Aug 2022 16:11:47 +0000 (16:11 +0000)]
iwlwifi: add FreeBSD specific debugging

"Invalid TXQ id" and "Queue <n> is stuck <x> <y>" are two errors seen
more commonly by FreeBSD users.  Try to gather some extra data the
"easy way" adding more error logging for these situations in the hope
to find a clue or at least do more targetd debugging in the future.
Note that for one of the errors the Linux Intel driver has a TODO to
print register data.  If that will show up in future versions of the
driver this may also help.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit e674ddec0b4138274539587fe9336b577ff1242a)

21 months agonet80211: simplify an #ifdef INET/INET6 block
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:35:42 +0000 (22:35 +0000)]
net80211: simplify an #ifdef INET/INET6 block

I got lost in the #ifdef #endif here so I changed the code to a
switch block with two non-overlapping #ifdef parts and a default
which makes it a lot easier to read.

No functional changes.

Sponsored by: The FreeBSD Foundation
Reviewed by: (zlei.huang gmail.com)
Differential Revision: https://reviews.freebsd.org/D36411

(cherry picked from commit 8def06d5afdcd8020a039b1de994cfe6ad18229e)

21 months agonet80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA
Bjoern A. Zeeb [Wed, 31 Aug 2022 22:19:32 +0000 (22:19 +0000)]
net80211 / drivers: rename to IEEE80211_FC0_SUBTYPE_QOS_DATA

Going through the Frame (Sub)types the "QOS Data" being called "QOS"
scheme leads to a naming conflict for QOS_CFPOLL and QOS_CFACKPOLL
(if added).   Rename QOS* to QOS_DATA* to avoid the conflict and
to also better match the standards name.

No functional changes intended.

Sponsored by: The FreeBSD Foundation
Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D36409

(cherry picked from commit c9b7e9df18e413a27bbddd776315a595255453f1)

21 months agoLinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()
Bjoern A. Zeeb [Mon, 5 Sep 2022 20:57:17 +0000 (20:57 +0000)]
LinuxKPI: 80211: improve linuxkpi_ieee80211_get_tid()

Continue what was started in 26a36948331bd08d9afaddfc0da724eacdb953dd
in iwlwifi and extend out internal implementation of
linuxkpi_ieee80211_get_tid() by an argument as to whether "no-QoS"
answers are acceptable.  For the LinuxKPI ieee80211_get_tid() set
this to false as the Linux derived drivers seem to do extra checks
for the QoS-Data frame before acquiring the tid.
Add KASSERTs to enforce the extra argument.
This allows us to use the net80211 variant in LinuxKPI for other
means explicitly documenting that we do accept a IEEE80211_NONQOS_TID.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ec190d91500676614feaf6456084369325ddcaa0)

21 months agoiwlwifi: move an ieee80211_get_tid() call
Bjoern A. Zeeb [Wed, 31 Aug 2022 23:01:36 +0000 (23:01 +0000)]
iwlwifi: move an ieee80211_get_tid() call

Introduce a local change.  It seems ieee80211_get_tid() does not deal
with non-dataqos packets unlike net80211's ieee80211_gettid().
Gernally all calls in Linux drivers to ieee80211_get_tid() seem to
be proceeded by an ieee80211_is_data_qos() check.

Moving the ieee80211_get_tid() has no difference in the result, but
(a) saves us the call if we do not need it due to an earlier return,
and (b) allows us to put an assert into the LinuxKPI ieee80211_get_tid()
implementation to avoid accidentally returning random frame header data
in case of a missing earlier ieee80211_is_data_qos() check in (future/
other) drivers.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 26a36948331bd08d9afaddfc0da724eacdb953dd)

21 months agoLinuxKPI: 80211: scanning code updates
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:40:51 +0000 (23:40 +0000)]
LinuxKPI: 80211: scanning code updates

For consistency rename LKPI_SCAN_RUNNING adding a LHW_ prefix.
Add a local flag LKPI_LHW_SCAN_HW mirroring the net80211
IEEE80211_FEXT_SCAN_OFFLOAD flag.
Slightly simplify the code.
Overload (*ic_scan_curchan) and (*ic_scan_mindwell) so that we can
call the net80211 implementation in case of software scan but skip it
in case of full-offload scans.
Also add a bandaid to our (*ic_set_channel) implementation to not siwtch
channels if we have an active hw_scan running.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation (partially)

(cherry picked from commit a486fbbd7876bed81d738a32274953c89906edb5)

21 months agoLinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream
Bjoern A. Zeeb [Sat, 3 Sep 2022 23:11:05 +0000 (23:11 +0000)]
LinuxKPI: 80211: implement (*get_antenna) and set ic_[rt]xstream

Implement the mac80211 (*get_antenna) call and after checking any
antenna information present query the current configuration on startup
(both informations should be identical at this point in theory).
Both the wiphy variables and function call report a bitmask not a count.
Count the bits for net80211 for as long as we get away with just a
number in ic_[rt]xstream.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 527687a9e30aef2e5e0c0c5b5e64e6059f1a37a4)

21 months agoLinuxKPI: 80211: make HW_CRYPTO compileable again
Bjoern A. Zeeb [Sat, 3 Sep 2022 22:51:16 +0000 (22:51 +0000)]
LinuxKPI: 80211: make HW_CRYPTO compileable again

Rename TRY_HW_CRYPTO to LKPI_80211_HW_CRYPTO for consitency and make
it compileable again in case someone wants to sit down and make it
work.  It's probably not too much to do.  Otherwise I might eventually
get around to it.

Obtained from: bz/wireless-dev
Sponsored by: The FreeBSD Foundation

(cherry picked from commit b35f6cd066128f8cf0b7f3125529f59dd8ba3059)

21 months agoLinuxKPI: extend kfifo to be usable
Bjoern A. Zeeb [Sat, 16 Jul 2022 00:36:55 +0000 (00:36 +0000)]
LinuxKPI: extend kfifo to be usable

Implement some basic kfifo pieces as needed by drivers.

Reviewed by: wulf, hselasky
Differential Revision: https://reviews.freebsd.org/D35829

(cherry picked from commit 4a7e8c7bd40bc39b3e247df069fa913f0197ea01)

21 months agoLinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf
Bjoern A. Zeeb [Sat, 27 Aug 2022 14:48:09 +0000 (14:48 +0000)]
LinuxKPI 802.11: change type of bssid in struct ieee80211_bss_conf

Enabling other driver code found that the bssid in
struct ieee80211_bss_conf is not an array but expected to be
a const pointer (const, != NULL checks).
Adjust accordingly in the header and in the LinuxKPI compat code.
There initialization now needs to be a static array always present
as we need a value before we will have a BSS (node in scan_to_auth)
as the mac80211 driver (*handlers) are expecting the pointer to be
not NULL (copying without checks).
This is a pre-req to enable d3 (CONFIG_PM[_SLEEP]) in the future.

Tested by: Tomoaki AOKI (junchoon dec.sakura.ne.jp)
Tested by: Berislav Purgar (bpurgar gmail.com)
Sponsored by: The FreeBSD Foundation

(cherry picked from commit caaa79c3f8c692b9822df74a2dc0a37e4ab33a3b)

21 months agonet80211: consistently use the IEEE80211_M_ memory related options
Bjoern A. Zeeb [Wed, 17 Aug 2022 18:33:08 +0000 (18:33 +0000)]
net80211: consistently use the IEEE80211_M_ memory related options

Replace a malloc() by IEEE80211_MALLOC().
For malloc flags even in the local ieee80211_freebsd.c there was a mix
of both versions M_ and IEEE80211_M_.
Consistently use the IEEE80211_M_ malloc options everywhere.
If the field is changed for malloc, it'll also be changed for the
other accessor functions taking a "how" field to avoid any confusion.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36249

(cherry picked from commit bd29f81763aa9cac74c75b663c2cf46723f05528)

21 months agonet80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*
Bjoern A. Zeeb [Wed, 17 Aug 2022 21:59:07 +0000 (21:59 +0000)]
net80211: LinuxKPI 802.11: harmonize IEEE80211_VHT_MCS_*

Rather than defining the same values in two places and having to do
conflict resulution on the name in LKPI, change the defines to an
enum in net80211.  In addition to de-duplication this also gives us
value checks in certain cases.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36250

(cherry picked from commit 8d371164898141673ad3bfe6ee771931569e07d2)

21 months agonet80211: ieee80211_ies_expand() add extra length check
Bjoern A. Zeeb [Wed, 17 Aug 2022 16:48:37 +0000 (16:48 +0000)]
net80211: ieee80211_ies_expand() add extra length check

Make sure the given IE length fits into the total length left when
parsing through the information elements.  In theory I would say
discard everything if there is an error but that proves hard with
the current code.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D36245

(cherry picked from commit 9d2ba51806c32e7ea8ad83439cb48df91575b5bf)

21 months agoiwlwifi firmware: update to -73 / newer builds for 9xxx
Bjoern A. Zeeb [Sun, 31 Jul 2022 00:36:23 +0000 (00:36 +0000)]
iwlwifi firmware:  update to -73 / newer builds for 9xxx

Update iwlwifi 22000 firmware to -73 and rebuilds for 9000/9260.
Update the driver to accept the newer version.

Firmware was obtained from linux-firmware at
150864a4d73e8c448eb1e2c68e65f07635fe1a66.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit 13a7663c521ac3541756aa1157dcfce9f0ce78e8)

21 months agortw88: correct a typo in man page
Andres Ramirez [Sun, 7 Aug 2022 23:06:28 +0000 (23:06 +0000)]
rtw88: correct a typo in man page

s/mmeory/memory/

(cherry picked from commit 13e9d624f2f4741e40ff7b8395d7173f319f548d)

21 months agoLinuxKPI: 802.11 header updates
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:23:49 +0000 (15:23 +0000)]
LinuxKPI: 802.11 header updates
LinuxKPI: 802.11: add missing linuxkpi_cfg80211_bss_flush()

While working on new and updates to drivers more structs, fields,
functions, .. were found, had to be shuffled around, ..
Some of these are (so far still dummy) functions or not properly
typed fields.  The IEEE80211_HE_ constants are all still dummy.
This was msotly as a start to make new (out-of-tree) things compile.

Sponsored by: The FreeBSD Foundation (minor VHT/chan width bits)

Add the missing implementation of linuxkpi_cfg80211_bss_flush().
without this we get unresolved symbols and drivers won't load.

Reported by: eduardo, Berislav Purgar (bpurgar gmail.com)

(cherry picked from commit b0f73768220e945deebebefc4a2d63ae6a3bfe19)
(cherry picked from commit d8dd6b329e4653a2aca308102187797d44afc2c4)

21 months agonet80211: change order in ieee80211_vhtchanflags()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:18:48 +0000 (00:18 +0000)]
net80211: change order in ieee80211_vhtchanflags()

While 80P80 is less likely to be used, VHT160 (a single contiguous
width) is harder to acquire but also preferable so return that first.

Sponsored by: The FreeBSD Foundation
Reviewed by:    adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 195733401f431622df3185897cd04c1aeb113e0d)

21 months agonet80211: add VHT5G and VHT2G checks/return to media_status
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:10:34 +0000 (00:10 +0000)]
net80211: add VHT5G and VHT2G checks/return to media_status

Add the fields for VHT (2Ghz and 5Ghz) to report back by media_status
so we actually have a chance to get the right information.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 656d0e8fa92ad72626808479d0935814425ee78d)

21 months agoLinuxKPI: skbuff: sort list header and add new (dummy) functions
Bjoern A. Zeeb [Fri, 29 Jul 2022 15:21:48 +0000 (15:21 +0000)]
LinuxKPI: skbuff: sort list header and add new (dummy) functions

While working on new and updates to drivers more skbuff changes
came up.  Sort out the list/prev/next header problem and add more
(so far dummy) functions needed.

(cherry picked from commit 89c32dafa560fe0e0259f14185ceefbcee3dcec6)

21 months agonet80211: correct IEEE80211_FEXT_BITS
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:03:37 +0000 (00:03 +0000)]
net80211: correct IEEE80211_FEXT_BITS

Correct IEEE80211_FEXT_BITS adding the missed one and move the later
one further.  This will actually make VHT to show.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 463d6125e7bff6504099f34e4fe7aa0a68166e6e)

21 months agonet80211: radiotap: add one more define for HE
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:56:07 +0000 (23:56 +0000)]
net80211: radiotap:  add one more define for HE

Add one more define for HE radiotap used by a driver.

Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit c7a8db6a8556b1a99e94f010bdf3485a5f3fdd32)

21 months agonet80211: improve DDB output.
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:05:51 +0000 (00:05 +0000)]
net80211: improve DDB output.

Start adding more fields to DDB output related to VHT (11ac) and
mark COM, VAP, and STA more explicitly to make show all vaps /..
more readable.

Sponsored by: The FreeBSD Foundaton
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit 5c9f992919eee6771dd15da278228e5f3bcee7b6)

21 months agonet80211: add more 802.11ac Element IDs
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:59:08 +0000 (23:59 +0000)]
net80211: add more 802.11ac Element IDs

Add more Element IDs for VHT (11ac) to complete the current list
and we can use them if/as needed.

Sposnored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit a78be09e4d1aa8a2117f71d96093d4884c211903)

21 months agonet80211: VHT correct check/option in ieee80211_vht_adjust_channel()
Bjoern A. Zeeb [Fri, 29 Jul 2022 00:12:34 +0000 (00:12 +0000)]
net80211: VHT correct check/option in ieee80211_vht_adjust_channel()

In ieee80211_vht_adjust_channel() we have to check for all possible
IEEE80211_FVHT_VHT* options using the mask rather than just checking
for IEEE80211_FVHT_VHT;  ieee80211_vhtchanflags() (contrary to its
HT counterpart) only returns the "highest" flag nor or-ing them together
with the base flag.  For the moment this seems to make sense as with
more width options we'd add a pyramid.

Later on, in the same function when we get VHT160 actually go and look
for VHT160 and not VHT80.

Sponsored by: The FreeBSD Foundation
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D35977

(cherry picked from commit dc32c7133921a34f3144a4b5fc4f7c1f6cddbd1f)

21 months agoLinuxKPI 802.11/iwlwifi/rtw88: update KPI
Bjoern A. Zeeb [Thu, 28 Jul 2022 23:39:03 +0000 (23:39 +0000)]
LinuxKPI 802.11/iwlwifi/rtw88: update KPI

Upgrade the argument of (*bss_info_changed) mac80211 ops function call
from 32 to 64 bit.
Add an extra argument to ieee80211_beacon_get_template().

Both changes are needed in order to keep other out-of-tree drivers in
synch and to move forward.

The driver changes were extracted from Linux wireless-testing
7b7090b4c6a906cc7c3e2a460335f705b93f4506 and
6e8912a503759bb8f1f01c5b761d0d45815fa6de.

Sponsored by: The FreBSD Foundation

(cherry picked from commit 467d3e2e8aa3157794d0c7adc7884b1c4a5535c1)

21 months agoUSB: add 2 (3) more device IDs for rtw88-usb devices and a quirk
Bjoern A. Zeeb [Wed, 7 Sep 2022 23:48:59 +0000 (23:48 +0000)]
USB: add 2 (3) more device IDs for rtw88-usb devices and a quirk

Add DLink DWA-182 rev D1 and generic Realtek RTW8821CU entry found on
a Tenda U10 USB WLAN Stick, AC 650 Mbps (and possibly more devices).
The latter first presents itself as a CD device with Windows drivers
(useless on FreeBSD) first so add a quirk for that we get the wireless
device right away.

While here sort some other Realtek entries by DeviceID.

(cherry picked from commit b3b6a959c85af3aabbde3ef2b80dbd4bf5b6f5a7)

21 months agoifconfig: print interface name on SIOCIFCREATE2 error
Bjoern A. Zeeb [Tue, 6 Sep 2022 13:09:39 +0000 (13:09 +0000)]
ifconfig: print interface name on SIOCIFCREATE2 error

We have repeatedly gotten reports of unclassified SIOCIFCREATE2 errors
(usually "Device not configured").  This can happen if there is
configuration for interfaces in rc.conf which do not (yet) exist and
we try to configure.  I can, e.g., provoke this by configuring wlan
interfaces with their physical interface not installed.
In order to cut support (guesswork) down print the name of the
interface to be configured with the error message.
Hopefully this will help us in the future to improve other configuration
or driver problems.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit ac606903a800bc4ce80bc6fa1374b45efcdb7014)

21 months agods1307: add support for the EPSON RX-8035SA I2C RTC
Mathew McBride [Sat, 23 Jul 2022 00:29:16 +0000 (00:29 +0000)]
ds1307: add support for the EPSON RX-8035SA I2C RTC

The EPSON RX-8035SA I2C RTC has a similar time register layout to the
ds1307 family, with some minor differences in bit positions, polarity
and control registers.  Further generalize ds1307 to make it easier
to add more compatible chips and add support for the EPSON RX-8035SA.

Sponsored by: Traverse Technologies
Differential Revision: https://reviews.freebsd.org/D35837

(cherry picked from commit 2486b446db8270a7d6dc7f3c6df0a88c4745b527)

21 months agoXHCI: remove a self-assignment
Bjoern A. Zeeb [Sun, 7 Aug 2022 22:46:55 +0000 (22:46 +0000)]
XHCI: remove a self-assignment

x = x is an unneeded operation, remove it.
The value is read and assigned above for real.

(cherry picked from commit d3ef3c4cf818b1aac6a51402ec27b6762d9feb1f)