pcm_oss.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef __SOUND_PCM_OSS_H
  3. #define __SOUND_PCM_OSS_H
  4. /*
  5. * Digital Audio (PCM) - OSS compatibility abstract layer
  6. * Copyright (c) by Jaroslav Kysela <[email protected]>
  7. */
  8. struct snd_pcm_oss_setup {
  9. char *task_name;
  10. unsigned int disable:1,
  11. direct:1,
  12. block:1,
  13. nonblock:1,
  14. partialfrag:1,
  15. nosilence:1,
  16. buggyptr:1;
  17. unsigned int periods;
  18. unsigned int period_size;
  19. struct snd_pcm_oss_setup *next;
  20. };
  21. struct snd_pcm_oss_runtime {
  22. unsigned params: 1, /* format/parameter change */
  23. prepare: 1, /* need to prepare the operation */
  24. trigger: 1, /* trigger flag */
  25. sync_trigger: 1; /* sync trigger flag */
  26. int rate; /* requested rate */
  27. int format; /* requested OSS format */
  28. unsigned int channels; /* requested channels */
  29. unsigned int fragshift;
  30. unsigned int maxfrags;
  31. unsigned int subdivision; /* requested subdivision */
  32. size_t period_bytes; /* requested period size */
  33. size_t period_frames; /* period frames for poll */
  34. size_t period_ptr; /* actual write pointer to period */
  35. unsigned int periods;
  36. size_t buffer_bytes; /* requested buffer size */
  37. size_t bytes; /* total # bytes processed */
  38. size_t mmap_bytes;
  39. char *buffer; /* vmallocated period */
  40. size_t buffer_used; /* used length from period buffer */
  41. struct mutex params_lock;
  42. atomic_t rw_ref; /* concurrent read/write accesses */
  43. #ifdef CONFIG_SND_PCM_OSS_PLUGINS
  44. struct snd_pcm_plugin *plugin_first;
  45. struct snd_pcm_plugin *plugin_last;
  46. #endif
  47. unsigned int prev_hw_ptr_period;
  48. };
  49. struct snd_pcm_oss_file {
  50. struct snd_pcm_substream *streams[2];
  51. };
  52. struct snd_pcm_oss_substream {
  53. unsigned oss: 1; /* oss mode */
  54. struct snd_pcm_oss_setup setup; /* active setup */
  55. };
  56. struct snd_pcm_oss_stream {
  57. struct snd_pcm_oss_setup *setup_list; /* setup list */
  58. struct mutex setup_mutex;
  59. #ifdef CONFIG_SND_VERBOSE_PROCFS
  60. struct snd_info_entry *proc_entry;
  61. #endif
  62. };
  63. struct snd_pcm_oss {
  64. int reg;
  65. unsigned int reg_mask;
  66. };
  67. #endif /* __SOUND_PCM_OSS_H */