> Date: Mon, 17 Oct 2022 19:45:33 +0000
> From: Klemens Nanni <[email protected]>
> 
> I was looking at one particular driver and needed to know what those
> flags are, turns out AUDIO_PROP_FULLDUPLEX is the only audio(9) property
> that is in use.
> 
> The other two are only ever set in *_get_props();  their handling
> disappeared from sys/dev/audio.c in
> 
>       commit 1cf2860827c8ca659d8097d8da94a5ae5b888c53
>       Author: ratchov <[email protected]>
>       Date:   Thu Jun 25 06:43:45 2015 +0000
> 
>           Reimplement the audio driver in a simpler way, removing 
> unused/unusable
>           functionality. Same API and ABI except for the removed bits and no
>           behaviour change for programs using libsndio. With help from armani@
>           and mpi@, thanks.
> 
> and the following merely moved them when they were dead code already:
> 
>       commit 9215aa3dfad387bca877a805534df6dcfe8722eb
>       Author: ratchov <[email protected]>
>       Date:   Wed Aug 31 07:22:43 2016 +0000
> 
>           Delete unused ioctls and associated macros. Move macros that are 
> still
>           used internally by low-level drivers from sys/audioio.h to
>           dev/audio_if.h instead of deleting them.
> 
> Feedback? Objection? OK?

Is there code in ports (or even base) that relies on those flags being
defined in sys/audioio.h.

