s390/fs3270: split header files
authorSven Schnelle <svens@linux.ibm.com>
Mon, 5 Dec 2022 12:20:46 +0000 (13:20 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:34:05 +0000 (14:34 +0100)
In order to use the fs3270 one would need at least the ioctl definitions
in uapi. Add two new include files in uapi, which contain:

fs3270: ioctl number declarations + returned struct for TUBGETMOD.
raw3270: all the orders, attributes and similar stuff used with 3270
terminals.

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/uapi/asm/fs3270.h [new file with mode: 0644]
arch/s390/include/uapi/asm/raw3270.h [new file with mode: 0644]
drivers/s390/char/fs3270.c
drivers/s390/char/raw3270.h

diff --git a/arch/s390/include/uapi/asm/fs3270.h b/arch/s390/include/uapi/asm/fs3270.h
new file mode 100644 (file)
index 0000000..c4bc110
--- /dev/null
@@ -0,0 +1,25 @@
+/* SPDX-License-Identifier:  GPL-2.0 WITH Linux-syscall-note */
+#ifndef __ASM_S390_UAPI_FS3270_H
+#define __ASM_S390_UAPI_FS3270_H
+
+#include <linux/types.h>
+#include <asm/ioctl.h>
+
+/* ioctls for fullscreen 3270 */
+#define TUBICMD                _IO('3', 3)     /* set ccw command for fs reads. */
+#define TUBOCMD                _IO('3', 4)     /* set ccw command for fs writes. */
+#define TUBGETI                _IO('3', 7)     /* get ccw command for fs reads. */
+#define TUBGETO                _IO('3', 8)     /* get ccw command for fs writes. */
+#define TUBGETMOD      _IO('3', 13)    /* get characteristics like model, cols, rows */
+
+/* For TUBGETMOD */
+struct raw3270_iocb {
+       __u16 model;
+       __u16 line_cnt;
+       __u16 col_cnt;
+       __u16 pf_cnt;
+       __u16 re_cnt;
+       __u16 map;
+};
+
+#endif /* __ASM_S390_UAPI_FS3270_H */
diff --git a/arch/s390/include/uapi/asm/raw3270.h b/arch/s390/include/uapi/asm/raw3270.h
new file mode 100644 (file)
index 0000000..6676f10
--- /dev/null
@@ -0,0 +1,75 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+#ifndef __ASM_S390_UAPI_RAW3270_H
+#define __ASM_S390_UAPI_RAW3270_H
+
+/* Local Channel Commands */
+#define TC_WRITE       0x01            /* Write */
+#define TC_RDBUF       0x02            /* Read Buffer */
+#define TC_EWRITE      0x05            /* Erase write */
+#define TC_READMOD     0x06            /* Read modified */
+#define TC_EWRITEA     0x0d            /* Erase write alternate */
+#define TC_WRITESF     0x11            /* Write structured field */
+
+/* Buffer Control Orders */
+#define TO_GE          0x08            /* Graphics Escape */
+#define TO_SF          0x1d            /* Start field */
+#define TO_SBA         0x11            /* Set buffer address */
+#define TO_IC          0x13            /* Insert cursor */
+#define TO_PT          0x05            /* Program tab */
+#define TO_RA          0x3c            /* Repeat to address */
+#define TO_SFE         0x29            /* Start field extended */
+#define TO_EUA         0x12            /* Erase unprotected to address */
+#define TO_MF          0x2c            /* Modify field */
+#define TO_SA          0x28            /* Set attribute */
+
+/* Field Attribute Bytes */
+#define TF_INPUT       0x40            /* Visible input */
+#define TF_INPUTN      0x4c            /* Invisible input */
+#define TF_INMDT       0xc1            /* Visible, Set-MDT */
+#define TF_LOG         0x60
+
+/* Character Attribute Bytes */
+#define TAT_RESET      0x00
+#define TAT_FIELD      0xc0
+#define TAT_EXTHI      0x41
+#define TAT_FGCOLOR    0x42
+#define TAT_CHARS      0x43
+#define TAT_BGCOLOR    0x45
+#define TAT_TRANS      0x46
+
+/* Extended-Highlighting Bytes */
+#define TAX_RESET      0x00
+#define TAX_BLINK      0xf1
+#define TAX_REVER      0xf2
+#define TAX_UNDER      0xf4
+
+/* Reset value */
+#define TAR_RESET      0x00
+
+/* Color values */
+#define TAC_RESET      0x00
+#define TAC_BLUE       0xf1
+#define TAC_RED                0xf2
+#define TAC_PINK       0xf3
+#define TAC_GREEN      0xf4
+#define TAC_TURQ       0xf5
+#define TAC_YELLOW     0xf6
+#define TAC_WHITE      0xf7
+#define TAC_DEFAULT    0x00
+
+/* Write Control Characters */
+#define TW_NONE                0x40            /* No particular action */
+#define TW_KR          0xc2            /* Keyboard restore */
+#define TW_PLUSALARM   0x04            /* Add this bit for alarm */
+
+#define RAW3270_FIRSTMINOR     1       /* First minor number */
+#define RAW3270_MAXDEVS                255     /* Max number of 3270 devices */
+
+#define AID_CLEAR              0x6d
+#define AID_ENTER              0x7d
+#define AID_PF3                        0xf3
+#define AID_PF7                        0xf7
+#define AID_PF8                        0xf8
+#define AID_READ_PARTITION     0x88
+
+#endif /* __ASM_S390_UAPI_RAW3270_H */
index aff38db1aa406a58dc102f04804dc84f4bf995a8..4f26b0a55620fcd7b6fdb89075d9235e41c78f5b 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 #include <linux/types.h>
 
+#include <uapi/asm/fs3270.h>
 #include <asm/ccwdev.h>
 #include <asm/cio.h>
 #include <asm/ebcdic.h>
index e8c71ef7bfa05e1e9d339e1dd0a40a4cc2515244..b1beecc7a0a94acbd30f86dd9983a21f730144ce 100644 (file)
@@ -8,97 +8,10 @@
  *     Copyright IBM Corp. 2003, 2009
  */
 
+#include <uapi/asm/raw3270.h>
 #include <asm/idals.h>
 #include <asm/ioctl.h>
 
-/* ioctls for fullscreen 3270 */
-#define TUBICMD                _IO('3', 3)     /* set ccw command for fs reads. */
-#define TUBOCMD                _IO('3', 4)     /* set ccw command for fs writes. */
-#define TUBGETI                _IO('3', 7)     /* get ccw command for fs reads. */
-#define TUBGETO                _IO('3', 8)     /* get ccw command for fs writes. */
-#define TUBSETMOD      _IO('3', 12)    /* FIXME: what does it do ?*/
-#define TUBGETMOD      _IO('3', 13)    /* FIXME: what does it do ?*/
-
-/* Local Channel Commands */
-#define TC_WRITE       0x01            /* Write */
-#define TC_RDBUF       0x02            /* Read Buffer */
-#define TC_EWRITE      0x05            /* Erase write */
-#define TC_READMOD     0x06            /* Read modified */
-#define TC_EWRITEA     0x0d            /* Erase write alternate */
-#define TC_WRITESF     0x11            /* Write structured field */
-
-/* Buffer Control Orders */
-#define TO_GE          0x08            /* Graphics Escape */
-#define TO_SF          0x1d            /* Start field */
-#define TO_SBA         0x11            /* Set buffer address */
-#define TO_IC          0x13            /* Insert cursor */
-#define TO_PT          0x05            /* Program tab */
-#define TO_RA          0x3c            /* Repeat to address */
-#define TO_SFE         0x29            /* Start field extended */
-#define TO_EUA         0x12            /* Erase unprotected to address */
-#define TO_MF          0x2c            /* Modify field */
-#define TO_SA          0x28            /* Set attribute */
-
-/* Field Attribute Bytes */
-#define TF_INPUT       0x40            /* Visible input */
-#define TF_INPUTN      0x4c            /* Invisible input */
-#define TF_INMDT       0xc1            /* Visible, Set-MDT */
-#define TF_LOG         0x60
-
-/* Character Attribute Bytes */
-#define TAT_RESET      0x00
-#define TAT_FIELD      0xc0
-#define TAT_EXTHI      0x41
-#define TAT_FGCOLOR    0x42
-#define TAT_CHARS      0x43
-#define TAT_BGCOLOR    0x45
-#define TAT_TRANS      0x46
-
-/* Extended-Highlighting Bytes */
-#define TAX_RESET      0x00
-#define TAX_BLINK      0xf1
-#define TAX_REVER      0xf2
-#define TAX_UNDER      0xf4
-
-/* Reset value */
-#define TAR_RESET      0x00
-
-/* Color values */
-#define TAC_RESET      0x00
-#define TAC_BLUE       0xf1
-#define TAC_RED                0xf2
-#define TAC_PINK       0xf3
-#define TAC_GREEN      0xf4
-#define TAC_TURQ       0xf5
-#define TAC_YELLOW     0xf6
-#define TAC_WHITE      0xf7
-#define TAC_DEFAULT    0x00
-
-/* Write Control Characters */
-#define TW_NONE                0x40            /* No particular action */
-#define TW_KR          0xc2            /* Keyboard restore */
-#define TW_PLUSALARM   0x04            /* Add this bit for alarm */
-
-#define RAW3270_FIRSTMINOR     1       /* First minor number */
-#define RAW3270_MAXDEVS                255     /* Max number of 3270 devices */
-
-#define AID_CLEAR              0x6d
-#define AID_ENTER              0x7d
-#define AID_PF3                        0xf3
-#define AID_PF7                        0xf7
-#define AID_PF8                        0xf8
-#define AID_READ_PARTITION     0x88
-
-/* For TUBGETMOD and TUBSETMOD. Should include. */
-struct raw3270_iocb {
-       short model;
-       short line_cnt;
-       short col_cnt;
-       short pf_cnt;
-       short re_cnt;
-       short map;
-};
-
 struct raw3270;
 struct raw3270_view;
 extern struct class *class3270;