aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2014-03-21 04:25:24 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-03-26 05:55:33 -0400
commit233faec97a1dfef1f4bc271f9e5d33f2ba4845ca (patch)
treecd42c8828846c9c73ecf867f9604af17bf7055f7
parent6e5a40a49fe16f8032c4dcd4fa5ff866da09d445 (diff)
s390/con3270: optionally disable auto update
This patch adds a parameter 'auto_update' to the con3270 driver, causing the 'auto_update' feature to be disabled if unset. The 'auto_update' feature will cause the con3270 driver to switch to the console view whenever new system messages are displayed, which makes working on the 3270 terminal awkward. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/char/con3270.c7
-rw-r--r--drivers/s390/char/raw3270.c9
-rw-r--r--drivers/s390/char/raw3270.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index bb6b0df50b33..75ffe9980c3e 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -7,6 +7,7 @@
7 * Copyright IBM Corp. 2003, 2009 7 * Copyright IBM Corp. 2003, 2009
8 */ 8 */
9 9
10#include <linux/module.h>
10#include <linux/console.h> 11#include <linux/console.h>
11#include <linux/init.h> 12#include <linux/init.h>
12#include <linux/interrupt.h> 13#include <linux/interrupt.h>
@@ -30,6 +31,9 @@
30 31
31static struct raw3270_fn con3270_fn; 32static struct raw3270_fn con3270_fn;
32 33
34static bool auto_update = 1;
35module_param(auto_update, bool, 0);
36
33/* 37/*
34 * Main 3270 console view data structure. 38 * Main 3270 console view data structure.
35 */ 39 */
@@ -204,6 +208,8 @@ con3270_update(struct con3270 *cp)
204 struct string *s, *n; 208 struct string *s, *n;
205 int rc; 209 int rc;
206 210
211 if (!auto_update && !raw3270_view_active(&cp->view))
212 return;
207 if (cp->view.dev) 213 if (cp->view.dev)
208 raw3270_activate_view(&cp->view); 214 raw3270_activate_view(&cp->view);
209 215
@@ -529,6 +535,7 @@ con3270_flush(void)
529 if (!cp->view.dev) 535 if (!cp->view.dev)
530 return; 536 return;
531 raw3270_pm_unfreeze(&cp->view); 537 raw3270_pm_unfreeze(&cp->view);
538 raw3270_activate_view(&cp->view);
532 spin_lock_irqsave(&cp->view.lock, flags); 539 spin_lock_irqsave(&cp->view.lock, flags);
533 con3270_wait_write(cp); 540 con3270_wait_write(cp);
534 cp->nr_up = 0; 541 cp->nr_up = 0;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 041c65bc7bb1..9f849df4381e 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -276,6 +276,15 @@ __raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
276} 276}
277 277
278int 278int
279raw3270_view_active(struct raw3270_view *view)
280{
281 struct raw3270 *rp = view->dev;
282
283 return rp && rp->view == view &&
284 !test_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
285}
286
287int
279raw3270_start(struct raw3270_view *view, struct raw3270_request *rq) 288raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
280{ 289{
281 unsigned long flags; 290 unsigned long flags;
diff --git a/drivers/s390/char/raw3270.h b/drivers/s390/char/raw3270.h
index 359276a88396..e1e41c2861fb 100644
--- a/drivers/s390/char/raw3270.h
+++ b/drivers/s390/char/raw3270.h
@@ -173,6 +173,7 @@ int raw3270_start_locked(struct raw3270_view *, struct raw3270_request *);
173int raw3270_start_irq(struct raw3270_view *, struct raw3270_request *); 173int raw3270_start_irq(struct raw3270_view *, struct raw3270_request *);
174int raw3270_reset(struct raw3270_view *); 174int raw3270_reset(struct raw3270_view *);
175struct raw3270_view *raw3270_view(struct raw3270_view *); 175struct raw3270_view *raw3270_view(struct raw3270_view *);
176int raw3270_view_active(struct raw3270_view *);
176 177
177/* Reference count inliner for view structures. */ 178/* Reference count inliner for view structures. */
178static inline void 179static inline void