Commit graph

43742 commits

Author SHA1 Message Date
Piotr Kubaj
2e16618fe7 ipmi: fix runtime on powerpc64le
Summary:
OPAL runs in big-endian mode, so we need to byteswap msg_len on little-endian.

MFC after:	1 week

Test Plan: ipmitool lan print

Reviewers: #powerpc

Subscribers: imp

Differential Revision: https://reviews.freebsd.org/D49530
2025-03-27 12:57:28 +01:00
Adrian Chadd
d342ae6719 uath: add support for GCMP-128 encryption
Explicitly set the software ciphers; add support for GCMP-128.

Locally tested:

* AR5523 11abg NIC, 2/5GHz STA operation, GCMP forced
  in wpa_supplicant.conf

Differential Revision:	https://reviews.freebsd.org/D49370
Reviewed by:	bz
2025-03-26 18:28:47 -07:00
Adrian Chadd
077108d94a rtwn: add support for AES-GCM-128 in the supported software cipher set
I'm testing this with rtwn(4) NICs right now, so enable it here.

Locally tested:

* RTL8812AU / RTL8821AU, STA mode (with some wpa_supplicant.conf
  shenanigans to force GCMP as the pairwise key to an OpenWRT AP
  configured to use GCMP but without requiring MFP.)

Differential Revision:	https://reviews.freebsd.org/D49190
Reviewed by:	bz
2025-03-26 18:28:46 -07:00
Ruslan Bukin
3969b51ffa xilinx axi ethernet: allocate memory for buffers.
The xae(9) driver expects that the "memory-region" property is always
provided in its DTS node, but this is not a case for every platform.

If the property is not provided, then no restriction on buffer location
is in place and busdma backend could be used.

Since the Xilinx AXI DMA engine driver does not support busdma(9), then
allocate some memory for buffers manually, so we don't panic.

This fixes operation on Codasip A730.
2025-03-26 15:14:13 +00:00
Ruslan Bukin
c7ffe32b1b xilinx quad spi: various fixes.
- add compat table and a string for an older IP
- name driver properly
- depend on ofw_spibus
- add missing ofw_bus_get_node() method
- connect to GENERIC (similar to other Xilinx IP)

Tested on Codasip A730.
2025-03-26 12:08:27 +00:00
Christos Margiolis
2f1f523a45 snd_hda: Patch Framework 16 AMD
Reported by:	jrm
Tested by:	jrm
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D49416
2025-03-25 20:13:59 +01:00
Adrian Chadd
23db5fccb6 hda: add macbook air 6,1 and 6,2 GPIO to enable amplifier
GPIO0 needs to be flipped on to enable the amplifier.

The CS4208 looks /sort/ of like previous cirrus logic codecs,
enough for audio to work.  This actually provides working audio
on my mbair 6,2 but it doesn't yet detect the jack.

That requires patches to the pin configs, which is going to
need some further work.

Differential Revision: https://reviews.freebsd.org/D49350
Reviewed by: christos
2025-03-22 08:56:34 -07:00
Christos Margiolis
fc40132603 snd_hda: Support Intel Raptor Lake 0x7a50
PR:		276379
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste, markj
Differential Revision:	https://reviews.freebsd.org/D49389
2025-03-19 19:18:37 +01:00
Navdeep Parhar
c22b297062 cxgbe(4): Add two new transceiver types.
Future firmwares will report these types to the driver.  These
transceivers work already but are misidentified as a different type.

MFC after:	1 month
Sponsored by:	Chelsio Communications
2025-03-18 11:36:00 -07:00
Stephen Hurd
0f684b5aec Disable HS200 on rockchip_dwmmc in attach
HS200 mode requires tuning, and there is no code to perform this
tuning at present.  Until there is, leave HS200 mode disabled.

Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D49400
2025-03-18 13:01:21 -04:00
Vladimir Kondratyev
027b93c2f5 acpi_asus_wmi(4): Handle TUF-specific hotkeys internally
- Cycle TUF laptop RGB mode on AURA key press
- Switch TUF 'Throttle Thermal Policy' with 'Fan' key

Sponsored by:	Future Crew LLC
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D48985
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
d5bf6a7245 acpi_asus_wmi(4): Add support for WMI event queue
Event codes are expected to be retrieved from a queue on at least some
models. Specifically, very likely the ACPI WMI devices with _UID ATK are
queued whereas those with ASUSWMI are not.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48984
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
f134662a1a acpi_asus_wmi(4): Improve keyboard backlight support.
- Fix maximal keyboard backlight level, Although Linux source code
  comment says that backlight level is encoded in 3 bits of data,
  actual code limits maximum level to 3.
