pcm_oss.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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@suse.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 snd_pcm_plugin *plugin_first;
  57. struct snd_pcm_plugin *plugin_last;
  58. unsigned int prev_hw_ptr_interrupt;
  59. };
  60. struct snd_pcm_oss_file {
  61. struct snd_pcm_substream *streams[2];
  62. };
  63. struct snd_pcm_oss_substream {
  64. unsigned oss: 1; /* oss mode */
  65. struct snd_pcm_oss_setup *setup; /* active setup */
  66. struct snd_pcm_oss_file *file;
  67. };
  68. struct snd_pcm_oss_stream {
  69. struct snd_pcm_oss_setup *setup_list; /* setup list */
  70. struct semaphore setup_mutex;
  71. struct snd_info_entry *proc_entry;
  72. };
  73. struct snd_pcm_oss {
  74. int reg;
  75. unsigned int reg_mask;
  76. };
  77. #endif /* __SOUND_PCM_OSS_H */