Re: Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Alexandre Ratchov
On Thu, Oct 27, 2022 at 08:28:53PM +, Klemens Nanni wrote: > On Thu, Oct 27, 2022 at 03:49:55PM +0200, Alexandre Ratchov wrote: > > On Thu, Oct 27, 2022 at 01:09:57PM +, Klemens Nanni wrote: > > > @@ -1859,6 +1857,9 @@ utvfu_audio_open(void *v, int flags) > > > if

Re: Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Klemens Nanni
On Thu, Oct 27, 2022 at 03:49:55PM +0200, Alexandre Ratchov wrote: > On Thu, Oct 27, 2022 at 01:09:57PM +, Klemens Nanni wrote: > > @@ -1859,6 +1857,9 @@ utvfu_audio_open(void *v, int flags) > > if (usbd_is_dying(sc->sc_udev)) > > return (EIO); > > > > + if ((flags &

Re: Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Alexandre Ratchov
On Thu, Oct 27, 2022 at 01:09:57PM +, Klemens Nanni wrote: > @@ -1859,6 +1857,9 @@ utvfu_audio_open(void *v, int flags) > if (usbd_is_dying(sc->sc_udev)) > return (EIO); > > + if ((flags & (FWRITE | FREAD))) > + return (ENXIO); > + > if ((flags &

Replace audio(9) get_props() with duplex check in open() for record-only drivers

2022-10-27 Thread Klemens Nanni
Make drivers which do *not* adverise AUDIO_PROP_FULLDPLEX return ENXIO in their open() if full-duplex mode was requested. This way, sys/dev/audio.c:audio_open() will fail immediately rather than later through the to-be-removed get_props() check. utvfu(4) seems to be the only driver that