Commit graph

42506 commits

Author SHA1 Message Date
Emmanuel Vadot
82829e49e6 vt: splash: Use splash screen passed from loader
If loader(8) gives use a splash screen to use using the MODINFOMD_SPLASH
type, use it if RB_MUTE is set to "YES".
By design only argb data will be displayed.

Differential Revision:	https://reviews.freebsd.org/D45931
Reviewed by:		imp, tsoome
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit f6e8b0e85081681100bf9cd74423be02233204bc)
2024-07-29 18:37:44 +02:00
Emmanuel Vadot
01215ffec6 vt: Add vd_bitblt_argb
This blit an ARGB image on the dedicated vd.
This also adds vt_fb_bitblt_argb which will works for most of the vt backends

Differential Revision:	https://reviews.freebsd.org/D45929
Reviewed by:		tsoome
Sponsored by:		Beckhoff Automation GmbH & Co. KG

(cherry picked from commit b93028d8cd3aafc883b5f0ecec65a8a2a30af7f3)
2024-07-29 18:37:12 +02:00
Christos Margiolis
a9e27006db sound: Simplify feeder_remove()
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D46100

(cherry picked from commit 00172d20070a544e0514cce9f94475c5525fd15e)
2024-07-29 18:34:55 +03:00
Christos Margiolis
9b5e6dfe18 sound: Remove unused defines from pcm/sound.h
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D45986

(cherry picked from commit f477d412530a8cb9d8e058d00189ce127584f6f6)
2024-07-29 18:34:55 +03:00
Christos Margiolis
a619d8c76c sound: Simplify chn_init()
- Remove unnecessary CHN_[UN]LOCKs.
- Improve device_printf() messages.
- Remove redundant checks.
- Remove 0 assignments, since the channel is allocated with M_ZERO.
- Re-organize sections in a more coherent way.
- Remove "out1" label, just return NULL directly.
- Rename "out2" to "fail" and simplify logic.
- Do not check the return value of dsp_unit2name(), as it is guaranteed
  not to fail (we pass a valid channel type).

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45985

(cherry picked from commit 5b209e153b58515c0315f5902e18ecd7d75ecd2a)
2024-07-29 18:34:55 +03:00
Christos Margiolis
cbbc1f5db1 sound: Remove unused FEEDER_DEBUG
No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45984

(cherry picked from commit c55f995502cbaa2d38b7a7003bc27805b28a6a29)
2024-07-29 18:34:55 +03:00
Christos Margiolis
8f685b1f1f sound: Rename chn_* feeder functions to feeder_*
Avoid layering violation. No functional change intended.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45983

(cherry picked from commit 29ff7b08be363f0d4345794bb951d5c0c8406a0a)
2024-07-29 18:34:55 +03:00
Christos Margiolis
6716cc7e27 sound: Fix memory leak in chn_init()
In case chn_init() fails, we are leaking memory by not freeing the
feeder.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj
Differential Revision:	https://reviews.freebsd.org/D45979

(cherry picked from commit 16329b7b3276f09dc70bdd1ca8bc605546fe71e0)
2024-07-29 18:34:54 +03:00
Christos Margiolis
1ff260a6e1 sound: Implement dummy driver
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45967

(cherry picked from commit c15c9315b2cb7601cc337f7d5a8e124f4b2d5861)
2024-07-29 18:34:54 +03:00
Christos Margiolis
188d619e45 sound: Add OSS channel capabilities to sndstat nvlist
Assignment taken from dsp_oss_engineinfo().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46166

(cherry picked from commit bd5bcc848c5764229926ad27a4bd77af4f87d189)
2024-07-29 18:34:54 +03:00
Christos Margiolis
08c1cf0b52 sound: Add *vchanrate and *vchanformat to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46164

(cherry picked from commit a6283717577066b0ff6c62053145470ff4134051)
2024-07-29 18:34:54 +03:00
Christos Margiolis
894edb7cb1 sound: Add device status string to sndstat nvlist
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D46163

