If people like me having multiple cards in the same system
creating the debugfs dirctory leads to a panic upon attaching
the 2nd card due to the duplicate name.
Rather than using the hard coded driver name, use the device name
(e.g., rtw880, rtw881, rtw882).
This solves two issues: it avoids the duplicate name and we get
individual debugging/statistic information for each card.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
X-Note: ath1[01]k and mt76 likely will need a similar change
Implement the combination of all four functions, the *_vif versions
from mac80211.h as a wrapper to the non-*_vif ones in cfg80211.h.
Put the function pairs next to each other and in the right files
and harmonize argument naming, etc.
Both of them have shown up too often in the todo-tracing to bother
enough to implement them now for a time in the future when we will
support HE/EHT.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
Given the channel struct has an extra bool we cannot assign the
information 1:1 to net80211. While the caps where assigned the
suppoerted mcs sets were not. Fix that.
Sponsored by: The FreeBSD Foundation
MFC after: 3 days
A tcpcb in TCPS_LISTEN has always socket in SO_ACCEPTCONN. One block
above there is an assertion that proves that this never happens. We
stopped ever clearing SO_ACCEPTCONN back in 779f106aa1.
This reverts commit 982c1675ff.
Reviewed by: cc, markj
Differential Revision: https://reviews.freebsd.org/D48710
This returns an nvlist indicating if a Fabrics host is connected and
the time of the most recent disconnection.
Reviewed by: imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48219
Both nvme and nvmf cache a copy of the controller's identify data in
the softc. Add an ioctl to fetch this copy of the cdata. This is
primarily useful for allowing commands like 'nvmecontrol devlist' to
work against a disconnected Fabrics host.
Reviewed by: dab, imp
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D48218
This MD function is invoked before dumping register set notes when
writing out a core dump to ensure that the PCB for a given thread is
up to date. This provides a centralized place to update the PCB with
values of the current thread for each arch rather than doing this work
in each register set's get method.
Discussed with: jrtc27
Reviewed by: kib, markj
Sponsored by: AFRL, DARPA
Differential Revision: https://reviews.freebsd.org/D44910
This is generally harmless but can trigger spurious warnings on the
console due to duplicate attempts to disable LUNs.
Sponsored by: Chelsio Communications
Firstly, pagecount is a u_long so we should ensure j is the same for the
sake of 64-bit systems. Secondly, ptoa is just a macro, and does not
cast its argument, so in order to handle PAE systems correctly we need
to cast j to vm_paddr_t (the type of startp).
Fixes: 0078df5f02 ("vm_phys: reduce touching of page->pool fields")
[Why]
The mutex initialized in `xa_init_flags()` is not destroyed here on
purpose. The reason is that on Linux, the xarray remains usable after a
call to `xa_destroy()`. For instance the i915 DRM driver relies on that
during the initialixation of its GuC. Basically, `xa_destroy()` "resets"
the structure to zero but doesn't really destroy it.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48762
[Why]
This function is used by hhe DRM generic code starting with Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48761
[Why]
The i915 DRM driver relies on this chain of includes to access the
definition of `struct tasklet_struct` in `<linux/interrupt.h>`.
Reviewed by: imp, manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48760
[Why]
This is used by the amdgpu DRM driver starting with Linux 6.7.
[How]
The function just returns 0 for now.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48759
[Why]
This is used by the amdgpy DRM driver starting from Linux 6.7.
[How]
The function always returns false, like `pci_is_thunderbolt_attached()`
because we don't have an API for this in FreeBSD yet.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48758
[Why]
This is used by the i915 DRM driver starting from Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48757
[Why]
In Linux 6.7, the signature of `get_file_rcu()` changed significantly,
going from:
bool get_file_rcu(struct linux_file *f);
... to:
struct linux_file * get_file_rcu(struct linux_file **f);
I.e., both the argument and the return value changed in an incompatible
way.
This is used by the i915 DRM driver.
[How]
This patch introduces the variant and hide the new prototype behind
`LINUXKPI_VERSION >= 60700`.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48756
[Why]
The i915 DRM driver started to access the `xa_lock` field in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48754
[Why]
This function is used by the i915 DRM driver starting with Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48753
[Why]
This function is used by the i915 DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48752
[Why]
Some files in the i915 DRM driver in Linux 6.7 depend on these implicit
inclusions.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48751
[Why]
It is already defined in <asm-generic/io.h> to use the FreeBSD versions.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48750
[Why]
This is used by the amdkfd DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48749
[Why]
This field is used by the i915 DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48748
[Why]
This new API is used by the amdgpu DRM driver is Linux 6.7.
[How]
This is the same as `pci_get_class()` except that it searches a PCI
device matching the base class only; the subclass is ignored.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48746
[Why]
linuxkpi needs to export `pci_get_base_class()` for DRM drivers from
Linux 6.7.
[How]
This new function searches a PCI device with the given base class and
returns it, regardless of its subclass.
The behavior is the same as `pci_find_class_from()` but the subclass is
ignored.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48745
[Why]
This is used by the amdgpu DRM driver in Linux 6.7.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48744
[Why]
DRM drivers in Linux 6.7 already use this constant.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48742
[Why]
Some files in DRM rely on namespace pollution: they use the
<linux/rcupdate.h> API without including it explicitly.
[How]
Reproduce the Linux chain of includes even if it means nothing on
FreeBSD. This allows consumers of <linux/idr.h> to "inherit"
<linux/rcupdate.h> API.
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48741
In 4cc5d081d8, a change was introduced that manipulated
drv_ioctl_data->reqcap using IFCAP2 bits. This was noticed
when creating a mixed lagg with mce0 and ixl0 caused the
interfaces' txcsum caps to be disabled.
Fixes: 4cc5d081d8
Reviewed by: glebius
Sponsored by: Netflix
MFC After: 7 days
UFS1 uses a signed 32-bit value for its times. Zero is
January 1, 1970 UTC. Negative values of 32-bit time predate
January 1, 1970 back to December 13, 1901. The maximum positive
value for 32-bit time is on January 19, 2038 (my 84th birthday).
On that date, time will go negative and start registering from
December 13, 1901. Note that this issue only affects UFS1 filesystems
since UFS2 has 64-bit times. This fix changes UFS1 times from
signed to unsigned 32-bit values. With this change it will no longer
be possible to represent time from before January 1, 1970, but it
will accurately track time until February 7, 2106. Hopefully there
will not be any FreeBSD systems using UFS1 still in existence by
that time (and by then I will have been dead long enough that no-one
will know at whom to yell :-).
It is possible that some existing UFS1 systems will have set times
predating January 1, 1970. With this commit they will appear as
later than the current time. This commit checks inode times when
they are read into memory and if they are greater than the current
time resets them to the current time. By default this reset happens
silently, but setting the sysctl vfs.ffs.prttimechgs=1 will cause
console messages to be printed whenever a future time is changed.
Reviewed-by: kib
Tested-by: Peter Holm
MFC-after: 1 week
Differential Revision: https://reviews.freebsd.org/D48472
Per the "Intel® 64 and IA-32 Architectures Software Developer’s Manual
Combined Volumes: Vol. 3B 17-7", the Green and Yellow threshold
indicators are mutually exclusive. Add the missing `break` statements so
they're treated that way.
MFC after: 1 week
Reported by: Coverity
Differential Revision: https://reviews.freebsd.org/D48722
Use uint32_t for anything that is derived from message length, use
uint16_t for anything that represents attribute length and use u_int for
array indices.
Child devices handling I/O port resources (such as PCI-e bridges)
should map those to a memory resource and pass up a request for the
translated memory resource.
Differential Revision: https://reviews.freebsd.org/D48501
Change the usage of the pool field in vm_page structs.
Currently, every page belongs to a pool, and the pool field identifies
that pool, whether the page is allocated or free.
With this change, the pool field of the first page of a free block is
used by the buddy allocator to identify its pool, but the buddy
allocator makes no guarantees about the pool field value for allocated
pages. The buddy allocator requires that a pool parameter be passed as
part of freeing memory. A function that allocates memory may use the
pool field of a page to record what pool to pass as that parameter
when the memory is freed, but might not need to do so for every
allocated page.
Suggested by: alc
Reviewed by: markj (previous version)
Tested by: pho
Differential Revision: https://reviews.freebsd.org/D45409
The change is clearly wrong as it removes a dereference of the pointer
into the stack. Just revert for now.
This reverts commit 70c0670622.
Reported by: jrtc27
On arm64, the FBT provider treats tail calls as return probes. Ignoring
the question of whether this is really correct, the implementation is
wrong: instr is a pointer to uint32_t, so the removed multiplication by
the instruction size is wrong. As a result, FBT would create return
probes for intra-function branches.
MFC after: 2 weeks
Sponsored by: Innovate UK
The use of memcpy here is redundant, and also incorrect since memcpy()
might be instrumented by fbt or kinst. dtrace_bcopy() exists, but we
don't need it.
MFC after: 2 weeks
Sponsored by: Innovate UK