aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/midi
Commit message (Collapse)AuthorAgeFilesLines
* sound: Replace MIN() with min()Christos Margiolis12 days2-7/+7
| | | | | | | | | We use min() in most places. No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Unlock around uiomove() in midi_{read,write}()Christos Margiolis12 days1-2/+6
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54130
* sound: Retire unused snd_midi->nameChristos Margiolis2026-01-021-1/+0
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Allocate mpu401 with M_WAITOKChristos Margiolis2026-01-021-4/+1
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Get rid of unused MIDIQ macrosChristos Margiolis2026-01-021-2/+0
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Make mpu_if definitions staticChristos Margiolis2026-01-021-3/+3
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Retire mpu_callbackp()Christos Margiolis2026-01-023-15/+1
| | | | | | | | | It is the exact same as mpu_callback(). No functional changed intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Get rid of unused midi/midi.c definesChristos Margiolis2026-01-021-13/+0
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Do not check for NULL before free()Christos Margiolis2026-01-021-4/+2
| | | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54174
* sound: Improve snd_midi->{in,out}q allocationChristos Margiolis2026-01-021-16/+8
| | | | | | | | | | | | | Currently we lock and allocate the buffers with M_NOWAIT, without checking if the return value of malloc(). This is not necessary as subsequent check below will eventually check that. However, for correctness, allocate the buffers with M_WAITOK (there is no reason not to) and lock afterwards. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54131
* sound: Retire MIDIQ_DEBUGChristos Margiolis2026-01-021-17/+0
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Retire MIDI_DEBUGChristos Margiolis2026-01-021-39/+1
| | | | | | | Better logging will be implemented. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Rename midi_cdevsw name to "midi"Christos Margiolis2026-01-021-2/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Remove dead if-statementChristos Margiolis2026-01-021-1/+0
| | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Retire snd_midi->busyChristos Margiolis2026-01-021-24/+7
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Merge midi_destroy() with midi_uninit()Christos Margiolis2026-01-021-43/+14
| | | | | | | | | | Also always call MPU_UNINIT(). It does not make sense not to if we are deallocating everything. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54192
* sound: Update midi/midi.* LICENSEChristos Margiolis2026-01-022-0/+8
| | | | | Spsonsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Retire snd_midi->qlockChristos Margiolis2026-01-021-38/+22
| | | | | | | | | | | | snd_midi->qlock is used to protect snd_midi->{in,out}q. However, apart from the numerous LORs present already in the code, there is no reason not to use snd_midi->lock, as we do for the rest of the structure Started by: https://github.com/freebsd/freebsd-src/pull/1902 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_nicolas-provost.fr Differential Revision: https://reviews.freebsd.org/D54129
* sound: Retire midi_devs and mstat_lockChristos Margiolis2026-01-023-113/+26
| | | | | | | | | | | | | | | | | | | Nowadays midi_devs only has two uses: 1. To verify in midi_init() if a given device unit exists, as well as to calculate the next device unit. Instead, make sure we always get a unique unit and channel number using unr(9). 2. To keep track of all midi devices, so that it can destroy them all at once in midi_sysuninit(). However, since we stopped building midi as a kernel module, there is no reason to do that, simply let the drivers tear down the devices themselves. Also retire mstat_lock since it's only used to protect midi_devs. PR: 261071 Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54126
* sound: Stop building midi as a moduleChristos Margiolis2026-01-021-37/+7
| | | | | | | | | | | There is no reason for this. The midi functions are used by drivers on-demand anyway. Use SYSINIT(9) instead to do the appropriate (de-)initilizations. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D54125
* sound: Fix revents in midi_poll()Nicolas Provost2025-11-241-11/+9
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: christos Pull Request: https://github.com/freebsd/freebsd-src/pull/1887
* sound: Clean up midi/ includesChristos Margiolis2025-11-212-23/+11
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D53841
* sound: Remove dead midi codeChristos Margiolis2025-11-131-123/+14
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* sound: Remove KOBJMETHOD_END re-definitionsChristos Margiolis2025-11-122-8/+0
| | | | | | | | | No functional change intended. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: markj, emaste Differential Revision: https://reviews.freebsd.org/D53696
* sound: Remove dead printfs from midi/mpu401.cChristos Margiolis2025-07-061-26/+1
| | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50617
* sound: Remove unused midi_cmdname()Christos Margiolis2025-07-061-34/+0
| | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50616
* sound: Remove unnecessary comments from midi/midi.cChristos Margiolis2025-07-061-68/+6
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50615
* sound: Remove duplicate mpu_if.h includeChristos Margiolis2025-07-061-7/+0
| | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50613
* sound: Remove unused mpu_if methodsChristos Margiolis2025-07-062-28/+0
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50612
* sound: Retire unused MIDI sysctlsChristos Margiolis2025-07-061-6/+0
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50611
* sound: Retire /dev/midistatChristos Margiolis2025-07-061-143/+2
| | | | | | | | | | This doesn't register all MIDI devices, for example USB ones, and is not widely used in the first place. In the future all MIDI devices will register to sndstat, where we already have defined a MIDI device type, but we haven't made use of it yet. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50610
* sound: Retire midisynthChristos Margiolis2025-07-063-708/+0
| | | | | | | Unused code since we retired the sequencer. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50609
* sound: Retire the MIDI sequencerChristos Margiolis2025-07-064-2211/+0
| | | | | | | | | | The in-kernel MIDI sequencer is not used anymore, since this is done by userland applications nowadays. It also contains bugs, and we are not exactly sure how it works, or if it worked properly in the first place. Sponsored by: The FreeBSD Foundation Reviewed by: vishwin, markj Differential Revision: https://reviews.freebsd.org/D50605
* gone_in: make it __printflike()Gleb Smirnoff2025-06-241-2/+4
| | | | | | | | | | | | Provide flexibility to use format strings for gone_in(). As a side effect, this removes hardcoded string "Obsolete code will be removed soon:" from the message, so now it is obligation of the deprecated code to provide a meaningful message. This required a small adoption of the existing users: midi, drm2 and le(4). Note that gone_in() is not a public KPI as it has no sense to use it outside of the FreeBSD tree. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D50783
* sound: Deprecate the MIDI sequencerChristos Margiolis2025-05-301-0/+4
| | | | | | | | | | | The in-kernel MIDI sequencer is not used anymore, since this is done by userland applications nowadays. It also contains bugs, and we are not exactly sure how it works, or if it worked properly in the first place. Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D50606
* sound: Do not check for NULL if sbuf is allocated with SBUF_AUTOEXTENDChristos Margiolis2024-10-181-5/+1
| | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D46846
* sound: drop midistat lock in error pathRobert Wing2024-07-091-0/+1
| | | | | | Fixes: fc76e24e583d45a3a59fd7ad4e603c0679eaf572 Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45939
* sound: Handle midistat_lock through function interfaceChristos Margiolis2024-07-063-33/+53
| | | | | | | | | | | 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
* sound: Remove *MINOR from midi/Christos Margiolis2024-07-062-19/+7
| | | | | | Sponsored by: The FreeBSD Foundation MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D45772
* sound: Remove MIDI_TYPEChristos Margiolis2024-07-063-11/+9
| | | | | | | | | No good reason to have this. It only makes things harder to read. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45773
* sound: Fix lock order reversals in mseq_open()Christos Margiolis2024-07-063-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening /dev/sequencer after a clean reboot yields: lock order reversal: (sleepable after non-sleepable) 1st 0xfffffe004a2c2c08 seqflq (seqflq, sleep mutex) @ /mnt/src/sys/dev/sound/midi/sequencer.c:754 2nd 0xffffffff84197ed8 midistat lock (midistat lock, sx) @ /mnt/src/sys/dev/sound/midi/midi.c:1478 lock order seqflq -> midistat lock attempted at: 0xffffffff811c9029 at witness_checkorder+0x12b9 0xffffffff810f18a7 at _sx_xlock+0xf7 0xffffffff8417f992 at midimapper_open+0x22 0xffffffff84182770 at mseq_open+0xf0 0xffffffff80e3380f at devfs_open+0x30f 0xffffffff81b8b4b7 at VOP_OPEN_APV+0x57 0xffffffff812da1e7 at vn_open_vnode+0x397 0xffffffff812d96b3 at vn_open_cred+0xb23 0xffffffff812c2c6b at openatfp+0x52b 0xffffffff812c2711 at sys_openat+0x81 0xffffffff84110579 at filemon_wrapper_openat+0x19 0xffffffff81a223ae at amd64_syscall+0x39e 0xffffffff819dd0eb at fast_syscall_common+0xf8 Expose midistat_lock to midi/midi.c so that we can acquire the lock from mseq_open() before we lock seq_lock, and introduce _locked variants of midimapper_open() and midimapper_fetch_synth(). Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45770
* sys: Automated cleanup of cdefs and other formattingWarner Losh2023-11-273-3/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* sys: Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* sys: Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-164-8/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-126-6/+6
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* sound(4): Fix a typo in a source code commentGordon Bergling2022-04-021-1/+1
| | | | | | - s/immediatly/immediately/ MFC after: 3 days
* sound(4): Fix some common typos in commentsGordon Bergling2021-08-261-2/+2
| | | | | | | | - s/doens't/doesn't/ - s/apropriate/appropriate/ - s/intepretation/interpretation/ MFC after: 5 days
* sound: clean up empty lines in .c and .h filesMateusz Guzik2020-09-014-20/+0
| | | | Notes: svn path=/head/; revision=365085