(cherry picked from commit 810530aa2648812860e84d951d9cf96dfd24e595)
2024-07-29 18:34:53 +03:00
Florian Walpen
12f6e0a4d2 snd_hdspe(4): Recognize newer firmware's PCI vendor id.
At least for HDSPe RayDAT cards, newer firmware comes with RME's own PCI
vendor id instead of the Xilinx one. Other HDSPe cards are probably also
affected. Update snd_hdspe(4) to recognize both the old Xilinx and the
new RME vendor ids.

Differential Revision:	https://reviews.freebsd.org/D44978
MFC after: 1 day

(cherry picked from commit 9718d4ab99386918f5b5c207c58289eaade20623)
2024-07-28 21:23:07 +01:00
Mark Johnston
030cbcc4c2 if_urndis: Organize buffer layouts more naturally
- Group the request header and I/O buffer in one structure, rather than
  assuming that both request structures have the same size.
- Pass a pointer to the whole structure to urndis_ctrl_query() and
  urndis_ctrl_set() rather than just the header.  Otherwise, on CHERI
  platforms, these functions violate subobject bounds since they modify
  the buffer following the header.

While here, there is no apparent reason for the request structure used
in urndis_attach() to be allocated statically.  Change it so that it's
allocated on the stack.

No functional change intended.

Reviewed by:	jhb
MFC after:	2 weeks
Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D45866

(cherry picked from commit 5dc4682c32691b9d0a20abdc5479d6ce2b36915e)
2024-07-23 09:01:37 -04:00
John Baldwin
4ba4cfaf9f acpi: Narrow workaround for broken interrupt settings on x86
Commit 9a7bf07ccd from 2016 introduced a workaround for some broken
BIOSes that specified active-lo instead of active-hi polarity for ISA
IRQs for UARTs.  The workaround assumed that edge-sensitive ISA IRQs
on x86 should always be active-hi.  However, some recent AMD systems
actually use active-lo edge-sensitive ISA IRQs (and not just for
UARTs, but also for the keyboard and PS/2 mouse devices) and the
override causes interrupts to be dropped resulting in boot time hangs,
non-working keyboards, etc.

Add a hw.acpi.override_isa_irq_polarity tunable (readable as a sysctl
post-boot) to control this quirk.  It can be set to 1 to force enable
the override and 0 to disable it.  The log of original message
mentions an Intel motherboard as the sample case, so default the
tunable to 1 on systems with an Intel CPU and 0 otherwise.

Special thanks to Matthias Lanter <freebsd@lanter-it.ch> for tracking
down boot time issues on recent AMD systems to mismatched interrupt
polarity.

PR:		270707
Reported by:	aixdroix_OSS@protonmail.com, Michael Dexter
Reported by:	mfw_burn@pm.me, Hannes Hfauswedell <h2+fbsdports@fsfe.org>
Reported by:	Matthias Lanter <freebsd@lanter-it.ch>
Reported by:	William Bulley <web@umich.edu>
Reviewed by:	imp, emaste
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45554

(cherry picked from commit 0a34d050ae8ea14feddd3d2a62fd2f612613b2c5)
2024-07-22 15:54:14 -04:00
Mark Johnston
f48bfa248f axgbe: Remove a nonsensical use of kernel_sysctlbyname()
No functional change intended.

MFC after:	1 week

(cherry picked from commit d254651de392538fa7f5c0020093dde0ca06c614)
2024-07-21 20:55:28 -04:00
Mark Johnston
239c9c6de1 hptiop: Use device_set_descf()
No functional change intended.

MFC after:	1 week

(cherry picked from commit 1c64b3aba3d0e2910ac52c18e3c240348eb3e36e)
2024-07-21 20:55:27 -04:00
Navdeep Parhar
60bf442ee2 cxgbe(4): Do not report link state change during interface detach.
This fixes a panic when multiple VIs are configured on an interface and
only the non-primary VI is up at the time of driver detach.  The problem
was that the driver would queue a link state change notification for an
interface about to be freed.

