diff options
Diffstat (limited to 'drivers/s390/char/sclp_cmd.c')
-rw-r--r-- | drivers/s390/char/sclp_cmd.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index 766cb7b19b40..71ea923c322d 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -48,6 +48,7 @@ struct read_info_sccb { | |||
48 | u8 _reserved5[4096 - 112]; /* 112-4095 */ | 48 | u8 _reserved5[4096 - 112]; /* 112-4095 */ |
49 | } __attribute__((packed, aligned(PAGE_SIZE))); | 49 | } __attribute__((packed, aligned(PAGE_SIZE))); |
50 | 50 | ||
51 | static struct init_sccb __initdata early_event_mask_sccb __aligned(PAGE_SIZE); | ||
51 | static struct read_info_sccb __initdata early_read_info_sccb; | 52 | static struct read_info_sccb __initdata early_read_info_sccb; |
52 | static int __initdata early_read_info_sccb_valid; | 53 | static int __initdata early_read_info_sccb_valid; |
53 | 54 | ||
@@ -104,6 +105,19 @@ static void __init sclp_read_info_early(void) | |||
104 | } | 105 | } |
105 | } | 106 | } |
106 | 107 | ||
108 | static void __init sclp_event_mask_early(void) | ||
109 | { | ||
110 | struct init_sccb *sccb = &early_event_mask_sccb; | ||
111 | int rc; | ||
112 | |||
113 | do { | ||
114 | memset(sccb, 0, sizeof(*sccb)); | ||
115 | sccb->header.length = sizeof(*sccb); | ||
116 | sccb->mask_length = sizeof(sccb_mask_t); | ||
117 | rc = sclp_cmd_sync_early(SCLP_CMDW_WRITE_EVENT_MASK, sccb); | ||
118 | } while (rc == -EBUSY); | ||
119 | } | ||
120 | |||
107 | void __init sclp_facilities_detect(void) | 121 | void __init sclp_facilities_detect(void) |
108 | { | 122 | { |
109 | struct read_info_sccb *sccb; | 123 | struct read_info_sccb *sccb; |
@@ -119,6 +133,30 @@ void __init sclp_facilities_detect(void) | |||
119 | rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; | 133 | rnmax = sccb->rnmax ? sccb->rnmax : sccb->rnmax2; |
120 | rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; | 134 | rzm = sccb->rnsize ? sccb->rnsize : sccb->rnsize2; |
121 | rzm <<= 20; | 135 | rzm <<= 20; |
136 | |||
137 | sclp_event_mask_early(); | ||
138 | } | ||
139 | |||
140 | bool __init sclp_has_linemode(void) | ||
141 | { | ||
142 | struct init_sccb *sccb = &early_event_mask_sccb; | ||
143 | |||
144 | if (sccb->header.response_code != 0x20) | ||
145 | return 0; | ||
146 | if (sccb->sclp_send_mask & (EVTYP_MSG_MASK | EVTYP_PMSGCMD_MASK)) | ||
147 | return 1; | ||
148 | return 0; | ||
149 | } | ||
150 | |||
151 | bool __init sclp_has_vt220(void) | ||
152 | { | ||
153 | struct init_sccb *sccb = &early_event_mask_sccb; | ||
154 | |||
155 | if (sccb->header.response_code != 0x20) | ||
156 | return 0; | ||
157 | if (sccb->sclp_send_mask & EVTYP_VT220MSG_MASK) | ||
158 | return 1; | ||
159 | return 0; | ||
122 | } | 160 | } |
123 | 161 | ||
124 | unsigned long long sclp_get_rnmax(void) | 162 | unsigned long long sclp_get_rnmax(void) |