pcm_compat.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. /*
  2. * 32bit -> 64bit ioctl wrapper for PCM API
  3. * Copyright (c) by Takashi Iwai <tiwai@suse.de>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. *
  19. */
  20. /* This file included from pcm_native.c */
  21. #include <linux/compat.h>
  22. #include <linux/slab.h>
  23. static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream *substream,
  24. s32 __user *src)
  25. {
  26. snd_pcm_sframes_t delay;
  27. mm_segment_t fs;
  28. int err;
  29. fs = snd_enter_user();
  30. err = snd_pcm_delay(substream, &delay);
  31. snd_leave_user(fs);
  32. if (err < 0)
  33. return err;
  34. if (put_user(delay, src))
  35. return -EFAULT;
  36. return err;
  37. }
  38. static int snd_pcm_ioctl_rewind_compat(struct snd_pcm_substream *substream,
  39. u32 __user *src)
  40. {
  41. snd_pcm_uframes_t frames;
  42. int err;
  43. if (get_user(frames, src))
  44. return -EFAULT;
  45. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  46. err = snd_pcm_playback_rewind(substream, frames);
  47. else
  48. err = snd_pcm_capture_rewind(substream, frames);
  49. if (put_user(err, src))
  50. return -EFAULT;
  51. return err < 0 ? err : 0;
  52. }
  53. static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream *substream,
  54. u32 __user *src)
  55. {
  56. snd_pcm_uframes_t frames;
  57. int err;
  58. if (get_user(frames, src))
  59. return -EFAULT;
  60. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  61. err = snd_pcm_playback_forward(substream, frames);
  62. else
  63. err = snd_pcm_capture_forward(substream, frames);
  64. if (put_user(err, src))
  65. return -EFAULT;
  66. return err < 0 ? err : 0;
  67. }
  68. struct snd_pcm_hw_params32 {
  69. u32 flags;
  70. struct snd_mask masks[SNDRV_PCM_HW_PARAM_LAST_MASK - SNDRV_PCM_HW_PARAM_FIRST_MASK + 1]; /* this must be identical */
  71. struct snd_mask mres[5]; /* reserved masks */
  72. struct snd_interval intervals[SNDRV_PCM_HW_PARAM_LAST_INTERVAL - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL + 1];
  73. struct snd_interval ires[9]; /* reserved intervals */
  74. u32 rmask;
  75. u32 cmask;
  76. u32 info;
  77. u32 msbits;
  78. u32 rate_num;
  79. u32 rate_den;
  80. u32 fifo_size;
  81. unsigned char reserved[64];
  82. };
  83. struct snd_pcm_sw_params32 {
  84. s32 tstamp_mode;
  85. u32 period_step;
  86. u32 sleep_min;
  87. u32 avail_min;
  88. u32 xfer_align;
  89. u32 start_threshold;
  90. u32 stop_threshold;
  91. u32 silence_threshold;
  92. u32 silence_size;
  93. u32 boundary;
  94. u32 proto;
  95. u32 tstamp_type;
  96. unsigned char reserved[56];
  97. };
  98. /* recalcuate the boundary within 32bit */
  99. static snd_pcm_uframes_t recalculate_boundary(struct snd_pcm_runtime *runtime)
  100. {
  101. snd_pcm_uframes_t boundary;
  102. if (! runtime->buffer_size)
  103. return 0;
  104. boundary = runtime->buffer_size;
  105. while (boundary * 2 <= 0x7fffffffUL - runtime->buffer_size)
  106. boundary *= 2;
  107. return boundary;
  108. }
  109. static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream *substream,
  110. struct snd_pcm_sw_params32 __user *src)
  111. {
  112. struct snd_pcm_sw_params params;
  113. snd_pcm_uframes_t boundary;
  114. int err;
  115. memset(&params, 0, sizeof(params));
  116. if (get_user(params.tstamp_mode, &src->tstamp_mode) ||
  117. get_user(params.period_step, &src->period_step) ||
  118. get_user(params.sleep_min, &src->sleep_min) ||
  119. get_user(params.avail_min, &src->avail_min) ||
  120. get_user(params.xfer_align, &src->xfer_align) ||
  121. get_user(params.start_threshold, &src->start_threshold) ||
  122. get_user(params.stop_threshold, &src->stop_threshold) ||
  123. get_user(params.silence_threshold, &src->silence_threshold) ||
  124. get_user(params.silence_size, &src->silence_size) ||
  125. get_user(params.tstamp_type, &src->tstamp_type) ||
  126. get_user(params.proto, &src->proto))
  127. return -EFAULT;
  128. /*
  129. * Check silent_size parameter. Since we have 64bit boundary,
  130. * silence_size must be compared with the 32bit boundary.
  131. */
  132. boundary = recalculate_boundary(substream->runtime);
  133. if (boundary && params.silence_size >= boundary)
  134. params.silence_size = substream->runtime->boundary;
  135. err = snd_pcm_sw_params(substream, &params);
  136. if (err < 0)
  137. return err;
  138. if (boundary && put_user(boundary, &src->boundary))
  139. return -EFAULT;
  140. return err;
  141. }
  142. struct snd_pcm_channel_info32 {
  143. u32 channel;
  144. u32 offset;
  145. u32 first;
  146. u32 step;
  147. };
  148. static int snd_pcm_ioctl_channel_info_compat(struct snd_pcm_substream *substream,
  149. struct snd_pcm_channel_info32 __user *src)
  150. {
  151. struct snd_pcm_channel_info info;
  152. int err;
  153. if (get_user(info.channel, &src->channel) ||
  154. get_user(info.offset, &src->offset) ||
  155. get_user(info.first, &src->first) ||
  156. get_user(info.step, &src->step))
  157. return -EFAULT;
  158. err = snd_pcm_channel_info(substream, &info);
  159. if (err < 0)
  160. return err;
  161. if (put_user(info.channel, &src->channel) ||
  162. put_user(info.offset, &src->offset) ||
  163. put_user(info.first, &src->first) ||
  164. put_user(info.step, &src->step))
  165. return -EFAULT;
  166. return err;
  167. }
  168. struct snd_pcm_status32 {
  169. s32 state;
  170. struct compat_timespec trigger_tstamp;
  171. struct compat_timespec tstamp;
  172. u32 appl_ptr;
  173. u32 hw_ptr;
  174. s32 delay;
  175. u32 avail;
  176. u32 avail_max;
  177. u32 overrange;
  178. s32 suspended_state;
  179. u32 audio_tstamp_data;
  180. struct compat_timespec audio_tstamp;
  181. struct compat_timespec driver_tstamp;
  182. u32 audio_tstamp_accuracy;
  183. unsigned char reserved[52-2*sizeof(struct compat_timespec)];
  184. } __attribute__((packed));
  185. static int snd_pcm_status_user_compat(struct snd_pcm_substream *substream,
  186. struct snd_pcm_status32 __user *src,
  187. bool ext)
  188. {
  189. struct snd_pcm_status status;
  190. int err;
  191. memset(&status, 0, sizeof(status));
  192. /*
  193. * with extension, parameters are read/write,
  194. * get audio_tstamp_data from user,
  195. * ignore rest of status structure
  196. */
  197. if (ext && get_user(status.audio_tstamp_data,
  198. (u32 __user *)(&src->audio_tstamp_data)))
  199. return -EFAULT;
  200. err = snd_pcm_status(substream, &status);
  201. if (err < 0)
  202. return err;
  203. if (clear_user(src, sizeof(*src)))
  204. return -EFAULT;
  205. if (put_user(status.state, &src->state) ||
  206. compat_put_timespec(&status.trigger_tstamp, &src->trigger_tstamp) ||
  207. compat_put_timespec(&status.tstamp, &src->tstamp) ||
  208. put_user(status.appl_ptr, &src->appl_ptr) ||
  209. put_user(status.hw_ptr, &src->hw_ptr) ||
  210. put_user(status.delay, &src->delay) ||
  211. put_user(status.avail, &src->avail) ||
  212. put_user(status.avail_max, &src->avail_max) ||
  213. put_user(status.overrange, &src->overrange) ||
  214. put_user(status.suspended_state, &src->suspended_state) ||
  215. put_user(status.audio_tstamp_data, &src->audio_tstamp_data) ||
  216. compat_put_timespec(&status.audio_tstamp, &src->audio_tstamp) ||
  217. compat_put_timespec(&status.driver_tstamp, &src->driver_tstamp) ||
  218. put_user(status.audio_tstamp_accuracy, &src->audio_tstamp_accuracy))
  219. return -EFAULT;
  220. return err;
  221. }
  222. /* both for HW_PARAMS and HW_REFINE */
  223. static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream *substream,
  224. int refine,
  225. struct snd_pcm_hw_params32 __user *data32)
  226. {
  227. struct snd_pcm_hw_params *data;
  228. struct snd_pcm_runtime *runtime;
  229. int err;
  230. if (! (runtime = substream->runtime))
  231. return -ENOTTY;
  232. /* only fifo_size is different, so just copy all */
  233. data = memdup_user(data32, sizeof(*data32));
  234. if (IS_ERR(data))
  235. return PTR_ERR(data);
  236. if (refine)
  237. err = snd_pcm_hw_refine(substream, data);
  238. else
  239. err = snd_pcm_hw_params(substream, data);
  240. if (err < 0)
  241. goto error;
  242. if (copy_to_user(data32, data, sizeof(*data32)) ||
  243. put_user(data->fifo_size, &data32->fifo_size)) {
  244. err = -EFAULT;
  245. goto error;
  246. }
  247. if (! refine) {
  248. unsigned int new_boundary = recalculate_boundary(runtime);
  249. if (new_boundary)
  250. runtime->boundary = new_boundary;
  251. }
  252. error:
  253. kfree(data);
  254. return err;
  255. }
  256. /*
  257. */
  258. struct snd_xferi32 {
  259. s32 result;
  260. u32 buf;
  261. u32 frames;
  262. };
  263. static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream *substream,
  264. int dir, struct snd_xferi32 __user *data32)
  265. {
  266. compat_caddr_t buf;
  267. u32 frames;
  268. int err;
  269. if (! substream->runtime)
  270. return -ENOTTY;
  271. if (substream->stream != dir)
  272. return -EINVAL;
  273. if (substream->runtime->status->state == SNDRV_PCM_STATE_OPEN)
  274. return -EBADFD;
  275. if (get_user(buf, &data32->buf) ||
  276. get_user(frames, &data32->frames))
  277. return -EFAULT;
  278. if (dir == SNDRV_PCM_STREAM_PLAYBACK)
  279. err = snd_pcm_lib_write(substream, compat_ptr(buf), frames);
  280. else
  281. err = snd_pcm_lib_read(substream, compat_ptr(buf), frames);
  282. if (err < 0)
  283. return err;
  284. /* copy the result */
  285. if (put_user(err, &data32->result))
  286. return -EFAULT;
  287. return 0;
  288. }
  289. /* snd_xfern needs remapping of bufs */
  290. struct snd_xfern32 {
  291. s32 result;
  292. u32 bufs; /* this is void **; */
  293. u32 frames;
  294. };
  295. /*
  296. * xfern ioctl nees to copy (up to) 128 pointers on stack.
  297. * although we may pass the copied pointers through f_op->ioctl, but the ioctl
  298. * handler there expands again the same 128 pointers on stack, so it is better
  299. * to handle the function (calling pcm_readv/writev) directly in this handler.
  300. */
  301. static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream *substream,
  302. int dir, struct snd_xfern32 __user *data32)
  303. {
  304. compat_caddr_t buf;
  305. compat_caddr_t __user *bufptr;
  306. u32 frames;
  307. void __user **bufs;
  308. int err, ch, i;
  309. if (! substream->runtime)
  310. return -ENOTTY;
  311. if (substream->stream != dir)
  312. return -EINVAL;
  313. if ((ch = substream->runtime->channels) > 128)
  314. return -EINVAL;
  315. if (get_user(buf, &data32->bufs) ||
  316. get_user(frames, &data32->frames))
  317. return -EFAULT;
  318. bufptr = compat_ptr(buf);
  319. bufs = kmalloc(sizeof(void __user *) * ch, GFP_KERNEL);
  320. if (bufs == NULL)
  321. return -ENOMEM;
  322. for (i = 0; i < ch; i++) {
  323. u32 ptr;
  324. if (get_user(ptr, bufptr)) {
  325. kfree(bufs);
  326. return -EFAULT;
  327. }
  328. bufs[i] = compat_ptr(ptr);
  329. bufptr++;
  330. }
  331. if (dir == SNDRV_PCM_STREAM_PLAYBACK)
  332. err = snd_pcm_lib_writev(substream, bufs, frames);
  333. else
  334. err = snd_pcm_lib_readv(substream, bufs, frames);
  335. if (err >= 0) {
  336. if (put_user(err, &data32->result))
  337. err = -EFAULT;
  338. }
  339. kfree(bufs);
  340. return err;
  341. }
  342. struct snd_pcm_mmap_status32 {
  343. s32 state;
  344. s32 pad1;
  345. u32 hw_ptr;
  346. struct compat_timespec tstamp;
  347. s32 suspended_state;
  348. struct compat_timespec audio_tstamp;
  349. } __attribute__((packed));
  350. struct snd_pcm_mmap_control32 {
  351. u32 appl_ptr;
  352. u32 avail_min;
  353. };
  354. struct snd_pcm_sync_ptr32 {
  355. u32 flags;
  356. union {
  357. struct snd_pcm_mmap_status32 status;
  358. unsigned char reserved[64];
  359. } s;
  360. union {
  361. struct snd_pcm_mmap_control32 control;
  362. unsigned char reserved[64];
  363. } c;
  364. } __attribute__((packed));
  365. static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream *substream,
  366. struct snd_pcm_sync_ptr32 __user *src)
  367. {
  368. struct snd_pcm_runtime *runtime = substream->runtime;
  369. volatile struct snd_pcm_mmap_status *status;
  370. volatile struct snd_pcm_mmap_control *control;
  371. u32 sflags;
  372. struct snd_pcm_mmap_control scontrol;
  373. struct snd_pcm_mmap_status sstatus;
  374. snd_pcm_uframes_t boundary;
  375. int err;
  376. if (snd_BUG_ON(!runtime))
  377. return -EINVAL;
  378. if (get_user(sflags, &src->flags) ||
  379. get_user(scontrol.appl_ptr, &src->c.control.appl_ptr) ||
  380. get_user(scontrol.avail_min, &src->c.control.avail_min))
  381. return -EFAULT;
  382. if (sflags & SNDRV_PCM_SYNC_PTR_HWSYNC) {
  383. err = snd_pcm_hwsync(substream);
  384. if (err < 0)
  385. return err;
  386. }
  387. status = runtime->status;
  388. control = runtime->control;
  389. boundary = recalculate_boundary(runtime);
  390. if (! boundary)
  391. boundary = 0x7fffffff;
  392. snd_pcm_stream_lock_irq(substream);
  393. /* FIXME: we should consider the boundary for the sync from app */
  394. if (!(sflags & SNDRV_PCM_SYNC_PTR_APPL))
  395. control->appl_ptr = scontrol.appl_ptr;
  396. else
  397. scontrol.appl_ptr = control->appl_ptr % boundary;
  398. if (!(sflags & SNDRV_PCM_SYNC_PTR_AVAIL_MIN))
  399. control->avail_min = scontrol.avail_min;
  400. else
  401. scontrol.avail_min = control->avail_min;
  402. sstatus.state = status->state;
  403. sstatus.hw_ptr = status->hw_ptr % boundary;
  404. sstatus.tstamp = status->tstamp;
  405. sstatus.suspended_state = status->suspended_state;
  406. sstatus.audio_tstamp = status->audio_tstamp;
  407. snd_pcm_stream_unlock_irq(substream);
  408. if (put_user(sstatus.state, &src->s.status.state) ||
  409. put_user(sstatus.hw_ptr, &src->s.status.hw_ptr) ||
  410. compat_put_timespec(&sstatus.tstamp, &src->s.status.tstamp) ||
  411. put_user(sstatus.suspended_state, &src->s.status.suspended_state) ||
  412. compat_put_timespec(&sstatus.audio_tstamp,
  413. &src->s.status.audio_tstamp) ||
  414. put_user(scontrol.appl_ptr, &src->c.control.appl_ptr) ||
  415. put_user(scontrol.avail_min, &src->c.control.avail_min))
  416. return -EFAULT;
  417. return 0;
  418. }
  419. /*
  420. */
  421. enum {
  422. SNDRV_PCM_IOCTL_HW_REFINE32 = _IOWR('A', 0x10, struct snd_pcm_hw_params32),
  423. SNDRV_PCM_IOCTL_HW_PARAMS32 = _IOWR('A', 0x11, struct snd_pcm_hw_params32),
  424. SNDRV_PCM_IOCTL_SW_PARAMS32 = _IOWR('A', 0x13, struct snd_pcm_sw_params32),
  425. SNDRV_PCM_IOCTL_STATUS32 = _IOR('A', 0x20, struct snd_pcm_status32),
  426. SNDRV_PCM_IOCTL_STATUS_EXT32 = _IOWR('A', 0x24, struct snd_pcm_status32),
  427. SNDRV_PCM_IOCTL_DELAY32 = _IOR('A', 0x21, s32),
  428. SNDRV_PCM_IOCTL_CHANNEL_INFO32 = _IOR('A', 0x32, struct snd_pcm_channel_info32),
  429. SNDRV_PCM_IOCTL_REWIND32 = _IOW('A', 0x46, u32),
  430. SNDRV_PCM_IOCTL_FORWARD32 = _IOW('A', 0x49, u32),
  431. SNDRV_PCM_IOCTL_WRITEI_FRAMES32 = _IOW('A', 0x50, struct snd_xferi32),
  432. SNDRV_PCM_IOCTL_READI_FRAMES32 = _IOR('A', 0x51, struct snd_xferi32),
  433. SNDRV_PCM_IOCTL_WRITEN_FRAMES32 = _IOW('A', 0x52, struct snd_xfern32),
  434. SNDRV_PCM_IOCTL_READN_FRAMES32 = _IOR('A', 0x53, struct snd_xfern32),
  435. SNDRV_PCM_IOCTL_SYNC_PTR32 = _IOWR('A', 0x23, struct snd_pcm_sync_ptr32),
  436. };
  437. static long snd_pcm_ioctl_compat(struct file *file, unsigned int cmd, unsigned long arg)
  438. {
  439. struct snd_pcm_file *pcm_file;
  440. struct snd_pcm_substream *substream;
  441. void __user *argp = compat_ptr(arg);
  442. pcm_file = file->private_data;
  443. if (! pcm_file)
  444. return -ENOTTY;
  445. substream = pcm_file->substream;
  446. if (! substream)
  447. return -ENOTTY;
  448. /*
  449. * When PCM is used on 32bit mode, we need to disable
  450. * mmap of PCM status/control records because of the size
  451. * incompatibility.
  452. */
  453. pcm_file->no_compat_mmap = 1;
  454. switch (cmd) {
  455. case SNDRV_PCM_IOCTL_PVERSION:
  456. case SNDRV_PCM_IOCTL_INFO:
  457. case SNDRV_PCM_IOCTL_TSTAMP:
  458. case SNDRV_PCM_IOCTL_TTSTAMP:
  459. case SNDRV_PCM_IOCTL_HWSYNC:
  460. case SNDRV_PCM_IOCTL_PREPARE:
  461. case SNDRV_PCM_IOCTL_RESET:
  462. case SNDRV_PCM_IOCTL_START:
  463. case SNDRV_PCM_IOCTL_DROP:
  464. case SNDRV_PCM_IOCTL_DRAIN:
  465. case SNDRV_PCM_IOCTL_PAUSE:
  466. case SNDRV_PCM_IOCTL_HW_FREE:
  467. case SNDRV_PCM_IOCTL_RESUME:
  468. case SNDRV_PCM_IOCTL_XRUN:
  469. case SNDRV_PCM_IOCTL_LINK:
  470. case SNDRV_PCM_IOCTL_UNLINK:
  471. if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  472. return snd_pcm_playback_ioctl1(file, substream, cmd, argp);
  473. else
  474. return snd_pcm_capture_ioctl1(file, substream, cmd, argp);
  475. case SNDRV_PCM_IOCTL_HW_REFINE32:
  476. return snd_pcm_ioctl_hw_params_compat(substream, 1, argp);
  477. case SNDRV_PCM_IOCTL_HW_PARAMS32:
  478. return snd_pcm_ioctl_hw_params_compat(substream, 0, argp);
  479. case SNDRV_PCM_IOCTL_SW_PARAMS32:
  480. return snd_pcm_ioctl_sw_params_compat(substream, argp);
  481. case SNDRV_PCM_IOCTL_STATUS32:
  482. return snd_pcm_status_user_compat(substream, argp, false);
  483. case SNDRV_PCM_IOCTL_STATUS_EXT32:
  484. return snd_pcm_status_user_compat(substream, argp, true);
  485. case SNDRV_PCM_IOCTL_SYNC_PTR32:
  486. return snd_pcm_ioctl_sync_ptr_compat(substream, argp);
  487. case SNDRV_PCM_IOCTL_CHANNEL_INFO32:
  488. return snd_pcm_ioctl_channel_info_compat(substream, argp);
  489. case SNDRV_PCM_IOCTL_WRITEI_FRAMES32:
  490. return snd_pcm_ioctl_xferi_compat(substream, SNDRV_PCM_STREAM_PLAYBACK, argp);
  491. case SNDRV_PCM_IOCTL_READI_FRAMES32:
  492. return snd_pcm_ioctl_xferi_compat(substream, SNDRV_PCM_STREAM_CAPTURE, argp);
  493. case SNDRV_PCM_IOCTL_WRITEN_FRAMES32:
  494. return snd_pcm_ioctl_xfern_compat(substream, SNDRV_PCM_STREAM_PLAYBACK, argp);
  495. case SNDRV_PCM_IOCTL_READN_FRAMES32:
  496. return snd_pcm_ioctl_xfern_compat(substream, SNDRV_PCM_STREAM_CAPTURE, argp);
  497. case SNDRV_PCM_IOCTL_DELAY32:
  498. return snd_pcm_ioctl_delay_compat(substream, argp);
  499. case SNDRV_PCM_IOCTL_REWIND32:
  500. return snd_pcm_ioctl_rewind_compat(substream, argp);
  501. case SNDRV_PCM_IOCTL_FORWARD32:
  502. return snd_pcm_ioctl_forward_compat(substream, argp);
  503. }
  504. return -ENOIOCTLCMD;
  505. }