- Add backlight(9) support for keyboard
- Turn off/on keyboard backlight on suspend/resume

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48983
2025-03-17 18:45:14 +03:00
Vladimir Kondratyev
5e41194bfc acpi_asus_wmi(4): Add EVDEV support
Use input event device to export hotkey events.

Sponsored by:	Future Crew LLC
MFC after:	1 month
Reviewed by:	mav
Differential Revision:	https://reviews.freebsd.org/D48982
2025-03-17 18:45:14 +03:00
Warner Losh
b0375f78e3 usb-msctest: Be more conservative setting GETMAXLUN quirk
Only set the GETMAXLUN quirk when it causes an error, but don't set it
when it returns 0. Since we reset the device when we set any quirk, only
set this quirk when it generates an error so umass will avoid it. When
the command works, there's no reason for umass to avoid it at all.

MFC After: 1 week
Sponsored by: Netflix
2025-03-16 13:23:25 -06:00
Warner Losh
9ea38ca4a8 umass/quirk: Remove useless quirk for Transcend flash
I have several of these. They all work without these quirks (either the
auto quirk mechanism does the right thing, or a likely
soon-to-be-removed vendor catch-all does the right thing, or no probing
at all does the right hting).

Both PREVENT ALLOW and SYNCHRONIZE CACHE are (a) unimplemented but (b)
return the proper asc/ascq code so da just does the right thing, quirk
or no. This was a left-over from the days where you'd get scary error
messages, but we'd work just fine. Now that the scary error messages are
gone (and only a calm one under bootverbose), this can be deleted.

Sponsored by:		Netflix
2025-03-15 21:47:44 -06:00
Warner Losh
4804a461b5 umass/quirks: Remove nonsensical NO_GETMAXLUN quirks
We only try to do a GETMAXLUN query of BBB devices. If we're forcing the
device to be CBI, then it's not BBB. Delete the quirks from there. Also,
UFI devices are all CBI as well, so remove the quirk from there as well.
Confirmed this isn't needed with three different floppy disk drives I
have.

Sponsored by:		Netflix
2025-03-15 21:45:31 -06:00
Navdeep Parhar
011e3d0b8b cxgbe(4): Perform Conventional Reset instead of FLR on the device.
The driver uses bus_reset_child on its parent to reset itself but that
performs an FLR whereas the hardware needs a Conventional Reset[1] for
full re-initialization.  Add routines that perform conventional hot
reset and use them instead.  The available reset mechanisms are:
* PCIe secondary bus reset (default)
* PCIe link bounce

hw.cxgbe.reset_method can be used to override the default.  The internal
PL_RST is also available but is for testing only.

[1] 6.6.1 in PCI Express® Base Specification 5.0 version 1.0

MFC after:	1 month
Sponsored by:	Chelsio Communications
2025-03-15 18:16:42 -07:00
Colin Percival
55c3348ed7 acpi_pci: Add quirk for DELAY-after-EJ0
On some EC2 instances, there is a race between removing a device from
the system and making the PCI bus stop reporting the presence of the
device.  As a result, a PCI BUS_RESCAN performed immediately after
the _EJ0 method returns "sees" the device which is being ejected, which
then causes problems later (e.g. we won't recognize a new device being
plugged into that slot because we never knew it was vacant).

On other operating systems the bus is synchronously marked as needing
to be rescanned but the rescan does not occur until O(1) seconds later.

Create a new ACPI_Q_DELAY_BEFORE_EJECT_RESCAN quirk and set it in EC2
AMIs, and add a 10 ms DELAY between _EJ0 and BUS_RESCAN when tht quirk
is set.

Reviewed by:	jhb
MFC after:	1 month
Sponsored by:	Amazon
Differential Revision:	https://reviews.freebsd.org/D49252
2025-03-14 11:35:35 -07:00
Wei Hu
47f4137e44 mana: remove redundant doorbell in mana_poll_rx_cq()
With the last commit to refill the rx mbuf in batch, the doorbell
in mana_poll_rx_cq() becomes redundant. Remove it to save a few
microseconds spent in mmio call.

