aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/char/sclp.h
diff options
context:
space:
mode:
authorMichael Holzheu <holzheu@de.ibm.com>2009-06-16 04:30:40 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-16 04:31:16 -0400
commit62b7494209495847269a6ce0504cbefd23d42eb1 (patch)
tree6318661837ddd250dc86b48a94f44fa2d1ae9421 /drivers/s390/char/sclp.h
parent3ef32e62cb55785f6f1b5ad7290744f74bdadaf0 (diff)
[S390] pm: power management support for SCLP drivers.
The SCLP base driver defines a new notifier call back for all upper level SCLP drivers, like the SCLP console, etc. This guarantees that in suspend first the upper level drivers are suspended and afterwards the SCLP base driver. For resume it is the other way round. The SCLP base driver itself registers a new platform device at the platform bus and gets PM notifications via the dev_pm_ops. In suspend, the SCLP base driver switches off the receiver and sender mask This is done in sclp_deactivate(). After suspend all new requests will be rejected with -EIO and no more interrupts will be received, because the masks are switched off. For resume the sender and receiver masks are reset in the sclp_reactivate() function. When the SCLP console is suspended, all new messages are cached in the sclp console buffers. In resume, all the cached messages are written to the console. In addition to that we have an early resume function that removes the cached messages from the suspend image. Signed-off-by: Michael Holzheu <holzheu@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/sclp.h')
-rw-r--r--drivers/s390/char/sclp.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index bac80e856f97..60e7cb07095b 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -1,10 +1,8 @@
1/* 1/*
2 * drivers/s390/char/sclp.h 2 * Copyright IBM Corp. 1999, 2009
3 * 3 *
4 * S390 version 4 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
5 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 5 * Martin Schwidefsky <schwidefsky@de.ibm.com>
6 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
7 * Martin Schwidefsky <schwidefsky@de.ibm.com>
8 */ 6 */
9 7
10#ifndef __SCLP_H__ 8#ifndef __SCLP_H__
@@ -17,7 +15,7 @@
17 15
18/* maximum number of pages concerning our own memory management */ 16/* maximum number of pages concerning our own memory management */
19#define MAX_KMEM_PAGES (sizeof(unsigned long) << 3) 17#define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
20#define MAX_CONSOLE_PAGES 4 18#define MAX_CONSOLE_PAGES 6
21 19
22#define EVTYP_OPCMD 0x01 20#define EVTYP_OPCMD 0x01
23#define EVTYP_MSG 0x02 21#define EVTYP_MSG 0x02
@@ -68,6 +66,15 @@ typedef unsigned int sclp_cmdw_t;
68 66
69#define GDS_KEY_SELFDEFTEXTMSG 0x31 67#define GDS_KEY_SELFDEFTEXTMSG 0x31
70 68
69enum sclp_pm_event {
70 SCLP_PM_EVENT_FREEZE,
71 SCLP_PM_EVENT_THAW,
72 SCLP_PM_EVENT_RESTORE,
73};
74
75#define SCLP_PANIC_PRIO 1
76#define SCLP_PANIC_PRIO_CLIENT 0
77
71typedef u32 sccb_mask_t; /* ATTENTION: assumes 32bit mask !!! */ 78typedef u32 sccb_mask_t; /* ATTENTION: assumes 32bit mask !!! */
72 79
73struct sccb_header { 80struct sccb_header {
@@ -134,6 +141,10 @@ struct sclp_register {
134 void (*state_change_fn)(struct sclp_register *); 141 void (*state_change_fn)(struct sclp_register *);
135 /* called for events in cp_receive_mask/sclp_receive_mask */ 142 /* called for events in cp_receive_mask/sclp_receive_mask */
136 void (*receiver_fn)(struct evbuf_header *); 143 void (*receiver_fn)(struct evbuf_header *);
144 /* called for power management events */
145 void (*pm_event_fn)(struct sclp_register *, enum sclp_pm_event);
146 /* pm event posted flag */
147 int pm_event_posted;
137}; 148};
138 149
139/* externals from sclp.c */ 150/* externals from sclp.c */