2 * 32bit -> 64bit ioctl wrapper for PCM API
3 * Copyright (c) by Takashi Iwai <tiwai@suse.de>
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.
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.
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
21 /* This file included from pcm_native.c */
23 #include <linux/compat.h>
24 #include <linux/slab.h>
26 static int snd_pcm_ioctl_delay_compat(struct snd_pcm_substream
*substream
,
29 snd_pcm_sframes_t delay
;
31 delay
= snd_pcm_delay(substream
);
34 if (put_user(delay
, src
))
39 static int snd_pcm_ioctl_rewind_compat(struct snd_pcm_substream
*substream
,
42 snd_pcm_uframes_t frames
;
45 if (get_user(frames
, src
))
47 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
48 err
= snd_pcm_playback_rewind(substream
, frames
);
50 err
= snd_pcm_capture_rewind(substream
, frames
);
51 if (put_user(err
, src
))
53 return err
< 0 ? err
: 0;
56 static int snd_pcm_ioctl_forward_compat(struct snd_pcm_substream
*substream
,
59 snd_pcm_uframes_t frames
;
62 if (get_user(frames
, src
))
64 if (substream
->stream
== SNDRV_PCM_STREAM_PLAYBACK
)
65 err
= snd_pcm_playback_forward(substream
, frames
);
67 err
= snd_pcm_capture_forward(substream
, frames
);
68 if (put_user(err
, src
))
70 return err
< 0 ? err
: 0;
73 struct snd_pcm_hw_params32
{
75 struct snd_mask masks
[SNDRV_PCM_HW_PARAM_LAST_MASK
- SNDRV_PCM_HW_PARAM_FIRST_MASK
+ 1]; /* this must be identical */
76 struct snd_mask mres
[5]; /* reserved masks */
77 struct snd_interval intervals
[SNDRV_PCM_HW_PARAM_LAST_INTERVAL
- SNDRV_PCM_HW_PARAM_FIRST_INTERVAL
+ 1];
78 struct snd_interval ires
[9]; /* reserved intervals */
86 unsigned char reserved
[64];
89 struct snd_pcm_sw_params32
{
97 u32 silence_threshold
;
102 unsigned char reserved
[56];
105 /* recalcuate the boundary within 32bit */
106 static snd_pcm_uframes_t
recalculate_boundary(struct snd_pcm_runtime
*runtime
)
108 snd_pcm_uframes_t boundary
;
110 if (! runtime
->buffer_size
)
112 boundary
= runtime
->buffer_size
;
113 while (boundary
* 2 <= 0x7fffffffUL
- runtime
->buffer_size
)
118 static int snd_pcm_ioctl_sw_params_compat(struct snd_pcm_substream
*substream
,
119 struct snd_pcm_sw_params32 __user
*src
)
121 struct snd_pcm_sw_params params
;
122 snd_pcm_uframes_t boundary
;
125 memset(¶ms
, 0, sizeof(params
));
126 if (get_user(params
.tstamp_mode
, &src
->tstamp_mode
) ||
127 get_user(params
.period_step
, &src
->period_step
) ||
128 get_user(params
.sleep_min
, &src
->sleep_min
) ||
129 get_user(params
.avail_min
, &src
->avail_min
) ||
130 get_user(params
.xfer_align
, &src
->xfer_align
) ||
131 get_user(params
.start_threshold
, &src
->start_threshold
) ||
132 get_user(params
.stop_threshold
, &src
->stop_threshold
) ||
133 get_user(params
.silence_threshold
, &src
->silence_threshold
) ||
134 get_user(params
.silence_size
, &src
->silence_size
) ||
135 get_user(params
.tstamp_type
, &src
->tstamp_type
) ||
136 get_user(params
.proto
, &src
->proto
))
139 * Check silent_size parameter. Since we have 64bit boundary,
140 * silence_size must be compared with the 32bit boundary.
142 boundary
= recalculate_boundary(substream
->runtime
);
143 if (boundary
&& params
.silence_size
>= boundary
)
144 params
.silence_size
= substream
->runtime
->boundary
;
145 err
= snd_pcm_sw_params(substream
, ¶ms
);
148 if (boundary
&& put_user(boundary
, &src
->boundary
))
153 struct snd_pcm_channel_info32
{
160 static int snd_pcm_ioctl_channel_info_compat(struct snd_pcm_substream
*substream
,
161 struct snd_pcm_channel_info32 __user
*src
)
163 struct snd_pcm_channel_info info
;
166 if (get_user(info
.channel
, &src
->channel
) ||
167 get_user(info
.offset
, &src
->offset
) ||
168 get_user(info
.first
, &src
->first
) ||
169 get_user(info
.step
, &src
->step
))
171 err
= snd_pcm_channel_info(substream
, &info
);
174 if (put_user(info
.channel
, &src
->channel
) ||
175 put_user(info
.offset
, &src
->offset
) ||
176 put_user(info
.first
, &src
->first
) ||
177 put_user(info
.step
, &src
->step
))
182 #ifdef CONFIG_X86_X32
183 /* X32 ABI has the same struct as x86-64 for snd_pcm_channel_info */
184 static int snd_pcm_channel_info_user(struct snd_pcm_substream
*substream
,
185 struct snd_pcm_channel_info __user
*src
);
186 #define snd_pcm_ioctl_channel_info_x32(s, p) \
187 snd_pcm_channel_info_user(s, p)
188 #endif /* CONFIG_X86_X32 */
190 struct snd_pcm_status32
{
192 struct compat_timespec trigger_tstamp
;
193 struct compat_timespec tstamp
;
201 u32 audio_tstamp_data
;
202 struct compat_timespec audio_tstamp
;
203 struct compat_timespec driver_tstamp
;
204 u32 audio_tstamp_accuracy
;
205 unsigned char reserved
[52-2*sizeof(struct compat_timespec
)];
206 } __attribute__((packed
));
209 static int snd_pcm_status_user_compat(struct snd_pcm_substream
*substream
,
210 struct snd_pcm_status32 __user
*src
,
213 struct snd_pcm_status status
;
216 memset(&status
, 0, sizeof(status
));
218 * with extension, parameters are read/write,
219 * get audio_tstamp_data from user,
220 * ignore rest of status structure
222 if (ext
&& get_user(status
.audio_tstamp_data
,
223 (u32 __user
*)(&src
->audio_tstamp_data
)))
225 err
= snd_pcm_status(substream
, &status
);
229 if (clear_user(src
, sizeof(*src
)))
231 if (put_user(status
.state
, &src
->state
) ||
232 compat_put_timespec(&status
.trigger_tstamp
, &src
->trigger_tstamp
) ||
233 compat_put_timespec(&status
.tstamp
, &src
->tstamp
) ||
234 put_user(status
.appl_ptr
, &src
->appl_ptr
) ||
235 put_user(status
.hw_ptr
, &src
->hw_ptr
) ||
236 put_user(status
.delay
, &src
->delay
) ||
237 put_user(status
.avail
, &src
->avail
) ||
238 put_user(status
.avail_max
, &src
->avail_max
) ||
239 put_user(status
.overrange
, &src
->overrange
) ||
240 put_user(status
.suspended_state
, &src
->suspended_state
) ||
241 put_user(status
.audio_tstamp_data
, &src
->audio_tstamp_data
) ||
242 compat_put_timespec(&status
.audio_tstamp
, &src
->audio_tstamp
) ||
243 compat_put_timespec(&status
.driver_tstamp
, &src
->driver_tstamp
) ||
244 put_user(status
.audio_tstamp_accuracy
, &src
->audio_tstamp_accuracy
))
250 #ifdef CONFIG_X86_X32
251 /* X32 ABI has 64bit timespec and 64bit alignment */
252 struct snd_pcm_status_x32
{
254 u32 rsvd
; /* alignment */
255 struct timespec trigger_tstamp
;
256 struct timespec tstamp
;
264 u32 audio_tstamp_data
;
265 struct timespec audio_tstamp
;
266 struct timespec driver_tstamp
;
267 u32 audio_tstamp_accuracy
;
268 unsigned char reserved
[52-2*sizeof(struct timespec
)];
271 #define put_timespec(src, dst) copy_to_user(dst, src, sizeof(*dst))
273 static int snd_pcm_status_user_x32(struct snd_pcm_substream
*substream
,
274 struct snd_pcm_status_x32 __user
*src
,
277 struct snd_pcm_status status
;
280 memset(&status
, 0, sizeof(status
));
282 * with extension, parameters are read/write,
283 * get audio_tstamp_data from user,
284 * ignore rest of status structure
286 if (ext
&& get_user(status
.audio_tstamp_data
,
287 (u32 __user
*)(&src
->audio_tstamp_data
)))
289 err
= snd_pcm_status(substream
, &status
);
293 if (clear_user(src
, sizeof(*src
)))
295 if (put_user(status
.state
, &src
->state
) ||
296 put_timespec(&status
.trigger_tstamp
, &src
->trigger_tstamp
) ||
297 put_timespec(&status
.tstamp
, &src
->tstamp
) ||
298 put_user(status
.appl_ptr
, &src
->appl_ptr
) ||
299 put_user(status
.hw_ptr
, &src
->hw_ptr
) ||
300 put_user(status
.delay
, &src
->delay
) ||
301 put_user(status
.avail
, &src
->avail
) ||
302 put_user(status
.avail_max
, &src
->avail_max
) ||
303 put_user(status
.overrange
, &src
->overrange
) ||
304 put_user(status
.suspended_state
, &src
->suspended_state
) ||
305 put_user(status
.audio_tstamp_data
, &src
->audio_tstamp_data
) ||
306 put_timespec(&status
.audio_tstamp
, &src
->audio_tstamp
) ||
307 put_timespec(&status
.driver_tstamp
, &src
->driver_tstamp
) ||
308 put_user(status
.audio_tstamp_accuracy
, &src
->audio_tstamp_accuracy
))
313 #endif /* CONFIG_X86_X32 */
315 /* both for HW_PARAMS and HW_REFINE */
316 static int snd_pcm_ioctl_hw_params_compat(struct snd_pcm_substream
*substream
,
318 struct snd_pcm_hw_params32 __user
*data32
)
320 struct snd_pcm_hw_params
*data
;
321 struct snd_pcm_runtime
*runtime
;
324 if (! (runtime
= substream
->runtime
))
327 data
= kmalloc(sizeof(*data
), GFP_KERNEL
);
331 /* only fifo_size (RO from userspace) is different, so just copy all */
332 if (copy_from_user(data
, data32
, sizeof(*data32
))) {
338 err
= snd_pcm_hw_refine(substream
, data
);
340 err
= snd_pcm_hw_params(substream
, data
);
343 if (copy_to_user(data32
, data
, sizeof(*data32
)) ||
344 put_user(data
->fifo_size
, &data32
->fifo_size
)) {
350 unsigned int new_boundary
= recalculate_boundary(runtime
);
352 runtime
->boundary
= new_boundary
;
368 static int snd_pcm_ioctl_xferi_compat(struct snd_pcm_substream
*substream
,
369 int dir
, struct snd_xferi32 __user
*data32
)
375 if (! substream
->runtime
)
377 if (substream
->stream
!= dir
)
379 if (substream
->runtime
->status
->state
== SNDRV_PCM_STATE_OPEN
)
382 if (get_user(buf
, &data32
->buf
) ||
383 get_user(frames
, &data32
->frames
))
386 if (dir
== SNDRV_PCM_STREAM_PLAYBACK
)
387 err
= snd_pcm_lib_write(substream
, compat_ptr(buf
), frames
);
389 err
= snd_pcm_lib_read(substream
, compat_ptr(buf
), frames
);
392 /* copy the result */
393 if (put_user(err
, &data32
->result
))
399 /* snd_xfern needs remapping of bufs */
402 u32 bufs
; /* this is void **; */
407 * xfern ioctl nees to copy (up to) 128 pointers on stack.
408 * although we may pass the copied pointers through f_op->ioctl, but the ioctl
409 * handler there expands again the same 128 pointers on stack, so it is better
410 * to handle the function (calling pcm_readv/writev) directly in this handler.
412 static int snd_pcm_ioctl_xfern_compat(struct snd_pcm_substream
*substream
,
413 int dir
, struct snd_xfern32 __user
*data32
)
416 compat_caddr_t __user
*bufptr
;
421 if (! substream
->runtime
)
423 if (substream
->stream
!= dir
)
426 if ((ch
= substream
->runtime
->channels
) > 128)
428 if (get_user(buf
, &data32
->bufs
) ||
429 get_user(frames
, &data32
->frames
))
431 bufptr
= compat_ptr(buf
);
432 bufs
= kmalloc(sizeof(void __user
*) * ch
, GFP_KERNEL
);
435 for (i
= 0; i
< ch
; i
++) {
437 if (get_user(ptr
, bufptr
)) {
441 bufs
[i
] = compat_ptr(ptr
);
444 if (dir
== SNDRV_PCM_STREAM_PLAYBACK
)
445 err
= snd_pcm_lib_writev(substream
, bufs
, frames
);
447 err
= snd_pcm_lib_readv(substream
, bufs
, frames
);
449 if (put_user(err
, &data32
->result
))
457 struct snd_pcm_mmap_status32
{
461 struct compat_timespec tstamp
;
463 struct compat_timespec audio_tstamp
;
464 } __attribute__((packed
));
466 struct snd_pcm_mmap_control32
{
471 struct snd_pcm_sync_ptr32
{
474 struct snd_pcm_mmap_status32 status
;
475 unsigned char reserved
[64];
478 struct snd_pcm_mmap_control32 control
;
479 unsigned char reserved
[64];
481 } __attribute__((packed
));
483 static int snd_pcm_ioctl_sync_ptr_compat(struct snd_pcm_substream
*substream
,
484 struct snd_pcm_sync_ptr32 __user
*src
)
486 struct snd_pcm_runtime
*runtime
= substream
->runtime
;
487 volatile struct snd_pcm_mmap_status
*status
;
488 volatile struct snd_pcm_mmap_control
*control
;
490 struct snd_pcm_mmap_control scontrol
;
491 struct snd_pcm_mmap_status sstatus
;
492 snd_pcm_uframes_t boundary
;
495 if (snd_BUG_ON(!runtime
))
498 if (get_user(sflags
, &src
->flags
) ||
499 get_user(scontrol
.appl_ptr
, &src
->c
.control
.appl_ptr
) ||
500 get_user(scontrol
.avail_min
, &src
->c
.control
.avail_min
))
502 if (sflags
& SNDRV_PCM_SYNC_PTR_HWSYNC
) {
503 err
= snd_pcm_hwsync(substream
);
507 status
= runtime
->status
;
508 control
= runtime
->control
;
509 boundary
= recalculate_boundary(runtime
);
511 boundary
= 0x7fffffff;
512 snd_pcm_stream_lock_irq(substream
);
513 /* FIXME: we should consider the boundary for the sync from app */
514 if (!(sflags
& SNDRV_PCM_SYNC_PTR_APPL
))
515 control
->appl_ptr
= scontrol
.appl_ptr
;
517 scontrol
.appl_ptr
= control
->appl_ptr
% boundary
;
518 if (!(sflags
& SNDRV_PCM_SYNC_PTR_AVAIL_MIN
))
519 control
->avail_min
= scontrol
.avail_min
;
521 scontrol
.avail_min
= control
->avail_min
;
522 sstatus
.state
= status
->state
;
523 sstatus
.hw_ptr
= status
->hw_ptr
% boundary
;
524 sstatus
.tstamp
= status
->tstamp
;
525 sstatus
.suspended_state
= status
->suspended_state
;
526 sstatus
.audio_tstamp
= status
->audio_tstamp
;
527 snd_pcm_stream_unlock_irq(substream
);
528 if (put_user(sstatus
.state
, &src
->s
.status
.state
) ||
529 put_user(sstatus
.hw_ptr
, &src
->s
.status
.hw_ptr
) ||
530 compat_put_timespec(&sstatus
.tstamp
, &src
->s
.status
.tstamp
) ||
531 put_user(sstatus
.suspended_state
, &src
->s
.status
.suspended_state
) ||
532 compat_put_timespec(&sstatus
.audio_tstamp
,
533 &src
->s
.status
.audio_tstamp
) ||
534 put_user(scontrol
.appl_ptr
, &src
->c
.control
.appl_ptr
) ||
535 put_user(scontrol
.avail_min
, &src
->c
.control
.avail_min
))
541 #ifdef CONFIG_X86_X32
542 /* X32 ABI has 64bit timespec and 64bit alignment */
543 struct snd_pcm_mmap_status_x32
{
547 u32 pad2
; /* alignment */
548 struct timespec tstamp
;
551 struct timespec audio_tstamp
;
554 struct snd_pcm_mmap_control_x32
{
559 struct snd_pcm_sync_ptr_x32
{
561 u32 rsvd
; /* alignment */
563 struct snd_pcm_mmap_status_x32 status
;
564 unsigned char reserved
[64];
567 struct snd_pcm_mmap_control_x32 control
;
568 unsigned char reserved
[64];
572 static int snd_pcm_ioctl_sync_ptr_x32(struct snd_pcm_substream
*substream
,
573 struct snd_pcm_sync_ptr_x32 __user
*src
)
575 struct snd_pcm_runtime
*runtime
= substream
->runtime
;
576 volatile struct snd_pcm_mmap_status
*status
;
577 volatile struct snd_pcm_mmap_control
*control
;
579 struct snd_pcm_mmap_control scontrol
;
580 struct snd_pcm_mmap_status sstatus
;
581 snd_pcm_uframes_t boundary
;
584 if (snd_BUG_ON(!runtime
))
587 if (get_user(sflags
, &src
->flags
) ||
588 get_user(scontrol
.appl_ptr
, &src
->c
.control
.appl_ptr
) ||
589 get_user(scontrol
.avail_min
, &src
->c
.control
.avail_min
))
591 if (sflags
& SNDRV_PCM_SYNC_PTR_HWSYNC
) {
592 err
= snd_pcm_hwsync(substream
);
596 status
= runtime
->status
;
597 control
= runtime
->control
;
598 boundary
= recalculate_boundary(runtime
);
600 boundary
= 0x7fffffff;
601 snd_pcm_stream_lock_irq(substream
);
602 /* FIXME: we should consider the boundary for the sync from app */
603 if (!(sflags
& SNDRV_PCM_SYNC_PTR_APPL
))
604 control
->appl_ptr
= scontrol
.appl_ptr
;
606 scontrol
.appl_ptr
= control
->appl_ptr
% boundary
;
607 if (!(sflags
& SNDRV_PCM_SYNC_PTR_AVAIL_MIN
))
608 control
->avail_min
= scontrol
.avail_min
;
610 scontrol
.avail_min
= control
->avail_min
;
611 sstatus
.state
= status
->state
;
612 sstatus
.hw_ptr
= status
->hw_ptr
% boundary
;
613 sstatus
.tstamp
= status
->tstamp
;
614 sstatus
.suspended_state
= status
->suspended_state
;
615 sstatus
.audio_tstamp
= status
->audio_tstamp
;
616 snd_pcm_stream_unlock_irq(substream
);
617 if (put_user(sstatus
.state
, &src
->s
.status
.state
) ||
618 put_user(sstatus
.hw_ptr
, &src
->s
.status
.hw_ptr
) ||
619 put_timespec(&sstatus
.tstamp
, &src
->s
.status
.tstamp
) ||
620 put_user(sstatus
.suspended_state
, &src
->s
.status
.suspended_state
) ||
621 put_timespec(&sstatus
.audio_tstamp
, &src
->s
.status
.audio_tstamp
) ||
622 put_user(scontrol
.appl_ptr
, &src
->c
.control
.appl_ptr
) ||
623 put_user(scontrol
.avail_min
, &src
->c
.control
.avail_min
))
628 #endif /* CONFIG_X86_X32 */
633 SNDRV_PCM_IOCTL_HW_REFINE32
= _IOWR('A', 0x10, struct snd_pcm_hw_params32
),
634 SNDRV_PCM_IOCTL_HW_PARAMS32
= _IOWR('A', 0x11, struct snd_pcm_hw_params32
),
635 SNDRV_PCM_IOCTL_SW_PARAMS32
= _IOWR('A', 0x13, struct snd_pcm_sw_params32
),
636 SNDRV_PCM_IOCTL_STATUS32
= _IOR('A', 0x20, struct snd_pcm_status32
),
637 SNDRV_PCM_IOCTL_STATUS_EXT32
= _IOWR('A', 0x24, struct snd_pcm_status32
),
638 SNDRV_PCM_IOCTL_DELAY32
= _IOR('A', 0x21, s32
),
639 SNDRV_PCM_IOCTL_CHANNEL_INFO32
= _IOR('A', 0x32, struct snd_pcm_channel_info32
),
640 SNDRV_PCM_IOCTL_REWIND32
= _IOW('A', 0x46, u32
),
641 SNDRV_PCM_IOCTL_FORWARD32
= _IOW('A', 0x49, u32
),
642 SNDRV_PCM_IOCTL_WRITEI_FRAMES32
= _IOW('A', 0x50, struct snd_xferi32
),
643 SNDRV_PCM_IOCTL_READI_FRAMES32
= _IOR('A', 0x51, struct snd_xferi32
),
644 SNDRV_PCM_IOCTL_WRITEN_FRAMES32
= _IOW('A', 0x52, struct snd_xfern32
),
645 SNDRV_PCM_IOCTL_READN_FRAMES32
= _IOR('A', 0x53, struct snd_xfern32
),
646 SNDRV_PCM_IOCTL_SYNC_PTR32
= _IOWR('A', 0x23, struct snd_pcm_sync_ptr32
),
647 #ifdef CONFIG_X86_X32
648 SNDRV_PCM_IOCTL_CHANNEL_INFO_X32
= _IOR('A', 0x32, struct snd_pcm_channel_info
),
649 SNDRV_PCM_IOCTL_STATUS_X32
= _IOR('A', 0x20, struct snd_pcm_status_x32
),
650 SNDRV_PCM_IOCTL_STATUS_EXT_X32
= _IOWR('A', 0x24, struct snd_pcm_status_x32
),
651 SNDRV_PCM_IOCTL_SYNC_PTR_X32
= _IOWR('A', 0x23, struct snd_pcm_sync_ptr_x32
),
652 #endif /* CONFIG_X86_X32 */
655 static long snd_pcm_ioctl_compat(struct file
*file
, unsigned int cmd
, unsigned long arg
)
657 struct snd_pcm_file
*pcm_file
;
658 struct snd_pcm_substream
*substream
;
659 void __user
*argp
= compat_ptr(arg
);
661 pcm_file
= file
->private_data
;
664 substream
= pcm_file
->substream
;
669 * When PCM is used on 32bit mode, we need to disable
670 * mmap of PCM status/control records because of the size
673 pcm_file
->no_compat_mmap
= 1;
676 case SNDRV_PCM_IOCTL_PVERSION
:
677 case SNDRV_PCM_IOCTL_INFO
:
678 case SNDRV_PCM_IOCTL_TSTAMP
:
679 case SNDRV_PCM_IOCTL_TTSTAMP
:
680 case SNDRV_PCM_IOCTL_USER_PVERSION
:
681 case SNDRV_PCM_IOCTL_HWSYNC
:
682 case SNDRV_PCM_IOCTL_PREPARE
:
683 case SNDRV_PCM_IOCTL_RESET
:
684 case SNDRV_PCM_IOCTL_START
:
685 case SNDRV_PCM_IOCTL_DROP
:
686 case SNDRV_PCM_IOCTL_DRAIN
:
687 case SNDRV_PCM_IOCTL_PAUSE
:
688 case SNDRV_PCM_IOCTL_HW_FREE
:
689 case SNDRV_PCM_IOCTL_RESUME
:
690 case SNDRV_PCM_IOCTL_XRUN
:
691 case SNDRV_PCM_IOCTL_LINK
:
692 case SNDRV_PCM_IOCTL_UNLINK
:
693 return snd_pcm_common_ioctl(file
, substream
, cmd
, argp
);
694 case SNDRV_PCM_IOCTL_HW_REFINE32
:
695 return snd_pcm_ioctl_hw_params_compat(substream
, 1, argp
);
696 case SNDRV_PCM_IOCTL_HW_PARAMS32
:
697 return snd_pcm_ioctl_hw_params_compat(substream
, 0, argp
);
698 case SNDRV_PCM_IOCTL_SW_PARAMS32
:
699 return snd_pcm_ioctl_sw_params_compat(substream
, argp
);
700 case SNDRV_PCM_IOCTL_STATUS32
:
701 return snd_pcm_status_user_compat(substream
, argp
, false);
702 case SNDRV_PCM_IOCTL_STATUS_EXT32
:
703 return snd_pcm_status_user_compat(substream
, argp
, true);
704 case SNDRV_PCM_IOCTL_SYNC_PTR32
:
705 return snd_pcm_ioctl_sync_ptr_compat(substream
, argp
);
706 case SNDRV_PCM_IOCTL_CHANNEL_INFO32
:
707 return snd_pcm_ioctl_channel_info_compat(substream
, argp
);
708 case SNDRV_PCM_IOCTL_WRITEI_FRAMES32
:
709 return snd_pcm_ioctl_xferi_compat(substream
, SNDRV_PCM_STREAM_PLAYBACK
, argp
);
710 case SNDRV_PCM_IOCTL_READI_FRAMES32
:
711 return snd_pcm_ioctl_xferi_compat(substream
, SNDRV_PCM_STREAM_CAPTURE
, argp
);
712 case SNDRV_PCM_IOCTL_WRITEN_FRAMES32
:
713 return snd_pcm_ioctl_xfern_compat(substream
, SNDRV_PCM_STREAM_PLAYBACK
, argp
);
714 case SNDRV_PCM_IOCTL_READN_FRAMES32
:
715 return snd_pcm_ioctl_xfern_compat(substream
, SNDRV_PCM_STREAM_CAPTURE
, argp
);
716 case SNDRV_PCM_IOCTL_DELAY32
:
717 return snd_pcm_ioctl_delay_compat(substream
, argp
);
718 case SNDRV_PCM_IOCTL_REWIND32
:
719 return snd_pcm_ioctl_rewind_compat(substream
, argp
);
720 case SNDRV_PCM_IOCTL_FORWARD32
:
721 return snd_pcm_ioctl_forward_compat(substream
, argp
);
722 #ifdef CONFIG_X86_X32
723 case SNDRV_PCM_IOCTL_STATUS_X32
:
724 return snd_pcm_status_user_x32(substream
, argp
, false);
725 case SNDRV_PCM_IOCTL_STATUS_EXT_X32
:
726 return snd_pcm_status_user_x32(substream
, argp
, true);
727 case SNDRV_PCM_IOCTL_SYNC_PTR_X32
:
728 return snd_pcm_ioctl_sync_ptr_x32(substream
, argp
);
729 case SNDRV_PCM_IOCTL_CHANNEL_INFO_X32
:
730 return snd_pcm_ioctl_channel_info_x32(substream
, argp
);
731 #endif /* CONFIG_X86_X32 */