summaryrefslogtreecommitdiff
path: root/drivers/s390/char/fs3270.c
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2022-12-05 14:32:02 +0300
committerHeiko Carstens <hca@linux.ibm.com>2023-01-09 16:34:05 +0300
commita554dbd740bd45247a7b9617760f1c7e1b26ebfc (patch)
tree45abee0f70308139f4d1dfa3d030f62509408dff /drivers/s390/char/fs3270.c
parentec40213bfbe41a73f8b9b96643c66edb0cbeb064 (diff)
downloadlinux-a554dbd740bd45247a7b9617760f1c7e1b26ebfc.tar.xz
s390/fs3270: fix screen reset on activate
fs3270 uses EWRITEA to clear the screen when a user opens /dev/3270/tub. However it misses the attribute byte after the EWRITEA, so (at least) x3270 complains about 'Record too short, missing write flags'. Add the missing flag byte to fix this. 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>
Diffstat (limited to 'drivers/s390/char/fs3270.c')
-rw-r--r--drivers/s390/char/fs3270.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/s390/char/fs3270.c b/drivers/s390/char/fs3270.c
index 7975dbea8d1b..aff38db1aa40 100644
--- a/drivers/s390/char/fs3270.c
+++ b/drivers/s390/char/fs3270.c
@@ -122,16 +122,19 @@ static int fs3270_activate(struct raw3270_view *view)
if (!raw3270_request_final(fp->init))
return 0;
+ raw3270_request_set_cmd(fp->init, TC_EWRITEA);
+ raw3270_request_set_idal(fp->init, fp->rdbuf);
+ fp->init->rescnt = 0;
+ cp = fp->rdbuf->data[0];
if (fp->rdbuf_size == 0) {
/* No saved buffer. Just clear the screen. */
- raw3270_request_set_cmd(fp->init, TC_EWRITEA);
+ fp->init->ccw.count = 1;
fp->init->callback = fs3270_reset_callback;
+ cp[0] = 0;
} else {
/* Restore fullscreen buffer saved by fs3270_deactivate. */
- raw3270_request_set_cmd(fp->init, TC_EWRITEA);
- raw3270_request_set_idal(fp->init, fp->rdbuf);
fp->init->ccw.count = fp->rdbuf_size;
- cp = fp->rdbuf->data[0];
+ fp->init->callback = fs3270_restore_callback;
cp[0] = TW_KR;
cp[1] = TO_SBA;
cp[2] = cp[6];
@@ -140,8 +143,6 @@ static int fs3270_activate(struct raw3270_view *view)
cp[5] = TO_SBA;
cp[6] = 0x40;
cp[7] = 0x40;
- fp->init->rescnt = 0;
- fp->init->callback = fs3270_restore_callback;
}
rc = raw3270_start_locked(view, fp->init);
fp->init->rc = rc;