blob: 6504c4e69986783da98e0f27f26217587949dfe3 [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>
Richard Hitted3cb6f2005-10-30 15:00:10 -080021#include <asm/ccwdev.h>
22#include "../../../drivers/s390/char/raw3270.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070023
24static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
25 unsigned long arg, struct file *f)
26{
27 return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
28}
29
30static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
31 unsigned long arg, struct file *f)
32{
33 return sys_ioctl(fd, cmd, arg);
34}
35
36#define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
37#define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
38#define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
39
40struct ioctl_trans ioctl_start[] = {
41/* architecture independent ioctls */
42#include <linux/compat_ioctl.h>
43#define DECLARES
44#include "../../../fs/compat_ioctl.c"
45
46/* s390 only ioctls */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047COMPATIBLE_IOCTL(DASDAPIVER)
48COMPATIBLE_IOCTL(BIODASDDISABLE)
49COMPATIBLE_IOCTL(BIODASDENABLE)
50COMPATIBLE_IOCTL(BIODASDRSRV)
51COMPATIBLE_IOCTL(BIODASDRLSE)
52COMPATIBLE_IOCTL(BIODASDSLCK)
53COMPATIBLE_IOCTL(BIODASDINFO)
54COMPATIBLE_IOCTL(BIODASDINFO2)
55COMPATIBLE_IOCTL(BIODASDFMT)
56COMPATIBLE_IOCTL(BIODASDPRRST)
57COMPATIBLE_IOCTL(BIODASDQUIESCE)
58COMPATIBLE_IOCTL(BIODASDRESUME)
59COMPATIBLE_IOCTL(BIODASDPRRD)
60COMPATIBLE_IOCTL(BIODASDPSRD)
61COMPATIBLE_IOCTL(BIODASDGATTR)
62COMPATIBLE_IOCTL(BIODASDSATTR)
Cornelia Huck4beb3702005-05-01 08:58:59 -070063COMPATIBLE_IOCTL(BIODASDCMFENABLE)
64COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
65COMPATIBLE_IOCTL(BIODASDREADALLCMB)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
Richard Hitted3cb6f2005-10-30 15:00:10 -080067COMPATIBLE_IOCTL(TUBICMD)
68COMPATIBLE_IOCTL(TUBOCMD)
69COMPATIBLE_IOCTL(TUBGETI)
70COMPATIBLE_IOCTL(TUBGETO)
71COMPATIBLE_IOCTL(TUBSETMOD)
72COMPATIBLE_IOCTL(TUBGETMOD)
73
Linus Torvalds1da177e2005-04-16 15:20:36 -070074COMPATIBLE_IOCTL(TAPE390_DISPLAY)
Linus Torvalds1da177e2005-04-16 15:20:36 -070075
76/* s390 doesn't need handlers here */
77COMPATIBLE_IOCTL(TIOCGSERIAL)
78COMPATIBLE_IOCTL(TIOCSSERIAL)
79};
80
81int ioctl_table_size = ARRAY_SIZE(ioctl_start);