pcm_oss.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef __SOUND_PCM_OSS_H
  2. #define __SOUND_PCM_OSS_H
  3. /*
  4. * Digital Audio (PCM) - OSS compatibility abstract layer
  5. * Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  6. *
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. *
  22. */
  23. struct snd_pcm_oss_setup {
  24. char *task_name;
  25. unsigned int disable:1,
  26. direct:1,
  27. block:1,
  28. nonblock:1,
  29. partialfrag:1,
  30. nosilence:1,
  31. buggyptr:1;
  32. unsigned int periods;
  33. unsigned int period_size;
  34. struct snd_pcm_oss_setup *next;
  35. };
  36. struct snd_pcm_oss_runtime {
  37. unsigned params: 1, /* format/parameter change */
  38. prepare: 1, /* need to prepare the operation */
  39. trigger: 1, /* trigger flag */
  40. sync_trigger: 1; /* sync trigger flag */
  41. int rate; /* requested rate */
  42. int format; /* requested OSS format */
  43. unsigned int channels; /* requested channels */
  44. unsigned int fragshift;
  45. unsigned int maxfrags;
  46. unsigned int subdivision; /* requested subdivision */
  47. size_t period_bytes; /* requested period size */
  48. size_t period_frames; /* period frames for poll */
  49. size_t period_ptr; /* actual write pointer to period */
  50. unsigned int periods;
  51. size_t buffer_bytes; /* requested buffer size */
  52. size_t bytes; /* total # bytes processed */
  53. size_t mmap_bytes;
  54. char *buffer; /* vmallocated period */
  55. size_t buffer_used; /* used length from period buffer */
  56. struct mutex params_lock;
  57. atomic_t rw_ref; /* concurrent read/write accesses */
  58. #ifdef CONFIG_SND_PCM_OSS_PLUGINS
  59. struct snd_pcm_plugin *plugin_first;
  60. struct snd_pcm_plugin *plugin_last;
  61. #endif
  62. unsigned int prev_hw_ptr_period;
  63. };
  64. struct snd_pcm_oss_file {
  65. struct snd_pcm_substream *streams[2];
  66. };
  67. struct snd_pcm_oss_substream {
  68. unsigned oss: 1; /* oss mode */
  69. struct snd_pcm_oss_setup setup; /* active setup */
  70. };
  71. struct snd_pcm_oss_stream {
  72. struct snd_pcm_oss_setup *setup_list; /* setup list */
  73. struct mutex setup_mutex;
  74. #ifdef CONFIG_SND_VERBOSE_PROCFS
  75. struct snd_info_entry *proc_entry;
  76. #endif
  77. };
  78. struct snd_pcm_oss {
  79. int reg;
  80. unsigned int reg_mask;
  81. };
  82. #endif /* __SOUND_PCM_OSS_H */