Reported by:	NetApp
Reviewed by:	Tallamraju, Sai
Tested by:	whu
Fixes:		9b8701b8 ("mana: refill the rx mbuf in batch")
MFC after:	3 days
Sponsored by:	Microsoft
2025-03-14 05:51:34 +00:00
Christos Margiolis
68b6567d09 snd_hda: Patch Framework AMD 13th gen
Redirect sound to headphone jack when plugged in.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D49346
2025-03-13 22:51:45 +01:00
Konstantin Belousov
480fc5b8e5 mlx5en: bump MLX5E_MAX_BUSDMA_RX_SEGS
This is needed to accomodate more data segments in wqes for 64K receive
mbuf chains.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:02:17 +02:00
Konstantin Belousov
016f40466a mlx5en: fix rq->wqe_sz usage
Define it as the size of the single data segment in wqe.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:59 +02:00
Konstantin Belousov
c2987d7876 mlx5: bump the max LRO packet size
The belief is that the 7*MCLBYTES limit was set to not hit the segment
limit for wqe busdma tag.  But with the current mbuf allocator it is not
possible, and even if it was, the corresponding wqe fill would simply
fail.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:36 +02:00
Konstantin Belousov
89491b1edb mlx5en: stop arbitrary limiting max wqe size
Since the times the driver accepts s/g receive buffers, there is no
sense in trying to use pre-existing mbuf clusters sizes.  The only
possible optimization is to use full page size if wqe size is greater
than MCLBYTES.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:17 +02:00
Konstantin Belousov
bc10238492 mlx5: overwrite only the echo reply timestamp from the last packet in LRO
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:01:05 +02:00
Konstantin Belousov
7560ed3a6b mlx5: assert CQE structure size
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:00:53 +02:00
Konstantin Belousov
903996760d mlx5: correct the predicate asserted in __predict_true()
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:00:42 +02:00
Konstantin Belousov
efe9a3996e mlx5: recalculate tcp checksum for ipv6 hw lro coalesced packet
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:00:27 +02:00
Konstantin Belousov
3eb6d4b4a2 mlx5: recalculate tcp checksum for ipv4 hw lro coalesced packet
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 18:00:09 +02:00
Konstantin Belousov
dd1bd0ec5c mlx5_en: correct recalculation of the ipv4 checksum for hw lro packet
The call to in_cksum_skip() did not skipped the ethernet header.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:59:50 +02:00
Konstantin Belousov
c3555174fd mlx5en: follow PRM for setting the max hw lro segment size
If the NIC is capable, just pass the full packet size, including L2/L3
headers, as the segment size.  Otherwise, decrement the number of
strides by 1 to left the space for L2/IP headers, as it was done before.
But do the arithmetic on the segment number instead of the full packet
size.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:59:27 +02:00
Konstantin Belousov
93e70e3a94 mlx5en: explain why interface needs to be reopened on hw lro change
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:59:12 +02:00
Konstantin Belousov
02fe38b921 mlx5en: make the hw lro control dynamic
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:58:53 +02:00
Konstantin Belousov
9807157363 mlx5core: add mlx5_core_modify_tir()
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:58:35 +02:00
Konstantin Belousov
816f27e848 mlx5en: control hw LRO with the driver conf sysctl, leaving IFCAP_LRO to sw
Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:58:12 +02:00
Konstantin Belousov
bbac54b820 mlx5en: make conf.hw_lro sysctl r/w
This alone does not make hw lro configurable by sysctl, it only removes
unneeded complications for users to access it.

Reviewed by:	Ariel Ehrenberg <aehrenberg@nvidia.com>, Slava Shwartsman <slavash@nvidia.com>
Sponsored by:	NVidia networking
MFC after:	1 week
2025-03-13 17:57:54 +02:00
Christos Margiolis
cabf76fde8 sound: Remove redundant check in mixer_clone()
PCM_REGISTERED() does this check through PCM_ALIVE().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2025-03-12 22:15:34 +01:00
John Baldwin
ba6c35f0ca usb: Use bus_detach_children instead of bus_generic_detach
The USB bus performs additional teardown steps in between detaching
child devices and deleting child devices.

Reported by:	phk, thj
Tested by:	phk
Fixes:		e9d3857040 ("Use bus_detach_children instead of bus_generic_detach")
2025-03-12 10:54:49 -04:00
Slava Shwartsman
7008b9fab5 mlx5: Fix BlueField-4 device description
BlueField-4 will not be based on ConnectX-8. Remove the wrong description

