s390/tty3270: add AID defines
authorSven Schnelle <svens@linux.ibm.com>
Mon, 28 Nov 2022 18:40:44 +0000 (19:40 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 9 Jan 2023 13:33:59 +0000 (14:33 +0100)
Use AID_* instead of hex numbers to make the code a bit
easier to read. also convert the if/else blocks to a
switch statement in tty3270_read_tasklet().

Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/char/con3270.c
drivers/s390/char/raw3270.h

index 7ff116c..0dea178 100644 (file)
@@ -565,7 +565,8 @@ static void tty3270_read_tasklet(unsigned long data)
         */
        input = NULL;
        len = 0;
-       if (tp->input->string[0] == 0x7d) {
+       switch (tp->input->string[0]) {
+       case AID_ENTER:
                /* Enter: write input to tty. */
                input = tp->input->string + 6;
                len = tp->input->len - 6 - rrq->rescnt;
@@ -579,10 +580,13 @@ static void tty3270_read_tasklet(unsigned long data)
                /* Clear input area. */
                tty3270_update_prompt(tp, NULL, 0);
                tty3270_set_timer(tp, 1);
-       } else if (tp->input->string[0] == 0x6d) {
+               break;
+       case AID_CLEAR:
                /* Display has been cleared. Redraw. */
                tp->update_flags = TTY_UPDATE_ALL;
                tty3270_set_timer(tp, 1);
+       default:
+               break;
        }
        spin_unlock_irq(&tp->view.lock);
 
index cdf0367..7e0c88e 100644 (file)
 #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;