2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
7 * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
9 * These routines maintain argument size conversion between 32bit and 64bit
13 #include <linux/types.h>
14 #include <linux/compat.h>
15 #include <linux/kernel.h>
16 #include <linux/capability.h>
17 #include <linux/compiler.h>
18 #include <linux/sched.h>
19 #include <linux/smp.h>
20 #include <linux/ioctl.h>
22 #include <linux/if_bridge.h>
23 #include <linux/slab.h>
24 #include <linux/raid/md.h>
26 #include <linux/dirent.h>
27 #include <linux/route.h>
28 #include <linux/in6.h>
29 #include <linux/ipv6_route.h>
30 #include <linux/skbuff.h>
31 #include <linux/netlink.h>
34 #include <linux/file.h>
35 #include <linux/ppp_defs.h>
36 #include <linux/if_ppp.h>
37 #include <linux/if_pppox.h>
38 #include <linux/mtio.h>
39 #include <linux/auto_fs.h>
40 #include <linux/auto_fs4.h>
41 #include <linux/tty.h>
42 #include <linux/vt_kern.h>
44 #include <linux/videodev.h>
45 #include <linux/netdevice.h>
46 #include <linux/raw.h>
47 #include <linux/smb_fs.h>
48 #include <linux/blkdev.h>
49 #include <linux/elevator.h>
50 #include <linux/rtc.h>
51 #include <linux/pci.h>
52 #include <linux/module.h>
53 #include <linux/serial.h>
54 #include <linux/if_tun.h>
55 #include <linux/ctype.h>
56 #include <linux/syscalls.h>
57 #include <linux/i2c.h>
58 #include <linux/i2c-dev.h>
59 #include <linux/wireless.h>
60 #include <linux/atalk.h>
61 #include <linux/loop.h>
63 #include <net/bluetooth/bluetooth.h>
64 #include <net/bluetooth/hci.h>
65 #include <net/bluetooth/rfcomm.h>
67 #include <linux/capi.h>
68 #include <linux/gigaset_dev.h>
70 #include <scsi/scsi.h>
71 #include <scsi/scsi_ioctl.h>
74 #include <asm/uaccess.h>
75 #include <linux/ethtool.h>
76 #include <linux/mii.h>
77 #include <linux/if_bonding.h>
78 #include <linux/watchdog.h>
79 #include <linux/dm-ioctl.h>
81 #include <linux/soundcard.h>
83 #include <linux/ppdev.h>
85 #include <linux/atm.h>
86 #include <linux/atmarp.h>
87 #include <linux/atmclip.h>
88 #include <linux/atmdev.h>
89 #include <linux/atmioc.h>
90 #include <linux/atmlec.h>
91 #include <linux/atmmpc.h>
92 #include <linux/atmsvc.h>
93 #include <linux/atm_tcp.h>
94 #include <linux/sonet.h>
95 #include <linux/atm_suni.h>
96 #include <linux/mtd/mtd.h>
98 #include <linux/usb.h>
99 #include <linux/usbdevice_fs.h>
100 #include <linux/nbd.h>
101 #include <linux/random.h>
102 #include <linux/filter.h>
103 #include <linux/pktcdvd.h>
105 #include <linux/hiddev.h>
107 #include <linux/dvb/audio.h>
108 #include <linux/dvb/dmx.h>
109 #include <linux/dvb/frontend.h>
110 #include <linux/dvb/video.h>
113 #include <asm/fbio.h>
116 static int do_ioctl32_pointer(unsigned int fd
, unsigned int cmd
,
117 unsigned long arg
, struct file
*f
)
119 return sys_ioctl(fd
, cmd
, (unsigned long)compat_ptr(arg
));
122 static int w_long(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
124 mm_segment_t old_fs
= get_fs();
129 err
= sys_ioctl(fd
, cmd
, (unsigned long)&val
);
131 if (!err
&& put_user(val
, (u32 __user
*)compat_ptr(arg
)))
136 static int rw_long(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
138 mm_segment_t old_fs
= get_fs();
139 u32 __user
*argptr
= compat_ptr(arg
);
143 if(get_user(val
, argptr
))
146 err
= sys_ioctl(fd
, cmd
, (unsigned long)&val
);
148 if (!err
&& put_user(val
, argptr
))
153 struct compat_video_event
{
155 compat_time_t timestamp
;
158 unsigned int frame_rate
;
162 static int do_video_get_event(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
164 struct video_event kevent
;
165 mm_segment_t old_fs
= get_fs();
169 err
= sys_ioctl(fd
, cmd
, (unsigned long) &kevent
);
173 struct compat_video_event __user
*up
= compat_ptr(arg
);
175 err
= put_user(kevent
.type
, &up
->type
);
176 err
|= put_user(kevent
.timestamp
, &up
->timestamp
);
177 err
|= put_user(kevent
.u
.size
.w
, &up
->u
.size
.w
);
178 err
|= put_user(kevent
.u
.size
.h
, &up
->u
.size
.h
);
179 err
|= put_user(kevent
.u
.size
.aspect_ratio
,
180 &up
->u
.size
.aspect_ratio
);
188 struct compat_video_still_picture
{
189 compat_uptr_t iFrame
;
193 static int do_video_stillpicture(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
195 struct compat_video_still_picture __user
*up
;
196 struct video_still_picture __user
*up_native
;
201 up
= (struct compat_video_still_picture __user
*) arg
;
202 err
= get_user(fp
, &up
->iFrame
);
203 err
|= get_user(size
, &up
->size
);
208 compat_alloc_user_space(sizeof(struct video_still_picture
));
210 err
= put_user(compat_ptr(fp
), &up_native
->iFrame
);
211 err
|= put_user(size
, &up_native
->size
);
215 err
= sys_ioctl(fd
, cmd
, (unsigned long) up_native
);
220 struct compat_video_spu_palette
{
222 compat_uptr_t palette
;
225 static int do_video_set_spu_palette(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
227 struct compat_video_spu_palette __user
*up
;
228 struct video_spu_palette __user
*up_native
;
232 up
= (struct compat_video_spu_palette __user
*) arg
;
233 err
= get_user(palp
, &up
->palette
);
234 err
|= get_user(length
, &up
->length
);
236 up_native
= compat_alloc_user_space(sizeof(struct video_spu_palette
));
237 err
= put_user(compat_ptr(palp
), &up_native
->palette
);
238 err
|= put_user(length
, &up_native
->length
);
242 err
= sys_ioctl(fd
, cmd
, (unsigned long) up_native
);
248 static int do_siocgstamp(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
250 struct compat_timeval __user
*up
= compat_ptr(arg
);
252 mm_segment_t old_fs
= get_fs();
256 err
= sys_ioctl(fd
, cmd
, (unsigned long)&ktv
);
259 err
= put_user(ktv
.tv_sec
, &up
->tv_sec
);
260 err
|= __put_user(ktv
.tv_usec
, &up
->tv_usec
);
265 static int do_siocgstampns(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
267 struct compat_timespec __user
*up
= compat_ptr(arg
);
269 mm_segment_t old_fs
= get_fs();
273 err
= sys_ioctl(fd
, cmd
, (unsigned long)&kts
);
276 err
= put_user(kts
.tv_sec
, &up
->tv_sec
);
277 err
|= __put_user(kts
.tv_nsec
, &up
->tv_nsec
);
283 compat_ulong_t mem_start
;
284 compat_ulong_t mem_end
;
285 unsigned short base_addr
;
292 #define IFHWADDRLEN 6
295 char ifrn_name
[IFNAMSIZ
]; /* if name, e.g. "en0" */
298 struct sockaddr ifru_addr
;
299 struct sockaddr ifru_dstaddr
;
300 struct sockaddr ifru_broadaddr
;
301 struct sockaddr ifru_netmask
;
302 struct sockaddr ifru_hwaddr
;
304 compat_int_t ifru_ivalue
;
305 compat_int_t ifru_mtu
;
306 struct ifmap32 ifru_map
;
307 char ifru_slave
[IFNAMSIZ
]; /* Just fits the size */
308 char ifru_newname
[IFNAMSIZ
];
309 compat_caddr_t ifru_data
;
310 /* XXXX? ifru_settings should be here */
315 compat_int_t ifc_len
; /* size of buffer */
316 compat_caddr_t ifcbuf
;
319 static int dev_ifname32(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
321 struct ifreq __user
*uifr
;
324 uifr
= compat_alloc_user_space(sizeof(struct ifreq
));
325 if (copy_in_user(uifr
, compat_ptr(arg
), sizeof(struct ifreq32
)));
328 err
= sys_ioctl(fd
, SIOCGIFNAME
, (unsigned long)uifr
);
332 if (copy_in_user(compat_ptr(arg
), uifr
, sizeof(struct ifreq32
)))
338 static int dev_ifconf(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
340 struct ifconf32 ifc32
;
342 struct ifconf __user
*uifc
;
343 struct ifreq32 __user
*ifr32
;
344 struct ifreq __user
*ifr
;
348 if (copy_from_user(&ifc32
, compat_ptr(arg
), sizeof(struct ifconf32
)))
351 if (ifc32
.ifcbuf
== 0) {
355 uifc
= compat_alloc_user_space(sizeof(struct ifconf
));
357 size_t len
=((ifc32
.ifc_len
/ sizeof (struct ifreq32
)) + 1) *
358 sizeof (struct ifreq
);
359 uifc
= compat_alloc_user_space(sizeof(struct ifconf
) + len
);
361 ifr
= ifc
.ifc_req
= (void __user
*)(uifc
+ 1);
362 ifr32
= compat_ptr(ifc32
.ifcbuf
);
363 for (i
= 0; i
< ifc32
.ifc_len
; i
+= sizeof (struct ifreq32
)) {
364 if (copy_in_user(ifr
, ifr32
, sizeof(struct ifreq32
)))
370 if (copy_to_user(uifc
, &ifc
, sizeof(struct ifconf
)))
373 err
= sys_ioctl (fd
, SIOCGIFCONF
, (unsigned long)uifc
);
377 if (copy_from_user(&ifc
, uifc
, sizeof(struct ifconf
)))
381 ifr32
= compat_ptr(ifc32
.ifcbuf
);
383 i
+ sizeof (struct ifreq32
) <= ifc32
.ifc_len
&& j
< ifc
.ifc_len
;
384 i
+= sizeof (struct ifreq32
), j
+= sizeof (struct ifreq
)) {
385 if (copy_in_user(ifr32
, ifr
, sizeof (struct ifreq32
)))
391 if (ifc32
.ifcbuf
== 0) {
392 /* Translate from 64-bit structure multiple to
396 i
= ((i
/ sizeof(struct ifreq
)) * sizeof(struct ifreq32
));
401 if (copy_to_user(compat_ptr(arg
), &ifc32
, sizeof(struct ifconf32
)))
407 static int ethtool_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
409 struct ifreq __user
*ifr
;
410 struct ifreq32 __user
*ifr32
;
414 ifr
= compat_alloc_user_space(sizeof(*ifr
));
415 ifr32
= compat_ptr(arg
);
417 if (copy_in_user(&ifr
->ifr_name
, &ifr32
->ifr_name
, IFNAMSIZ
))
420 if (get_user(data
, &ifr32
->ifr_ifru
.ifru_data
))
423 datap
= compat_ptr(data
);
424 if (put_user(datap
, &ifr
->ifr_ifru
.ifru_data
))
427 return sys_ioctl(fd
, cmd
, (unsigned long) ifr
);
430 static int bond_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
433 struct ifreq __user
*uifr
;
434 struct ifreq32 __user
*ifr32
= compat_ptr(arg
);
441 case SIOCBONDENSLAVE
:
442 case SIOCBONDRELEASE
:
443 case SIOCBONDSETHWADDR
:
444 case SIOCBONDCHANGEACTIVE
:
445 if (copy_from_user(&kifr
, ifr32
, sizeof(struct ifreq32
)))
450 err
= sys_ioctl (fd
, cmd
, (unsigned long)&kifr
);
454 case SIOCBONDSLAVEINFOQUERY
:
455 case SIOCBONDINFOQUERY
:
456 uifr
= compat_alloc_user_space(sizeof(*uifr
));
457 if (copy_in_user(&uifr
->ifr_name
, &ifr32
->ifr_name
, IFNAMSIZ
))
460 if (get_user(data
, &ifr32
->ifr_ifru
.ifru_data
))
463 datap
= compat_ptr(data
);
464 if (put_user(datap
, &uifr
->ifr_ifru
.ifru_data
))
467 return sys_ioctl (fd
, cmd
, (unsigned long)uifr
);
473 static int siocdevprivate_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
475 struct ifreq __user
*u_ifreq64
;
476 struct ifreq32 __user
*u_ifreq32
= compat_ptr(arg
);
477 char tmp_buf
[IFNAMSIZ
];
481 if (copy_from_user(&tmp_buf
[0], &(u_ifreq32
->ifr_ifrn
.ifrn_name
[0]),
484 if (__get_user(data32
, &u_ifreq32
->ifr_ifru
.ifru_data
))
486 data64
= compat_ptr(data32
);
488 u_ifreq64
= compat_alloc_user_space(sizeof(*u_ifreq64
));
490 /* Don't check these user accesses, just let that get trapped
491 * in the ioctl handler instead.
493 if (copy_to_user(&u_ifreq64
->ifr_ifrn
.ifrn_name
[0], &tmp_buf
[0],
496 if (__put_user(data64
, &u_ifreq64
->ifr_ifru
.ifru_data
))
499 return sys_ioctl(fd
, cmd
, (unsigned long) u_ifreq64
);
502 static int dev_ifsioc(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
505 struct ifreq32 __user
*uifr32
;
506 struct ifmap32 __user
*uifmap32
;
510 uifr32
= compat_ptr(arg
);
511 uifmap32
= &uifr32
->ifr_ifru
.ifru_map
;
514 err
= copy_from_user(&ifr
, uifr32
, sizeof(ifr
.ifr_name
));
515 err
|= __get_user(ifr
.ifr_map
.mem_start
, &uifmap32
->mem_start
);
516 err
|= __get_user(ifr
.ifr_map
.mem_end
, &uifmap32
->mem_end
);
517 err
|= __get_user(ifr
.ifr_map
.base_addr
, &uifmap32
->base_addr
);
518 err
|= __get_user(ifr
.ifr_map
.irq
, &uifmap32
->irq
);
519 err
|= __get_user(ifr
.ifr_map
.dma
, &uifmap32
->dma
);
520 err
|= __get_user(ifr
.ifr_map
.port
, &uifmap32
->port
);
525 if (copy_from_user(&ifr
, uifr32
, sizeof(*uifr32
)))
531 err
= sys_ioctl (fd
, cmd
, (unsigned long)&ifr
);
535 /* TUNSETIFF is defined as _IOW, it should be _IORW
536 * as the data is copied back to user space, but that
537 * cannot be fixed without breaking all existing apps.
551 if (copy_to_user(uifr32
, &ifr
, sizeof(*uifr32
)))
555 err
= copy_to_user(uifr32
, &ifr
, sizeof(ifr
.ifr_name
));
556 err
|= __put_user(ifr
.ifr_map
.mem_start
, &uifmap32
->mem_start
);
557 err
|= __put_user(ifr
.ifr_map
.mem_end
, &uifmap32
->mem_end
);
558 err
|= __put_user(ifr
.ifr_map
.base_addr
, &uifmap32
->base_addr
);
559 err
|= __put_user(ifr
.ifr_map
.irq
, &uifmap32
->irq
);
560 err
|= __put_user(ifr
.ifr_map
.dma
, &uifmap32
->dma
);
561 err
|= __put_user(ifr
.ifr_map
.port
, &uifmap32
->port
);
572 struct sockaddr rt_dst
; /* target address */
573 struct sockaddr rt_gateway
; /* gateway addr (RTF_GATEWAY) */
574 struct sockaddr rt_genmask
; /* target network mask (IP) */
575 unsigned short rt_flags
;
578 unsigned char rt_tos
;
579 unsigned char rt_class
;
581 short rt_metric
; /* +1 for binary compatibility! */
582 /* char * */ u32 rt_dev
; /* forcing the device at add */
583 u32 rt_mtu
; /* per route MTU/Window */
584 u32 rt_window
; /* Window clamping */
585 unsigned short rt_irtt
; /* Initial RTT */
590 struct in6_addr rtmsg_dst
;
591 struct in6_addr rtmsg_src
;
592 struct in6_addr rtmsg_gateway
;
602 static int routing_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
610 mm_segment_t old_fs
= get_fs();
612 struct socket
*mysock
= sockfd_lookup(fd
, &ret
);
614 if (mysock
&& mysock
->sk
&& mysock
->sk
->sk_family
== AF_INET6
) { /* ipv6 */
615 struct in6_rtmsg32 __user
*ur6
= compat_ptr(arg
);
616 ret
= copy_from_user (&r6
.rtmsg_dst
, &(ur6
->rtmsg_dst
),
617 3 * sizeof(struct in6_addr
));
618 ret
|= __get_user (r6
.rtmsg_type
, &(ur6
->rtmsg_type
));
619 ret
|= __get_user (r6
.rtmsg_dst_len
, &(ur6
->rtmsg_dst_len
));
620 ret
|= __get_user (r6
.rtmsg_src_len
, &(ur6
->rtmsg_src_len
));
621 ret
|= __get_user (r6
.rtmsg_metric
, &(ur6
->rtmsg_metric
));
622 ret
|= __get_user (r6
.rtmsg_info
, &(ur6
->rtmsg_info
));
623 ret
|= __get_user (r6
.rtmsg_flags
, &(ur6
->rtmsg_flags
));
624 ret
|= __get_user (r6
.rtmsg_ifindex
, &(ur6
->rtmsg_ifindex
));
628 struct rtentry32 __user
*ur4
= compat_ptr(arg
);
629 ret
= copy_from_user (&r4
.rt_dst
, &(ur4
->rt_dst
),
630 3 * sizeof(struct sockaddr
));
631 ret
|= __get_user (r4
.rt_flags
, &(ur4
->rt_flags
));
632 ret
|= __get_user (r4
.rt_metric
, &(ur4
->rt_metric
));
633 ret
|= __get_user (r4
.rt_mtu
, &(ur4
->rt_mtu
));
634 ret
|= __get_user (r4
.rt_window
, &(ur4
->rt_window
));
635 ret
|= __get_user (r4
.rt_irtt
, &(ur4
->rt_irtt
));
636 ret
|= __get_user (rtdev
, &(ur4
->rt_dev
));
638 ret
|= copy_from_user (devname
, compat_ptr(rtdev
), 15);
639 r4
.rt_dev
= devname
; devname
[15] = 0;
652 ret
= sys_ioctl (fd
, cmd
, (unsigned long) r
);
664 typedef struct sg_io_hdr32
{
665 compat_int_t interface_id
; /* [i] 'S' for SCSI generic (required) */
666 compat_int_t dxfer_direction
; /* [i] data transfer direction */
667 unsigned char cmd_len
; /* [i] SCSI command length ( <= 16 bytes) */
668 unsigned char mx_sb_len
; /* [i] max length to write to sbp */
669 unsigned short iovec_count
; /* [i] 0 implies no scatter gather */
670 compat_uint_t dxfer_len
; /* [i] byte count of data transfer */
671 compat_uint_t dxferp
; /* [i], [*io] points to data transfer memory
672 or scatter gather list */
673 compat_uptr_t cmdp
; /* [i], [*i] points to command to perform */
674 compat_uptr_t sbp
; /* [i], [*o] points to sense_buffer memory */
675 compat_uint_t timeout
; /* [i] MAX_UINT->no timeout (unit: millisec) */
676 compat_uint_t flags
; /* [i] 0 -> default, see SG_FLAG... */
677 compat_int_t pack_id
; /* [i->o] unused internally (normally) */
678 compat_uptr_t usr_ptr
; /* [i->o] unused internally */
679 unsigned char status
; /* [o] scsi status */
680 unsigned char masked_status
; /* [o] shifted, masked scsi status */
681 unsigned char msg_status
; /* [o] messaging level data (optional) */
682 unsigned char sb_len_wr
; /* [o] byte count actually written to sbp */
683 unsigned short host_status
; /* [o] errors from host adapter */
684 unsigned short driver_status
; /* [o] errors from software driver */
685 compat_int_t resid
; /* [o] dxfer_len - actual_transferred */
686 compat_uint_t duration
; /* [o] time taken by cmd (unit: millisec) */
687 compat_uint_t info
; /* [o] auxiliary information */
688 } sg_io_hdr32_t
; /* 64 bytes long (on sparc32) */
690 typedef struct sg_iovec32
{
691 compat_uint_t iov_base
;
692 compat_uint_t iov_len
;
695 static int sg_build_iovec(sg_io_hdr_t __user
*sgio
, void __user
*dxferp
, u16 iovec_count
)
697 sg_iovec_t __user
*iov
= (sg_iovec_t __user
*) (sgio
+ 1);
698 sg_iovec32_t __user
*iov32
= dxferp
;
701 for (i
= 0; i
< iovec_count
; i
++) {
704 if (get_user(base
, &iov32
[i
].iov_base
) ||
705 get_user(len
, &iov32
[i
].iov_len
) ||
706 put_user(compat_ptr(base
), &iov
[i
].iov_base
) ||
707 put_user(len
, &iov
[i
].iov_len
))
711 if (put_user(iov
, &sgio
->dxferp
))
716 static int sg_ioctl_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
718 sg_io_hdr_t __user
*sgio
;
719 sg_io_hdr32_t __user
*sgio32
;
725 sgio32
= compat_ptr(arg
);
726 if (get_user(iovec_count
, &sgio32
->iovec_count
))
730 void __user
*top
= compat_alloc_user_space(0);
731 void __user
*new = compat_alloc_user_space(sizeof(sg_io_hdr_t
) +
732 (iovec_count
* sizeof(sg_iovec_t
)));
739 /* Ok, now construct. */
740 if (copy_in_user(&sgio
->interface_id
, &sgio32
->interface_id
,
742 (2 * sizeof(unsigned char)) +
743 (1 * sizeof(unsigned short)) +
744 (1 * sizeof(unsigned int))))
747 if (get_user(data
, &sgio32
->dxferp
))
749 dxferp
= compat_ptr(data
);
751 if (sg_build_iovec(sgio
, dxferp
, iovec_count
))
754 if (put_user(dxferp
, &sgio
->dxferp
))
759 unsigned char __user
*cmdp
;
760 unsigned char __user
*sbp
;
762 if (get_user(data
, &sgio32
->cmdp
))
764 cmdp
= compat_ptr(data
);
766 if (get_user(data
, &sgio32
->sbp
))
768 sbp
= compat_ptr(data
);
770 if (put_user(cmdp
, &sgio
->cmdp
) ||
771 put_user(sbp
, &sgio
->sbp
))
775 if (copy_in_user(&sgio
->timeout
, &sgio32
->timeout
,
779 if (get_user(data
, &sgio32
->usr_ptr
))
781 if (put_user(compat_ptr(data
), &sgio
->usr_ptr
))
784 if (copy_in_user(&sgio
->status
, &sgio32
->status
,
785 (4 * sizeof(unsigned char)) +
786 (2 * sizeof(unsigned (short))) +
790 err
= sys_ioctl(fd
, cmd
, (unsigned long) sgio
);
795 if (copy_in_user(&sgio32
->pack_id
, &sgio
->pack_id
,
797 get_user(datap
, &sgio
->usr_ptr
) ||
798 put_user((u32
)(unsigned long)datap
,
800 copy_in_user(&sgio32
->status
, &sgio
->status
,
801 (4 * sizeof(unsigned char)) +
802 (2 * sizeof(unsigned short)) +
810 struct compat_sg_req_info
{ /* used by SG_GET_REQUEST_TABLE ioctl() */
816 compat_uptr_t usr_ptr
;
817 unsigned int duration
;
821 static int sg_grt_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
824 sg_req_info_t __user
*r
;
825 struct compat_sg_req_info __user
*o
= (void __user
*)arg
;
826 r
= compat_alloc_user_space(sizeof(sg_req_info_t
)*SG_MAX_QUEUE
);
827 err
= sys_ioctl(fd
,cmd
,(unsigned long)r
);
830 for (i
= 0; i
< SG_MAX_QUEUE
; i
++) {
834 if (copy_in_user(o
+ i
, r
+ i
, offsetof(sg_req_info_t
, usr_ptr
)) ||
835 get_user(ptr
, &r
[i
].usr_ptr
) ||
836 get_user(d
, &r
[i
].duration
) ||
837 put_user((u32
)(unsigned long)(ptr
), &o
[i
].usr_ptr
) ||
838 put_user(d
, &o
[i
].duration
))
843 #endif /* CONFIG_BLOCK */
845 struct sock_fprog32
{
847 compat_caddr_t filter
;
850 #define PPPIOCSPASS32 _IOW('t', 71, struct sock_fprog32)
851 #define PPPIOCSACTIVE32 _IOW('t', 70, struct sock_fprog32)
853 static int ppp_sock_fprog_ioctl_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
855 struct sock_fprog32 __user
*u_fprog32
= compat_ptr(arg
);
856 struct sock_fprog __user
*u_fprog64
= compat_alloc_user_space(sizeof(struct sock_fprog
));
861 if (get_user(flen
, &u_fprog32
->len
) ||
862 get_user(fptr32
, &u_fprog32
->filter
))
865 fptr64
= compat_ptr(fptr32
);
867 if (put_user(flen
, &u_fprog64
->len
) ||
868 put_user(fptr64
, &u_fprog64
->filter
))
871 if (cmd
== PPPIOCSPASS32
)
876 return sys_ioctl(fd
, cmd
, (unsigned long) u_fprog64
);
879 struct ppp_option_data32
{
882 compat_int_t transmit
;
884 #define PPPIOCSCOMPRESS32 _IOW('t', 77, struct ppp_option_data32)
887 compat_time_t xmit_idle
;
888 compat_time_t recv_idle
;
890 #define PPPIOCGIDLE32 _IOR('t', 63, struct ppp_idle32)
892 static int ppp_gidle(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
894 struct ppp_idle __user
*idle
;
895 struct ppp_idle32 __user
*idle32
;
896 __kernel_time_t xmit
, recv
;
899 idle
= compat_alloc_user_space(sizeof(*idle
));
900 idle32
= compat_ptr(arg
);
902 err
= sys_ioctl(fd
, PPPIOCGIDLE
, (unsigned long) idle
);
905 if (get_user(xmit
, &idle
->xmit_idle
) ||
906 get_user(recv
, &idle
->recv_idle
) ||
907 put_user(xmit
, &idle32
->xmit_idle
) ||
908 put_user(recv
, &idle32
->recv_idle
))
914 static int ppp_scompress(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
916 struct ppp_option_data __user
*odata
;
917 struct ppp_option_data32 __user
*odata32
;
921 odata
= compat_alloc_user_space(sizeof(*odata
));
922 odata32
= compat_ptr(arg
);
924 if (get_user(data
, &odata32
->ptr
))
927 datap
= compat_ptr(data
);
928 if (put_user(datap
, &odata
->ptr
))
931 if (copy_in_user(&odata
->length
, &odata32
->length
,
932 sizeof(__u32
) + sizeof(int)))
935 return sys_ioctl(fd
, PPPIOCSCOMPRESS
, (unsigned long) odata
);
938 static int ppp_ioctl_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
944 err
= ppp_gidle(fd
, cmd
, arg
);
947 case PPPIOCSCOMPRESS32
:
948 err
= ppp_scompress(fd
, cmd
, arg
);
955 printk("ppp_ioctl: Unknown cmd fd(%d) "
956 "cmd(%08x) arg(%08x)\n",
957 (int)fd
, (unsigned int)cmd
, (unsigned int)arg
);
969 compat_long_t mt_type
;
970 compat_long_t mt_resid
;
971 compat_long_t mt_dsreg
;
972 compat_long_t mt_gstat
;
973 compat_long_t mt_erreg
;
974 compat_daddr_t mt_fileno
;
975 compat_daddr_t mt_blkno
;
977 #define MTIOCGET32 _IOR('m', 2, struct mtget32)
980 compat_long_t mt_blkno
;
982 #define MTIOCPOS32 _IOR('m', 3, struct mtpos32)
984 static int mt_ioctl_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
986 mm_segment_t old_fs
= get_fs();
988 struct mtget32 __user
*umget32
;
990 struct mtpos32 __user
*upos32
;
1008 printk("mt_ioctl: Unknown cmd fd(%d) "
1009 "cmd(%08x) arg(%08x)\n",
1010 (int)fd
, (unsigned int)cmd
, (unsigned int)arg
);
1015 err
= sys_ioctl (fd
, kcmd
, (unsigned long)karg
);
1021 upos32
= compat_ptr(arg
);
1022 err
= __put_user(pos
.mt_blkno
, &upos32
->mt_blkno
);
1025 umget32
= compat_ptr(arg
);
1026 err
= __put_user(get
.mt_type
, &umget32
->mt_type
);
1027 err
|= __put_user(get
.mt_resid
, &umget32
->mt_resid
);
1028 err
|= __put_user(get
.mt_dsreg
, &umget32
->mt_dsreg
);
1029 err
|= __put_user(get
.mt_gstat
, &umget32
->mt_gstat
);
1030 err
|= __put_user(get
.mt_erreg
, &umget32
->mt_erreg
);
1031 err
|= __put_user(get
.mt_fileno
, &umget32
->mt_fileno
);
1032 err
|= __put_user(get
.mt_blkno
, &umget32
->mt_blkno
);
1035 return err
? -EFAULT
: 0;
1038 #endif /* CONFIG_BLOCK */
1042 static int vt_check(struct file
*file
)
1044 struct tty_struct
*tty
;
1045 struct inode
*inode
= file
->f_path
.dentry
->d_inode
;
1048 if (file
->f_op
->ioctl
!= tty_ioctl
)
1051 tty
= (struct tty_struct
*)file
->private_data
;
1052 if (tty_paranoia_check(tty
, inode
, "tty_ioctl"))
1055 if (tty
->driver
->ioctl
!= vt_ioctl
)
1058 vc
= (struct vc_data
*)tty
->driver_data
;
1059 if (!vc_cons_allocated(vc
->vc_num
)) /* impossible? */
1060 return -ENOIOCTLCMD
;
1063 * To have permissions to do most of the vt ioctls, we either have
1064 * to be the owner of the tty, or have CAP_SYS_TTY_CONFIG.
1066 if (current
->signal
->tty
== tty
|| capable(CAP_SYS_TTY_CONFIG
))
1071 struct consolefontdesc32
{
1072 unsigned short charcount
; /* characters in font (256 or 512) */
1073 unsigned short charheight
; /* scan lines per character (1-32) */
1074 compat_caddr_t chardata
; /* font data in expanded form */
1077 static int do_fontx_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
, struct file
*file
)
1079 struct consolefontdesc32 __user
*user_cfd
= compat_ptr(arg
);
1080 struct console_font_op op
;
1081 compat_caddr_t data
;
1084 perm
= vt_check(file
);
1085 if (perm
< 0) return perm
;
1091 op
.op
= KD_FONT_OP_SET
;
1094 if (get_user(op
.height
, &user_cfd
->charheight
) ||
1095 get_user(op
.charcount
, &user_cfd
->charcount
) ||
1096 get_user(data
, &user_cfd
->chardata
))
1098 op
.data
= compat_ptr(data
);
1099 return con_font_op(vc_cons
[fg_console
].d
, &op
);
1101 op
.op
= KD_FONT_OP_GET
;
1104 if (get_user(op
.height
, &user_cfd
->charheight
) ||
1105 get_user(op
.charcount
, &user_cfd
->charcount
) ||
1106 get_user(data
, &user_cfd
->chardata
))
1110 op
.data
= compat_ptr(data
);
1111 i
= con_font_op(vc_cons
[fg_console
].d
, &op
);
1114 if (put_user(op
.height
, &user_cfd
->charheight
) ||
1115 put_user(op
.charcount
, &user_cfd
->charcount
) ||
1116 put_user((compat_caddr_t
)(unsigned long)op
.data
,
1117 &user_cfd
->chardata
))
1124 struct console_font_op32
{
1125 compat_uint_t op
; /* operation code KD_FONT_OP_* */
1126 compat_uint_t flags
; /* KD_FONT_FLAG_* */
1127 compat_uint_t width
, height
; /* font size */
1128 compat_uint_t charcount
;
1129 compat_caddr_t data
; /* font data with height fixed to 32 */
1132 static int do_kdfontop_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
, struct file
*file
)
1134 struct console_font_op op
;
1135 struct console_font_op32 __user
*fontop
= compat_ptr(arg
);
1136 int perm
= vt_check(file
), i
;
1139 if (perm
< 0) return perm
;
1141 if (copy_from_user(&op
, fontop
, sizeof(struct console_font_op32
)))
1143 if (!perm
&& op
.op
!= KD_FONT_OP_GET
)
1145 op
.data
= compat_ptr(((struct console_font_op32
*)&op
)->data
);
1146 op
.flags
|= KD_FONT_FLAG_OLD
;
1147 vc
= ((struct tty_struct
*)file
->private_data
)->driver_data
;
1148 i
= con_font_op(vc
, &op
);
1151 ((struct console_font_op32
*)&op
)->data
= (unsigned long)op
.data
;
1152 if (copy_to_user(fontop
, &op
, sizeof(struct console_font_op32
)))
1157 struct unimapdesc32
{
1158 unsigned short entry_ct
;
1159 compat_caddr_t entries
;
1162 static int do_unimap_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
, struct file
*file
)
1164 struct unimapdesc32 tmp
;
1165 struct unimapdesc32 __user
*user_ud
= compat_ptr(arg
);
1166 int perm
= vt_check(file
);
1171 if (copy_from_user(&tmp
, user_ud
, sizeof tmp
))
1174 if (!access_ok(VERIFY_WRITE
, compat_ptr(tmp
.entries
),
1175 tmp
.entry_ct
*sizeof(struct unipair
)))
1177 vc
= ((struct tty_struct
*)file
->private_data
)->driver_data
;
1182 return con_set_unimap(vc
, tmp
.entry_ct
,
1183 compat_ptr(tmp
.entries
));
1185 if (!perm
&& fg_console
!= vc
->vc_num
)
1187 return con_get_unimap(vc
, tmp
.entry_ct
, &(user_ud
->entry_ct
),
1188 compat_ptr(tmp
.entries
));
1193 #endif /* CONFIG_VT */
1195 static int do_smb_getmountuid(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1197 mm_segment_t old_fs
= get_fs();
1198 __kernel_uid_t kuid
;
1201 cmd
= SMB_IOC_GETMOUNTUID
;
1204 err
= sys_ioctl(fd
, cmd
, (unsigned long)&kuid
);
1208 err
= put_user(kuid
, (compat_uid_t __user
*)compat_ptr(arg
));
1213 struct atmif_sioc32
{
1214 compat_int_t number
;
1215 compat_int_t length
;
1219 struct atm_iobuf32
{
1220 compat_int_t length
;
1221 compat_caddr_t buffer
;
1224 #define ATM_GETLINKRATE32 _IOW('a', ATMIOC_ITF+1, struct atmif_sioc32)
1225 #define ATM_GETNAMES32 _IOW('a', ATMIOC_ITF+3, struct atm_iobuf32)
1226 #define ATM_GETTYPE32 _IOW('a', ATMIOC_ITF+4, struct atmif_sioc32)
1227 #define ATM_GETESI32 _IOW('a', ATMIOC_ITF+5, struct atmif_sioc32)
1228 #define ATM_GETADDR32 _IOW('a', ATMIOC_ITF+6, struct atmif_sioc32)
1229 #define ATM_RSTADDR32 _IOW('a', ATMIOC_ITF+7, struct atmif_sioc32)
1230 #define ATM_ADDADDR32 _IOW('a', ATMIOC_ITF+8, struct atmif_sioc32)
1231 #define ATM_DELADDR32 _IOW('a', ATMIOC_ITF+9, struct atmif_sioc32)
1232 #define ATM_GETCIRANGE32 _IOW('a', ATMIOC_ITF+10, struct atmif_sioc32)
1233 #define ATM_SETCIRANGE32 _IOW('a', ATMIOC_ITF+11, struct atmif_sioc32)
1234 #define ATM_SETESI32 _IOW('a', ATMIOC_ITF+12, struct atmif_sioc32)
1235 #define ATM_SETESIF32 _IOW('a', ATMIOC_ITF+13, struct atmif_sioc32)
1236 #define ATM_GETSTAT32 _IOW('a', ATMIOC_SARCOM+0, struct atmif_sioc32)
1237 #define ATM_GETSTATZ32 _IOW('a', ATMIOC_SARCOM+1, struct atmif_sioc32)
1238 #define ATM_GETLOOP32 _IOW('a', ATMIOC_SARCOM+2, struct atmif_sioc32)
1239 #define ATM_SETLOOP32 _IOW('a', ATMIOC_SARCOM+3, struct atmif_sioc32)
1240 #define ATM_QUERYLOOP32 _IOW('a', ATMIOC_SARCOM+4, struct atmif_sioc32)
1245 } atm_ioctl_map
[] = {
1246 { ATM_GETLINKRATE32
, ATM_GETLINKRATE
},
1247 { ATM_GETNAMES32
, ATM_GETNAMES
},
1248 { ATM_GETTYPE32
, ATM_GETTYPE
},
1249 { ATM_GETESI32
, ATM_GETESI
},
1250 { ATM_GETADDR32
, ATM_GETADDR
},
1251 { ATM_RSTADDR32
, ATM_RSTADDR
},
1252 { ATM_ADDADDR32
, ATM_ADDADDR
},
1253 { ATM_DELADDR32
, ATM_DELADDR
},
1254 { ATM_GETCIRANGE32
, ATM_GETCIRANGE
},
1255 { ATM_SETCIRANGE32
, ATM_SETCIRANGE
},
1256 { ATM_SETESI32
, ATM_SETESI
},
1257 { ATM_SETESIF32
, ATM_SETESIF
},
1258 { ATM_GETSTAT32
, ATM_GETSTAT
},
1259 { ATM_GETSTATZ32
, ATM_GETSTATZ
},
1260 { ATM_GETLOOP32
, ATM_GETLOOP
},
1261 { ATM_SETLOOP32
, ATM_SETLOOP
},
1262 { ATM_QUERYLOOP32
, ATM_QUERYLOOP
}
1265 #define NR_ATM_IOCTL ARRAY_SIZE(atm_ioctl_map)
1267 static int do_atm_iobuf(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1269 struct atm_iobuf __user
*iobuf
;
1270 struct atm_iobuf32 __user
*iobuf32
;
1275 iobuf
= compat_alloc_user_space(sizeof(*iobuf
));
1276 iobuf32
= compat_ptr(arg
);
1278 if (get_user(len
, &iobuf32
->length
) ||
1279 get_user(data
, &iobuf32
->buffer
))
1281 datap
= compat_ptr(data
);
1282 if (put_user(len
, &iobuf
->length
) ||
1283 put_user(datap
, &iobuf
->buffer
))
1286 err
= sys_ioctl(fd
, cmd
, (unsigned long)iobuf
);
1289 if (copy_in_user(&iobuf32
->length
, &iobuf
->length
,
1297 static int do_atmif_sioc(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1299 struct atmif_sioc __user
*sioc
;
1300 struct atmif_sioc32 __user
*sioc32
;
1305 sioc
= compat_alloc_user_space(sizeof(*sioc
));
1306 sioc32
= compat_ptr(arg
);
1308 if (copy_in_user(&sioc
->number
, &sioc32
->number
, 2 * sizeof(int)) ||
1309 get_user(data
, &sioc32
->arg
))
1311 datap
= compat_ptr(data
);
1312 if (put_user(datap
, &sioc
->arg
))
1315 err
= sys_ioctl(fd
, cmd
, (unsigned long) sioc
);
1318 if (copy_in_user(&sioc32
->length
, &sioc
->length
,
1325 static int do_atm_ioctl(unsigned int fd
, unsigned int cmd32
, unsigned long arg
)
1328 unsigned int cmd
= 0;
1332 case SONET_GETSTATZ
:
1336 case SONET_SETFRAMING
:
1337 case SONET_GETFRAMING
:
1338 case SONET_GETFRSENSE
:
1339 return do_atmif_sioc(fd
, cmd32
, arg
);
1342 for (i
= 0; i
< NR_ATM_IOCTL
; i
++) {
1343 if (cmd32
== atm_ioctl_map
[i
].cmd32
) {
1344 cmd
= atm_ioctl_map
[i
].cmd
;
1348 if (i
== NR_ATM_IOCTL
)
1353 return do_atm_iobuf(fd
, cmd
, arg
);
1355 case ATM_GETLINKRATE
:
1362 case ATM_GETCIRANGE
:
1363 case ATM_SETCIRANGE
:
1371 return do_atmif_sioc(fd
, cmd
, arg
);
1377 static __attribute_used__
int
1378 ret_einval(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1383 static int ioc_settimeout(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1385 return rw_long(fd
, AUTOFS_IOC_SETTIMEOUT
, arg
);
1388 /* Bluetooth ioctls */
1389 #define HCIUARTSETPROTO _IOW('U', 200, int)
1390 #define HCIUARTGETPROTO _IOR('U', 201, int)
1392 #define BNEPCONNADD _IOW('B', 200, int)
1393 #define BNEPCONNDEL _IOW('B', 201, int)
1394 #define BNEPGETCONNLIST _IOR('B', 210, int)
1395 #define BNEPGETCONNINFO _IOR('B', 211, int)
1397 #define CMTPCONNADD _IOW('C', 200, int)
1398 #define CMTPCONNDEL _IOW('C', 201, int)
1399 #define CMTPGETCONNLIST _IOR('C', 210, int)
1400 #define CMTPGETCONNINFO _IOR('C', 211, int)
1402 #define HIDPCONNADD _IOW('H', 200, int)
1403 #define HIDPCONNDEL _IOW('H', 201, int)
1404 #define HIDPGETCONNLIST _IOR('H', 210, int)
1405 #define HIDPGETCONNINFO _IOR('H', 211, int)
1407 struct mtd_oob_buf32
{
1410 compat_caddr_t ptr
; /* unsigned char* */
1413 #define MEMWRITEOOB32 _IOWR('M',3,struct mtd_oob_buf32)
1414 #define MEMREADOOB32 _IOWR('M',4,struct mtd_oob_buf32)
1416 static int mtd_rw_oob(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1418 struct mtd_oob_buf __user
*buf
= compat_alloc_user_space(sizeof(*buf
));
1419 struct mtd_oob_buf32 __user
*buf32
= compat_ptr(arg
);
1422 unsigned int real_cmd
;
1425 real_cmd
= (cmd
== MEMREADOOB32
) ?
1426 MEMREADOOB
: MEMWRITEOOB
;
1428 if (copy_in_user(&buf
->start
, &buf32
->start
,
1430 get_user(data
, &buf32
->ptr
))
1432 datap
= compat_ptr(data
);
1433 if (put_user(datap
, &buf
->ptr
))
1436 err
= sys_ioctl(fd
, real_cmd
, (unsigned long) buf
);
1439 if (copy_in_user(&buf32
->start
, &buf
->start
,
1448 struct raw32_config_request
1450 compat_int_t raw_minor
;
1453 } __attribute__((packed
));
1455 static int get_raw32_request(struct raw_config_request
*req
, struct raw32_config_request __user
*user_req
)
1459 if (!access_ok(VERIFY_READ
, user_req
, sizeof(struct raw32_config_request
)))
1462 ret
= __get_user(req
->raw_minor
, &user_req
->raw_minor
);
1463 ret
|= __get_user(req
->block_major
, &user_req
->block_major
);
1464 ret
|= __get_user(req
->block_minor
, &user_req
->block_minor
);
1466 return ret
? -EFAULT
: 0;
1469 static int set_raw32_request(struct raw_config_request
*req
, struct raw32_config_request __user
*user_req
)
1473 if (!access_ok(VERIFY_WRITE
, user_req
, sizeof(struct raw32_config_request
)))
1476 ret
= __put_user(req
->raw_minor
, &user_req
->raw_minor
);
1477 ret
|= __put_user(req
->block_major
, &user_req
->block_major
);
1478 ret
|= __put_user(req
->block_minor
, &user_req
->block_minor
);
1480 return ret
? -EFAULT
: 0;
1483 static int raw_ioctl(unsigned fd
, unsigned cmd
, unsigned long arg
)
1490 struct raw_config_request req
;
1491 struct raw32_config_request __user
*user_req
= compat_ptr(arg
);
1492 mm_segment_t oldfs
= get_fs();
1494 if ((ret
= get_raw32_request(&req
, user_req
)))
1498 ret
= sys_ioctl(fd
,cmd
,(unsigned long)&req
);
1501 if ((!ret
) && (cmd
== RAW_GETBIND
)) {
1502 ret
= set_raw32_request(&req
, user_req
);
1507 ret
= sys_ioctl(fd
, cmd
, arg
);
1512 #endif /* CONFIG_BLOCK */
1514 struct serial_struct32
{
1520 compat_int_t xmit_fifo_size
;
1521 compat_int_t custom_divisor
;
1522 compat_int_t baud_base
;
1523 unsigned short close_delay
;
1525 char reserved_char
[1];
1527 unsigned short closing_wait
; /* time to wait before closing */
1528 unsigned short closing_wait2
; /* no longer used... */
1529 compat_uint_t iomem_base
;
1530 unsigned short iomem_reg_shift
;
1531 unsigned int port_high
;
1532 /* compat_ulong_t iomap_base FIXME */
1533 compat_int_t reserved
[1];
1536 static int serial_struct_ioctl(unsigned fd
, unsigned cmd
, unsigned long arg
)
1538 typedef struct serial_struct SS
;
1539 typedef struct serial_struct32 SS32
;
1540 struct serial_struct32 __user
*ss32
= compat_ptr(arg
);
1542 struct serial_struct ss
;
1543 mm_segment_t oldseg
= get_fs();
1547 if (cmd
== TIOCSSERIAL
) {
1548 if (!access_ok(VERIFY_READ
, ss32
, sizeof(SS32
)))
1550 if (__copy_from_user(&ss
, ss32
, offsetof(SS32
, iomem_base
)))
1552 if (__get_user(udata
, &ss32
->iomem_base
))
1554 ss
.iomem_base
= compat_ptr(udata
);
1555 if (__get_user(ss
.iomem_reg_shift
, &ss32
->iomem_reg_shift
) ||
1556 __get_user(ss
.port_high
, &ss32
->port_high
))
1558 ss
.iomap_base
= 0UL;
1561 err
= sys_ioctl(fd
,cmd
,(unsigned long)(&ss
));
1563 if (cmd
== TIOCGSERIAL
&& err
>= 0) {
1564 if (!access_ok(VERIFY_WRITE
, ss32
, sizeof(SS32
)))
1566 if (__copy_to_user(ss32
,&ss
,offsetof(SS32
,iomem_base
)))
1568 base
= (unsigned long)ss
.iomem_base
>> 32 ?
1569 0xffffffff : (unsigned)(unsigned long)ss
.iomem_base
;
1570 if (__put_user(base
, &ss32
->iomem_base
) ||
1571 __put_user(ss
.iomem_reg_shift
, &ss32
->iomem_reg_shift
) ||
1572 __put_user(ss
.port_high
, &ss32
->port_high
))
1578 struct usbdevfs_ctrltransfer32
{
1584 u32 timeout
; /* in milliseconds */
1585 compat_caddr_t data
;
1588 #define USBDEVFS_CONTROL32 _IOWR('U', 0, struct usbdevfs_ctrltransfer32)
1590 static int do_usbdevfs_control(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1592 struct usbdevfs_ctrltransfer32 __user
*p32
= compat_ptr(arg
);
1593 struct usbdevfs_ctrltransfer __user
*p
;
1595 p
= compat_alloc_user_space(sizeof(*p
));
1596 if (copy_in_user(p
, p32
, (sizeof(*p32
) - sizeof(compat_caddr_t
))) ||
1597 get_user(udata
, &p32
->data
) ||
1598 put_user(compat_ptr(udata
), &p
->data
))
1600 return sys_ioctl(fd
, USBDEVFS_CONTROL
, (unsigned long)p
);
1604 struct usbdevfs_bulktransfer32
{
1607 compat_uint_t timeout
; /* in milliseconds */
1608 compat_caddr_t data
;
1611 #define USBDEVFS_BULK32 _IOWR('U', 2, struct usbdevfs_bulktransfer32)
1613 static int do_usbdevfs_bulk(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1615 struct usbdevfs_bulktransfer32 __user
*p32
= compat_ptr(arg
);
1616 struct usbdevfs_bulktransfer __user
*p
;
1618 compat_caddr_t addr
;
1620 p
= compat_alloc_user_space(sizeof(*p
));
1622 if (get_user(n
, &p32
->ep
) || put_user(n
, &p
->ep
) ||
1623 get_user(n
, &p32
->len
) || put_user(n
, &p
->len
) ||
1624 get_user(n
, &p32
->timeout
) || put_user(n
, &p
->timeout
) ||
1625 get_user(addr
, &p32
->data
) || put_user(compat_ptr(addr
), &p
->data
))
1628 return sys_ioctl(fd
, USBDEVFS_BULK
, (unsigned long)p
);
1633 * USBDEVFS_SUBMITURB, USBDEVFS_REAPURB and USBDEVFS_REAPURBNDELAY
1634 * are handled in usbdevfs core. -Christopher Li
1637 struct usbdevfs_disconnectsignal32
{
1639 compat_caddr_t context
;
1642 #define USBDEVFS_DISCSIGNAL32 _IOR('U', 14, struct usbdevfs_disconnectsignal32)
1644 static int do_usbdevfs_discsignal(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1646 struct usbdevfs_disconnectsignal kdis
;
1647 struct usbdevfs_disconnectsignal32 __user
*udis
;
1648 mm_segment_t old_fs
;
1652 udis
= compat_ptr(arg
);
1654 if (get_user(kdis
.signr
, &udis
->signr
) ||
1655 __get_user(uctx
, &udis
->context
))
1658 kdis
.context
= compat_ptr(uctx
);
1662 err
= sys_ioctl(fd
, USBDEVFS_DISCSIGNAL
, (unsigned long) &kdis
);
1679 struct i2c_rdwr_ioctl_data32
{
1680 compat_caddr_t msgs
; /* struct i2c_msg __user *msgs */
1684 struct i2c_smbus_ioctl_data32
{
1688 compat_caddr_t data
; /* union i2c_smbus_data *data */
1691 struct i2c_rdwr_aligned
{
1692 struct i2c_rdwr_ioctl_data cmd
;
1693 struct i2c_msg msgs
[0];
1696 static int do_i2c_rdwr_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1698 struct i2c_rdwr_ioctl_data32 __user
*udata
= compat_ptr(arg
);
1699 struct i2c_rdwr_aligned __user
*tdata
;
1700 struct i2c_msg __user
*tmsgs
;
1701 struct i2c_msg32 __user
*umsgs
;
1702 compat_caddr_t datap
;
1705 if (get_user(nmsgs
, &udata
->nmsgs
))
1707 if (nmsgs
> I2C_RDRW_IOCTL_MAX_MSGS
)
1710 if (get_user(datap
, &udata
->msgs
))
1712 umsgs
= compat_ptr(datap
);
1714 tdata
= compat_alloc_user_space(sizeof(*tdata
) +
1715 nmsgs
* sizeof(struct i2c_msg
));
1716 tmsgs
= &tdata
->msgs
[0];
1718 if (put_user(nmsgs
, &tdata
->cmd
.nmsgs
) ||
1719 put_user(tmsgs
, &tdata
->cmd
.msgs
))
1722 for (i
= 0; i
< nmsgs
; i
++) {
1723 if (copy_in_user(&tmsgs
[i
].addr
, &umsgs
[i
].addr
, 3*sizeof(u16
)))
1725 if (get_user(datap
, &umsgs
[i
].buf
) ||
1726 put_user(compat_ptr(datap
), &tmsgs
[i
].buf
))
1729 return sys_ioctl(fd
, cmd
, (unsigned long)tdata
);
1732 static int do_i2c_smbus_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1734 struct i2c_smbus_ioctl_data __user
*tdata
;
1735 struct i2c_smbus_ioctl_data32 __user
*udata
;
1736 compat_caddr_t datap
;
1738 tdata
= compat_alloc_user_space(sizeof(*tdata
));
1741 if (!access_ok(VERIFY_WRITE
, tdata
, sizeof(*tdata
)))
1744 udata
= compat_ptr(arg
);
1745 if (!access_ok(VERIFY_READ
, udata
, sizeof(*udata
)))
1748 if (__copy_in_user(&tdata
->read_write
, &udata
->read_write
, 2 * sizeof(u8
)))
1750 if (__copy_in_user(&tdata
->size
, &udata
->size
, 2 * sizeof(u32
)))
1752 if (__get_user(datap
, &udata
->data
) ||
1753 __put_user(compat_ptr(datap
), &tdata
->data
))
1756 return sys_ioctl(fd
, cmd
, (unsigned long)tdata
);
1759 struct compat_iw_point
{
1760 compat_caddr_t pointer
;
1765 static int do_wireless_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1767 struct iwreq __user
*iwr
;
1768 struct iwreq __user
*iwr_u
;
1769 struct iw_point __user
*iwp
;
1770 struct compat_iw_point __user
*iwp_u
;
1771 compat_caddr_t pointer_u
;
1772 void __user
*pointer
;
1773 __u16 length
, flags
;
1776 iwr_u
= compat_ptr(arg
);
1777 iwp_u
= (struct compat_iw_point __user
*) &iwr_u
->u
.data
;
1778 iwr
= compat_alloc_user_space(sizeof(*iwr
));
1784 if (!access_ok(VERIFY_WRITE
, iwr
, sizeof(*iwr
)))
1787 if (__copy_in_user(&iwr
->ifr_ifrn
.ifrn_name
[0],
1788 &iwr_u
->ifr_ifrn
.ifrn_name
[0],
1789 sizeof(iwr
->ifr_ifrn
.ifrn_name
)))
1792 if (__get_user(pointer_u
, &iwp_u
->pointer
) ||
1793 __get_user(length
, &iwp_u
->length
) ||
1794 __get_user(flags
, &iwp_u
->flags
))
1797 if (__put_user(compat_ptr(pointer_u
), &iwp
->pointer
) ||
1798 __put_user(length
, &iwp
->length
) ||
1799 __put_user(flags
, &iwp
->flags
))
1802 ret
= sys_ioctl(fd
, cmd
, (unsigned long) iwr
);
1804 if (__get_user(pointer
, &iwp
->pointer
) ||
1805 __get_user(length
, &iwp
->length
) ||
1806 __get_user(flags
, &iwp
->flags
))
1809 if (__put_user(ptr_to_compat(pointer
), &iwp_u
->pointer
) ||
1810 __put_user(length
, &iwp_u
->length
) ||
1811 __put_user(flags
, &iwp_u
->flags
))
1817 /* Since old style bridge ioctl's endup using SIOCDEVPRIVATE
1818 * for some operations; this forces use of the newer bridge-utils that
1819 * use compatiable ioctls
1821 static int old_bridge_ioctl(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1825 if (get_user(tmp
, (u32 __user
*) arg
))
1827 if (tmp
== BRCTL_GET_VERSION
)
1828 return BRCTL_VERSION
+ 1;
1832 #define RTC_IRQP_READ32 _IOR('p', 0x0b, compat_ulong_t)
1833 #define RTC_IRQP_SET32 _IOW('p', 0x0c, compat_ulong_t)
1834 #define RTC_EPOCH_READ32 _IOR('p', 0x0d, compat_ulong_t)
1835 #define RTC_EPOCH_SET32 _IOW('p', 0x0e, compat_ulong_t)
1837 static int rtc_ioctl(unsigned fd
, unsigned cmd
, unsigned long arg
)
1839 mm_segment_t oldfs
= get_fs();
1840 compat_ulong_t val32
;
1845 case RTC_IRQP_READ32
:
1846 case RTC_EPOCH_READ32
:
1848 ret
= sys_ioctl(fd
, (cmd
== RTC_IRQP_READ32
) ?
1849 RTC_IRQP_READ
: RTC_EPOCH_READ
,
1850 (unsigned long)&kval
);
1855 return put_user(val32
, (unsigned int __user
*)arg
);
1856 case RTC_IRQP_SET32
:
1857 return sys_ioctl(fd
, RTC_IRQP_SET
, arg
);
1858 case RTC_EPOCH_SET32
:
1859 return sys_ioctl(fd
, RTC_EPOCH_SET
, arg
);
1862 return -ENOIOCTLCMD
;
1867 lp_timeout_trans(unsigned int fd
, unsigned int cmd
, unsigned long arg
)
1869 struct compat_timeval __user
*tc
= (struct compat_timeval __user
*)arg
;
1870 struct timeval __user
*tn
= compat_alloc_user_space(sizeof(struct timeval
));
1872 if (get_user(ts
.tv_sec
, &tc
->tv_sec
) ||
1873 get_user(ts
.tv_usec
, &tc
->tv_usec
) ||
1874 put_user(ts
.tv_sec
, &tn
->tv_sec
) ||
1875 put_user(ts
.tv_usec
, &tn
->tv_usec
))
1877 return sys_ioctl(fd
, cmd
, (unsigned long)tn
);
1881 typedef int (*ioctl_trans_handler_t
)(unsigned int, unsigned int,
1882 unsigned long, struct file
*);
1884 struct ioctl_trans
{
1886 ioctl_trans_handler_t handler
;
1887 struct ioctl_trans
*next
;
1890 #define HANDLE_IOCTL(cmd,handler) \
1891 { (cmd), (ioctl_trans_handler_t)(handler) },
1893 /* pointer to compatible structure or no argument */
1894 #define COMPATIBLE_IOCTL(cmd) \
1895 { (cmd), do_ioctl32_pointer },
1897 /* argument is an unsigned long integer, not a pointer */
1898 #define ULONG_IOCTL(cmd) \
1899 { (cmd), (ioctl_trans_handler_t)sys_ioctl },
1901 /* ioctl should not be warned about even if it's not implemented.
1902 Valid reasons to use this:
1903 - It is implemented with ->compat_ioctl on some device, but programs
1904 call it on others too.
1905 - The ioctl is not implemented in the native kernel, but programs
1906 call it commonly anyways.
1907 Most other reasons are not valid. */
1908 #define IGNORE_IOCTL(cmd) COMPATIBLE_IOCTL(cmd)
1910 static struct ioctl_trans ioctl_start
[] = {
1911 /* compatible ioctls first */
1912 COMPATIBLE_IOCTL(0x4B50) /* KDGHWCLK - not in the kernel, but don't complain */
1913 COMPATIBLE_IOCTL(0x4B51) /* KDSHWCLK - not in the kernel, but don't complain */
1916 COMPATIBLE_IOCTL(TCGETA
)
1917 COMPATIBLE_IOCTL(TCSETA
)
1918 COMPATIBLE_IOCTL(TCSETAW
)
1919 COMPATIBLE_IOCTL(TCSETAF
)
1920 COMPATIBLE_IOCTL(TCSBRK
)
1921 ULONG_IOCTL(TCSBRKP
)
1922 COMPATIBLE_IOCTL(TCXONC
)
1923 COMPATIBLE_IOCTL(TCFLSH
)
1924 COMPATIBLE_IOCTL(TCGETS
)
1925 COMPATIBLE_IOCTL(TCSETS
)
1926 COMPATIBLE_IOCTL(TCSETSW
)
1927 COMPATIBLE_IOCTL(TCSETSF
)
1928 COMPATIBLE_IOCTL(TIOCLINUX
)
1929 COMPATIBLE_IOCTL(TIOCSBRK
)
1930 COMPATIBLE_IOCTL(TIOCCBRK
)
1931 ULONG_IOCTL(TIOCMIWAIT
)
1932 COMPATIBLE_IOCTL(TIOCGICOUNT
)
1934 COMPATIBLE_IOCTL(TIOCGETD
)
1935 COMPATIBLE_IOCTL(TIOCSETD
)
1936 COMPATIBLE_IOCTL(TIOCEXCL
)
1937 COMPATIBLE_IOCTL(TIOCNXCL
)
1938 COMPATIBLE_IOCTL(TIOCCONS
)
1939 COMPATIBLE_IOCTL(TIOCGSOFTCAR
)
1940 COMPATIBLE_IOCTL(TIOCSSOFTCAR
)
1941 COMPATIBLE_IOCTL(TIOCSWINSZ
)
1942 COMPATIBLE_IOCTL(TIOCGWINSZ
)
1943 COMPATIBLE_IOCTL(TIOCMGET
)
1944 COMPATIBLE_IOCTL(TIOCMBIC
)
1945 COMPATIBLE_IOCTL(TIOCMBIS
)
1946 COMPATIBLE_IOCTL(TIOCMSET
)
1947 COMPATIBLE_IOCTL(TIOCPKT
)
1948 COMPATIBLE_IOCTL(TIOCNOTTY
)
1949 COMPATIBLE_IOCTL(TIOCSTI
)
1950 COMPATIBLE_IOCTL(TIOCOUTQ
)
1951 COMPATIBLE_IOCTL(TIOCSPGRP
)
1952 COMPATIBLE_IOCTL(TIOCGPGRP
)
1953 ULONG_IOCTL(TIOCSCTTY
)
1954 COMPATIBLE_IOCTL(TIOCGPTN
)
1955 COMPATIBLE_IOCTL(TIOCSPTLCK
)
1956 COMPATIBLE_IOCTL(TIOCSERGETLSR
)
1958 COMPATIBLE_IOCTL(FIOCLEX
)
1959 COMPATIBLE_IOCTL(FIONCLEX
)
1960 COMPATIBLE_IOCTL(FIOASYNC
)
1961 COMPATIBLE_IOCTL(FIONBIO
)
1962 COMPATIBLE_IOCTL(FIONREAD
) /* This is also TIOCINQ */
1964 COMPATIBLE_IOCTL(FIBMAP
)
1965 COMPATIBLE_IOCTL(FIGETBSZ
)
1967 COMPATIBLE_IOCTL(RAID_VERSION
)
1968 COMPATIBLE_IOCTL(GET_ARRAY_INFO
)
1969 COMPATIBLE_IOCTL(GET_DISK_INFO
)
1970 COMPATIBLE_IOCTL(PRINT_RAID_DEBUG
)
1971 COMPATIBLE_IOCTL(RAID_AUTORUN
)
1972 COMPATIBLE_IOCTL(CLEAR_ARRAY
)
1973 COMPATIBLE_IOCTL(ADD_NEW_DISK
)
1974 ULONG_IOCTL(HOT_REMOVE_DISK
)
1975 COMPATIBLE_IOCTL(SET_ARRAY_INFO
)
1976 COMPATIBLE_IOCTL(SET_DISK_INFO
)
1977 COMPATIBLE_IOCTL(WRITE_RAID_INFO
)
1978 COMPATIBLE_IOCTL(UNPROTECT_ARRAY
)
1979 COMPATIBLE_IOCTL(PROTECT_ARRAY
)
1980 ULONG_IOCTL(HOT_ADD_DISK
)
1981 ULONG_IOCTL(SET_DISK_FAULTY
)
1982 COMPATIBLE_IOCTL(RUN_ARRAY
)
1983 COMPATIBLE_IOCTL(STOP_ARRAY
)
1984 COMPATIBLE_IOCTL(STOP_ARRAY_RO
)
1985 COMPATIBLE_IOCTL(RESTART_ARRAY_RW
)
1986 COMPATIBLE_IOCTL(GET_BITMAP_FILE
)
1987 ULONG_IOCTL(SET_BITMAP_FILE
)
1989 COMPATIBLE_IOCTL(DM_VERSION_32
)
1990 COMPATIBLE_IOCTL(DM_REMOVE_ALL_32
)
1991 COMPATIBLE_IOCTL(DM_LIST_DEVICES_32
)
1992 COMPATIBLE_IOCTL(DM_DEV_CREATE_32
)
1993 COMPATIBLE_IOCTL(DM_DEV_REMOVE_32
)
1994 COMPATIBLE_IOCTL(DM_DEV_RENAME_32
)
1995 COMPATIBLE_IOCTL(DM_DEV_SUSPEND_32
)
1996 COMPATIBLE_IOCTL(DM_DEV_STATUS_32
)
1997 COMPATIBLE_IOCTL(DM_DEV_WAIT_32
)
1998 COMPATIBLE_IOCTL(DM_TABLE_LOAD_32
)
1999 COMPATIBLE_IOCTL(DM_TABLE_CLEAR_32
)
2000 COMPATIBLE_IOCTL(DM_TABLE_DEPS_32
)
2001 COMPATIBLE_IOCTL(DM_TABLE_STATUS_32
)
2002 COMPATIBLE_IOCTL(DM_LIST_VERSIONS_32
)
2003 COMPATIBLE_IOCTL(DM_TARGET_MSG_32
)
2004 COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY_32
)
2005 COMPATIBLE_IOCTL(DM_VERSION
)
2006 COMPATIBLE_IOCTL(DM_REMOVE_ALL
)
2007 COMPATIBLE_IOCTL(DM_LIST_DEVICES
)
2008 COMPATIBLE_IOCTL(DM_DEV_CREATE
)
2009 COMPATIBLE_IOCTL(DM_DEV_REMOVE
)
2010 COMPATIBLE_IOCTL(DM_DEV_RENAME
)
2011 COMPATIBLE_IOCTL(DM_DEV_SUSPEND
)
2012 COMPATIBLE_IOCTL(DM_DEV_STATUS
)
2013 COMPATIBLE_IOCTL(DM_DEV_WAIT
)
2014 COMPATIBLE_IOCTL(DM_TABLE_LOAD
)
2015 COMPATIBLE_IOCTL(DM_TABLE_CLEAR
)
2016 COMPATIBLE_IOCTL(DM_TABLE_DEPS
)
2017 COMPATIBLE_IOCTL(DM_TABLE_STATUS
)
2018 COMPATIBLE_IOCTL(DM_LIST_VERSIONS
)
2019 COMPATIBLE_IOCTL(DM_TARGET_MSG
)
2020 COMPATIBLE_IOCTL(DM_DEV_SET_GEOMETRY
)
2022 COMPATIBLE_IOCTL(PIO_FONT
)
2023 COMPATIBLE_IOCTL(GIO_FONT
)
2024 ULONG_IOCTL(KDSIGACCEPT
)
2025 COMPATIBLE_IOCTL(KDGETKEYCODE
)
2026 COMPATIBLE_IOCTL(KDSETKEYCODE
)
2027 ULONG_IOCTL(KIOCSOUND
)
2028 ULONG_IOCTL(KDMKTONE
)
2029 COMPATIBLE_IOCTL(KDGKBTYPE
)
2030 ULONG_IOCTL(KDSETMODE
)
2031 COMPATIBLE_IOCTL(KDGETMODE
)
2032 ULONG_IOCTL(KDSKBMODE
)
2033 COMPATIBLE_IOCTL(KDGKBMODE
)
2034 ULONG_IOCTL(KDSKBMETA
)
2035 COMPATIBLE_IOCTL(KDGKBMETA
)
2036 COMPATIBLE_IOCTL(KDGKBENT
)
2037 COMPATIBLE_IOCTL(KDSKBENT
)
2038 COMPATIBLE_IOCTL(KDGKBSENT
)
2039 COMPATIBLE_IOCTL(KDSKBSENT
)
2040 COMPATIBLE_IOCTL(KDGKBDIACR
)
2041 COMPATIBLE_IOCTL(KDSKBDIACR
)
2042 COMPATIBLE_IOCTL(KDKBDREP
)
2043 COMPATIBLE_IOCTL(KDGKBLED
)
2044 ULONG_IOCTL(KDSKBLED
)
2045 COMPATIBLE_IOCTL(KDGETLED
)
2046 ULONG_IOCTL(KDSETLED
)
2047 COMPATIBLE_IOCTL(GIO_SCRNMAP
)
2048 COMPATIBLE_IOCTL(PIO_SCRNMAP
)
2049 COMPATIBLE_IOCTL(GIO_UNISCRNMAP
)
2050 COMPATIBLE_IOCTL(PIO_UNISCRNMAP
)
2051 COMPATIBLE_IOCTL(PIO_FONTRESET
)
2052 COMPATIBLE_IOCTL(PIO_UNIMAPCLR
)
2054 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_IDLUN
)
2055 COMPATIBLE_IOCTL(SCSI_IOCTL_DOORLOCK
)
2056 COMPATIBLE_IOCTL(SCSI_IOCTL_DOORUNLOCK
)
2057 COMPATIBLE_IOCTL(SCSI_IOCTL_TEST_UNIT_READY
)
2058 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_BUS_NUMBER
)
2059 COMPATIBLE_IOCTL(SCSI_IOCTL_SEND_COMMAND
)
2060 COMPATIBLE_IOCTL(SCSI_IOCTL_PROBE_HOST
)
2061 COMPATIBLE_IOCTL(SCSI_IOCTL_GET_PCI
)
2063 COMPATIBLE_IOCTL(TUNSETNOCSUM
)
2064 COMPATIBLE_IOCTL(TUNSETDEBUG
)
2065 COMPATIBLE_IOCTL(TUNSETPERSIST
)
2066 COMPATIBLE_IOCTL(TUNSETOWNER
)
2068 COMPATIBLE_IOCTL(VT_SETMODE
)
2069 COMPATIBLE_IOCTL(VT_GETMODE
)
2070 COMPATIBLE_IOCTL(VT_GETSTATE
)
2071 COMPATIBLE_IOCTL(VT_OPENQRY
)
2072 ULONG_IOCTL(VT_ACTIVATE
)
2073 ULONG_IOCTL(VT_WAITACTIVE
)
2074 ULONG_IOCTL(VT_RELDISP
)
2075 ULONG_IOCTL(VT_DISALLOCATE
)
2076 COMPATIBLE_IOCTL(VT_RESIZE
)
2077 COMPATIBLE_IOCTL(VT_RESIZEX
)
2078 COMPATIBLE_IOCTL(VT_LOCKSWITCH
)
2079 COMPATIBLE_IOCTL(VT_UNLOCKSWITCH
)
2080 COMPATIBLE_IOCTL(VT_GETHIFONTMASK
)
2081 /* Little p (/dev/rtc, /dev/envctrl, etc.) */
2082 COMPATIBLE_IOCTL(RTC_AIE_ON
)
2083 COMPATIBLE_IOCTL(RTC_AIE_OFF
)
2084 COMPATIBLE_IOCTL(RTC_UIE_ON
)
2085 COMPATIBLE_IOCTL(RTC_UIE_OFF
)
2086 COMPATIBLE_IOCTL(RTC_PIE_ON
)
2087 COMPATIBLE_IOCTL(RTC_PIE_OFF
)
2088 COMPATIBLE_IOCTL(RTC_WIE_ON
)
2089 COMPATIBLE_IOCTL(RTC_WIE_OFF
)
2090 COMPATIBLE_IOCTL(RTC_ALM_SET
)
2091 COMPATIBLE_IOCTL(RTC_ALM_READ
)
2092 COMPATIBLE_IOCTL(RTC_RD_TIME
)
2093 COMPATIBLE_IOCTL(RTC_SET_TIME
)
2094 COMPATIBLE_IOCTL(RTC_WKALM_SET
)
2095 COMPATIBLE_IOCTL(RTC_WKALM_RD
)
2097 * These two are only for the sbus rtc driver, but
2098 * hwclock tries them on every rtc device first when
2099 * running on sparc. On other architectures the entries
2100 * are useless but harmless.
2102 COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
2103 COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
2105 COMPATIBLE_IOCTL(MTIOCTOP
)
2106 /* Socket level stuff */
2107 COMPATIBLE_IOCTL(FIOQSIZE
)
2108 COMPATIBLE_IOCTL(FIOSETOWN
)
2109 COMPATIBLE_IOCTL(SIOCSPGRP
)
2110 COMPATIBLE_IOCTL(FIOGETOWN
)
2111 COMPATIBLE_IOCTL(SIOCGPGRP
)
2112 COMPATIBLE_IOCTL(SIOCATMARK
)
2113 COMPATIBLE_IOCTL(SIOCSIFLINK
)
2114 COMPATIBLE_IOCTL(SIOCSIFENCAP
)
2115 COMPATIBLE_IOCTL(SIOCGIFENCAP
)
2116 COMPATIBLE_IOCTL(SIOCSIFNAME
)
2117 COMPATIBLE_IOCTL(SIOCSARP
)
2118 COMPATIBLE_IOCTL(SIOCGARP
)
2119 COMPATIBLE_IOCTL(SIOCDARP
)
2120 COMPATIBLE_IOCTL(SIOCSRARP
)
2121 COMPATIBLE_IOCTL(SIOCGRARP
)
2122 COMPATIBLE_IOCTL(SIOCDRARP
)
2123 COMPATIBLE_IOCTL(SIOCADDDLCI
)
2124 COMPATIBLE_IOCTL(SIOCDELDLCI
)
2125 COMPATIBLE_IOCTL(SIOCGMIIPHY
)
2126 COMPATIBLE_IOCTL(SIOCGMIIREG
)
2127 COMPATIBLE_IOCTL(SIOCSMIIREG
)
2128 COMPATIBLE_IOCTL(SIOCGIFVLAN
)
2129 COMPATIBLE_IOCTL(SIOCSIFVLAN
)
2130 COMPATIBLE_IOCTL(SIOCBRADDBR
)
2131 COMPATIBLE_IOCTL(SIOCBRDELBR
)
2133 COMPATIBLE_IOCTL(SG_SET_TIMEOUT
)
2134 COMPATIBLE_IOCTL(SG_GET_TIMEOUT
)
2135 COMPATIBLE_IOCTL(SG_EMULATED_HOST
)
2136 ULONG_IOCTL(SG_SET_TRANSFORM
)
2137 COMPATIBLE_IOCTL(SG_GET_TRANSFORM
)
2138 COMPATIBLE_IOCTL(SG_SET_RESERVED_SIZE
)
2139 COMPATIBLE_IOCTL(SG_GET_RESERVED_SIZE
)
2140 COMPATIBLE_IOCTL(SG_GET_SCSI_ID
)
2141 COMPATIBLE_IOCTL(SG_SET_FORCE_LOW_DMA
)
2142 COMPATIBLE_IOCTL(SG_GET_LOW_DMA
)
2143 COMPATIBLE_IOCTL(SG_SET_FORCE_PACK_ID
)
2144 COMPATIBLE_IOCTL(SG_GET_PACK_ID
)
2145 COMPATIBLE_IOCTL(SG_GET_NUM_WAITING
)
2146 COMPATIBLE_IOCTL(SG_SET_DEBUG
)
2147 COMPATIBLE_IOCTL(SG_GET_SG_TABLESIZE
)
2148 COMPATIBLE_IOCTL(SG_GET_COMMAND_Q
)
2149 COMPATIBLE_IOCTL(SG_SET_COMMAND_Q
)
2150 COMPATIBLE_IOCTL(SG_GET_VERSION_NUM
)
2151 COMPATIBLE_IOCTL(SG_NEXT_CMD_LEN
)
2152 COMPATIBLE_IOCTL(SG_SCSI_RESET
)
2153 COMPATIBLE_IOCTL(SG_GET_REQUEST_TABLE
)
2154 COMPATIBLE_IOCTL(SG_SET_KEEP_ORPHAN
)
2155 COMPATIBLE_IOCTL(SG_GET_KEEP_ORPHAN
)
2157 COMPATIBLE_IOCTL(PPPIOCGFLAGS
)
2158 COMPATIBLE_IOCTL(PPPIOCSFLAGS
)
2159 COMPATIBLE_IOCTL(PPPIOCGASYNCMAP
)
2160 COMPATIBLE_IOCTL(PPPIOCSASYNCMAP
)
2161 COMPATIBLE_IOCTL(PPPIOCGUNIT
)
2162 COMPATIBLE_IOCTL(PPPIOCGRASYNCMAP
)
2163 COMPATIBLE_IOCTL(PPPIOCSRASYNCMAP
)
2164 COMPATIBLE_IOCTL(PPPIOCGMRU
)
2165 COMPATIBLE_IOCTL(PPPIOCSMRU
)
2166 COMPATIBLE_IOCTL(PPPIOCSMAXCID
)
2167 COMPATIBLE_IOCTL(PPPIOCGXASYNCMAP
)
2168 COMPATIBLE_IOCTL(PPPIOCSXASYNCMAP
)
2169 COMPATIBLE_IOCTL(PPPIOCXFERUNIT
)
2170 /* PPPIOCSCOMPRESS is translated */
2171 COMPATIBLE_IOCTL(PPPIOCGNPMODE
)
2172 COMPATIBLE_IOCTL(PPPIOCSNPMODE
)
2173 COMPATIBLE_IOCTL(PPPIOCGDEBUG
)
2174 COMPATIBLE_IOCTL(PPPIOCSDEBUG
)
2175 /* PPPIOCSPASS is translated */
2176 /* PPPIOCSACTIVE is translated */
2177 /* PPPIOCGIDLE is translated */
2178 COMPATIBLE_IOCTL(PPPIOCNEWUNIT
)
2179 COMPATIBLE_IOCTL(PPPIOCATTACH
)
2180 COMPATIBLE_IOCTL(PPPIOCDETACH
)
2181 COMPATIBLE_IOCTL(PPPIOCSMRRU
)
2182 COMPATIBLE_IOCTL(PPPIOCCONNECT
)
2183 COMPATIBLE_IOCTL(PPPIOCDISCONN
)
2184 COMPATIBLE_IOCTL(PPPIOCATTCHAN
)
2185 COMPATIBLE_IOCTL(PPPIOCGCHAN
)
2187 COMPATIBLE_IOCTL(PPPOEIOCSFWD
)
2188 COMPATIBLE_IOCTL(PPPOEIOCDFWD
)
2190 COMPATIBLE_IOCTL(LPGETSTATUS
)
2192 COMPATIBLE_IOCTL(PPSETMODE
)
2193 COMPATIBLE_IOCTL(PPRSTATUS
)
2194 COMPATIBLE_IOCTL(PPRCONTROL
)
2195 COMPATIBLE_IOCTL(PPWCONTROL
)
2196 COMPATIBLE_IOCTL(PPFCONTROL
)
2197 COMPATIBLE_IOCTL(PPRDATA
)
2198 COMPATIBLE_IOCTL(PPWDATA
)
2199 COMPATIBLE_IOCTL(PPCLAIM
)
2200 COMPATIBLE_IOCTL(PPRELEASE
)
2201 COMPATIBLE_IOCTL(PPYIELD
)
2202 COMPATIBLE_IOCTL(PPEXCL
)
2203 COMPATIBLE_IOCTL(PPDATADIR
)
2204 COMPATIBLE_IOCTL(PPNEGOT
)
2205 COMPATIBLE_IOCTL(PPWCTLONIRQ
)
2206 COMPATIBLE_IOCTL(PPCLRIRQ
)
2207 COMPATIBLE_IOCTL(PPSETPHASE
)
2208 COMPATIBLE_IOCTL(PPGETMODES
)
2209 COMPATIBLE_IOCTL(PPGETMODE
)
2210 COMPATIBLE_IOCTL(PPGETPHASE
)
2211 COMPATIBLE_IOCTL(PPGETFLAGS
)
2212 COMPATIBLE_IOCTL(PPSETFLAGS
)
2214 COMPATIBLE_IOCTL(PACKET_CTRL_CMD
)
2217 /* Big Q for sound/OSS */
2218 COMPATIBLE_IOCTL(SNDCTL_SEQ_RESET
)
2219 COMPATIBLE_IOCTL(SNDCTL_SEQ_SYNC
)
2220 COMPATIBLE_IOCTL(SNDCTL_SYNTH_INFO
)
2221 COMPATIBLE_IOCTL(SNDCTL_SEQ_CTRLRATE
)
2222 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETOUTCOUNT
)
2223 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETINCOUNT
)
2224 COMPATIBLE_IOCTL(SNDCTL_SEQ_PERCMODE
)
2225 COMPATIBLE_IOCTL(SNDCTL_FM_LOAD_INSTR
)
2226 COMPATIBLE_IOCTL(SNDCTL_SEQ_TESTMIDI
)
2227 COMPATIBLE_IOCTL(SNDCTL_SEQ_RESETSAMPLES
)
2228 COMPATIBLE_IOCTL(SNDCTL_SEQ_NRSYNTHS
)
2229 COMPATIBLE_IOCTL(SNDCTL_SEQ_NRMIDIS
)
2230 COMPATIBLE_IOCTL(SNDCTL_MIDI_INFO
)
2231 COMPATIBLE_IOCTL(SNDCTL_SEQ_THRESHOLD
)
2232 COMPATIBLE_IOCTL(SNDCTL_SYNTH_MEMAVL
)
2233 COMPATIBLE_IOCTL(SNDCTL_FM_4OP_ENABLE
)
2234 COMPATIBLE_IOCTL(SNDCTL_SEQ_PANIC
)
2235 COMPATIBLE_IOCTL(SNDCTL_SEQ_OUTOFBAND
)
2236 COMPATIBLE_IOCTL(SNDCTL_SEQ_GETTIME
)
2237 COMPATIBLE_IOCTL(SNDCTL_SYNTH_ID
)
2238 COMPATIBLE_IOCTL(SNDCTL_SYNTH_CONTROL
)
2239 COMPATIBLE_IOCTL(SNDCTL_SYNTH_REMOVESAMPLE
)
2240 /* Big T for sound/OSS */
2241 COMPATIBLE_IOCTL(SNDCTL_TMR_TIMEBASE
)
2242 COMPATIBLE_IOCTL(SNDCTL_TMR_START
)
2243 COMPATIBLE_IOCTL(SNDCTL_TMR_STOP
)
2244 COMPATIBLE_IOCTL(SNDCTL_TMR_CONTINUE
)
2245 COMPATIBLE_IOCTL(SNDCTL_TMR_TEMPO
)
2246 COMPATIBLE_IOCTL(SNDCTL_TMR_SOURCE
)
2247 COMPATIBLE_IOCTL(SNDCTL_TMR_METRONOME
)
2248 COMPATIBLE_IOCTL(SNDCTL_TMR_SELECT
)
2249 /* Little m for sound/OSS */
2250 COMPATIBLE_IOCTL(SNDCTL_MIDI_PRETIME
)
2251 COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUMODE
)
2252 COMPATIBLE_IOCTL(SNDCTL_MIDI_MPUCMD
)
2253 /* Big P for sound/OSS */
2254 COMPATIBLE_IOCTL(SNDCTL_DSP_RESET
)
2255 COMPATIBLE_IOCTL(SNDCTL_DSP_SYNC
)
2256 COMPATIBLE_IOCTL(SNDCTL_DSP_SPEED
)
2257 COMPATIBLE_IOCTL(SNDCTL_DSP_STEREO
)
2258 COMPATIBLE_IOCTL(SNDCTL_DSP_GETBLKSIZE
)
2259 COMPATIBLE_IOCTL(SNDCTL_DSP_CHANNELS
)
2260 COMPATIBLE_IOCTL(SOUND_PCM_WRITE_FILTER
)
2261 COMPATIBLE_IOCTL(SNDCTL_DSP_POST
)
2262 COMPATIBLE_IOCTL(SNDCTL_DSP_SUBDIVIDE
)
2263 COMPATIBLE_IOCTL(SNDCTL_DSP_SETFRAGMENT
)
2264 COMPATIBLE_IOCTL(SNDCTL_DSP_GETFMTS
)
2265 COMPATIBLE_IOCTL(SNDCTL_DSP_SETFMT
)
2266 COMPATIBLE_IOCTL(SNDCTL_DSP_GETOSPACE
)
2267 COMPATIBLE_IOCTL(SNDCTL_DSP_GETISPACE
)
2268 COMPATIBLE_IOCTL(SNDCTL_DSP_NONBLOCK
)
2269 COMPATIBLE_IOCTL(SNDCTL_DSP_GETCAPS
)
2270 COMPATIBLE_IOCTL(SNDCTL_DSP_GETTRIGGER
)
2271 COMPATIBLE_IOCTL(SNDCTL_DSP_SETTRIGGER
)
2272 COMPATIBLE_IOCTL(SNDCTL_DSP_GETIPTR
)
2273 COMPATIBLE_IOCTL(SNDCTL_DSP_GETOPTR
)
2274 /* SNDCTL_DSP_MAPINBUF, XXX needs translation */
2275 /* SNDCTL_DSP_MAPOUTBUF, XXX needs translation */
2276 COMPATIBLE_IOCTL(SNDCTL_DSP_SETSYNCRO
)
2277 COMPATIBLE_IOCTL(SNDCTL_DSP_SETDUPLEX
)
2278 COMPATIBLE_IOCTL(SNDCTL_DSP_GETODELAY
)
2279 COMPATIBLE_IOCTL(SNDCTL_DSP_PROFILE
)
2280 COMPATIBLE_IOCTL(SOUND_PCM_READ_RATE
)
2281 COMPATIBLE_IOCTL(SOUND_PCM_READ_CHANNELS
)
2282 COMPATIBLE_IOCTL(SOUND_PCM_READ_BITS
)
2283 COMPATIBLE_IOCTL(SOUND_PCM_READ_FILTER
)
2284 /* Big C for sound/OSS */
2285 COMPATIBLE_IOCTL(SNDCTL_COPR_RESET
)
2286 COMPATIBLE_IOCTL(SNDCTL_COPR_LOAD
)
2287 COMPATIBLE_IOCTL(SNDCTL_COPR_RDATA
)
2288 COMPATIBLE_IOCTL(SNDCTL_COPR_RCODE
)
2289 COMPATIBLE_IOCTL(SNDCTL_COPR_WDATA
)
2290 COMPATIBLE_IOCTL(SNDCTL_COPR_WCODE
)
2291 COMPATIBLE_IOCTL(SNDCTL_COPR_RUN
)
2292 COMPATIBLE_IOCTL(SNDCTL_COPR_HALT
)
2293 COMPATIBLE_IOCTL(SNDCTL_COPR_SENDMSG
)
2294 COMPATIBLE_IOCTL(SNDCTL_COPR_RCVMSG
)
2295 /* Big M for sound/OSS */
2296 COMPATIBLE_IOCTL(SOUND_MIXER_READ_VOLUME
)
2297 COMPATIBLE_IOCTL(SOUND_MIXER_READ_BASS
)
2298 COMPATIBLE_IOCTL(SOUND_MIXER_READ_TREBLE
)
2299 COMPATIBLE_IOCTL(SOUND_MIXER_READ_SYNTH
)
2300 COMPATIBLE_IOCTL(SOUND_MIXER_READ_PCM
)
2301 COMPATIBLE_IOCTL(SOUND_MIXER_READ_SPEAKER
)
2302 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE
)
2303 COMPATIBLE_IOCTL(SOUND_MIXER_READ_MIC
)
2304 COMPATIBLE_IOCTL(SOUND_MIXER_READ_CD
)
2305 COMPATIBLE_IOCTL(SOUND_MIXER_READ_IMIX
)
2306 COMPATIBLE_IOCTL(SOUND_MIXER_READ_ALTPCM
)
2307 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECLEV
)
2308 COMPATIBLE_IOCTL(SOUND_MIXER_READ_IGAIN
)
2309 COMPATIBLE_IOCTL(SOUND_MIXER_READ_OGAIN
)
2310 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE1
)
2311 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE2
)
2312 COMPATIBLE_IOCTL(SOUND_MIXER_READ_LINE3
)
2313 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL1
))
2314 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL2
))
2315 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_DIGITAL3
))
2316 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEIN
))
2317 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_PHONEOUT
))
2318 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_VIDEO
))
2319 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_RADIO
))
2320 COMPATIBLE_IOCTL(MIXER_READ(SOUND_MIXER_MONITOR
))
2321 COMPATIBLE_IOCTL(SOUND_MIXER_READ_MUTE
)
2322 /* SOUND_MIXER_READ_ENHANCE, same value as READ_MUTE */
2323 /* SOUND_MIXER_READ_LOUD, same value as READ_MUTE */
2324 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECSRC
)
2325 COMPATIBLE_IOCTL(SOUND_MIXER_READ_DEVMASK
)
2326 COMPATIBLE_IOCTL(SOUND_MIXER_READ_RECMASK
)
2327 COMPATIBLE_IOCTL(SOUND_MIXER_READ_STEREODEVS
)
2328 COMPATIBLE_IOCTL(SOUND_MIXER_READ_CAPS
)
2329 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_VOLUME
)
2330 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_BASS
)
2331 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_TREBLE
)
2332 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SYNTH
)
2333 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_PCM
)
2334 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_SPEAKER
)
2335 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE
)
2336 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MIC
)
2337 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_CD
)
2338 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IMIX
)
2339 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_ALTPCM
)
2340 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECLEV
)
2341 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_IGAIN
)
2342 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_OGAIN
)
2343 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE1
)
2344 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE2
)
2345 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_LINE3
)
2346 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL1
))
2347 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL2
))
2348 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_DIGITAL3
))
2349 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEIN
))
2350 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_PHONEOUT
))
2351 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_VIDEO
))
2352 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_RADIO
))
2353 COMPATIBLE_IOCTL(MIXER_WRITE(SOUND_MIXER_MONITOR
))
2354 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_MUTE
)
2355 /* SOUND_MIXER_WRITE_ENHANCE, same value as WRITE_MUTE */
2356 /* SOUND_MIXER_WRITE_LOUD, same value as WRITE_MUTE */
2357 COMPATIBLE_IOCTL(SOUND_MIXER_WRITE_RECSRC
)
2358 COMPATIBLE_IOCTL(SOUND_MIXER_INFO
)
2359 COMPATIBLE_IOCTL(SOUND_OLD_MIXER_INFO
)
2360 COMPATIBLE_IOCTL(SOUND_MIXER_ACCESS
)
2361 COMPATIBLE_IOCTL(SOUND_MIXER_AGC
)
2362 COMPATIBLE_IOCTL(SOUND_MIXER_3DSE
)
2363 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE1
)
2364 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE2
)
2365 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE3
)
2366 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE4
)
2367 COMPATIBLE_IOCTL(SOUND_MIXER_PRIVATE5
)
2368 COMPATIBLE_IOCTL(SOUND_MIXER_GETLEVELS
)
2369 COMPATIBLE_IOCTL(SOUND_MIXER_SETLEVELS
)
2370 COMPATIBLE_IOCTL(OSS_GETVERSION
)
2372 ULONG_IOCTL(AUTOFS_IOC_READY
)
2373 ULONG_IOCTL(AUTOFS_IOC_FAIL
)
2374 COMPATIBLE_IOCTL(AUTOFS_IOC_CATATONIC
)
2375 COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOVER
)
2376 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE
)
2377 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI
)
2378 COMPATIBLE_IOCTL(AUTOFS_IOC_PROTOSUBVER
)
2379 COMPATIBLE_IOCTL(AUTOFS_IOC_ASKREGHOST
)
2380 COMPATIBLE_IOCTL(AUTOFS_IOC_TOGGLEREGHOST
)
2381 COMPATIBLE_IOCTL(AUTOFS_IOC_ASKUMOUNT
)
2383 COMPATIBLE_IOCTL(RAW_SETBIND
)
2384 COMPATIBLE_IOCTL(RAW_GETBIND
)
2385 /* SMB ioctls which do not need any translations */
2386 COMPATIBLE_IOCTL(SMB_IOC_NEWCONN
)
2388 COMPATIBLE_IOCTL(ATMSIGD_CTRL
)
2389 COMPATIBLE_IOCTL(ATMARPD_CTRL
)
2390 COMPATIBLE_IOCTL(ATMLEC_CTRL
)
2391 COMPATIBLE_IOCTL(ATMLEC_MCAST
)
2392 COMPATIBLE_IOCTL(ATMLEC_DATA
)
2393 COMPATIBLE_IOCTL(ATM_SETSC
)
2394 COMPATIBLE_IOCTL(SIOCSIFATMTCP
)
2395 COMPATIBLE_IOCTL(SIOCMKCLIP
)
2396 COMPATIBLE_IOCTL(ATMARP_MKIP
)
2397 COMPATIBLE_IOCTL(ATMARP_SETENTRY
)
2398 COMPATIBLE_IOCTL(ATMARP_ENCAP
)
2399 COMPATIBLE_IOCTL(ATMTCP_CREATE
)
2400 COMPATIBLE_IOCTL(ATMTCP_REMOVE
)
2401 COMPATIBLE_IOCTL(ATMMPC_CTRL
)
2402 COMPATIBLE_IOCTL(ATMMPC_DATA
)
2404 COMPATIBLE_IOCTL(WDIOC_GETSUPPORT
)
2405 COMPATIBLE_IOCTL(WDIOC_GETSTATUS
)
2406 COMPATIBLE_IOCTL(WDIOC_GETBOOTSTATUS
)
2407 COMPATIBLE_IOCTL(WDIOC_GETTEMP
)
2408 COMPATIBLE_IOCTL(WDIOC_SETOPTIONS
)
2409 COMPATIBLE_IOCTL(WDIOC_KEEPALIVE
)
2410 COMPATIBLE_IOCTL(WDIOC_SETTIMEOUT
)
2411 COMPATIBLE_IOCTL(WDIOC_GETTIMEOUT
)
2413 COMPATIBLE_IOCTL(RNDGETENTCNT
)
2414 COMPATIBLE_IOCTL(RNDADDTOENTCNT
)
2415 COMPATIBLE_IOCTL(RNDGETPOOL
)
2416 COMPATIBLE_IOCTL(RNDADDENTROPY
)
2417 COMPATIBLE_IOCTL(RNDZAPENTCNT
)
2418 COMPATIBLE_IOCTL(RNDCLEARPOOL
)
2420 COMPATIBLE_IOCTL(HCIDEVUP
)
2421 COMPATIBLE_IOCTL(HCIDEVDOWN
)
2422 COMPATIBLE_IOCTL(HCIDEVRESET
)
2423 COMPATIBLE_IOCTL(HCIDEVRESTAT
)
2424 COMPATIBLE_IOCTL(HCIGETDEVLIST
)
2425 COMPATIBLE_IOCTL(HCIGETDEVINFO
)
2426 COMPATIBLE_IOCTL(HCIGETCONNLIST
)
2427 COMPATIBLE_IOCTL(HCIGETCONNINFO
)
2428 COMPATIBLE_IOCTL(HCISETRAW
)
2429 COMPATIBLE_IOCTL(HCISETSCAN
)
2430 COMPATIBLE_IOCTL(HCISETAUTH
)
2431 COMPATIBLE_IOCTL(HCISETENCRYPT
)
2432 COMPATIBLE_IOCTL(HCISETPTYPE
)
2433 COMPATIBLE_IOCTL(HCISETLINKPOL
)
2434 COMPATIBLE_IOCTL(HCISETLINKMODE
)
2435 COMPATIBLE_IOCTL(HCISETACLMTU
)
2436 COMPATIBLE_IOCTL(HCISETSCOMTU
)
2437 COMPATIBLE_IOCTL(HCIINQUIRY
)
2438 COMPATIBLE_IOCTL(HCIUARTSETPROTO
)
2439 COMPATIBLE_IOCTL(HCIUARTGETPROTO
)
2440 COMPATIBLE_IOCTL(RFCOMMCREATEDEV
)
2441 COMPATIBLE_IOCTL(RFCOMMRELEASEDEV
)
2442 COMPATIBLE_IOCTL(RFCOMMGETDEVLIST
)
2443 COMPATIBLE_IOCTL(RFCOMMGETDEVINFO
)
2444 COMPATIBLE_IOCTL(RFCOMMSTEALDLC
)
2445 COMPATIBLE_IOCTL(BNEPCONNADD
)
2446 COMPATIBLE_IOCTL(BNEPCONNDEL
)
2447 COMPATIBLE_IOCTL(BNEPGETCONNLIST
)
2448 COMPATIBLE_IOCTL(BNEPGETCONNINFO
)
2449 COMPATIBLE_IOCTL(CMTPCONNADD
)
2450 COMPATIBLE_IOCTL(CMTPCONNDEL
)
2451 COMPATIBLE_IOCTL(CMTPGETCONNLIST
)
2452 COMPATIBLE_IOCTL(CMTPGETCONNINFO
)
2453 COMPATIBLE_IOCTL(HIDPCONNADD
)
2454 COMPATIBLE_IOCTL(HIDPCONNDEL
)
2455 COMPATIBLE_IOCTL(HIDPGETCONNLIST
)
2456 COMPATIBLE_IOCTL(HIDPGETCONNINFO
)
2458 COMPATIBLE_IOCTL(CAPI_REGISTER
)
2459 COMPATIBLE_IOCTL(CAPI_GET_MANUFACTURER
)
2460 COMPATIBLE_IOCTL(CAPI_GET_VERSION
)
2461 COMPATIBLE_IOCTL(CAPI_GET_SERIAL
)
2462 COMPATIBLE_IOCTL(CAPI_GET_PROFILE
)
2463 COMPATIBLE_IOCTL(CAPI_MANUFACTURER_CMD
)
2464 COMPATIBLE_IOCTL(CAPI_GET_ERRCODE
)
2465 COMPATIBLE_IOCTL(CAPI_INSTALLED
)
2466 COMPATIBLE_IOCTL(CAPI_GET_FLAGS
)
2467 COMPATIBLE_IOCTL(CAPI_SET_FLAGS
)
2468 COMPATIBLE_IOCTL(CAPI_CLR_FLAGS
)
2469 COMPATIBLE_IOCTL(CAPI_NCCI_OPENCOUNT
)
2470 COMPATIBLE_IOCTL(CAPI_NCCI_GETUNIT
)
2471 /* Siemens Gigaset */
2472 COMPATIBLE_IOCTL(GIGASET_REDIR
)
2473 COMPATIBLE_IOCTL(GIGASET_CONFIG
)
2474 COMPATIBLE_IOCTL(GIGASET_BRKCHARS
)
2475 COMPATIBLE_IOCTL(GIGASET_VERSION
)
2477 COMPATIBLE_IOCTL(0x41545900) /* ATYIO_CLKR */
2478 COMPATIBLE_IOCTL(0x41545901) /* ATYIO_CLKW */
2479 COMPATIBLE_IOCTL(PCIIOC_CONTROLLER
)
2480 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_IO
)
2481 COMPATIBLE_IOCTL(PCIIOC_MMAP_IS_MEM
)
2482 COMPATIBLE_IOCTL(PCIIOC_WRITE_COMBINE
)
2484 COMPATIBLE_IOCTL(USBDEVFS_RESETEP
)
2485 COMPATIBLE_IOCTL(USBDEVFS_SETINTERFACE
)
2486 COMPATIBLE_IOCTL(USBDEVFS_SETCONFIGURATION
)
2487 COMPATIBLE_IOCTL(USBDEVFS_GETDRIVER
)
2488 COMPATIBLE_IOCTL(USBDEVFS_DISCARDURB
)
2489 COMPATIBLE_IOCTL(USBDEVFS_CLAIMINTERFACE
)
2490 COMPATIBLE_IOCTL(USBDEVFS_RELEASEINTERFACE
)
2491 COMPATIBLE_IOCTL(USBDEVFS_CONNECTINFO
)
2492 COMPATIBLE_IOCTL(USBDEVFS_HUB_PORTINFO
)
2493 COMPATIBLE_IOCTL(USBDEVFS_RESET
)
2494 COMPATIBLE_IOCTL(USBDEVFS_SUBMITURB32
)
2495 COMPATIBLE_IOCTL(USBDEVFS_REAPURB32
)
2496 COMPATIBLE_IOCTL(USBDEVFS_REAPURBNDELAY32
)
2497 COMPATIBLE_IOCTL(USBDEVFS_CLEAR_HALT
)
2499 COMPATIBLE_IOCTL(MEMGETINFO
)
2500 COMPATIBLE_IOCTL(MEMERASE
)
2501 COMPATIBLE_IOCTL(MEMLOCK
)
2502 COMPATIBLE_IOCTL(MEMUNLOCK
)
2503 COMPATIBLE_IOCTL(MEMGETREGIONCOUNT
)
2504 COMPATIBLE_IOCTL(MEMGETREGIONINFO
)
2505 COMPATIBLE_IOCTL(MEMGETBADBLOCK
)
2506 COMPATIBLE_IOCTL(MEMSETBADBLOCK
)
2508 ULONG_IOCTL(NBD_SET_SOCK
)
2509 ULONG_IOCTL(NBD_SET_BLKSIZE
)
2510 ULONG_IOCTL(NBD_SET_SIZE
)
2511 COMPATIBLE_IOCTL(NBD_DO_IT
)
2512 COMPATIBLE_IOCTL(NBD_CLEAR_SOCK
)
2513 COMPATIBLE_IOCTL(NBD_CLEAR_QUE
)
2514 COMPATIBLE_IOCTL(NBD_PRINT_DEBUG
)
2515 ULONG_IOCTL(NBD_SET_SIZE_BLOCKS
)
2516 COMPATIBLE_IOCTL(NBD_DISCONNECT
)
2518 COMPATIBLE_IOCTL(I2C_SLAVE
)
2519 COMPATIBLE_IOCTL(I2C_SLAVE_FORCE
)
2520 COMPATIBLE_IOCTL(I2C_TENBIT
)
2521 COMPATIBLE_IOCTL(I2C_PEC
)
2522 COMPATIBLE_IOCTL(I2C_RETRIES
)
2523 COMPATIBLE_IOCTL(I2C_TIMEOUT
)
2525 COMPATIBLE_IOCTL(SIOCSIWCOMMIT
)
2526 COMPATIBLE_IOCTL(SIOCGIWNAME
)
2527 COMPATIBLE_IOCTL(SIOCSIWNWID
)
2528 COMPATIBLE_IOCTL(SIOCGIWNWID
)
2529 COMPATIBLE_IOCTL(SIOCSIWFREQ
)
2530 COMPATIBLE_IOCTL(SIOCGIWFREQ
)
2531 COMPATIBLE_IOCTL(SIOCSIWMODE
)
2532 COMPATIBLE_IOCTL(SIOCGIWMODE
)
2533 COMPATIBLE_IOCTL(SIOCSIWSENS
)
2534 COMPATIBLE_IOCTL(SIOCGIWSENS
)
2535 COMPATIBLE_IOCTL(SIOCSIWRANGE
)
2536 COMPATIBLE_IOCTL(SIOCSIWPRIV
)
2537 COMPATIBLE_IOCTL(SIOCSIWSTATS
)
2538 COMPATIBLE_IOCTL(SIOCSIWAP
)
2539 COMPATIBLE_IOCTL(SIOCGIWAP
)
2540 COMPATIBLE_IOCTL(SIOCSIWRATE
)
2541 COMPATIBLE_IOCTL(SIOCGIWRATE
)
2542 COMPATIBLE_IOCTL(SIOCSIWRTS
)
2543 COMPATIBLE_IOCTL(SIOCGIWRTS
)
2544 COMPATIBLE_IOCTL(SIOCSIWFRAG
)
2545 COMPATIBLE_IOCTL(SIOCGIWFRAG
)
2546 COMPATIBLE_IOCTL(SIOCSIWTXPOW
)
2547 COMPATIBLE_IOCTL(SIOCGIWTXPOW
)
2548 COMPATIBLE_IOCTL(SIOCSIWRETRY
)
2549 COMPATIBLE_IOCTL(SIOCGIWRETRY
)
2550 COMPATIBLE_IOCTL(SIOCSIWPOWER
)
2551 COMPATIBLE_IOCTL(SIOCGIWPOWER
)
2552 COMPATIBLE_IOCTL(SIOCSIWAUTH
)
2553 COMPATIBLE_IOCTL(SIOCGIWAUTH
)
2555 COMPATIBLE_IOCTL(HIDIOCGVERSION
)
2556 COMPATIBLE_IOCTL(HIDIOCAPPLICATION
)
2557 COMPATIBLE_IOCTL(HIDIOCGDEVINFO
)
2558 COMPATIBLE_IOCTL(HIDIOCGSTRING
)
2559 COMPATIBLE_IOCTL(HIDIOCINITREPORT
)
2560 COMPATIBLE_IOCTL(HIDIOCGREPORT
)
2561 COMPATIBLE_IOCTL(HIDIOCSREPORT
)
2562 COMPATIBLE_IOCTL(HIDIOCGREPORTINFO
)
2563 COMPATIBLE_IOCTL(HIDIOCGFIELDINFO
)
2564 COMPATIBLE_IOCTL(HIDIOCGUSAGE
)
2565 COMPATIBLE_IOCTL(HIDIOCSUSAGE
)
2566 COMPATIBLE_IOCTL(HIDIOCGUCODE
)
2567 COMPATIBLE_IOCTL(HIDIOCGFLAG
)
2568 COMPATIBLE_IOCTL(HIDIOCSFLAG
)
2569 COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINDEX
)
2570 COMPATIBLE_IOCTL(HIDIOCGCOLLECTIONINFO
)
2572 COMPATIBLE_IOCTL(AUDIO_STOP
)
2573 COMPATIBLE_IOCTL(AUDIO_PLAY
)
2574 COMPATIBLE_IOCTL(AUDIO_PAUSE
)
2575 COMPATIBLE_IOCTL(AUDIO_CONTINUE
)
2576 COMPATIBLE_IOCTL(AUDIO_SELECT_SOURCE
)
2577 COMPATIBLE_IOCTL(AUDIO_SET_MUTE
)
2578 COMPATIBLE_IOCTL(AUDIO_SET_AV_SYNC
)
2579 COMPATIBLE_IOCTL(AUDIO_SET_BYPASS_MODE
)
2580 COMPATIBLE_IOCTL(AUDIO_CHANNEL_SELECT
)
2581 COMPATIBLE_IOCTL(AUDIO_GET_STATUS
)
2582 COMPATIBLE_IOCTL(AUDIO_GET_CAPABILITIES
)
2583 COMPATIBLE_IOCTL(AUDIO_CLEAR_BUFFER
)
2584 COMPATIBLE_IOCTL(AUDIO_SET_ID
)
2585 COMPATIBLE_IOCTL(AUDIO_SET_MIXER
)
2586 COMPATIBLE_IOCTL(AUDIO_SET_STREAMTYPE
)
2587 COMPATIBLE_IOCTL(AUDIO_SET_EXT_ID
)
2588 COMPATIBLE_IOCTL(AUDIO_SET_ATTRIBUTES
)
2589 COMPATIBLE_IOCTL(AUDIO_SET_KARAOKE
)
2590 COMPATIBLE_IOCTL(DMX_START
)
2591 COMPATIBLE_IOCTL(DMX_STOP
)
2592 COMPATIBLE_IOCTL(DMX_SET_FILTER
)
2593 COMPATIBLE_IOCTL(DMX_SET_PES_FILTER
)
2594 COMPATIBLE_IOCTL(DMX_SET_BUFFER_SIZE
)
2595 COMPATIBLE_IOCTL(DMX_GET_PES_PIDS
)
2596 COMPATIBLE_IOCTL(DMX_GET_CAPS
)
2597 COMPATIBLE_IOCTL(DMX_SET_SOURCE
)
2598 COMPATIBLE_IOCTL(DMX_GET_STC
)
2599 COMPATIBLE_IOCTL(FE_GET_INFO
)
2600 COMPATIBLE_IOCTL(FE_DISEQC_RESET_OVERLOAD
)
2601 COMPATIBLE_IOCTL(FE_DISEQC_SEND_MASTER_CMD
)
2602 COMPATIBLE_IOCTL(FE_DISEQC_RECV_SLAVE_REPLY
)
2603 COMPATIBLE_IOCTL(FE_DISEQC_SEND_BURST
)
2604 COMPATIBLE_IOCTL(FE_SET_TONE
)
2605 COMPATIBLE_IOCTL(FE_SET_VOLTAGE
)
2606 COMPATIBLE_IOCTL(FE_ENABLE_HIGH_LNB_VOLTAGE
)
2607 COMPATIBLE_IOCTL(FE_READ_STATUS
)
2608 COMPATIBLE_IOCTL(FE_READ_BER
)
2609 COMPATIBLE_IOCTL(FE_READ_SIGNAL_STRENGTH
)
2610 COMPATIBLE_IOCTL(FE_READ_SNR
)
2611 COMPATIBLE_IOCTL(FE_READ_UNCORRECTED_BLOCKS
)
2612 COMPATIBLE_IOCTL(FE_SET_FRONTEND
)
2613 COMPATIBLE_IOCTL(FE_GET_FRONTEND
)
2614 COMPATIBLE_IOCTL(FE_GET_EVENT
)
2615 COMPATIBLE_IOCTL(FE_DISHNETWORK_SEND_LEGACY_CMD
)
2616 COMPATIBLE_IOCTL(VIDEO_STOP
)
2617 COMPATIBLE_IOCTL(VIDEO_PLAY
)
2618 COMPATIBLE_IOCTL(VIDEO_FREEZE
)
2619 COMPATIBLE_IOCTL(VIDEO_CONTINUE
)
2620 COMPATIBLE_IOCTL(VIDEO_SELECT_SOURCE
)
2621 COMPATIBLE_IOCTL(VIDEO_SET_BLANK
)
2622 COMPATIBLE_IOCTL(VIDEO_GET_STATUS
)
2623 COMPATIBLE_IOCTL(VIDEO_SET_DISPLAY_FORMAT
)
2624 COMPATIBLE_IOCTL(VIDEO_FAST_FORWARD
)
2625 COMPATIBLE_IOCTL(VIDEO_SLOWMOTION
)
2626 COMPATIBLE_IOCTL(VIDEO_GET_CAPABILITIES
)
2627 COMPATIBLE_IOCTL(VIDEO_CLEAR_BUFFER
)
2628 COMPATIBLE_IOCTL(VIDEO_SET_ID
)
2629 COMPATIBLE_IOCTL(VIDEO_SET_STREAMTYPE
)
2630 COMPATIBLE_IOCTL(VIDEO_SET_FORMAT
)
2631 COMPATIBLE_IOCTL(VIDEO_SET_SYSTEM
)
2632 COMPATIBLE_IOCTL(VIDEO_SET_HIGHLIGHT
)
2633 COMPATIBLE_IOCTL(VIDEO_SET_SPU
)
2634 COMPATIBLE_IOCTL(VIDEO_GET_NAVI
)
2635 COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES
)
2636 COMPATIBLE_IOCTL(VIDEO_GET_SIZE
)
2637 COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE
)
2639 /* now things that need handlers */
2640 HANDLE_IOCTL(MEMREADOOB32
, mtd_rw_oob
)
2641 HANDLE_IOCTL(MEMWRITEOOB32
, mtd_rw_oob
)
2643 HANDLE_IOCTL(SIOCGIFNAME
, dev_ifname32
)
2644 HANDLE_IOCTL(SIOCGIFCONF
, dev_ifconf
)
2645 HANDLE_IOCTL(SIOCGIFFLAGS
, dev_ifsioc
)
2646 HANDLE_IOCTL(SIOCSIFFLAGS
, dev_ifsioc
)
2647 HANDLE_IOCTL(SIOCGIFMETRIC
, dev_ifsioc
)
2648 HANDLE_IOCTL(SIOCSIFMETRIC
, dev_ifsioc
)
2649 HANDLE_IOCTL(SIOCGIFMTU
, dev_ifsioc
)
2650 HANDLE_IOCTL(SIOCSIFMTU
, dev_ifsioc
)
2651 HANDLE_IOCTL(SIOCGIFMEM
, dev_ifsioc
)
2652 HANDLE_IOCTL(SIOCSIFMEM
, dev_ifsioc
)
2653 HANDLE_IOCTL(SIOCGIFHWADDR
, dev_ifsioc
)
2654 HANDLE_IOCTL(SIOCSIFHWADDR
, dev_ifsioc
)
2655 HANDLE_IOCTL(SIOCADDMULTI
, dev_ifsioc
)
2656 HANDLE_IOCTL(SIOCDELMULTI
, dev_ifsioc
)
2657 HANDLE_IOCTL(SIOCGIFINDEX
, dev_ifsioc
)
2658 HANDLE_IOCTL(SIOCGIFMAP
, dev_ifsioc
)
2659 HANDLE_IOCTL(SIOCSIFMAP
, dev_ifsioc
)
2660 HANDLE_IOCTL(SIOCGIFADDR
, dev_ifsioc
)
2661 HANDLE_IOCTL(SIOCSIFADDR
, dev_ifsioc
)
2662 HANDLE_IOCTL(SIOCSIFHWBROADCAST
, dev_ifsioc
)
2664 /* ioctls used by appletalk ddp.c */
2665 HANDLE_IOCTL(SIOCATALKDIFADDR
, dev_ifsioc
)
2666 HANDLE_IOCTL(SIOCDIFADDR
, dev_ifsioc
)
2667 HANDLE_IOCTL(SIOCSARP
, dev_ifsioc
)
2668 HANDLE_IOCTL(SIOCDARP
, dev_ifsioc
)
2670 HANDLE_IOCTL(SIOCGIFBRDADDR
, dev_ifsioc
)
2671 HANDLE_IOCTL(SIOCSIFBRDADDR
, dev_ifsioc
)
2672 HANDLE_IOCTL(SIOCGIFDSTADDR
, dev_ifsioc
)
2673 HANDLE_IOCTL(SIOCSIFDSTADDR
, dev_ifsioc
)
2674 HANDLE_IOCTL(SIOCGIFNETMASK
, dev_ifsioc
)
2675 HANDLE_IOCTL(SIOCSIFNETMASK
, dev_ifsioc
)
2676 HANDLE_IOCTL(SIOCSIFPFLAGS
, dev_ifsioc
)
2677 HANDLE_IOCTL(SIOCGIFPFLAGS
, dev_ifsioc
)
2678 HANDLE_IOCTL(SIOCGIFTXQLEN
, dev_ifsioc
)
2679 HANDLE_IOCTL(SIOCSIFTXQLEN
, dev_ifsioc
)
2680 HANDLE_IOCTL(TUNSETIFF
, dev_ifsioc
)
2681 HANDLE_IOCTL(SIOCETHTOOL
, ethtool_ioctl
)
2682 HANDLE_IOCTL(SIOCBONDENSLAVE
, bond_ioctl
)
2683 HANDLE_IOCTL(SIOCBONDRELEASE
, bond_ioctl
)
2684 HANDLE_IOCTL(SIOCBONDSETHWADDR
, bond_ioctl
)
2685 HANDLE_IOCTL(SIOCBONDSLAVEINFOQUERY
, bond_ioctl
)
2686 HANDLE_IOCTL(SIOCBONDINFOQUERY
, bond_ioctl
)
2687 HANDLE_IOCTL(SIOCBONDCHANGEACTIVE
, bond_ioctl
)
2688 HANDLE_IOCTL(SIOCADDRT
, routing_ioctl
)
2689 HANDLE_IOCTL(SIOCDELRT
, routing_ioctl
)
2690 HANDLE_IOCTL(SIOCBRADDIF
, dev_ifsioc
)
2691 HANDLE_IOCTL(SIOCBRDELIF
, dev_ifsioc
)
2692 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
2693 HANDLE_IOCTL(SIOCRTMSG
, ret_einval
)
2694 HANDLE_IOCTL(SIOCGSTAMP
, do_siocgstamp
)
2695 HANDLE_IOCTL(SIOCGSTAMPNS
, do_siocgstampns
)
2698 HANDLE_IOCTL(SG_IO
,sg_ioctl_trans
)
2699 HANDLE_IOCTL(SG_GET_REQUEST_TABLE
, sg_grt_trans
)
2701 HANDLE_IOCTL(PPPIOCGIDLE32
, ppp_ioctl_trans
)
2702 HANDLE_IOCTL(PPPIOCSCOMPRESS32
, ppp_ioctl_trans
)
2703 HANDLE_IOCTL(PPPIOCSPASS32
, ppp_sock_fprog_ioctl_trans
)
2704 HANDLE_IOCTL(PPPIOCSACTIVE32
, ppp_sock_fprog_ioctl_trans
)
2706 HANDLE_IOCTL(MTIOCGET32
, mt_ioctl_trans
)
2707 HANDLE_IOCTL(MTIOCPOS32
, mt_ioctl_trans
)
2709 #define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,unsigned int)
2710 HANDLE_IOCTL(AUTOFS_IOC_SETTIMEOUT32
, ioc_settimeout
)
2712 HANDLE_IOCTL(PIO_FONTX
, do_fontx_ioctl
)
2713 HANDLE_IOCTL(GIO_FONTX
, do_fontx_ioctl
)
2714 HANDLE_IOCTL(PIO_UNIMAP
, do_unimap_ioctl
)
2715 HANDLE_IOCTL(GIO_UNIMAP
, do_unimap_ioctl
)
2716 HANDLE_IOCTL(KDFONTOP
, do_kdfontop_ioctl
)
2718 /* One SMB ioctl needs translations. */
2719 #define SMB_IOC_GETMOUNTUID_32 _IOR('u', 1, compat_uid_t)
2720 HANDLE_IOCTL(SMB_IOC_GETMOUNTUID_32
, do_smb_getmountuid
)
2721 HANDLE_IOCTL(ATM_GETLINKRATE32
, do_atm_ioctl
)
2722 HANDLE_IOCTL(ATM_GETNAMES32
, do_atm_ioctl
)
2723 HANDLE_IOCTL(ATM_GETTYPE32
, do_atm_ioctl
)
2724 HANDLE_IOCTL(ATM_GETESI32
, do_atm_ioctl
)
2725 HANDLE_IOCTL(ATM_GETADDR32
, do_atm_ioctl
)
2726 HANDLE_IOCTL(ATM_RSTADDR32
, do_atm_ioctl
)
2727 HANDLE_IOCTL(ATM_ADDADDR32
, do_atm_ioctl
)
2728 HANDLE_IOCTL(ATM_DELADDR32
, do_atm_ioctl
)
2729 HANDLE_IOCTL(ATM_GETCIRANGE32
, do_atm_ioctl
)
2730 HANDLE_IOCTL(ATM_SETCIRANGE32
, do_atm_ioctl
)
2731 HANDLE_IOCTL(ATM_SETESI32
, do_atm_ioctl
)
2732 HANDLE_IOCTL(ATM_SETESIF32
, do_atm_ioctl
)
2733 HANDLE_IOCTL(ATM_GETSTAT32
, do_atm_ioctl
)
2734 HANDLE_IOCTL(ATM_GETSTATZ32
, do_atm_ioctl
)
2735 HANDLE_IOCTL(ATM_GETLOOP32
, do_atm_ioctl
)
2736 HANDLE_IOCTL(ATM_SETLOOP32
, do_atm_ioctl
)
2737 HANDLE_IOCTL(ATM_QUERYLOOP32
, do_atm_ioctl
)
2738 HANDLE_IOCTL(SONET_GETSTAT
, do_atm_ioctl
)
2739 HANDLE_IOCTL(SONET_GETSTATZ
, do_atm_ioctl
)
2740 HANDLE_IOCTL(SONET_GETDIAG
, do_atm_ioctl
)
2741 HANDLE_IOCTL(SONET_SETDIAG
, do_atm_ioctl
)
2742 HANDLE_IOCTL(SONET_CLRDIAG
, do_atm_ioctl
)
2743 HANDLE_IOCTL(SONET_SETFRAMING
, do_atm_ioctl
)
2744 HANDLE_IOCTL(SONET_GETFRAMING
, do_atm_ioctl
)
2745 HANDLE_IOCTL(SONET_GETFRSENSE
, do_atm_ioctl
)
2749 HANDLE_IOCTL(RAW_SETBIND
, raw_ioctl
)
2750 HANDLE_IOCTL(RAW_GETBIND
, raw_ioctl
)
2753 HANDLE_IOCTL(TIOCGSERIAL
, serial_struct_ioctl
)
2754 HANDLE_IOCTL(TIOCSSERIAL
, serial_struct_ioctl
)
2756 COMPATIBLE_IOCTL(TIOCGLTC
)
2757 COMPATIBLE_IOCTL(TIOCSLTC
)
2761 * For these two we have defintions in ioctls.h and/or termios.h on
2762 * some architectures but no actual implemention. Some applications
2763 * like bash call them if they are defined in the headers, so we provide
2764 * entries here to avoid syslog message spew.
2766 COMPATIBLE_IOCTL(TIOCSTART
)
2767 COMPATIBLE_IOCTL(TIOCSTOP
)
2770 HANDLE_IOCTL(USBDEVFS_CONTROL32
, do_usbdevfs_control
)
2771 HANDLE_IOCTL(USBDEVFS_BULK32
, do_usbdevfs_bulk
)
2772 HANDLE_IOCTL(USBDEVFS_DISCSIGNAL32
, do_usbdevfs_discsignal
)
2773 COMPATIBLE_IOCTL(USBDEVFS_IOCTL32
)
2775 HANDLE_IOCTL(I2C_FUNCS
, w_long
)
2776 HANDLE_IOCTL(I2C_RDWR
, do_i2c_rdwr_ioctl
)
2777 HANDLE_IOCTL(I2C_SMBUS
, do_i2c_smbus_ioctl
)
2779 HANDLE_IOCTL(SIOCGIWRANGE
, do_wireless_ioctl
)
2780 HANDLE_IOCTL(SIOCGIWPRIV
, do_wireless_ioctl
)
2781 HANDLE_IOCTL(SIOCGIWSTATS
, do_wireless_ioctl
)
2782 HANDLE_IOCTL(SIOCSIWSPY
, do_wireless_ioctl
)
2783 HANDLE_IOCTL(SIOCGIWSPY
, do_wireless_ioctl
)
2784 HANDLE_IOCTL(SIOCSIWTHRSPY
, do_wireless_ioctl
)
2785 HANDLE_IOCTL(SIOCGIWTHRSPY
, do_wireless_ioctl
)
2786 HANDLE_IOCTL(SIOCSIWMLME
, do_wireless_ioctl
)
2787 HANDLE_IOCTL(SIOCGIWAPLIST
, do_wireless_ioctl
)
2788 HANDLE_IOCTL(SIOCSIWSCAN
, do_wireless_ioctl
)
2789 HANDLE_IOCTL(SIOCGIWSCAN
, do_wireless_ioctl
)
2790 HANDLE_IOCTL(SIOCSIWESSID
, do_wireless_ioctl
)
2791 HANDLE_IOCTL(SIOCGIWESSID
, do_wireless_ioctl
)
2792 HANDLE_IOCTL(SIOCSIWNICKN
, do_wireless_ioctl
)
2793 HANDLE_IOCTL(SIOCGIWNICKN
, do_wireless_ioctl
)
2794 HANDLE_IOCTL(SIOCSIWENCODE
, do_wireless_ioctl
)
2795 HANDLE_IOCTL(SIOCGIWENCODE
, do_wireless_ioctl
)
2796 HANDLE_IOCTL(SIOCSIWGENIE
, do_wireless_ioctl
)
2797 HANDLE_IOCTL(SIOCGIWGENIE
, do_wireless_ioctl
)
2798 HANDLE_IOCTL(SIOCSIWENCODEEXT
, do_wireless_ioctl
)
2799 HANDLE_IOCTL(SIOCGIWENCODEEXT
, do_wireless_ioctl
)
2800 HANDLE_IOCTL(SIOCSIWPMKSA
, do_wireless_ioctl
)
2801 HANDLE_IOCTL(SIOCSIFBR
, old_bridge_ioctl
)
2802 HANDLE_IOCTL(SIOCGIFBR
, old_bridge_ioctl
)
2803 /* Not implemented in the native kernel */
2804 IGNORE_IOCTL(SIOCGIFCOUNT
)
2805 HANDLE_IOCTL(RTC_IRQP_READ32
, rtc_ioctl
)
2806 HANDLE_IOCTL(RTC_IRQP_SET32
, rtc_ioctl
)
2807 HANDLE_IOCTL(RTC_EPOCH_READ32
, rtc_ioctl
)
2808 HANDLE_IOCTL(RTC_EPOCH_SET32
, rtc_ioctl
)
2811 HANDLE_IOCTL(VIDEO_GET_EVENT
, do_video_get_event
)
2812 HANDLE_IOCTL(VIDEO_STILLPICTURE
, do_video_stillpicture
)
2813 HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE
, do_video_set_spu_palette
)
2816 COMPATIBLE_IOCTL(LPTIME
)
2817 COMPATIBLE_IOCTL(LPCHAR
)
2818 COMPATIBLE_IOCTL(LPABORTOPEN
)
2819 COMPATIBLE_IOCTL(LPCAREFUL
)
2820 COMPATIBLE_IOCTL(LPWAIT
)
2821 COMPATIBLE_IOCTL(LPSETIRQ
)
2822 COMPATIBLE_IOCTL(LPGETSTATUS
)
2823 COMPATIBLE_IOCTL(LPGETSTATUS
)
2824 COMPATIBLE_IOCTL(LPRESET
)
2825 /*LPGETSTATS not implemented, but no kernels seem to compile it in anyways*/
2826 COMPATIBLE_IOCTL(LPGETFLAGS
)
2827 HANDLE_IOCTL(LPSETTIMEOUT
, lp_timeout_trans
)
2829 /* fat 'r' ioctls. These are handled by fat with ->compat_ioctl,
2830 but we don't want warnings on other file systems. So declare
2831 them as compatible here. */
2832 #define VFAT_IOCTL_READDIR_BOTH32 _IOR('r', 1, struct compat_dirent[2])
2833 #define VFAT_IOCTL_READDIR_SHORT32 _IOR('r', 2, struct compat_dirent[2])
2835 IGNORE_IOCTL(VFAT_IOCTL_READDIR_BOTH32
)
2836 IGNORE_IOCTL(VFAT_IOCTL_READDIR_SHORT32
)
2839 IGNORE_IOCTL(LOOP_CLR_FD
)
2842 /* Sparc framebuffers, handled in sbusfb_compat_ioctl() */
2843 IGNORE_IOCTL(FBIOGTYPE
)
2844 IGNORE_IOCTL(FBIOSATTR
)
2845 IGNORE_IOCTL(FBIOGATTR
)
2846 IGNORE_IOCTL(FBIOSVIDEO
)
2847 IGNORE_IOCTL(FBIOGVIDEO
)
2848 IGNORE_IOCTL(FBIOSCURPOS
)
2849 IGNORE_IOCTL(FBIOGCURPOS
)
2850 IGNORE_IOCTL(FBIOGCURMAX
)
2851 IGNORE_IOCTL(FBIOPUTCMAP32
)
2852 IGNORE_IOCTL(FBIOGETCMAP32
)
2853 IGNORE_IOCTL(FBIOSCURSOR32
)
2854 IGNORE_IOCTL(FBIOGCURSOR32
)
2858 #define IOCTL_HASHSIZE 256
2859 static struct ioctl_trans
*ioctl32_hash_table
[IOCTL_HASHSIZE
];
2861 static inline unsigned long ioctl32_hash(unsigned long cmd
)
2863 return (((cmd
>> 6) ^ (cmd
>> 4) ^ cmd
)) % IOCTL_HASHSIZE
;
2866 static void compat_ioctl_error(struct file
*filp
, unsigned int fd
,
2867 unsigned int cmd
, unsigned long arg
)
2873 /* find the name of the device. */
2874 path
= (char *)__get_free_page(GFP_KERNEL
);
2876 fn
= d_path(filp
->f_path
.dentry
, filp
->f_path
.mnt
, path
, PAGE_SIZE
);
2881 sprintf(buf
,"'%c'", (cmd
>>_IOC_TYPESHIFT
) & _IOC_TYPEMASK
);
2882 if (!isprint(buf
[1]))
2883 sprintf(buf
, "%02x", buf
[1]);
2884 compat_printk("ioctl32(%s:%d): Unknown cmd fd(%d) "
2885 "cmd(%08x){t:%s;sz:%u} arg(%08x) on %s\n",
2886 current
->comm
, current
->pid
,
2887 (int)fd
, (unsigned int)cmd
, buf
,
2888 (cmd
>> _IOC_SIZESHIFT
) & _IOC_SIZEMASK
,
2889 (unsigned int)arg
, fn
);
2892 free_page((unsigned long)path
);
2895 asmlinkage
long compat_sys_ioctl(unsigned int fd
, unsigned int cmd
,
2900 struct ioctl_trans
*t
;
2903 filp
= fget_light(fd
, &fput_needed
);
2907 /* RED-PEN how should LSM module know it's handling 32bit? */
2908 error
= security_file_ioctl(filp
, cmd
, arg
);
2913 * To allow the compat_ioctl handlers to be self contained
2914 * we need to check the common ioctls here first.
2915 * Just handle them with the standard handlers below.
2928 if (S_ISREG(filp
->f_path
.dentry
->d_inode
->i_mode
))
2933 if (filp
->f_op
&& filp
->f_op
->compat_ioctl
) {
2934 error
= filp
->f_op
->compat_ioctl(filp
, cmd
, arg
);
2935 if (error
!= -ENOIOCTLCMD
)
2940 (!filp
->f_op
->ioctl
&& !filp
->f_op
->unlocked_ioctl
))
2945 for (t
= ioctl32_hash_table
[ioctl32_hash(cmd
)]; t
; t
= t
->next
) {
2951 if (S_ISSOCK(filp
->f_path
.dentry
->d_inode
->i_mode
) &&
2952 cmd
>= SIOCDEVPRIVATE
&& cmd
<= (SIOCDEVPRIVATE
+ 15)) {
2953 error
= siocdevprivate_ioctl(fd
, cmd
, arg
);
2960 compat_ioctl_error(filp
, fd
, cmd
, arg
);
2969 error
= t
->handler(fd
, cmd
, arg
, filp
);
2975 error
= vfs_ioctl(filp
, fd
, cmd
, arg
);
2977 fput_light(filp
, fput_needed
);
2982 static void ioctl32_insert_translation(struct ioctl_trans
*trans
)
2985 struct ioctl_trans
*t
;
2987 hash
= ioctl32_hash (trans
->cmd
);
2988 if (!ioctl32_hash_table
[hash
])
2989 ioctl32_hash_table
[hash
] = trans
;
2991 t
= ioctl32_hash_table
[hash
];
2999 static int __init
init_sys32_ioctl(void)
3003 for (i
= 0; i
< ARRAY_SIZE(ioctl_start
); i
++) {
3004 if (ioctl_start
[i
].next
) {
3005 printk("ioctl translation %d bad\n",i
);
3009 ioctl32_insert_translation(&ioctl_start
[i
]);
3013 __initcall(init_sys32_ioctl
);