1 // SPDX-License-Identifier: GPL-2.0
3 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
5 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
6 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
7 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
8 * Copyright (C) 2003 Pavel Machek (pavel@ucw.cz)
10 * These routines maintain argument size conversion between 32bit and 64bit
14 #include <linux/joystick.h>
16 #include <linux/types.h>
17 #include <linux/compat.h>
18 #include <linux/kernel.h>
19 #include <linux/capability.h>
20 #include <linux/compiler.h>
21 #include <linux/sched.h>
22 #include <linux/smp.h>
23 #include <linux/ioctl.h>
25 #include <linux/raid/md_u.h>
26 #include <linux/falloc.h>
27 #include <linux/file.h>
28 #include <linux/ppp-ioctl.h>
29 #include <linux/if_pppox.h>
30 #include <linux/mtio.h>
31 #include <linux/tty.h>
32 #include <linux/vt_kern.h>
33 #include <linux/raw.h>
34 #include <linux/blkdev.h>
35 #include <linux/rtc.h>
36 #include <linux/pci.h>
37 #include <linux/serial.h>
38 #include <linux/ctype.h>
39 #include <linux/syscalls.h>
40 #include <linux/gfp.h>
41 #include <linux/cec.h>
45 #include <net/bluetooth/bluetooth.h>
46 #include <net/bluetooth/hci_sock.h>
47 #include <net/bluetooth/rfcomm.h>
49 #include <linux/capi.h>
50 #include <linux/gigaset_dev.h>
53 #include <linux/cdrom.h>
55 #include <scsi/scsi.h>
56 #include <scsi/scsi_ioctl.h>
60 #include <linux/uaccess.h>
61 #include <linux/watchdog.h>
63 #include <linux/soundcard.h>
65 #include <linux/hiddev.h>
68 #include <linux/dvb/audio.h>
69 #include <linux/dvb/dmx.h>
70 #include <linux/dvb/frontend.h>
71 #include <linux/dvb/video.h>
73 #include <linux/sort.h>
80 #define convert_in_user(srcptr, dstptr) \
82 typeof(*srcptr) val; \
84 get_user(val, srcptr) || put_user(val, dstptr); \
87 static int do_ioctl(struct file
*file
, unsigned int cmd
, unsigned long arg
)
91 err
= security_file_ioctl(file
, cmd
, arg
);
95 return vfs_ioctl(file
, cmd
, arg
);
98 struct compat_video_event
{
100 compat_time_t timestamp
;
103 unsigned int frame_rate
;
107 static int do_video_get_event(struct file
*file
,
108 unsigned int cmd
, struct compat_video_event __user
*up
)
110 struct video_event __user
*kevent
=
111 compat_alloc_user_space(sizeof(*kevent
));
117 err
= do_ioctl(file
, cmd
, (unsigned long)kevent
);
119 err
= convert_in_user(&kevent
->type
, &up
->type
);
120 err
|= convert_in_user(&kevent
->timestamp
, &up
->timestamp
);
121 err
|= convert_in_user(&kevent
->u
.size
.w
, &up
->u
.size
.w
);
122 err
|= convert_in_user(&kevent
->u
.size
.h
, &up
->u
.size
.h
);
123 err
|= convert_in_user(&kevent
->u
.size
.aspect_ratio
,
124 &up
->u
.size
.aspect_ratio
);
132 struct compat_video_still_picture
{
133 compat_uptr_t iFrame
;
137 static int do_video_stillpicture(struct file
*file
,
138 unsigned int cmd
, struct compat_video_still_picture __user
*up
)
140 struct video_still_picture __user
*up_native
;
145 err
= get_user(fp
, &up
->iFrame
);
146 err
|= get_user(size
, &up
->size
);
151 compat_alloc_user_space(sizeof(struct video_still_picture
));
153 err
= put_user(compat_ptr(fp
), &up_native
->iFrame
);
154 err
|= put_user(size
, &up_native
->size
);
158 err
= do_ioctl(file
, cmd
, (unsigned long) up_native
);
164 typedef struct sg_io_hdr32
{
165 compat_int_t interface_id
; /* [i] 'S' for SCSI generic (required) */
166 compat_int_t dxfer_direction
; /* [i] data transfer direction */
167 unsigned char cmd_len
; /* [i] SCSI command length ( <= 16 bytes) */
168 unsigned char mx_sb_len
; /* [i] max length to write to sbp */
169 unsigned short iovec_count
; /* [i] 0 implies no scatter gather */
170 compat_uint_t dxfer_len
; /* [i] byte count of data transfer */
171 compat_uint_t dxferp
; /* [i], [*io] points to data transfer memory
172 or scatter gather list */
173 compat_uptr_t cmdp
; /* [i], [*i] points to command to perform */
174 compat_uptr_t sbp
; /* [i], [*o] points to sense_buffer memory */
175 compat_uint_t timeout
; /* [i] MAX_UINT->no timeout (unit: millisec) */
176 compat_uint_t flags
; /* [i] 0 -> default, see SG_FLAG... */
177 compat_int_t pack_id
; /* [i->o] unused internally (normally) */
178 compat_uptr_t usr_ptr
; /* [i->o] unused internally */
179 unsigned char status
; /* [o] scsi status */
180 unsigned char masked_status
; /* [o] shifted, masked scsi status */
181 unsigned char msg_status
; /* [o] messaging level data (optional) */
182 unsigned char sb_len_wr
; /* [o] byte count actually written to sbp */
183 unsigned short host_status
; /* [o] errors from host adapter */
184 unsigned short driver_status
; /* [o] errors from software driver */
185 compat_int_t resid
; /* [o] dxfer_len - actual_transferred */
186 compat_uint_t duration
; /* [o] time taken by cmd (unit: millisec) */
187 compat_uint_t info
; /* [o] auxiliary information */
188 } sg_io_hdr32_t
; /* 64 bytes long (on sparc32) */
190 typedef struct sg_iovec32
{
191 compat_uint_t iov_base
;
192 compat_uint_t iov_len
;
195 static int sg_build_iovec(sg_io_hdr_t __user
*sgio
, void __user
*dxferp
, u16 iovec_count
)
197 sg_iovec_t __user
*iov
= (sg_iovec_t __user
*) (sgio
+ 1);
198 sg_iovec32_t __user
*iov32
= dxferp
;
201 for (i
= 0; i
< iovec_count
; i
++) {
204 if (get_user(base
, &iov32
[i
].iov_base
) ||
205 get_user(len
, &iov32
[i
].iov_len
) ||
206 put_user(compat_ptr(base
), &iov
[i
].iov_base
) ||
207 put_user(len
, &iov
[i
].iov_len
))
211 if (put_user(iov
, &sgio
->dxferp
))
216 static int sg_ioctl_trans(struct file
*file
, unsigned int cmd
,
217 sg_io_hdr32_t __user
*sgio32
)
219 sg_io_hdr_t __user
*sgio
;
226 if (get_user(interface_id
, &sgio32
->interface_id
))
228 if (interface_id
!= 'S')
229 return do_ioctl(file
, cmd
, (unsigned long)sgio32
);
231 if (get_user(iovec_count
, &sgio32
->iovec_count
))
235 void __user
*top
= compat_alloc_user_space(0);
236 void __user
*new = compat_alloc_user_space(sizeof(sg_io_hdr_t
) +
237 (iovec_count
* sizeof(sg_iovec_t
)));
244 /* Ok, now construct. */
245 if (copy_in_user(&sgio
->interface_id
, &sgio32
->interface_id
,
247 (2 * sizeof(unsigned char)) +
248 (1 * sizeof(unsigned short)) +
249 (1 * sizeof(unsigned int))))
252 if (get_user(data
, &sgio32
->dxferp
))
254 dxferp
= compat_ptr(data
);
256 if (sg_build_iovec(sgio
, dxferp
, iovec_count
))
259 if (put_user(dxferp
, &sgio
->dxferp
))
264 unsigned char __user
*cmdp
;
265 unsigned char __user
*sbp
;
267 if (get_user(data
, &sgio32
->cmdp
))
269 cmdp
= compat_ptr(data
);
271 if (get_user(data
, &sgio32
->sbp
))
273 sbp
= compat_ptr(data
);
275 if (put_user(cmdp
, &sgio
->cmdp
) ||
276 put_user(sbp
, &sgio
->sbp
))
280 if (copy_in_user(&sgio
->timeout
, &sgio32
->timeout
,
284 if (get_user(data
, &sgio32
->usr_ptr
))
286 if (put_user(compat_ptr(data
), &sgio
->usr_ptr
))
289 err
= do_ioctl(file
, cmd
, (unsigned long) sgio
);
294 if (copy_in_user(&sgio32
->pack_id
, &sgio
->pack_id
,
296 get_user(datap
, &sgio
->usr_ptr
) ||
297 put_user((u32
)(unsigned long)datap
,
299 copy_in_user(&sgio32
->status
, &sgio
->status
,
300 (4 * sizeof(unsigned char)) +
301 (2 * sizeof(unsigned short)) +
309 struct compat_sg_req_info
{ /* used by SG_GET_REQUEST_TABLE ioctl() */
315 compat_uptr_t usr_ptr
;
316 unsigned int duration
;
320 static int sg_grt_trans(struct file
*file
,
321 unsigned int cmd
, struct compat_sg_req_info __user
*o
)
324 sg_req_info_t __user
*r
;
325 r
= compat_alloc_user_space(sizeof(sg_req_info_t
)*SG_MAX_QUEUE
);
326 err
= do_ioctl(file
, cmd
, (unsigned long)r
);
329 for (i
= 0; i
< SG_MAX_QUEUE
; i
++) {
333 if (copy_in_user(o
+ i
, r
+ i
, offsetof(sg_req_info_t
, usr_ptr
)) ||
334 get_user(ptr
, &r
[i
].usr_ptr
) ||
335 get_user(d
, &r
[i
].duration
) ||
336 put_user((u32
)(unsigned long)(ptr
), &o
[i
].usr_ptr
) ||
337 put_user(d
, &o
[i
].duration
))
342 #endif /* CONFIG_BLOCK */
344 struct sock_fprog32
{
346 compat_caddr_t filter
;
349 #define PPPIOCSPASS32 _IOW('t', 71, struct sock_fprog32)
350 #define PPPIOCSACTIVE32 _IOW('t', 70, struct sock_fprog32)
352 static int ppp_sock_fprog_ioctl_trans(struct file
*file
,
353 unsigned int cmd
, struct sock_fprog32 __user
*u_fprog32
)
355 struct sock_fprog __user
*u_fprog64
= compat_alloc_user_space(sizeof(struct sock_fprog
));
360 if (get_user(flen
, &u_fprog32
->len
) ||
361 get_user(fptr32
, &u_fprog32
->filter
))
364 fptr64
= compat_ptr(fptr32
);
366 if (put_user(flen
, &u_fprog64
->len
) ||
367 put_user(fptr64
, &u_fprog64
->filter
))
370 if (cmd
== PPPIOCSPASS32
)
375 return do_ioctl(file
, cmd
, (unsigned long) u_fprog64
);
378 struct ppp_option_data32
{
381 compat_int_t transmit
;
383 #define PPPIOCSCOMPRESS32 _IOW('t', 77, struct ppp_option_data32)
386 compat_time_t xmit_idle
;
387 compat_time_t recv_idle
;
389 #define PPPIOCGIDLE32 _IOR('t', 63, struct ppp_idle32)
391 static int ppp_gidle(struct file
*file
, unsigned int cmd
,
392 struct ppp_idle32 __user
*idle32
)
394 struct ppp_idle __user
*idle
;
395 __kernel_time_t xmit
, recv
;
398 idle
= compat_alloc_user_space(sizeof(*idle
));
400 err
= do_ioctl(file
, PPPIOCGIDLE
, (unsigned long) idle
);
403 if (get_user(xmit
, &idle
->xmit_idle
) ||
404 get_user(recv
, &idle
->recv_idle
) ||
405 put_user(xmit
, &idle32
->xmit_idle
) ||
406 put_user(recv
, &idle32
->recv_idle
))
412 static int ppp_scompress(struct file
*file
, unsigned int cmd
,
413 struct ppp_option_data32 __user
*odata32
)
415 struct ppp_option_data __user
*odata
;
419 odata
= compat_alloc_user_space(sizeof(*odata
));
421 if (get_user(data
, &odata32
->ptr
))
424 datap
= compat_ptr(data
);
425 if (put_user(datap
, &odata
->ptr
))
428 if (copy_in_user(&odata
->length
, &odata32
->length
,
429 sizeof(__u32
) + sizeof(int)))
432 return do_ioctl(file
, PPPIOCSCOMPRESS
, (unsigned long) odata
);
437 compat_long_t mt_type
;
438 compat_long_t mt_resid
;
439 compat_long_t mt_dsreg
;
440 compat_long_t mt_gstat
;
441 compat_long_t mt_erreg
;
442 compat_daddr_t mt_fileno
;
443 compat_daddr_t mt_blkno
;
445 #define MTIOCGET32 _IOR('m', 2, struct mtget32)
448 compat_long_t mt_blkno
;
450 #define MTIOCPOS32 _IOR('m', 3, struct mtpos32)
452 static int mt_ioctl_trans(struct file
*file
,
453 unsigned int cmd
, void __user
*argp
)
455 /* NULL initialization to make gcc shut up */
456 struct mtget __user
*get
= NULL
;
457 struct mtget32 __user
*umget32
;
458 struct mtpos __user
*pos
= NULL
;
459 struct mtpos32 __user
*upos32
;
467 pos
= compat_alloc_user_space(sizeof(*pos
));
470 default: /* MTIOCGET32 */
472 get
= compat_alloc_user_space(sizeof(*get
));
478 err
= do_ioctl(file
, kcmd
, (unsigned long)karg
);
484 err
= convert_in_user(&pos
->mt_blkno
, &upos32
->mt_blkno
);
488 err
= convert_in_user(&get
->mt_type
, &umget32
->mt_type
);
489 err
|= convert_in_user(&get
->mt_resid
, &umget32
->mt_resid
);
490 err
|= convert_in_user(&get
->mt_dsreg
, &umget32
->mt_dsreg
);
491 err
|= convert_in_user(&get
->mt_gstat
, &umget32
->mt_gstat
);
492 err
|= convert_in_user(&get
->mt_erreg
, &umget32
->mt_erreg
);
493 err
|= convert_in_user(&get
->mt_fileno
, &umget32
->mt_fileno
);
494 err
|= convert_in_user(&get
->mt_blkno
, &umget32
->mt_blkno
);
497 return err
? -EFAULT
: 0;
500 #endif /* CONFIG_BLOCK */
502 /* Bluetooth ioctls */
503 #define HCIUARTSETPROTO _IOW('U', 200, int)
504 #define HCIUARTGETPROTO _IOR('U', 201, int)
505 #define HCIUARTGETDEVICE _IOR('U', 202, int)
506 #define HCIUARTSETFLAGS _IOW('U', 203, int)
507 #define HCIUARTGETFLAGS _IOR('U', 204, int)
509 #define RTC_IRQP_READ32 _IOR('p', 0x0b, compat_ulong_t)
510 #define RTC_IRQP_SET32 _IOW('p', 0x0c, compat_ulong_t)
511 #define RTC_EPOCH_READ32 _IOR('p', 0x0d, compat_ulong_t)
512 #define RTC_EPOCH_SET32 _IOW('p', 0x0e, compat_ulong_t)
514 static int rtc_ioctl(struct file
*file
,
515 unsigned cmd
, void __user
*argp
)
517 unsigned long __user
*valp
= compat_alloc_user_space(sizeof(*valp
));
523 case RTC_IRQP_READ32
:
524 case RTC_EPOCH_READ32
:
525 ret
= do_ioctl(file
, (cmd
== RTC_IRQP_READ32
) ?
526 RTC_IRQP_READ
: RTC_EPOCH_READ
,
527 (unsigned long)valp
);
530 return convert_in_user(valp
, (unsigned int __user
*)argp
);
532 return do_ioctl(file
, RTC_IRQP_SET
, (unsigned long)argp
);
533 case RTC_EPOCH_SET32
:
534 return do_ioctl(file
, RTC_EPOCH_SET
, (unsigned long)argp
);
540 /* on ia32 l_start is on a 32-bit boundary */
541 #if defined(CONFIG_IA64) || defined(CONFIG_X86_64)
542 struct space_resv_32
{
545 __s64 l_start
__attribute__((packed
));
546 /* len == 0 means until end of file */
547 __s64 l_len
__attribute__((packed
));
550 __s32 l_pad
[4]; /* reserve area */
553 #define FS_IOC_RESVSP_32 _IOW ('X', 40, struct space_resv_32)
554 #define FS_IOC_RESVSP64_32 _IOW ('X', 42, struct space_resv_32)
556 /* just account for different alignment */
557 static int compat_ioctl_preallocate(struct file
*file
,
558 struct space_resv_32 __user
*p32
)
560 struct space_resv __user
*p
= compat_alloc_user_space(sizeof(*p
));
562 if (copy_in_user(&p
->l_type
, &p32
->l_type
, sizeof(s16
)) ||
563 copy_in_user(&p
->l_whence
, &p32
->l_whence
, sizeof(s16
)) ||
564 copy_in_user(&p
->l_start
, &p32
->l_start
, sizeof(s64
)) ||
565 copy_in_user(&p
->l_len
, &p32
->l_len
, sizeof(s64
)) ||
566 copy_in_user(&p
->l_sysid
, &p32
->l_sysid
, sizeof(s32
)) ||
567 copy_in_user(&p
->l_pid
, &p32
->l_pid
, sizeof(u32
)) ||
568 copy_in_user(&p
->l_pad
, &p32
->l_pad
, 4*sizeof(u32
)))
571 return ioctl_preallocate(file
, p
);
576 * simple reversible transform to make our table more evenly
577 * distributed after sorting.
579 #define XFORM(i) (((i) ^ ((i) << 27) ^ ((i) << 17)) & 0xffffffff)
581 #define COMPATIBLE_IOCTL(cmd) XFORM((u32)cmd),
582 /* ioctl should not be warned about even if it's not implemented.
583 Valid reasons to use this:
584 - It is implemented with ->compat_ioctl on some device, but programs
585 call it on others too.
586 - The ioctl is not implemented in the native kernel, but programs
587 call it commonly anyways.
588 Most other reasons are not valid. */
589 #define IGNORE_IOCTL(cmd) COMPATIBLE_IOCTL(cmd)
591 static unsigned int ioctl_pointer
[] = {
592 /* compatible ioctls first */
594 COMPATIBLE_IOCTL(TIOCOUTQ
)
596 COMPATIBLE_IOCTL(FIOCLEX
)
597 COMPATIBLE_IOCTL(FIONCLEX
)
598 COMPATIBLE_IOCTL(FIOASYNC
)
599 COMPATIBLE_IOCTL(FIONBIO
)
600 COMPATIBLE_IOCTL(FIONREAD
) /* This is also TIOCINQ */
601 COMPATIBLE_IOCTL(FS_IOC_FIEMAP
)
603 COMPATIBLE_IOCTL(FIBMAP
)
604 COMPATIBLE_IOCTL(FIGETBSZ
)
605 /* 'X' - originally XFS but some now in the VFS */
606 COMPATIBLE_IOCTL(FIFREEZE
)
607 COMPATIBLE_IOCTL(FITHAW
)
608 COMPATIBLE_IOCTL(FITRIM
)
611 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN
)
612 COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK
)
613 COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK
)
614 COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY
)
615 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER
)
616 COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND
)
617 COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST
)
618 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI
)
620 /* Big V (don't complain on serial console) */
621 IGNORE_IOCTL(VT_OPENQRY
)
622 IGNORE_IOCTL(VT_GETMODE
)
623 /* Little p (/dev/rtc, /dev/envctrl, etc.) */
624 COMPATIBLE_IOCTL(RTC_AIE_ON
)
625 COMPATIBLE_IOCTL(RTC_AIE_OFF
)
626 COMPATIBLE_IOCTL(RTC_UIE_ON
)
627 COMPATIBLE_IOCTL(RTC_UIE_OFF
)
628 COMPATIBLE_IOCTL(RTC_PIE_ON
)
629 COMPATIBLE_IOCTL(RTC_PIE_OFF
)
630 COMPATIBLE_IOCTL(RTC_WIE_ON
)
631 COMPATIBLE_IOCTL(RTC_WIE_OFF
)
632 COMPATIBLE_IOCTL(RTC_ALM_SET
)
633 COMPATIBLE_IOCTL(RTC_ALM_READ
)
634 COMPATIBLE_IOCTL(RTC_RD_TIME
)
635 COMPATIBLE_IOCTL(RTC_SET_TIME
)
636 COMPATIBLE_IOCTL(RTC_WKALM_SET
)
637 COMPATIBLE_IOCTL(RTC_WKALM_RD
)
639 * These two are only for the sbus rtc driver, but
640 * hwclock tries them on every rtc device first when
641 * running on sparc. On other architectures the entries
642 * are useless but harmless.
644 COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
645 COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
647 COMPATIBLE_IOCTL(MTIOCTOP
)
648 /* Socket level stuff */
649 COMPATIBLE_IOCTL(FIOQSIZE
)
651 /* md calls this on random blockdevs */
652 IGNORE_IOCTL(RAID_VERSION
)
653 /* qemu/qemu-img might call these two on plain files for probing */
654 IGNORE_IOCTL(CDROM_DRIVE_STATUS
)
655 IGNORE_IOCTL(FDGETPRM32
)
657 COMPATIBLE_IOCTL(SG_SET_TIMEOUT
)
658 COMPATIBLE_IOCTL(SG_GET_TIMEOUT
)
659 COMPATIBLE_IOCTL(SG_EMULATED_HOST
)
660 COMPATIBLE_IOCTL(SG_GET_TRANSFORM
)
661 COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE
)
662 COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE
)
663 COMPATIBLE_IOCTL(SG_GET_SCSI_ID
)
664 COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA
)
665 COMPATIBLE_IOCTL(SG_GET_LOW_DMA
)
666 COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID
)
667 COMPATIBLE_IOCTL(SG_GET_PACK_ID
)
668 COMPATIBLE_IOCTL(SG_GET_NUM_WAITING
)
669 COMPATIBLE_IOCTL(SG_SET_DEBUG
)
670 COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE
)
671 COMPATIBLE_IOCTL(SG_GET_COMMAND_Q
)
672 COMPATIBLE_IOCTL(SG_SET_COMMAND_Q
)
673 COMPATIBLE_IOCTL(SG_GET_VERSION_NUM
)
674 COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN
)
675 COMPATIBLE_IOCTL(SG_SCSI_RESET
)
676 COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE
)
677 COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN
)
678 COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN
)
681 COMPATIBLE_IOCTL(PPPIOCGFLAGS
)
682 COMPATIBLE_IOCTL(PPPIOCSFLAGS
)
683 COMPATIBLE_IOCTL(PPPIOCGASYNCMAP
)
684 COMPATIBLE_IOCTL(PPPIOCSASYNCMAP
)
685 COMPATIBLE_IOCTL(PPPIOCGUNIT
)
686 COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP
)
687 COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP
)
688 COMPATIBLE_IOCTL(PPPIOCGMRU
)
689 COMPATIBLE_IOCTL(PPPIOCSMRU
)
690 COMPATIBLE_IOCTL(PPPIOCSMAXCID
)
691 COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP
)
692 COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP
)
693 COMPATIBLE_IOCTL(PPPIOCXFERUNIT
)
694 /* PPPIOCSCOMPRESS is translated */
695 COMPATIBLE_IOCTL(PPPIOCGNPMODE
)
696 COMPATIBLE_IOCTL(PPPIOCSNPMODE
)
697 COMPATIBLE_IOCTL(PPPIOCGDEBUG
)
698 COMPATIBLE_IOCTL(PPPIOCSDEBUG
)
699 /* PPPIOCSPASS is translated */
700 /* PPPIOCSACTIVE is translated */
701 /* PPPIOCGIDLE is translated */
702 COMPATIBLE_IOCTL(PPPIOCNEWUNIT
)
703 COMPATIBLE_IOCTL(PPPIOCATTACH
)
704 COMPATIBLE_IOCTL(PPPIOCDETACH
)
705 COMPATIBLE_IOCTL(PPPIOCSMRRU
)
706 COMPATIBLE_IOCTL(PPPIOCCONNECT
)
707 COMPATIBLE_IOCTL(PPPIOCDISCONN
)
708 COMPATIBLE_IOCTL(PPPIOCATTCHAN
)
709 COMPATIBLE_IOCTL(PPPIOCGCHAN
)
710 COMPATIBLE_IOCTL(PPPIOCGL2TPSTATS
)
712 COMPATIBLE_IOCTL(PPPOEIOCSFWD
)
713 COMPATIBLE_IOCTL(PPPOEIOCDFWD
)
716 /* Big Q for sound/OSS */
717 COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET
)
718 COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC
)
719 COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO
)
720 COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE
)
721 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT
)
722 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT
)
723 COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE
)
724 COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR
)
725 COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI
)
726 COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES
)
727 COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS
)
728 COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS
)
729 COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO
)
730 COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD
)
731 COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL
)
732 COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE
)
733 COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC
)
734 COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND
)
735 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME
)
736 COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID
)
737 COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL
)
738 COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE
)
739 /* Big T for sound/OSS */
740 COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE
)
741 COMPATIBLE_IOCTL(SNDCTL_TMR_START
)
742 COMPATIBLE_IOCTL(SNDCTL_TMR_STOP
)
743 COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE
)
744 COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO
)
745 COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE
)
746 COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME
)
747 COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT
)
748 /* Little m for sound/OSS */
749 COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME
)
750 COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE
)
751 COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD
)
752 /* Big P for sound/OSS */
753 COMPATIBLE_IOCTL(SNDCTL_DSP_RESET
)
754 COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC
)
755 COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED
)
756 COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO
)
757 COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE
)
758 COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS
)
759 COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER
)
760 COMPATIBLE_IOCTL(SNDCTL_DSP_POST
)
761 COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE
)
762 COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT
)
763 COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS
)
764 COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT
)
765 COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE
)
766 COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE
)
767 COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK
)
768 COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS
)
769 COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER
)
770 COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER
)
771 COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR
)
772 COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR
)
773 /* SNDCTL_DSP_MAPINBUF, XXX needs translation */
774 /* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
775 COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO
)
776 COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX
)
777 COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY
)
778 COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE
)
779 COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE
)
780 COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS
)
781 COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS
)
782 COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER
)
783 /* Big C for sound/OSS */
784 COMPATIBLE_IOCTL(SNDCTL_COPR_RESET
)
785 COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD
)
786 COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA
)
787 COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE
)
788 COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA
)
789 COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE
)
790 COMPATIBLE_IOCTL(SNDCTL_COPR_RUN
)
791 COMPATIBLE_IOCTL(SNDCTL_COPR_HALT
)
792 COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG
)
793 COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG
)
794 /* Big M for sound/OSS */
795 COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME
)
796 COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS
)
797 COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE
)
798 COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH
)
799 COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM
)
800 COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER
)
801 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE
)
802 COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC
)
803 COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD
)
804 COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX
)
805 COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM
)
806 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV
)
807 COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN
)
808 COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN
)
809 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1
)
810 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2
)
811 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3
)
812 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1
))
813 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2
))
814 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3
))
815 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN
))
816 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT
))
817 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO
))
818 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO
))
819 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR
))
820 COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE
)
821 /* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
822 /* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
823 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC
)
824 COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK
)
825 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK
)
826 COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS
)
827 COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS
)
828 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME
)
829 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS
)
830 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE
)
831 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH
)
832 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM
)
833 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER
)
834 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE
)
835 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC
)
836 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD
)
837 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX
)
838 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM
)
839 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV
)
840 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN
)
841 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN
)
842 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1
)
843 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2
)
844 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3
)
845 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1
))
846 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2
))
847 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3
))
848 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN
))
849 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT
))
850 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO
))
851 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO
))
852 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR
))
853 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE
)
854 /* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
855 /* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
856 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC
)
857 COMPATIBLE_IOCTL(SOUND_MIXER_INFO
)
858 COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO
)
859 COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS
)
860 COMPATIBLE_IOCTL(SOUND_MIXER_AGC
)
861 COMPATIBLE_IOCTL(SOUND_MIXER_3DSE
)
862 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1
)
863 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2
)
864 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3
)
865 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4
)
866 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5
)
867 COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS
)
868 COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS
)
869 COMPATIBLE_IOCTL(OSS_GETVERSION
)
871 COMPATIBLE_IOCTL(RAW_SETBIND
)
872 COMPATIBLE_IOCTL(RAW_GETBIND
)
874 COMPATIBLE_IOCTL(WDIOC_GETSUPPORT
)
875 COMPATIBLE_IOCTL(WDIOC_GETSTATUS
)
876 COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS
)
877 COMPATIBLE_IOCTL(WDIOC_GETTEMP
)
878 COMPATIBLE_IOCTL(WDIOC_SETOPTIONS
)
879 COMPATIBLE_IOCTL(WDIOC_KEEPALIVE
)
880 COMPATIBLE_IOCTL(WDIOC_SETTIMEOUT
)
881 COMPATIBLE_IOCTL(WDIOC_GETTIMEOUT
)
882 COMPATIBLE_IOCTL(WDIOC_SETPRETIMEOUT
)
883 COMPATIBLE_IOCTL(WDIOC_GETPRETIMEOUT
)
885 COMPATIBLE_IOCTL(RNDGETENTCNT
)
886 COMPATIBLE_IOCTL(RNDADDTOENTCNT
)
887 COMPATIBLE_IOCTL(RNDGETPOOL
)
888 COMPATIBLE_IOCTL(RNDADDENTROPY
)
889 COMPATIBLE_IOCTL(RNDZAPENTCNT
)
890 COMPATIBLE_IOCTL(RNDCLEARPOOL
)
892 COMPATIBLE_IOCTL(HCIDEVUP
)
893 COMPATIBLE_IOCTL(HCIDEVDOWN
)
894 COMPATIBLE_IOCTL(HCIDEVRESET
)
895 COMPATIBLE_IOCTL(HCIDEVRESTAT
)
896 COMPATIBLE_IOCTL(HCIGETDEVLIST
)
897 COMPATIBLE_IOCTL(HCIGETDEVINFO
)
898 COMPATIBLE_IOCTL(HCIGETCONNLIST
)
899 COMPATIBLE_IOCTL(HCIGETCONNINFO
)
900 COMPATIBLE_IOCTL(HCIGETAUTHINFO
)
901 COMPATIBLE_IOCTL(HCISETRAW
)
902 COMPATIBLE_IOCTL(HCISETSCAN
)
903 COMPATIBLE_IOCTL(HCISETAUTH
)
904 COMPATIBLE_IOCTL(HCISETENCRYPT
)
905 COMPATIBLE_IOCTL(HCISETPTYPE
)
906 COMPATIBLE_IOCTL(HCISETLINKPOL
)
907 COMPATIBLE_IOCTL(HCISETLINKMODE
)
908 COMPATIBLE_IOCTL(HCISETACLMTU
)
909 COMPATIBLE_IOCTL(HCISETSCOMTU
)
910 COMPATIBLE_IOCTL(HCIBLOCKADDR
)
911 COMPATIBLE_IOCTL(HCIUNBLOCKADDR
)
912 COMPATIBLE_IOCTL(HCIINQUIRY
)
913 COMPATIBLE_IOCTL(HCIUARTSETPROTO
)
914 COMPATIBLE_IOCTL(HCIUARTGETPROTO
)
915 COMPATIBLE_IOCTL(HCIUARTGETDEVICE
)
916 COMPATIBLE_IOCTL(HCIUARTSETFLAGS
)
917 COMPATIBLE_IOCTL(HCIUARTGETFLAGS
)
918 COMPATIBLE_IOCTL(RFCOMMCREATEDEV
)
919 COMPATIBLE_IOCTL(RFCOMMRELEASEDEV
)
920 COMPATIBLE_IOCTL(RFCOMMGETDEVLIST
)
921 COMPATIBLE_IOCTL(RFCOMMGETDEVINFO
)
922 COMPATIBLE_IOCTL(RFCOMMSTEALDLC
)
924 COMPATIBLE_IOCTL(CAPI_REGISTER
)
925 COMPATIBLE_IOCTL(CAPI_GET_MANUFACTURER
)
926 COMPATIBLE_IOCTL(CAPI_GET_VERSION
)
927 COMPATIBLE_IOCTL(CAPI_GET_SERIAL
)
928 COMPATIBLE_IOCTL(CAPI_GET_PROFILE
)
929 COMPATIBLE_IOCTL(CAPI_MANUFACTURER_CMD
)
930 COMPATIBLE_IOCTL(CAPI_GET_ERRCODE
)
931 COMPATIBLE_IOCTL(CAPI_INSTALLED
)
932 COMPATIBLE_IOCTL(CAPI_GET_FLAGS
)
933 COMPATIBLE_IOCTL(CAPI_SET_FLAGS
)
934 COMPATIBLE_IOCTL(CAPI_CLR_FLAGS
)
935 COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT
)
936 COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT
)
938 COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
939 COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
940 COMPATIBLE_IOCTL(PCIIOC_CONTROLLER
)
941 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO
)
942 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM
)
943 COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE
)
945 COMPATIBLE_IOCTL(HIDIOCGVERSION
)
946 COMPATIBLE_IOCTL(HIDIOCAPPLICATION
)
947 COMPATIBLE_IOCTL(HIDIOCGDEVINFO
)
948 COMPATIBLE_IOCTL(HIDIOCGSTRING
)
949 COMPATIBLE_IOCTL(HIDIOCINITREPORT
)
950 COMPATIBLE_IOCTL(HIDIOCGREPORT
)
951 COMPATIBLE_IOCTL(HIDIOCSREPORT
)
952 COMPATIBLE_IOCTL(HIDIOCGREPORTINFO
)
953 COMPATIBLE_IOCTL(HIDIOCGFIELDINFO
)
954 COMPATIBLE_IOCTL(HIDIOCGUSAGE
)
955 COMPATIBLE_IOCTL(HIDIOCSUSAGE
)
956 COMPATIBLE_IOCTL(HIDIOCGUCODE
)
957 COMPATIBLE_IOCTL(HIDIOCGFLAG
)
958 COMPATIBLE_IOCTL(HIDIOCSFLAG
)
959 COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX
)
960 COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO
)
962 COMPATIBLE_IOCTL(AUDIO_STOP
)
963 COMPATIBLE_IOCTL(AUDIO_PLAY
)
964 COMPATIBLE_IOCTL(AUDIO_PAUSE
)
965 COMPATIBLE_IOCTL(AUDIO_CONTINUE
)
966 COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE
)
967 COMPATIBLE_IOCTL(AUDIO_SET_MUTE
)
968 COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC
)
969 COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE
)
970 COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT
)
971 COMPATIBLE_IOCTL(AUDIO_GET_STATUS
)
972 COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES
)
973 COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER
)
974 COMPATIBLE_IOCTL(AUDIO_SET_ID
)
975 COMPATIBLE_IOCTL(AUDIO_SET_MIXER
)
976 COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE
)
977 COMPATIBLE_IOCTL(DMX_START
)
978 COMPATIBLE_IOCTL(DMX_STOP
)
979 COMPATIBLE_IOCTL(DMX_SET_FILTER
)
980 COMPATIBLE_IOCTL(DMX_SET_PES_FILTER
)
981 COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE
)
982 COMPATIBLE_IOCTL(DMX_GET_PES_PIDS
)
983 COMPATIBLE_IOCTL(DMX_GET_STC
)
984 COMPATIBLE_IOCTL(DMX_REQBUFS
)
985 COMPATIBLE_IOCTL(DMX_QUERYBUF
)
986 COMPATIBLE_IOCTL(DMX_EXPBUF
)
987 COMPATIBLE_IOCTL(DMX_QBUF
)
988 COMPATIBLE_IOCTL(DMX_DQBUF
)
989 COMPATIBLE_IOCTL(VIDEO_STOP
)
990 COMPATIBLE_IOCTL(VIDEO_PLAY
)
991 COMPATIBLE_IOCTL(VIDEO_FREEZE
)
992 COMPATIBLE_IOCTL(VIDEO_CONTINUE
)
993 COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE
)
994 COMPATIBLE_IOCTL(VIDEO_SET_BLANK
)
995 COMPATIBLE_IOCTL(VIDEO_GET_STATUS
)
996 COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT
)
997 COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD
)
998 COMPATIBLE_IOCTL(VIDEO_SLOWMOTION
)
999 COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES
)
1000 COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER
)
1001 COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE
)
1002 COMPATIBLE_IOCTL(VIDEO_SET_FORMAT
)
1003 COMPATIBLE_IOCTL(VIDEO_GET_SIZE
)
1005 COMPATIBLE_IOCTL(CEC_ADAP_G_CAPS
)
1006 COMPATIBLE_IOCTL(CEC_ADAP_G_LOG_ADDRS
)
1007 COMPATIBLE_IOCTL(CEC_ADAP_S_LOG_ADDRS
)
1008 COMPATIBLE_IOCTL(CEC_ADAP_G_PHYS_ADDR
)
1009 COMPATIBLE_IOCTL(CEC_ADAP_S_PHYS_ADDR
)
1010 COMPATIBLE_IOCTL(CEC_G_MODE
)
1011 COMPATIBLE_IOCTL(CEC_S_MODE
)
1012 COMPATIBLE_IOCTL(CEC_TRANSMIT
)
1013 COMPATIBLE_IOCTL(CEC_RECEIVE
)
1014 COMPATIBLE_IOCTL(CEC_DQEVENT
)
1017 COMPATIBLE_IOCTL(JSIOCGVERSION
)
1018 COMPATIBLE_IOCTL(JSIOCGAXES
)
1019 COMPATIBLE_IOCTL(JSIOCGBUTTONS
)
1020 COMPATIBLE_IOCTL(JSIOCGNAME(0))
1022 /* fat 'r' ioctls. These are handled by fat with ->compat_ioctl,
1023 but we don't want warnings on other file systems. So declare
1024 them as compatible here. */
1025 #define VFAT_IOCTL_READDIR_BOTH32 _IOR('r', 1, struct compat_dirent[2])
1026 #define VFAT_IOCTL_READDIR_SHORT32 _IOR('r', 2, struct compat_dirent[2])
1028 IGNORE_IOCTL(VFAT_IOCTL_READDIR_BOTH32
)
1029 IGNORE_IOCTL(VFAT_IOCTL_READDIR_SHORT32
)
1032 /* Sparc framebuffers, handled in sbusfb_compat_ioctl() */
1033 IGNORE_IOCTL(FBIOGTYPE
)
1034 IGNORE_IOCTL(FBIOSATTR
)
1035 IGNORE_IOCTL(FBIOGATTR
)
1036 IGNORE_IOCTL(FBIOSVIDEO
)
1037 IGNORE_IOCTL(FBIOGVIDEO
)
1038 IGNORE_IOCTL(FBIOSCURPOS
)
1039 IGNORE_IOCTL(FBIOGCURPOS
)
1040 IGNORE_IOCTL(FBIOGCURMAX
)
1041 IGNORE_IOCTL(FBIOPUTCMAP32
)
1042 IGNORE_IOCTL(FBIOGETCMAP32
)
1043 IGNORE_IOCTL(FBIOSCURSOR32
)
1044 IGNORE_IOCTL(FBIOGCURSOR32
)
1049 * Convert common ioctl arguments based on their command number
1051 * Please do not add any code in here. Instead, implement
1052 * a compat_ioctl operation in the place that handleѕ the
1053 * ioctl for the native case.
1055 static long do_ioctl_trans(unsigned int cmd
,
1056 unsigned long arg
, struct file
*file
)
1058 void __user
*argp
= compat_ptr(arg
);
1062 return ppp_gidle(file
, cmd
, argp
);
1063 case PPPIOCSCOMPRESS32
:
1064 return ppp_scompress(file
, cmd
, argp
);
1066 case PPPIOCSACTIVE32
:
1067 return ppp_sock_fprog_ioctl_trans(file
, cmd
, argp
);
1070 return sg_ioctl_trans(file
, cmd
, argp
);
1071 case SG_GET_REQUEST_TABLE
:
1072 return sg_grt_trans(file
, cmd
, argp
);
1075 return mt_ioctl_trans(file
, cmd
, argp
);
1077 /* Not implemented in the native kernel */
1078 case RTC_IRQP_READ32
:
1079 case RTC_IRQP_SET32
:
1080 case RTC_EPOCH_READ32
:
1081 case RTC_EPOCH_SET32
:
1082 return rtc_ioctl(file
, cmd
, argp
);
1085 case VIDEO_GET_EVENT
:
1086 return do_video_get_event(file
, cmd
, argp
);
1087 case VIDEO_STILLPICTURE
:
1088 return do_video_stillpicture(file
, cmd
, argp
);
1092 * These take an integer instead of a pointer as 'arg',
1093 * so we must not do a compat_ptr() translation.
1097 case HOT_REMOVE_DISK
:
1099 case SET_DISK_FAULTY
:
1100 case SET_BITMAP_FILE
:
1101 return vfs_ioctl(file
, cmd
, arg
);
1104 return -ENOIOCTLCMD
;
1107 static int compat_ioctl_check_table(unsigned int xcmd
)
1110 const int max
= ARRAY_SIZE(ioctl_pointer
) - 1;
1112 BUILD_BUG_ON(max
>= (1 << 16));
1114 /* guess initial offset into table, assuming a
1115 normalized distribution */
1116 i
= ((xcmd
>> 16) * max
) >> 16;
1118 /* do linear search up first, until greater or equal */
1119 while (ioctl_pointer
[i
] < xcmd
&& i
< max
)
1122 /* then do linear search down */
1123 while (ioctl_pointer
[i
] > xcmd
&& i
> 0)
1126 return ioctl_pointer
[i
] == xcmd
;
1129 COMPAT_SYSCALL_DEFINE3(ioctl
, unsigned int, fd
, unsigned int, cmd
,
1130 compat_ulong_t
, arg32
)
1132 unsigned long arg
= arg32
;
1133 struct fd f
= fdget(fd
);
1138 /* RED-PEN how should LSM module know it's handling 32bit? */
1139 error
= security_file_ioctl(f
.file
, cmd
, arg
);
1144 * To allow the compat_ioctl handlers to be self contained
1145 * we need to check the common ioctls here first.
1146 * Just handle them with the standard handlers below.
1156 #if defined(CONFIG_IA64) || defined(CONFIG_X86_64)
1157 case FS_IOC_RESVSP_32
:
1158 case FS_IOC_RESVSP64_32
:
1159 error
= compat_ioctl_preallocate(f
.file
, compat_ptr(arg
));
1163 case FS_IOC_RESVSP64
:
1164 error
= ioctl_preallocate(f
.file
, compat_ptr(arg
));
1177 if (S_ISREG(file_inode(f
.file
)->i_mode
))
1182 if (f
.file
->f_op
->compat_ioctl
) {
1183 error
= f
.file
->f_op
->compat_ioctl(f
.file
, cmd
, arg
);
1184 if (error
!= -ENOIOCTLCMD
)
1188 if (!f
.file
->f_op
->unlocked_ioctl
)
1193 if (compat_ioctl_check_table(XFORM(cmd
)))
1196 error
= do_ioctl_trans(cmd
, arg
, f
.file
);
1197 if (error
== -ENOIOCTLCMD
)
1203 arg
= (unsigned long)compat_ptr(arg
);
1205 error
= do_vfs_ioctl(f
.file
, fd
, cmd
, arg
);
1212 static int __init
init_sys32_ioctl_cmp(const void *p
, const void *q
)
1215 a
= *(unsigned int *)p
;
1216 b
= *(unsigned int *)q
;
1224 static int __init
init_sys32_ioctl(void)
1226 sort(ioctl_pointer
, ARRAY_SIZE(ioctl_pointer
), sizeof(*ioctl_pointer
),
1227 init_sys32_ioctl_cmp
, NULL
);
1230 __initcall(init_sys32_ioctl
);