11/*
2- * Sclp "store data in absolut storage"
2+ * SCLP "store data in absolute storage"
33 *
4- * Copyright IBM Corp. 2003, 2007
4+ * Copyright IBM Corp. 2003, 2013
55 * Author(s): Michael Holzheu
66 */
77
1414#include <asm/debug.h>
1515#include <asm/ipl.h>
1616
17+ #include "sclp_sdias.h"
1718#include "sclp.h"
1819#include "sclp_rw.h"
1920
2223#define SDIAS_RETRIES 300
2324#define SDIAS_SLEEP_TICKS 50
2425
25- #define EQ_STORE_DATA 0x0
26- #define EQ_SIZE 0x1
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
33-
3426static struct debug_info * sdias_dbf ;
3527
3628static struct sclp_register sclp_sdias_register = {
3729 .send_mask = EVTYP_SDIAS_MASK ,
3830};
3931
40- struct sdias_evbuf {
41- struct evbuf_header hdr ;
42- u8 event_qual ;
43- u8 data_id ;
44- u64 reserved2 ;
45- u32 event_id ;
46- u16 reserved3 ;
47- u8 asa_size ;
48- u8 event_status ;
49- u32 reserved4 ;
50- u32 blk_cnt ;
51- u64 asa ;
52- u32 reserved5 ;
53- u32 fbn ;
54- u32 reserved6 ;
55- u32 lbn ;
56- u16 reserved7 ;
57- u16 dbs ;
58- } __attribute__((packed ));
59-
60- struct sdias_sccb {
61- struct sccb_header hdr ;
62- struct sdias_evbuf evbuf ;
63- } __attribute__((packed ));
64-
6532static struct sdias_sccb sccb __attribute__((aligned (4096 )));
6633static struct sdias_evbuf sdias_evbuf ;
6734
@@ -148,8 +115,8 @@ int sclp_sdias_blk_count(void)
148115 sccb .hdr .length = sizeof (sccb );
149116 sccb .evbuf .hdr .length = sizeof (struct sdias_evbuf );
150117 sccb .evbuf .hdr .type = EVTYP_SDIAS ;
151- sccb .evbuf .event_qual = EQ_SIZE ;
152- sccb .evbuf .data_id = DI_FCP_DUMP ;
118+ sccb .evbuf .event_qual = SDIAS_EQ_SIZE ;
119+ sccb .evbuf .data_id = SDIAS_DI_FCP_DUMP ;
153120 sccb .evbuf .event_id = 4712 ;
154121 sccb .evbuf .dbs = 1 ;
155122
@@ -208,13 +175,13 @@ int sclp_sdias_copy(void *dest, int start_blk, int nr_blks)
208175 sccb .evbuf .hdr .length = sizeof (struct sdias_evbuf );
209176 sccb .evbuf .hdr .type = EVTYP_SDIAS ;
210177 sccb .evbuf .hdr .flags = 0 ;
211- sccb .evbuf .event_qual = EQ_STORE_DATA ;
212- sccb .evbuf .data_id = DI_FCP_DUMP ;
178+ sccb .evbuf .event_qual = SDIAS_EQ_STORE_DATA ;
179+ sccb .evbuf .data_id = SDIAS_DI_FCP_DUMP ;
213180 sccb .evbuf .event_id = 4712 ;
214181#ifdef CONFIG_64BIT
215- sccb .evbuf .asa_size = ASA_SIZE_64 ;
182+ sccb .evbuf .asa_size = SDIAS_ASA_SIZE_64 ;
216183#else
217- sccb .evbuf .asa_size = ASA_SIZE_32 ;
184+ sccb .evbuf .asa_size = SDIAS_ASA_SIZE_32 ;
218185#endif
219186 sccb .evbuf .event_status = 0 ;
220187 sccb .evbuf .blk_cnt = nr_blks ;
@@ -240,20 +207,19 @@ int sclp_sdias_copy(void *dest, int start_blk, int nr_blks)
240207 }
241208
242209 switch (sdias_evbuf .event_status ) {
243- case EVSTATE_ALL_STORED :
244- TRACE ("all stored\n" );
245- break ;
246- case EVSTATE_PART_STORED :
247- TRACE ("part stored: %i\n" , sdias_evbuf .blk_cnt );
248- break ;
249- case EVSTATE_NO_DATA :
250- TRACE ("no data\n" );
251- /* fall through */
252- default :
253- pr_err ("Error from SCLP while copying hsa. "
254- "Event status = %x\n" ,
255- sdias_evbuf .event_status );
256- rc = - EIO ;
210+ case SDIAS_EVSTATE_ALL_STORED :
211+ TRACE ("all stored\n" );
212+ break ;
213+ case SDIAS_EVSTATE_PART_STORED :
214+ TRACE ("part stored: %i\n" , sdias_evbuf .blk_cnt );
215+ break ;
216+ case SDIAS_EVSTATE_NO_DATA :
217+ TRACE ("no data\n" );
218+ /* fall through */
219+ default :
220+ pr_err ("Error from SCLP while copying hsa. Event status = %x\n" ,
221+ sdias_evbuf .event_status );
222+ rc = - EIO ;
257223 }
258224out :
259225 mutex_unlock (& sdias_mutex );
0 commit comments