To reproduce the panic, add "hw.cxgbe.num_vis=2" to loader.conf and

 # kldload if_cxgbe
 # ifconfig vcc0 up
 # devctl detach t6nex0

  trap 0x9, rip = 0xffffffff8107db70, rsp = 0xfffffe0055263d60, rbp = 0xfffffe0055263dd0
  taskqueue_run_locked() at taskqueue_run_locked+0x2a0/frame 0xfffffe0055263dd0
  taskqueue_run() at taskqueue_run+0x72/frame 0xfffffe0055263df0
  taskqueue_swi_run() at taskqueue_swi_run+0x18/frame 0xfffffe0055263e10
  intr_event_execute_handlers() at intr_event_execute_handlers+0x249/frame 0xfffffe0055263e50
  ithread_execute_handlers() at ithread_execute_handlers+0x9e/frame 0xfffffe0055263e70

Reviewed by:	jhb
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D45864

(cherry picked from commit dc20d49aa939caea365cbdf0341b00de69253be4)
2024-07-16 23:40:13 -07:00
Navdeep Parhar
8d214aa2c1 cxgbe(4): Consolidate all mk_set_tcb_field_ulp in one place.
Sponsored by:   Chelsio Communications

(cherry picked from commit 64a00f877fc23d904d5f4ca00471e09954eb9381)
2024-07-16 23:39:43 -07:00
Navdeep Parhar
307639c1e9 cxgbe(4): sc->port is indexed by port_id and not tx_chan.
Sponsored by:	Chelsio Communications

(cherry picked from commit cca3506dc15464baf9b09b143879ed13fb5684c7)
2024-07-16 23:39:32 -07:00
Navdeep Parhar
29791662e9 cxgbe/tom: Fix the rx channel selection in options2.
This affects TOE operation when multiple rx c-channels are in use for
offload, which is an unusual configuration.

Sponsored by:	Chelsio Communications

(cherry picked from commit c6c6d4aff90da83a292b4c2bbbe1f4d6e01cd82e)
2024-07-16 23:39:13 -07:00
Navdeep Parhar
c0b69999b1 cxgbe(4): Query TPCHMAP once and not once per port.
Sponsored by:	Chelsio Communications

(cherry picked from commit 7f10048f983a31c09587b436e7fb073f7cbb76e4)
2024-07-16 23:38:57 -07:00
Navdeep Parhar
0ca32f02de cxgbe(4): Rename rx_c_chan to rx_chan.
It is the equivalent of tx_chan but for receive so rx_chan is a better
name.  Initialize both using helper functions and make sure both are
displayed in the sysctl MIB.

Sponsored by:	Chelsio Communications

(cherry picked from commit 480ff89c67b25113515018cdcd13179229b4a0d3)
2024-07-16 23:38:40 -07:00
Navdeep Parhar
5af25b6e4d cxgbe(4): Minor tweaks to comments.
No functional change intended.

Sponsored by:	Chelsio Communications

(cherry picked from commit 21aba396551e29808fa56a6d4fab17e871c3524f)
2024-07-16 23:38:18 -07:00
Navdeep Parhar
67faf45be5 cxgbe(4): Initialize mps_bg_map to an invalid value if it's not known.
Sponsored by:	Chelsio Communications

(cherry picked from commit 9de0036b55dcdabc54fa69ea6e583b22d739818c)
2024-07-16 23:38:00 -07:00
Navdeep Parhar
92383a2c84 cxgbe(4): Do not read hardware registers to determine the number of ports.
PORTVEC obtained from the firmware is the authoritative source of this
information, and nports (calculated from PORTVEC) is available by the
time t4_port_init runs.

Sponsored by:	Chelsio Communications

(cherry picked from commit 4d1362cdc7375984a48f5f0048b1fe909524d21d)
2024-07-16 23:37:39 -07:00
Navdeep Parhar
e5efc8cf5d cxgbe(4): Allocate a taskqueue per port instead of per channel.
All the channels are not used on all boards and there's no point
allocating taskqueues that will never be used.

Sponsored by:	Chelsio Communications

(cherry picked from commit 857d74b6340e418396d79a46b264ce0eedd760e4)
2024-07-16 23:37:25 -07:00
Navdeep Parhar
a238d1b045 cxgbe(4): Shared code update to deal with partial failure in query_params.
Obtained from:	Chelsio Communications
Sponsored by:	Chelsio Communications