Sponsored by:   NVidia networking
MFC after:      1 week
2025-03-12 00:47:26 +02:00
Warner Losh
048d6ca31d umass: Remove some 20-year-old dead code
A REQUEST SENSE CDB was just copied into the cmd buffer, so testing for
INQUIRY will always fail.  Remove the dead code.

This code was added, apparently by mistake in 2003.  8541fbec79
merged changes from NetBSD's umass_scsipi.c 1.8 to address some BBB
bulk-in clear problems. NetBSD had fixed a problem in the
FORCE_SHORT_INQUIRY quirk code they had ported from FreeBSD that FreeBSD
also needed. That merge also included the dead code, which was not in
NetBSD.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D49311
2025-03-10 20:33:15 -06:00
Christos Margiolis
717adecbbb sound: Make feed_mixer_apply() __always_inline
Reported by:	mav
Fixes:		4021fa32d9 ("sound: Simplify pcm/feeder_mixer.c")
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2025-03-10 22:16:08 +01:00
Christos Margiolis
c824383b26 sound: Update COPYRIGHT notices
Only to files I've currently made significant contributions to.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2025-03-10 21:47:44 +01:00
Christos Margiolis
ab95710f30 sound: Make dev.pcm.X.mode dynamic
Currently dev.pcm.X.mode is calculated only once in pcm_sysinit(), which
is called by pcm_register() during attach, but this can result in
inconsistencies.

For some context, what pcm_mode_init() does is, it checks if "playcount"
is positive, in which case we assume the device supports playback. The
same is done for "reccount" for recording, and if "mixer_dev" is not
NULL, we know the device has a mixer.

The "playcount" and "reccount" variables correspond to the number of
_primary_ playback/recording channels, so we can assume that the primary
channels have been created before reaching pcm_mode_init(). However, for
the mixer that's not always the case. If the mixer is created _after_
pcm_register(), as is the case for snd_dummy(4) for example,
pcm_mode_init() will see that "mixer_dev" is NULL, and report that the
device does not have a mixer, whereas in reality we just created it
afterwards.

While this could be fixed by simply creating the mixers always before
pcm_register(), it is better to be robust and calculate the mode
dynamically.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D49024
2025-03-10 21:47:39 +01:00
Christos Margiolis
b768f2c777 sound: Retire SD_F_AUTOVCHAN
This flag is redundant and essentially a no-op, as it is set when the
device supports at least playback or recording, which is almost always
the case. But even if the device is mixer-only (i.e., 0 channels), there
is no reason to keep this flag; it is only used to bail out of the vchan
sysctl handlers, but we already bail out anyway if we try to use the
sysctl in a vchan direction that is not supported.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D49021
2025-03-10 21:47:35 +01:00
Christos Margiolis
2fda859711 sound: Take dsp_cdevsw out of header file
Not used outside of pcm/dsp.c.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Reviewed by:	imp, markj
Differential Revision:	https://reviews.freebsd.org/D49217
2025-03-10 21:47:28 +01:00
Christos Margiolis
4021fa32d9 sound: Simplify pcm/feeder_mixer.c
- Get rid of macro magic.
- Make feed_mixer_info handling similar to most feeders.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48394
2025-03-10 21:38:23 +01:00
Christos Margiolis
b73b5f70e9 sound: Remove feed_matrix_apply_generic()
It does what feed_matrix_apply() already does, so it is redundant.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48036
2025-03-10 21:19:46 +01:00
Christos Margiolis
ac24c9da8b sound: Remove macro magic from pcm/feeder_matrix.c
Turn the FEEDMATRIX_DECLARE macro into a single inline function
(feed_matrix_apply()). There is no reason to have this as a macro, it
only complicated the code. An advantage of this patch is that, because
we no longer call the functions created by the macro through function
pointers (apply field of feed_matrix_info), we can call
feed_matrix_apply() directly in feed_matrix_feed().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48035
2025-03-10 21:19:41 +01:00
Christos Margiolis
e18d66d9c5 sound: Remove macro magic from pcm/feeder_eq.c
Turn the FEEDEQ_DECLARE macro into a single inline function
(feed_eq_biquad()). There is no reason to have this as a macro, and it
only complicates the code. An advantage of this patch is that, because
we no longer call the functions created by the macro through function
pointers (biquad_op), we can call feed_eq_biquad() directly in
feed_eq_feed().

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D48032
2025-03-10 21:19:35 +01:00