提交 233faec9 编写于 作者: M Martin Schwidefsky

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: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 6e5a40a4
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
* Copyright IBM Corp. 2003, 2009 * Copyright IBM Corp. 2003, 2009
*/ */
#include <linux/module.h>
#include <linux/console.h> #include <linux/console.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -30,6 +31,9 @@ ...@@ -30,6 +31,9 @@
static struct raw3270_fn con3270_fn; static struct raw3270_fn con3270_fn;
static bool auto_update = 1;
module_param(auto_update, bool, 0);
/* /*
* Main 3270 console view data structure. * Main 3270 console view data structure.
*/ */
...@@ -204,6 +208,8 @@ con3270_update(struct con3270 *cp) ...@@ -204,6 +208,8 @@ con3270_update(struct con3270 *cp)
struct string *s, *n; struct string *s, *n;
int rc; int rc;
if (!auto_update && !raw3270_view_active(&cp->view))
return;
if (cp->view.dev) if (cp->view.dev)
raw3270_activate_view(&cp->view); raw3270_activate_view(&cp->view);
...@@ -529,6 +535,7 @@ con3270_flush(void) ...@@ -529,6 +535,7 @@ con3270_flush(void)
if (!cp->view.dev) if (!cp->view.dev)
return; return;
raw3270_pm_unfreeze(&cp->view); raw3270_pm_unfreeze(&cp->view);
raw3270_activate_view(&cp->view);
spin_lock_irqsave(&cp->view.lock, flags); spin_lock_irqsave(&cp->view.lock, flags);
con3270_wait_write(cp); con3270_wait_write(cp);
cp->nr_up = 0; cp->nr_up = 0;
......
...@@ -275,6 +275,15 @@ __raw3270_start(struct raw3270 *rp, struct raw3270_view *view, ...@@ -275,6 +275,15 @@ __raw3270_start(struct raw3270 *rp, struct raw3270_view *view,
return 0; return 0;
} }
int
raw3270_view_active(struct raw3270_view *view)
{
struct raw3270 *rp = view->dev;
return rp && rp->view == view &&
!test_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
}
int int
raw3270_start(struct raw3270_view *view, struct raw3270_request *rq) raw3270_start(struct raw3270_view *view, struct raw3270_request *rq)
{ {
......
...@@ -173,6 +173,7 @@ int raw3270_start_locked(struct raw3270_view *, struct raw3270_request *); ...@@ -173,6 +173,7 @@ int raw3270_start_locked(struct raw3270_view *, struct raw3270_request *);
int raw3270_start_irq(struct raw3270_view *, struct raw3270_request *); int raw3270_start_irq(struct raw3270_view *, struct raw3270_request *);
int raw3270_reset(struct raw3270_view *); int raw3270_reset(struct raw3270_view *);
struct raw3270_view *raw3270_view(struct raw3270_view *); struct raw3270_view *raw3270_view(struct raw3270_view *);
int raw3270_view_active(struct raw3270_view *);
/* Reference count inliner for view structures. */ /* Reference count inliner for view structures. */
static inline void static inline void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册