(cherry picked from commit 2965ae59144177eb3570721295da9cbc447f1105)
2024-07-16 23:37:03 -07:00
Navdeep Parhar
b67afd194c cxgbe(4): Reword the comment explaining the atid/cookie split.
Avoid a magic constant while here.  No functional change intended.

Sponsored by:	Chelsio Communications

(cherry picked from commit 43f6f08488046788b0ad66e9a5119f36e5de71ab)
2024-07-16 23:36:39 -07:00
Navdeep Parhar
d80e7fca01 cxgbe(4): Add missing description for a port type.
Sponsored by:	Chelsio Communications

(cherry picked from commit f0ee6112eb61a5130acedd20d9827627c0975fba)
2024-07-16 23:36:16 -07:00
Navdeep Parhar
6bc34cdd96 cxgbe(4): Retire t4_intr_clear.
The firmware clears the interrupts already and it has a better idea of
exactly what to clear for which generation of the ASIC.  There is no
need for the driver to get involved.

Sponsored by:	Chelsio Communications

(cherry picked from commit 1c7f9c8b4673abf3723be09afed4443261e0d186)
2024-07-16 23:35:55 -07:00
Navdeep Parhar
41309c878d cxgbe(4): Add a helper function to locate MPS/MAC registers.
These register blocks are at different locations in different chips.

Sponsored by:   Chelsio Communications

(cherry picked from commit b59c5d97edf17525405d95b1f5746c4a79a9c7c4)
2024-07-16 23:35:30 -07:00
Navdeep Parhar
1089f5755e cxgbe(4): Remove tx_modq lookup table.
The driver always uses the same modulation queue as the channel and the
table is unnecessary.

Sponsored by:   Chelsio Communications

(cherry picked from commit f76effed14b25bfa0c47b10f6d8a076104c48d94)
2024-07-16 23:27:14 -07:00
Kenneth D. Merry
44ca5d40f3 Add an isp(4) tunable to default to ispfw(4) firmware.
ispfw(4) recently gained firmware for Qlogic 27XX and 28XX
FC controllers, and isp(4) now selects the newer of firmware in
flash or in ispfw(4) to load for those controllers.

This differs from the previous behavior (which remains for older
controllers), which was to always load the ispfw(4) firmware if it
is available.

This adds a loader tunable, hint.isp.N.fwload_force to default to
loading the ispfw(4) firmware, whether or not it is newer than the
firmware in flash.  This allows the user to always use the known
firmware version included with the kernel.

Note that there is an existing fwload_disable tunable that tells
the driver to always load the firmware from flash and ignore
ispfw(4).  If fwload_disable is set, fwload_force will be ignored.
So users with existing fwload_disable tunables will have the same
behavior.

If a user specifies both fwload_force and fwload_disable for the
same controller, the isp(4) driver prints a warning message,
and fwload_disable will be honored.

The user can see which firmware is active through the
dev.isp.N.fw_version* sysctl variables.

share/man/man4/isp.4:
	Document the new loader tunable.

sys/dev/isp/isp.c:
	In isp_load_risc_flash(), changet the decision logic to
	also consider ISP_CFG_FWLOAD_ONLY.  Load the flash firmware
	and get the version, so the user knows what it is, but if
	the user set fwload_force, honor that.  If the user didn't
	set fwload_force, the behavior remains to select the newer
	firmware version.

sys/dev/isp/isp_pci.c:
	Add a new fwload_force tunable.  Print out a warning if the
	user sets both fwload_disable and fwload_force.

sys/dev/isp/ispvar.h:
	Add a new ISP_CFG_FWLOAD_FORCE configuration bit.

Reviewed by:	mav
MFC after:	1 week
Sponsored by:	Spectra Logic
Differential Revision:	<https://reviews.freebsd.org/D45688>

