diff options
author | Sven Schnelle <svens@linux.ibm.com> | 2022-11-28 19:53:04 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2023-01-09 14:33:59 +0100 |
commit | cbb36313bdb696cfe0874406327b24b403c9e8e0 (patch) | |
tree | a63bcdd4fce7fd92766374d44d5dcd452585641e /drivers/s390/char/con3270.c | |
parent | 91621ba7d7b7274cd44e5ee4942a39a6aae977a0 (diff) |
s390/tty3270: resize terminal when the clear key is pressed
There's no easy way to figure out whether the user has re-connected
to the z/VM session. When the user re-connected with a different geometry
to z/VM, the screen layout is broken. Allow the user to force a resizing
by pressing the Clear Key.
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>
Diffstat (limited to 'drivers/s390/char/con3270.c')
-rw-r--r-- | drivers/s390/char/con3270.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index caccf5d496fd..61c73eb2471f 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c @@ -58,6 +58,10 @@ struct tty3270_line { int len; }; +static const unsigned char sfq_read_partition[] = { + 0x00, 0x07, 0x01, 0xff, 0x03, 0x00, 0x81 +}; + #define ESCAPE_NPAR 8 /* @@ -95,6 +99,7 @@ struct tty3270 { struct string *input; /* Input string for read request. */ struct raw3270_request *read; /* Single read request. */ struct raw3270_request *kreset; /* Single keyboard reset request. */ + struct raw3270_request *readpartreq; unsigned char inattr; /* Visible/invisible input. */ int throttle, attn; /* tty throttle/unthrottle. */ struct tasklet_struct readlet; /* Tasklet to issue read request. */ @@ -581,6 +586,14 @@ static void tty3270_read_tasklet(unsigned long data) /* Display has been cleared. Redraw. */ tp->update_flags = TTY_UPDATE_ALL; tty3270_set_timer(tp, 1); + if (!list_empty(&tp->readpartreq->list)) + break; + raw3270_start_request(&tp->view, tp->readpartreq, TC_WRITESF, + (char *)sfq_read_partition, sizeof(sfq_read_partition)); + break; + case AID_READ_PARTITION: + raw3270_read_modified_cb(tp->readpartreq, tp->input->string); + break; default: break; } @@ -731,9 +744,12 @@ static struct tty3270 *tty3270_alloc_view(void) tp->kreset = raw3270_request_alloc(1); if (IS_ERR(tp->kreset)) goto out_read; + tp->readpartreq = raw3270_request_alloc(sizeof(sfq_read_partition)); + if (IS_ERR(tp->readpartreq)) + goto out_reset; tp->kbd = kbd_alloc(); if (!tp->kbd) - goto out_reset; + goto out_readpartreq; tty_port_init(&tp->port); timer_setup(&tp->timer, tty3270_update, 0); @@ -743,6 +759,8 @@ static struct tty3270 *tty3270_alloc_view(void) (unsigned long) tp); return tp; +out_readpartreq: + raw3270_request_free(tp->readpartreq); out_reset: raw3270_request_free(tp->kreset); out_read: |