summaryrefslogtreecommitdiffstats
path: root/drivers/s390/char
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2022-11-17 17:30:40 +0100
committerHeiko Carstens <hca@linux.ibm.com>2023-01-09 14:33:58 +0100
commite4b57b93935d103aae10abea361af77ef906f368 (patch)
treed09acd84ab6700d6e599b45391bdb83f953bf764 /drivers/s390/char
parent94dbb0a76ce21878867210d1cf0b21725023b452 (diff)
downloadlinux-stable-e4b57b93935d103aae10abea361af77ef906f368.tar.gz
linux-stable-e4b57b93935d103aae10abea361af77ef906f368.tar.bz2
linux-stable-e4b57b93935d103aae10abea361af77ef906f368.zip
s390/tty3270: add support for VT100 graphics escape
Add support for ESC(B and ESC(0 to switch between character charset and graphics charset. Used in vt100 and later terminal generations. 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')
-rw-r--r--drivers/s390/char/con3270.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index 13e2b4cb74fc..9c816d1239eb 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -1557,7 +1557,7 @@ static void tty3270_goto_xy(struct tty3270 *tp, int cx, int cy)
*/
static void tty3270_escape_sequence(struct tty3270 *tp, char ch)
{
- enum { ESnormal, ESesc, ESsquare, ESgetpars };
+ enum { ESnormal, ESesc, ESsquare, ESparen, ESgetpars };
if (tp->esc_state == ESnormal) {
if (ch == 0x1b)
@@ -1571,6 +1571,9 @@ static void tty3270_escape_sequence(struct tty3270 *tp, char ch)
case '[':
tp->esc_state = ESsquare;
break;
+ case '(':
+ tp->esc_state = ESparen;
+ break;
case 'E':
tty3270_cr(tp);
tty3270_lf(tp);
@@ -1604,15 +1607,28 @@ static void tty3270_escape_sequence(struct tty3270 *tp, char ch)
}
return;
}
- if (tp->esc_state == ESsquare) {
+
+ switch (tp->esc_state) {
+ case ESparen:
+ tp->esc_state = ESnormal;
+ switch (ch) {
+ case 'B':
+ tp->attributes.alternate_charset = 0;
+ break;
+ case '0':
+ tp->attributes.alternate_charset = 1;
+ break;
+ }
+ return;
+ case ESsquare:
tp->esc_state = ESgetpars;
memset(tp->esc_par, 0, sizeof(tp->esc_par));
tp->esc_npar = 0;
tp->esc_ques = (ch == '?');
if (tp->esc_ques)
return;
- }
- if (tp->esc_state == ESgetpars) {
+ fallthrough;
+ case ESgetpars:
if (ch == ';' && tp->esc_npar < ESCAPE_NPAR - 1) {
tp->esc_npar++;
return;
@@ -1622,6 +1638,9 @@ static void tty3270_escape_sequence(struct tty3270 *tp, char ch)
tp->esc_par[tp->esc_npar] += ch - '0';
return;
}
+ break;
+ default:
+ break;
}
tp->esc_state = ESnormal;
if (ch == 'n' && !tp->esc_ques) {