(cherry picked from commit 31354813f3c6e87532189be77c2f10a017c55472)
2024-07-16 16:06:39 -04:00
Kenneth D. Merry
ff9458b30f Fix the isp(4) driver with 9.x firmware.
The isp(4) driver (and ispfw(4) firmware) previously only included
firmware for Qlogic controllers up to 8Gb.  It recently gained
firmware for the 27XX and 28XX series controllers along with
improved firmware loading capabilities.

The 9.x firmware available for the 27XX and 28XX controllers in
ispfw(4) adds login state for NVMe devices in the top nibble of
the login state in the port database (isp_pdb_24xx_t in ispmbox.h).

This breaks the check at the end of isp_getpdb() to make sure the
device is in the right login state.  As a result, it breaks device
discovery for many (perhaps all?) FC devices.  In my testing with
IBM LTO-6 drives attached to a quad port 16Gb Qlogic 2714, they
don't show up when they are directly connected (and in loop mode)
or connected via a switch (and in fabric mode).

So, mask off the top bits of of the login state before checking it.
This shouldn't break anything, because all of the existing login
states defined in ispmbox.h are in the low nibble.

sys/dev/isp/ispmbox.h:
	Add a FCP login state mask define, and a NVMe login state
	shift.

sys/dev/isp/isp.c:
	In isp_getpdb(), make sure we're only looking at the FCP
	login state bits when we try to determine whether a device
	is in the right login state.

MFC after:	1 week
Sponsored by:	Spectra Logic
Reviewed by:	mav
Differential Revision:	<https://reviews.freebsd.org/D45660>

(cherry picked from commit 137b004e2b7ab504abf98c4aad9d52607df47b9a)
2024-07-16 16:04:29 -04:00
Andrew Turner
dfd26e29dd dev/hwpmc: Fix the dmc620 MD4 macro
Add braces to the dmc620 MD4 macro to fix the GCC build.

Reviewed by:	brooks, imp, jhb
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45266

(cherry picked from commit 131c1718c6331e87f139b42b4ad0e57b6a71ea44)
2024-07-15 12:27:45 +00:00
Andrew Turner
0496539fe3 pci: Fix pci_host_generic_acpi with gcc
In pci_host_generic_acpi.c we loop over pci_acpi_quirks to check if
we need to handle any quirks. GCC doesn't like the terminatin as it
sets a fixed width string to 0.

As this the array is only ever used in this file change to use nitems
to find when to stop the loop.

Reviewed by:	brooks, imp, jhb, emaste
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45265

(cherry picked from commit f55e866488ba2d8bb5b79659ee84bec1fe7808fb)
2024-07-15 12:27:37 +00:00
Andrew Turner
ab44e45862 dev/psci: Check all compat strings
When searching for the PSCI FDT node we only check a few compat strings.
Use the existing compat_data array to check all strings the driver may
attach to.

Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D44913

(cherry picked from commit f91e9401c2098ba56f43093ef9747d0b1f60f8eb)
2024-07-15 12:24:30 +00:00
Gordon Bergling
4779a4dde7 ocs_fc(4): Fix a typo in a kernel message
- s/elasped/elapsed/

(cherry picked from commit 6ea81bcaf8adcf6a8546407e93e97f3d920396d2)
2024-07-13 19:08:38 +02:00
Gordon Bergling
7ad3c40b17 mps(4): Correct a typo in a source code comment
- s/vender/vendor/

(cherry picked from commit a9d7f098b86576006f5aeb312521bfde5ac77c77)
2024-07-13 19:08:08 +02:00
Zhenlei Huang
6b1f530935 net: Remove unneeded NULL check for the allocated ifnet
Change 4787572d05 made if_alloc_domain() never fail, then also do the
wrappers if_alloc(), if_alloc_dev(), and if_gethandle().

No functional change intended.

Reviewed by:	kp, imp, glebius, stevek
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D45740

(cherry picked from commit aa3860851b9f6a6002d135b1cac7736e0995eedc)
2024-07-12 20:03:37 +08:00
Robert Wing
d6b6165ebb sound: drop midistat lock in error path
Fixes:          fc76e24e583d45a3a59fd7ad4e603c0679eaf572
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D45939

