2 * ossp - OSS Proxy: emulate OSS device using CUSE
4 * Copyright (C) 2008-2010 SUSE Linux Products GmbH
5 * Copyright (C) 2008-2010 Tejun Heo <tj@kernel.org>
7 * This file is released under the GPLv2.
12 const struct ossp_arg_size ossp_arg_sizes[OSSP_NR_OPCODES] = {
13 [OSSP_MIXER] = { sizeof(struct ossp_mixer_arg),
14 sizeof(struct ossp_mixer_arg), 0 },
16 [OSSP_DSP_OPEN] = { sizeof(struct ossp_dsp_open_arg), 0, 0 },
17 [OSSP_DSP_READ] = { sizeof(struct ossp_dsp_rw_arg), 0, 0 },
18 [OSSP_DSP_WRITE] = { sizeof(struct ossp_dsp_rw_arg), 0, 0 },
19 [OSSP_DSP_POLL] = { sizeof(int), sizeof(unsigned), 0 },
20 [OSSP_DSP_MMAP] = { sizeof(struct ossp_dsp_mmap_arg), 0, 0 },
21 [OSSP_DSP_MUNMAP] = { sizeof(int), 0, 0 },
23 [OSSP_DSP_RESET] = { 0, 0, 0 },
24 [OSSP_DSP_SYNC] = { 0, 0, 0 },
25 [OSSP_DSP_POST] = { 0, 0, 0 },
26 [OSSP_DSP_GET_RATE] = { 0, sizeof(int), 0 },
27 [OSSP_DSP_GET_CHANNELS] = { 0, sizeof(int), 0 },
28 [OSSP_DSP_GET_FORMAT] = { 0, sizeof(int), 0 },
29 [OSSP_DSP_GET_BLKSIZE] = { 0, sizeof(int), 0 },
30 [OSSP_DSP_GET_FORMATS] = { 0, sizeof(int), 0 },
31 [OSSP_DSP_SET_RATE] = { sizeof(int), sizeof(int), 0 },
32 [OSSP_DSP_SET_CHANNELS] = { sizeof(int), sizeof(int), 0 },
33 [OSSP_DSP_SET_FORMAT] = { sizeof(int), sizeof(int), 0 },
34 [OSSP_DSP_SET_SUBDIVISION] = { sizeof(int), sizeof(int), 0 },
35 [OSSP_DSP_SET_FRAGMENT] = { sizeof(int), 0, 0 },
36 [OSSP_DSP_GET_TRIGGER] = { 0, sizeof(int), 0 },
37 [OSSP_DSP_SET_TRIGGER] = { sizeof(int), 0, 0 },
38 [OSSP_DSP_GET_OSPACE] = { 0, sizeof(struct audio_buf_info), 0 },
39 [OSSP_DSP_GET_ISPACE] = { 0, sizeof(struct audio_buf_info), 0 },
40 [OSSP_DSP_GET_OPTR] = { 0, sizeof(struct count_info), 0 },
41 [OSSP_DSP_GET_IPTR] = { 0, sizeof(struct count_info), 0 },
42 [OSSP_DSP_GET_ODELAY] = { 0, sizeof(int), 0 },
45 const char *ossp_cmd_str[OSSP_NR_OPCODES] = {
46 [OSSP_MIXER] = "MIXER",
48 [OSSP_DSP_OPEN] = "OPEN",
49 [OSSP_DSP_READ] = "READ",
50 [OSSP_DSP_WRITE] = "WRITE",
51 [OSSP_DSP_POLL] = "POLL",
52 [OSSP_DSP_MMAP] = "MMAP",
53 [OSSP_DSP_MUNMAP] = "MUNMAP",
55 [OSSP_DSP_RESET] = "RESET",
56 [OSSP_DSP_SYNC] = "SYNC",
57 [OSSP_DSP_POST] = "POST",
59 [OSSP_DSP_GET_RATE] = "GET_RATE",
60 [OSSP_DSP_GET_CHANNELS] = "GET_CHANNELS",
61 [OSSP_DSP_GET_FORMAT] = "GET_FORMAT",
62 [OSSP_DSP_GET_BLKSIZE] = "GET_BLKSIZE",
63 [OSSP_DSP_GET_FORMATS] = "GET_FORMATS",
64 [OSSP_DSP_SET_RATE] = "SET_RATE",
65 [OSSP_DSP_SET_CHANNELS] = "SET_CHANNELS",
66 [OSSP_DSP_SET_FORMAT] = "SET_FORMAT",
67 [OSSP_DSP_SET_SUBDIVISION] = "SET_BUSDIVISION",
69 [OSSP_DSP_SET_FRAGMENT] = "SET_FRAGMENT",
70 [OSSP_DSP_GET_TRIGGER] = "GET_TRIGGER",
71 [OSSP_DSP_SET_TRIGGER] = "SET_TRIGGER",
72 [OSSP_DSP_GET_OSPACE] = "GET_OSPACE",
73 [OSSP_DSP_GET_ISPACE] = "GET_ISPACE",
74 [OSSP_DSP_GET_OPTR] = "GET_OPTR",
75 [OSSP_DSP_GET_IPTR] = "GET_IPTR",
76 [OSSP_DSP_GET_ODELAY] = "GET_ODELAY",
79 const char *ossp_notify_str[OSSP_NR_NOTIFY_OPCODES] = {
80 [OSSP_NOTIFY_POLL] = "POLL",
81 [OSSP_NOTIFY_OBITUARY] = "OBITUARY",
82 [OSSP_NOTIFY_VOLCHG] = "VOLCHG",