diff options
author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-03-04 17:23:20 +0000 |
---|---|---|
committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2020-03-04 17:23:20 +0000 |
commit | cc1efc23c8f94991ae65f43c9a311a7e43918480 (patch) | |
tree | bec88a39464c993ff3d482340b748b51b4c500c4 /sys/dev/sound/pcm/sound.h | |
parent | 3818c25a1d1fb4e573c4a7ca6826d759d6eb57b6 (diff) |
Implement a detaching flag for the sound(4) subsystem to take
appropriate actions when we are trying to detach an audio device,
but cannot because someone is using it.
This avoids applications having to wait for the DSP read data
timeout before they receive any error indication.
Tested with virtual_oss(8).
Remove some unused definitions while at it.
PR: 194727
MFC after: 1 week
Sponsored by: Mellanox Technologies
Notes
Notes:
svn path=/head/; revision=358629
Diffstat (limited to 'sys/dev/sound/pcm/sound.h')
-rw-r--r-- | sys/dev/sound/pcm/sound.h | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index 829ffcf6b721..5730e7fa39aa 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -131,15 +131,8 @@ struct snd_mixer; #define SD_F_SIMPLEX 0x00000001 #define SD_F_AUTOVCHAN 0x00000002 #define SD_F_SOFTPCMVOL 0x00000004 -/* - * Obsolete due to better matrixing - */ -#if 0 -#define SD_F_PSWAPLR 0x00000008 -#define SD_F_RSWAPLR 0x00000010 -#endif #define SD_F_DYING 0x00000008 -#define SD_F_SUICIDE 0x00000010 +#define SD_F_DETACHING 0x00000010 #define SD_F_BUSY 0x00000020 #define SD_F_MPSAFE 0x00000040 #define SD_F_REGISTERED 0x00000080 @@ -165,7 +158,7 @@ struct snd_mixer; "\002AUTOVCHAN" \ "\003SOFTPCMVOL" \ "\004DYING" \ - "\005SUICIDE" \ + "\005DETACHING" \ "\006BUSY" \ "\007MPSAFE" \ "\010REGISTERED" \ @@ -184,6 +177,8 @@ struct snd_mixer; #define PCM_REGISTERED(x) (PCM_ALIVE(x) && \ ((x)->flags & SD_F_REGISTERED)) +#define PCM_DETACHING(x) ((x)->flags & SD_F_DETACHING) + /* many variables should be reduced to a range. Here define a macro */ #define RANGE(var, low, high) (var) = \ (((var)<(low))? (low) : ((var)>(high))? (high) : (var)) |