> diff --git a/sys/arch/macppc/dev/awacs.c b/sys/arch/macppc/dev/awacs.c
> index 38c7ed6b411..bd5dcbb2273 100644
> --- a/sys/arch/macppc/dev/awacs.c
> +++ b/sys/arch/macppc/dev/awacs.c
> @@ -873,7 +873,7 @@ awacs_allocm(void *h, int dir, size_t size, int type, int 
> flags)
>  int
>  awacs_get_props(void *h)
>  {
> -     return AUDIO_PROP_FULLDUPLEX /* | AUDIO_PROP_MMAP */;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c
> index b87711a0497..e3ab9465ad8 100644
> --- a/sys/arch/macppc/dev/i2s.c
> +++ b/sys/arch/macppc/dev/i2s.c
> @@ -583,7 +583,7 @@ i2s_round_buffersize(void *h, int dir, size_t size)
>  int
>  i2s_get_props(void *h)
>  {
> -     return AUDIO_PROP_FULLDUPLEX /* | AUDIO_PROP_MMAP */;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/audio_if.h b/sys/dev/audio_if.h
> index c5adaf579cd..dd7a891f915 100644
> --- a/sys/dev/audio_if.h
> +++ b/sys/dev/audio_if.h
> @@ -44,8 +44,6 @@
>   * get_props
>   */
>  #define AUDIO_PROP_FULLDUPLEX        0x01
> -#define AUDIO_PROP_MMAP              0x02
> -#define AUDIO_PROP_INDEPENDENT       0x04
>  
>  #define AUDIO_BPS(bits)              (bits) <= 8 ? 1 : ((bits) <= 16 ? 2 : 4)
>  
> diff --git a/sys/dev/isa/ad1848.c b/sys/dev/isa/ad1848.c
> index 68e9a891f1e..d984d39ec4e 100644
> --- a/sys/dev/isa/ad1848.c
> +++ b/sys/dev/isa/ad1848.c
> @@ -1464,6 +1464,5 @@ ad1848_get_props(void *addr)
>  {
>       struct ad1848_softc *sc = addr;
>  
> -     return AUDIO_PROP_MMAP |
> -         (sc->mode == 2 ? AUDIO_PROP_FULLDUPLEX : 0);
> +     return (sc->mode == 2 ? AUDIO_PROP_FULLDUPLEX : 0);
>  }
> diff --git a/sys/dev/isa/ess.c b/sys/dev/isa/ess.c
> index c0298cacfb4..aab79005463 100644
> --- a/sys/dev/isa/ess.c
> +++ b/sys/dev/isa/ess.c
> @@ -2074,13 +2074,13 @@ ess_round_buffersize(void *addr, int direction, 
> size_t size)
>  int
>  ess_1788_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT);
> +     return (0);
>  }
>  
>  int
>  ess_1888_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | 
> AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  /* ============================================
> diff --git a/sys/dev/isa/gus.c b/sys/dev/isa/gus.c
> index fbe64587fd2..174989317d4 100644
> --- a/sys/dev/isa/gus.c
> +++ b/sys/dev/isa/gus.c
> @@ -2698,8 +2698,7 @@ int
>  gus_get_props(void *addr)
>  {
>       struct gus_softc *sc = addr;
> -     return AUDIO_PROP_MMAP |
> -             (sc->sc_recdrq == sc->sc_drq ? 0 : AUDIO_PROP_FULLDUPLEX);
> +     return (sc->sc_recdrq == sc->sc_drq ? 0 : AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/isa/sbdsp.c b/sys/dev/isa/sbdsp.c
> index 84845094c92..41ec544601c 100644
> --- a/sys/dev/isa/sbdsp.c
> +++ b/sys/dev/isa/sbdsp.c
> @@ -2116,8 +2116,7 @@ int
>  sbdsp_get_props(void *addr)
>  {
>       struct sbdsp_softc *sc = addr;
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT |
> -            (sc->sc_fullduplex ? AUDIO_PROP_FULLDUPLEX : 0);
> +     return (sc->sc_fullduplex ? AUDIO_PROP_FULLDUPLEX : 0);
>  }
>  
>  #if NMIDI > 0
> diff --git a/sys/dev/pci/auacer.c b/sys/dev/pci/auacer.c
> index ad840a08458..ee26ab75569 100644
> --- a/sys/dev/pci/auacer.c
> +++ b/sys/dev/pci/auacer.c
> @@ -642,8 +642,7 @@ auacer_round_buffersize(void *v, int direction, size_t 
> size)
>  int
>  auacer_get_props(void *v)
>  {
> -     return (AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX |
> -         AUDIO_PROP_MMAP);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  static void
> diff --git a/sys/dev/pci/auglx.c b/sys/dev/pci/auglx.c
> index 7902c382002..b943b464535 100644
> --- a/sys/dev/pci/auglx.c
> +++ b/sys/dev/pci/auglx.c
> @@ -627,7 +627,7 @@ auglx_round_buffersize(void *v, int direction, size_t 
> size)
>  int
>  auglx_get_props(void *v)
>  {
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/pci/auich.c b/sys/dev/pci/auich.c
> index f03c0e3bdb1..eeef6eb366c 100644
> --- a/sys/dev/pci/auich.c
> +++ b/sys/dev/pci/auich.c
> @@ -927,7 +927,7 @@ auich_round_buffersize(void *v, int direction, size_t 
> size)
>  int
>  auich_get_props(void *v)
>  {
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/pci/auixp.c b/sys/dev/pci/auixp.c
> index 92f57fd2676..91de3267e2c 100644
> --- a/sys/dev/pci/auixp.c
> +++ b/sys/dev/pci/auixp.c
> @@ -449,7 +449,7 @@ int
>  auixp_get_props(void *hdl)
>  {
>  
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  
> diff --git a/sys/dev/pci/autri.c b/sys/dev/pci/autri.c
> index 306aa674509..404b9bf82dd 100644
> --- a/sys/dev/pci/autri.c
> +++ b/sys/dev/pci/autri.c
> @@ -1034,8 +1034,7 @@ autri_find_dma(struct autri_softc *sc, void *addr)
>  int
>  autri_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT |
> -             AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  void
> diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c
> index a2b7923f3a7..007f7b9f821 100644
> --- a/sys/dev/pci/auvia.c
> +++ b/sys/dev/pci/auvia.c
> @@ -801,11 +801,7 @@ auvia_round_buffersize(void *addr, int direction, size_t 
> bufsize)
>  int
>  auvia_get_props(void *addr)
>  {
> -     int props;
> -
> -     props = AUDIO_PROP_MMAP|AUDIO_PROP_INDEPENDENT|AUDIO_PROP_FULLDUPLEX;
> -
> -     return  props;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  
> diff --git a/sys/dev/pci/azalia.c b/sys/dev/pci/azalia.c
> index 8725e96340f..84d942811bc 100644
> --- a/sys/dev/pci/azalia.c
> +++ b/sys/dev/pci/azalia.c
> @@ -4149,7 +4149,7 @@ azalia_round_buffersize(void *v, int dir, size_t size)
>  int
>  azalia_get_props(void *v)
>  {
> -     return AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/pci/cmpci.c b/sys/dev/pci/cmpci.c
> index 416db69f4d9..9487d0b0a15 100644
> --- a/sys/dev/pci/cmpci.c
> +++ b/sys/dev/pci/cmpci.c
> @@ -1768,7 +1768,7 @@ cmpci_round_buffersize(void *handle, int direction, 
> size_t bufsize)
>  int
>  cmpci_get_props(void *handle)
>  {
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/pci/cs4280.c b/sys/dev/pci/cs4280.c
> index 6f8d7f31ea4..fccd04b6db4 100644
> --- a/sys/dev/pci/cs4280.c
> +++ b/sys/dev/pci/cs4280.c
> @@ -1062,7 +1062,7 @@ cs4280_round_blocksize(void *hdl, int blk)
>  int
>  cs4280_get_props(void *hdl)
>  {
> -     return (AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX); 
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/pci/cs4281.c b/sys/dev/pci/cs4281.c
> index f8bc2564982..620983a61d4 100644
> --- a/sys/dev/pci/cs4281.c
> +++ b/sys/dev/pci/cs4281.c
> @@ -1195,13 +1195,7 @@ cs4281_round_buffersize(void *addr, int direction, 
> size_t size)
>  int
>  cs4281_get_props(void *addr)
>  {
> -     int retval;
> -
> -     retval = AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX;
> -#ifdef MMAP_READY
> -     retval |= AUDIO_PROP_MMAP;
> -#endif
> -     return (retval);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  /* AC97 */
> diff --git a/sys/dev/pci/eap.c b/sys/dev/pci/eap.c
> index 53c8acfae5f..83b6ecac5be 100644
> --- a/sys/dev/pci/eap.c
> +++ b/sys/dev/pci/eap.c
> @@ -1498,8 +1498,7 @@ eap_free(void *addr, void *ptr, int pool)
>  int
>  eap_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT |
> -         AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  enum ac97_host_flags
> diff --git a/sys/dev/pci/emuxki.c b/sys/dev/pci/emuxki.c
> index 998f722d4a5..c3f370c1bc4 100644
> --- a/sys/dev/pci/emuxki.c
> +++ b/sys/dev/pci/emuxki.c
> @@ -2269,8 +2269,7 @@ emuxki_round_buffersize(void *addr, int direction, 
> size_t bsize)
>  int
>  emuxki_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT |
> -             AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/pci/envy.c b/sys/dev/pci/envy.c
> index 51689997017..3799e90242b 100644
> --- a/sys/dev/pci/envy.c
> +++ b/sys/dev/pci/envy.c
> @@ -2442,7 +2442,7 @@ envy_set_port(void *self, struct mixer_ctrl *ctl)
>  int
>  envy_get_props(void *self)
>  {
> -     return AUDIO_PROP_FULLDUPLEX | AUDIO_PROP_INDEPENDENT;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  #if NMIDI > 0
> diff --git a/sys/dev/pci/esa.c b/sys/dev/pci/esa.c
> index 63c864db22f..b05283b50b3 100644
> --- a/sys/dev/pci/esa.c
> +++ b/sys/dev/pci/esa.c
> @@ -497,8 +497,7 @@ esa_round_buffersize(void *hdl, int direction, size_t 
> bufsize)
>  int
>  esa_get_props(void *hdl)
>  {
> -
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | 
> AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/pci/eso.c b/sys/dev/pci/eso.c
> index b700ddecbdc..ee4bcad3823 100644
> --- a/sys/dev/pci/eso.c
> +++ b/sys/dev/pci/eso.c
> @@ -1571,8 +1571,7 @@ eso_round_buffersize(void *hdl, int direction, size_t 
> bufsize)
>  int
>  eso_get_props(void *hdl)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT |
> -         AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/pci/fms.c b/sys/dev/pci/fms.c
> index 8e18364f857..423d321d6fe 100644
> --- a/sys/dev/pci/fms.c
> +++ b/sys/dev/pci/fms.c
> @@ -635,8 +635,7 @@ fms_free(void *addr, void *ptr, int pool)
>  int
>  fms_get_props(void *addr)
>  {
> -     return AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | 
> -            AUDIO_PROP_FULLDUPLEX;
> +     return AUDIO_PROP_FULLDUPLEX;
>  }
>  
>  int
> diff --git a/sys/dev/pci/maestro.c b/sys/dev/pci/maestro.c
> index d6ceb0cae2c..13a924e87a2 100644
> --- a/sys/dev/pci/maestro.c
> +++ b/sys/dev/pci/maestro.c
> @@ -852,7 +852,7 @@ maestro_get_props(void *self)
>  {
>       /* struct maestro_softc *sc = (struct maestro_softc *)self; */
>  
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT); /* XXX */
> +     return (0); /* XXX */
>  }
>  
>  int
> diff --git a/sys/dev/pci/neo.c b/sys/dev/pci/neo.c
> index b6f984d26e1..c524ff71b8c 100644
> --- a/sys/dev/pci/neo.c
> +++ b/sys/dev/pci/neo.c
> @@ -941,5 +941,5 @@ neo_round_buffersize(void *addr, int direction, size_t 
> size)
>  int
>  neo_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_INDEPENDENT | AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
> diff --git a/sys/dev/pci/yds.c b/sys/dev/pci/yds.c
> index 5657423174e..6618d7d7395 100644
> --- a/sys/dev/pci/yds.c
> +++ b/sys/dev/pci/yds.c
> @@ -1570,8 +1570,7 @@ yds_round_buffersize(void *addr, int direction, size_t 
> size)
>  int
>  yds_get_props(void *addr)
>  {
> -     return (AUDIO_PROP_MMAP | AUDIO_PROP_INDEPENDENT | 
> -             AUDIO_PROP_FULLDUPLEX);
> +     return (AUDIO_PROP_FULLDUPLEX);
>  }
>  
>  int
> diff --git a/sys/dev/tc/bba.c b/sys/dev/tc/bba.c
> index 840e7e85eda..9b86749bea4 100644
> --- a/sys/dev/tc/bba.c
> +++ b/sys/dev/tc/bba.c
> @@ -584,7 +584,7 @@ bba_intr(void *v)
>  int
>  bba_get_props(void *v)
>  {
> -     return AUDIO_PROP_MMAP | am7930_get_props(v);
> +     return am7930_get_props(v);
>  }
>  
>  int
> 
> 

Reply via email to