8 #define KMSG_COMPONENT "sclp_sdias"
9 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
12 #include <linux/sched.h>
14 #include <asm/debug.h>
20 #define TRACE(x...) debug_sprintf_event(sdias_dbf, 1, x)
22 #define SDIAS_RETRIES 300
23 #define SDIAS_SLEEP_TICKS 50
25 #define EQ_STORE_DATA 0x0
27 #define DI_FCP_DUMP 0x0
28 #define ASA_SIZE_32 0x0
29 #define ASA_SIZE_64 0x1
30 #define EVSTATE_ALL_STORED 0x0
31 #define EVSTATE_NO_DATA 0x3
32 #define EVSTATE_PART_STORED 0x10
80 TRACE(
"sclp_sdias_receiver_fn done\n");
89 TRACE(
"callback done\n");
98 TRACE(
"add request\n");
103 TRACE(
"add request failed: rc = %i\n",rc);
110 TRACE(
"sclp request failed\n");
114 if (!(sccb.evbuf.hdr.flags & 0x80)) {
115 TRACE(
"sclp request failed: flags=%x\n",
116 sccb.evbuf.hdr.flags);
124 TRACE(
"sync request done\n");
129 TRACE(
"request done\n");
146 memset(&request, 0,
sizeof(request));
151 sccb.evbuf.event_qual =
EQ_SIZE;
153 sccb.evbuf.event_id = 4712;
156 request.
sccb = &sccb;
161 rc = sdias_sclp_send(&request);
163 pr_err(
"sclp_send failed for get_nr_blocks\n");
166 if (sccb.hdr.response_code != 0x0020) {
167 TRACE(
"send failed: %x\n", sccb.hdr.response_code);
181 TRACE(
"%i blocks\n", rc);
205 memset(&request, 0,
sizeof(request));
210 sccb.evbuf.hdr.flags = 0;
213 sccb.evbuf.event_id = 4712;
219 sccb.evbuf.event_status = 0;
220 sccb.evbuf.blk_cnt = nr_blks;
221 sccb.evbuf.asa = (
unsigned long)dest;
222 sccb.evbuf.fbn = start_blk;
226 request.
sccb = &sccb;
231 rc = sdias_sclp_send(&request);
233 pr_err(
"sclp_send failed: %x\n", rc);
236 if (sccb.hdr.response_code != 0x0020) {
237 TRACE(
"copy failed: %x\n", sccb.hdr.response_code);
244 TRACE(
"all stored\n");
253 pr_err(
"Error from SCLP while copying hsa. "
254 "Event status = %x\n",
263 static int __init sclp_sdias_register_check(
void)
277 static int __init sclp_sdias_init_sync(
void)
279 TRACE(
"Try synchronous mode\n");
282 return sclp_sdias_register_check();
285 static int __init sclp_sdias_init_async(
void)
287 TRACE(
"Try asynchronous mode\n");
289 sclp_sdias_register.
receiver_fn = sclp_sdias_receiver_fn;
290 return sclp_sdias_register_check();
300 if (sclp_sdias_init_sync() == 0)
302 if (sclp_sdias_init_async() == 0)
304 TRACE(
"init failed\n");
307 TRACE(
"init done\n");