Commit da4e272e authored by Sven Schnelle's avatar Sven Schnelle Committed by Heiko Carstens

s390/con3270: simplify update flags

Make TTY3270_UPDATE_ALL the sum of all TTY3270_* flags, so we
don't need any special handling for it.
Signed-off-by: default avatarSven Schnelle <svens@linux.ibm.com>
Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 9975fde0
...@@ -127,10 +127,9 @@ struct tty3270 { ...@@ -127,10 +127,9 @@ struct tty3270 {
}; };
/* tty3270->update_flags. See tty3270_update for details. */ /* tty3270->update_flags. See tty3270_update for details. */
#define TTY_UPDATE_ERASE 1 /* Use EWRITEA instead of WRITE. */ #define TTY_UPDATE_INPUT 0x1 /* Update input line. */
#define TTY_UPDATE_INPUT 4 /* Update input line. */ #define TTY_UPDATE_STATUS 0x2 /* Update status line. */
#define TTY_UPDATE_STATUS 8 /* Update status line. */ #define TTY_UPDATE_ALL 0x3 /* Recreate screen. */
#define TTY_UPDATE_ALL 16 /* Recreate screen. */
#define TTY3270_INPUT_AREA_ROWS 2 #define TTY3270_INPUT_AREA_ROWS 2
...@@ -491,7 +490,7 @@ static void tty3270_update(struct timer_list *t) ...@@ -491,7 +490,7 @@ static void tty3270_update(struct timer_list *t)
struct tty3270 *tp = from_timer(tp, t, timer); struct tty3270 *tp = from_timer(tp, t, timer);
struct raw3270_request *wrq; struct raw3270_request *wrq;
struct tty3270_line *line; struct tty3270_line *line;
unsigned long updated; u8 cmd = TC_WRITE;
int i, rc, len; int i, rc, len;
wrq = xchg(&tp->write, 0); wrq = xchg(&tp->write, 0);
...@@ -501,18 +500,10 @@ static void tty3270_update(struct timer_list *t) ...@@ -501,18 +500,10 @@ static void tty3270_update(struct timer_list *t)
} }
spin_lock_irq(&tp->view.lock); spin_lock_irq(&tp->view.lock);
updated = 0; if (tp->update_flags == TTY_UPDATE_ALL)
if (tp->update_flags & TTY_UPDATE_ALL) { cmd = TC_EWRITEA;
tp->update_flags = TTY_UPDATE_ERASE |
TTY_UPDATE_INPUT | TTY_UPDATE_STATUS; raw3270_request_set_cmd(wrq, cmd);
}
if (tp->update_flags & TTY_UPDATE_ERASE) {
/* Use erase write alternate to erase display. */
raw3270_request_set_cmd(wrq, TC_EWRITEA);
updated |= TTY_UPDATE_ERASE;
} else {
raw3270_request_set_cmd(wrq, TC_WRITE);
}
raw3270_request_add_data(wrq, &tp->wcc, 1); raw3270_request_add_data(wrq, &tp->wcc, 1);
tp->wcc = TW_NONE; tp->wcc = TW_NONE;
...@@ -522,7 +513,7 @@ static void tty3270_update(struct timer_list *t) ...@@ -522,7 +513,7 @@ static void tty3270_update(struct timer_list *t)
if (tp->update_flags & TTY_UPDATE_STATUS) { if (tp->update_flags & TTY_UPDATE_STATUS) {
len = tty3270_add_status(tp); len = tty3270_add_status(tp);
if (raw3270_request_add_data(wrq, tp->converted_line, len) == 0) if (raw3270_request_add_data(wrq, tp->converted_line, len) == 0)
updated |= TTY_UPDATE_STATUS; tp->update_flags &= ~TTY_UPDATE_STATUS;
} }
/* /*
...@@ -531,7 +522,7 @@ static void tty3270_update(struct timer_list *t) ...@@ -531,7 +522,7 @@ static void tty3270_update(struct timer_list *t)
if (tp->update_flags & TTY_UPDATE_INPUT) { if (tp->update_flags & TTY_UPDATE_INPUT) {
len = tty3270_add_prompt(tp); len = tty3270_add_prompt(tp);
if (raw3270_request_add_data(wrq, tp->converted_line, len) == 0) if (raw3270_request_add_data(wrq, tp->converted_line, len) == 0)
updated |= TTY_UPDATE_INPUT; tp->update_flags &= ~TTY_UPDATE_INPUT;
} }
for (i = 0; i < tty3270_tty_rows(tp); i++) { for (i = 0; i < tty3270_tty_rows(tp); i++) {
...@@ -551,7 +542,6 @@ static void tty3270_update(struct timer_list *t) ...@@ -551,7 +542,6 @@ static void tty3270_update(struct timer_list *t)
wrq->callback = tty3270_write_callback; wrq->callback = tty3270_write_callback;
rc = raw3270_start(&tp->view, wrq); rc = raw3270_start(&tp->view, wrq);
if (rc == 0) { if (rc == 0) {
tp->update_flags &= ~updated;
if (tp->update_flags) if (tp->update_flags)
tty3270_set_timer(tp, 1); tty3270_set_timer(tp, 1);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment