mdmfs: Use standard bool definition
Include `<stdbool.h>` instead of defining a local bool enum.
This avoids duplicating a standard type name and keeps the
source compatible with headers that provide bool as a macro,
or in case of C23 that compilers provide it as keyword.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: fuz
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2203
(cherry picked from commit 64502126e126476456ca2aa60b4f798ed2d0b879)
rpcsvc: Remove obsolete bool definition from yp_prot.h
`yp_prot.h` has carried a SunRPC-era typedef of `bool` guarded by
`BOOL_DEFINED`, but the header itself does not use it. The YP/RPC
interfaces use `bool_t` for protocol booleans.
Defining `bool` in a public header collides with modern C headers
that provide `bool` as a macro or keyword, such as `<stdbool.h>`
and C23-aware assert handling. Drop the compatibility typedef and
leave `bool` definition to the consumer's language mode.
Signed-off-by: Faraz Vahedi <kfv at kfv.io>
Reviewed by: fuz
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2203
(cherry picked from commit 60c11e7c54d0128fafcea9c804c7736e2fb53e37)
sys/arm64: fix return values of freebsd32_{set,swap}context()
This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.
In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.
Tested by: fuz
MFC after: 1 week
(cherry picked from commit 92ae21e8a155734f73589b7ef9fa19a6bb6d042f)
sys/arm64: fix return values of freebsd32_{set,swap}context()
This patch aligns the return values of freebsd32_{set,swap}context()
with their counterparts on amd64 and powerpc64, fixing the setcontext()
and swapcontext() calls in armv7 applications running on aarch64.
In particular, this fixes random crashes in armv7 Ruby applications
running on aarch64 hosts.
Tested by: fuz
MFC after: 1 week
(cherry picked from commit 92ae21e8a155734f73589b7ef9fa19a6bb6d042f)
Vendor import of pkgconf 2.9.93
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-2.9.93.tar.gz
SHA1: 6bcbedc97081e17ea58e0164adea2ab827acfe23 -
SHA256: b9632d0d91321f56645de720fd8cd3584b0d0ca8ff13a3d9d5285888869fcc98 -
SHA512: e014096f5486b7cdfa8c6410992b9143b63c7ef0ba540c7cad09923867c3924b951c1dfbd9a85f6d786b0deb30be1b7284f67317f4b261b6e0eca70b20ace1af -
One test folder in tests/lib1 had to be removed to avoid UTF-8 filenames
in the tree. (Breaks `make create-source-packages`)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57890
Vendor import of pkgconf 2.9.92
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-2.9.92.tar.gz
SHA1: 865d15aac5e720a8897b14e0f475736a810a9340 -
SHA256: 1eeda57d5f7b8dd346278ea164536f313366bb10d531d7c490be439638942f6d -
SHA512: a66960f79f83508e372ef948ec98f906abb31aed0b4c1a667f2cf8235f55ede1553fc5dfd1baaa6217a2d82c725448e64207b1dfb858f21fdb12f82e6771546f -
One test folder in tests/lib1 had to be removed to avoid UTF-8 filenames
in the tree. (Breaks `make create-source-packages`)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57856
Vendor import of pkgconf 2.9.91
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-2.9.91.tar.gz
SHA1: 8ac84e584ff568dace16f9012efcec603b78ca34 -
SHA256: 68de1892189f085ab21e735561c67b5a077b85e0ce29f91ac774c3ad1afbfc94 -
SHA512: b069c7e9266059a126443392853b353845f0ebffd1591bdbc5582853016074d284d3b2f3a2b6588deb29a662bb712f05261c9bca81452d6de536018dbc9d4314 -
One test folder in tests/lib1 had to be removed to avoid UTF-8 filenames
in the tree. (Breaks `make create-source-packages`)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57855
Vendor import of pkgconf 2.9.90
Obtained from https://github.com/pkgconf/pkgconf/archive/refs/tags/pkgconf-2.9.90.tar.gz
SHA1: ebfb0525c019eda14190d463680cb1625f3177f9 -
SHA256: f5c10610be8ea7278fc31ad63b943525b5b2a2f6e5038d3c11947f5bd6fd214d -
SHA512: f93e6d15d25d02869a03ba339e18582f01a9b7241be89a87183c0f373a3df78d1be005dee376ea464f7942735700f51dab57b8688bc802ec152ff343af721f46 -
One test folder in tests/lib1 had to be removed to avoid UTF-8 filenames
in the tree. (Breaks `make create-source-packages`)
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57837
LinuxKPI: 802.11: adjust timing of sync_from_ni in lkpi_sta_assoc_to_run()
We used to call the (*sta_state) downcall into the driver to set the
sta state to ASSOC. After that we did a lot of sync operations incl.
the lkpi_sta_sync_from_ni() which does a lot of rate and bandwith
adjustments. This sync call needs to happen before we set the sta
to assoc as drivers rely on some of this information, e.g., ht_cap and
vht_cap (and equivalents for later standards) at that point. Moving
this will make, e.g., mt7921 transmit at higher rates than just
basic_rates.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 75aadc902298005c47d2b931c483452027ceae69)
LinuxKPI: 802.11: track bandwidth/rx_nss change in lkpi_sta_sync_from_ni()
In lkpi_sta_sync_from_ni() track the bandwidth and rx_nss at the
beginning so at the end we can diff if they changed in order to generate
the appropriate RC*CHNAGED flags for the (*link_sta_rc_update) downcall.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 53d9c14af6a65dcc037527c6ff5308c94806fafe)
LinuxKPI: 802.11: consider emulate_chanctx in lkpi_sync_chanctx_cw_from_rx_bw()
Only return early if the bandwidth has not changed and we are not
using emulate_chanctx or the chandef.width already matches the new
bandwidth. Otherwise we have to continue to get all the values
updated.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit cff565a4c0335e12376ea43f99ef5328c45ce933)
LinuxKPI: 802.11: add/change rate related tracing
Make use of the TRACE_RATES() macro and add various tracing events.
Also adjust some events formerly under TRACEOK to TRACE_RATES().
Ignoring the tracing, no other functional changes.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 42cf2798110e12df6ccc22a138ed89617ac7d407)
LinuxKPI: 802.11: add function to update some rate related fields
Add lkpi_sta_supp_rates() which serves multiple purposes:
(a) build (and update) the supp_rates field on a sta link (deflink only
in our case still),
(b) build and update basic_rates on the vif->bss_conf and print a
warning in case we end up without any basic rate (should not happen
anymore, not even on initial startup sync),
(c) if HT or VHT are supported, then update the relevant br_mask fields
for the current band.
Deal with the various flags which trigger different updates by returning
them so the caller can act upon.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 0d3cd54642f6695f9f82b82402f27e10bbee7cfc)
LinuxKPI: 802.11: make lkpi_sta_sync_from_ni() return bss_changes
This is a preparatory change with no functional changes.
Sponosred by: The FreeBSD Foundation
(cherry picked from commit 038489e46ea3e77484ea85c4369610ba3ee8381b)
LinuxKPI: 802.11: initalize br_mask and basic_rates for each vap
During vap creating we inialize most [l]vif related variables.
Add a br_mask (bit rate mask) to the lvif and setup the legacy component
as it seems to be static.
Given we are looping over the bands, also initialize the bss_conf
basic_rates. At this point we only have all bitrates for the band
or the mandatory bitrates for the band available. In order to not
hint usage of possibly unsupported bit rates set it up with the
manadatory bit rates only, which should get us through the mgmt
frames, etc. to get to assoc state. By then we will do updates.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 7bf2eec68a293a22f332fc1592dffaa4ed9f0809)
LinuxKPI: 802.11: introduce TRACE_RATES()
Add a tracing bit for tracing rates related changes introduced in
followup commits.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit b58d8df5829233ced7024c30a0a979e2e0a722fd)
LinuxKPI: 802.11: add 11g check to lkpi_ic_getradiocaps()
Replace an early comment with code and add a (simplified) 11g check.
We make use of the annotated bitrate flags we added (see
lkpi_wiphy_band_annotate()) and check if on the 2GHz band there are
any bitrates which are 11g. Upon the first one found we do set the
IEEE80211_MODE_11G to announce to net80211 that the 2.4Ghz channels
may operate on 11g as well.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit d4a529ad0d5638ad3e8d27815948b0a7c4628e3f)
LinuxKPI: 802.11: add/improve/correct comments
Adjust/add comments to clarify certain situations.
No functional changes.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 08a78a296c840aa95ec13895c3c9bf1349becbae)
LinuxKPI: 802.11: leave a comment for sta->rates (mt7615, ?)
While we currently try to fill most rates places (e.g., basic_rates,
supp_rates, (*set_bitrate_mask)), sta->rates are not populated.
They are likely managed by the 802.11 rate control code (given no
ieee80211_hw_check HAS_RATE_CONTROL), which for use would be net80211,
which will require some extra code just to manage that.
At least Mediatek mt76 (mt7615) driver seems to fall into the category
of this need. See about that once/if we get to it.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 557eed60d2a34d061350ac37acebe6686cd80d83)
mt76: mt7925: prevent PM from scheduling another delayed work on detach
This duplicates 009d92b25f7c from mt7921 which has the full description.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 482fda9814937691557ebadd0930535ff3d301b0)
LinuxKPI: scatterlist.h: implement sg_init_marker()
Add sg_init_marker() which is needed by mt76 drivers USB attachment.
Sponosored by: The FreeBSD Foundation
Reviewed by: emaste, dumbbell
Differential Revision: https://reviews.freebsd.org/D57594
(cherry picked from commit 3d0b6c69dced4936fccff6733912a0ef93214dbe)
LinuxKPI: add KERNEL_VERSION() macro
Add a KERNEL_VERSION() macro which normally would be in linux/version.h.
On Linux that file is auto-generated and we are supporting more than
one Linux version in LinuxKPI anyway so any further defines in there
would likely be wrong.
Adding the macro helps to support (vendor/out of tree) drivers more
easily which are supporting multiple Linux versions.
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D57590
(cherry picked from commit c5d6e2085a471cbb75cc7b88b37a2fe6276c16f8)
LinuxKPI: 802.11: lock down mac80211 downcalls
Add lock assertions and "might_sleep" annotations to various
mac80211 operation downcalls into the driver.
Make sure the code to these is all covered by locks--pushing more wiphy
lock into the code--or lock assertions as well. Split up parts of the
MC code up into an unlocked and locked version to avoid recurive locking.
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 1c601bf516ebefb1670f5612316c501f2ae2654a)