(cherry picked from commit 3114d55866b86ca1132923211936aa23881b0057)
2024-07-10 18:48:14 +02:00
Christos Margiolis
fab137d234 sound: Add missing CHN_[UN]LOCKs in sndstat
In sndstat_build_sound4_nvlist(), if we have INVARIANTS or
SND_DIAGNOSTIC enabled, we will hit a lock assertion panic when we call
CHN_GETVOLUME(). Also lock the channel in the sndstat_prepare_pcm() loop
for good measure.

Fixes:		bbca3a75bb41 ("sound: Include sound(4) channel information in sndstat nvlist")
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45898

(cherry picked from commit e850bd36dfda98608432d2459800627d16119fec)
2024-07-10 18:48:13 +02:00
Christos Margiolis
efaa4bcc92 sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO
If the channel list is empty, min_rate and min_channels will be INT_MAX.
Instead, assign them to 0, like we do in sndstat_get_caps().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45876

(cherry picked from commit 1a768ea9db3d66941b0dc5340ac028ef548808b8)
2024-07-10 18:48:13 +02:00
Christos Margiolis
ecb0a2ed2f sound: Refactor sndstat_get_caps()
The current implementation of sndstat_get_caps() does not work properly
when VCHANs are enabled, as it skips all information about physical
channels, and also assigns the min/max rates and channels to same
values, which is usually not the case. A device either supports any
sample rate within the [feeder_rate_min, feeder_rate_max] range, or
[hw_rate_min, hw_rate_max] range when the device is opened in exclusive
or bitperfect mode. The number of channels can also vary and is not
always the same for both min and max.

Refactor the whole function to resemble the way we handle fetching of
these values in dsp_oss_audioinfo() and dsp_oss_engineinfo().

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45872

(cherry picked from commit 9d8b93bc9ccea82b648ffa9354200c9e4d3f211b)
2024-07-10 18:48:13 +02:00
Christos Margiolis
95d3abff73 sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO
Since we allow feeding of any rate within the [feeder_rate_min,
feeder_rate_max] range, report this as the min/max rate as well. Only
exceptions are when we the device is opened in exclusive or bitperfect
mode.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45862

(cherry picked from commit 86585210fd5657542884b22eb52b21e960b7be6c)
2024-07-10 18:48:13 +02:00
Christos Margiolis
ff6b61a2c8 sound: Handle midistat_lock through function interface
midistat_lock is used outside midi/midi.c as well, so implement lock,
unlock and lockassert functions in order not to expose the lock in the
header file.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D45857

(cherry picked from commit 2d6fc24673ccc97020c94094f97ee015f1db9702)
2024-07-10 18:48:13 +02:00
Christos Margiolis
d325cd4a53 sound: Remove dead code in pcm_register()
Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D45831

(cherry picked from commit a9f08df3e9004f431e98f67afc1ac2b2f773ec14)
2024-07-10 18:48:13 +02:00
Christos Margiolis
d4b65f3f53 sound: Make DSP_FIXUP_ERROR() regular code
No reason to have this as a macro.

While here, change the second case to an "else if" as there is no reason
to check it if the open flags are invalid.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch, markj, emaste
Differential Revision:	https://reviews.freebsd.org/D45776

(cherry picked from commit adc1713fb13f89a6eb33f5de840c981d0e17e4b7)
2024-07-10 18:48:13 +02:00
Christos Margiolis
6378079427 sound: Improve simplex handling in dsp_open()
If we are in simplex mode, make sure we do not open in both directions
(read/write) and also that we do not open in a direction opposite of
what is already opened. For example, if the device is already doing
playback, we cannot open the device for recording at the same time, and
vice-versa.

While here, remove dsp_cdevpriv->simplex as it's no longer needed.

Sponsored by:	The FreeBSD Foundation
MFC after:	2 days
Reviewed by:	dev_submerge.ch
Differential Revision:	https://reviews.freebsd.org/D45835

(cherry picked from commit be04a9d9387f6b5d4e83fc4976d8d83bb03fe5af)
2024-07-10 18:48:13 +02:00