blob: 03d03c6d3cbbea2cdce5b15f5988717220882d5e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 *
4 * S390 version
5 * Copyright (C) 2000-2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
6 * Author(s): Gerhard Tonn (ton@de.ibm.com)
7 * Arnd Bergmann (arndb@de.ibm.com)
8 *
9 * Original implementation from 32-bit Sparc compat code which is
10 * Copyright (C) 2000 Silicon Graphics, Inc.
11 * Written by Ulf Carlsson (ulfc@engr.sgi.com)
12 */
13
14#include "compat_linux.h"
15#define INCLUDES
16#define CODE
17#include "../../../fs/compat_ioctl.c"
18#include <asm/dasd.h>
Cornelia Huck4beb3702005-05-01 08:58:59 -070019#include <asm/cmb.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm/tape390.h>
21
22static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
23 unsigned long arg, struct file *f)
24{
25 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
26}
27
28static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
29 unsigned long arg, struct file *f)
30{
31 return sys_ioctl(fd, cmd, arg);
32}
33
34#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
35#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
36#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
37
38struct ioctl_trans ioctl_start[] = {
39/* architecture independent ioctls */
40#include <linux/compat_ioctl.h>
41#define DECLARES
42#include "../../../fs/compat_ioctl.c"
43
44/* s390 only ioctls */
45#if defined(CONFIG_DASD) || defined(CONFIG_DASD_MODULE)
46COMPATIBLE_IOCTL(DASDAPIVER)
47COMPATIBLE_IOCTL(BIODASDDISABLE)
48COMPATIBLE_IOCTL(BIODASDENABLE)
49COMPATIBLE_IOCTL(BIODASDRSRV)
50COMPATIBLE_IOCTL(BIODASDRLSE)
51COMPATIBLE_IOCTL(BIODASDSLCK)
52COMPATIBLE_IOCTL(BIODASDINFO)
53COMPATIBLE_IOCTL(BIODASDINFO2)
54COMPATIBLE_IOCTL(BIODASDFMT)
55COMPATIBLE_IOCTL(BIODASDPRRST)
56COMPATIBLE_IOCTL(BIODASDQUIESCE)
57COMPATIBLE_IOCTL(BIODASDRESUME)
58COMPATIBLE_IOCTL(BIODASDPRRD)
59COMPATIBLE_IOCTL(BIODASDPSRD)
60COMPATIBLE_IOCTL(BIODASDGATTR)
61COMPATIBLE_IOCTL(BIODASDSATTR)
Cornelia Huck4beb3702005-05-01 08:58:59 -070062#if defined(CONFIG_DASD_CMB) || defined(CONFIG_DASD_CMB_MODULE)
63COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
66#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#endif
68
69#if defined(CONFIG_S390_TAPE) || defined(CONFIG_S390_TAPE_MODULE)
70COMPATIBLE_IOCTL(TAPE390_DISPLAY)
71#endif
72
73/* s390 doesn't need handlers here */
74COMPATIBLE_IOCTL(TIOCGSERIAL)
75COMPATIBLE_IOCTL(TIOCSSERIAL)
76};
77
78int ioctl_table_size = ARRAY_SIZE(ioctl_start);