Commit f8049e3e869f6de644e4302b3d85d06e185ddced
Committed by
Martin Schwidefsky
1 parent
7d594322b2
Exists in
master
and in
16 other branches
s390/sclp: Move declarations for sclp_sdias into separate header file
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 2 changed files with 68 additions and 56 deletions Side-by-side Diff
drivers/s390/char/sclp_sdias.c
1 | 1 | /* |
2 | - * Sclp "store data in absolut storage" | |
2 | + * SCLP "store data in absolute storage" | |
3 | 3 | * |
4 | - * Copyright IBM Corp. 2003, 2007 | |
4 | + * Copyright IBM Corp. 2003, 2013 | |
5 | 5 | * Author(s): Michael Holzheu |
6 | 6 | */ |
7 | 7 | |
... | ... | @@ -14,6 +14,7 @@ |
14 | 14 | #include <asm/debug.h> |
15 | 15 | #include <asm/ipl.h> |
16 | 16 | |
17 | +#include "sclp_sdias.h" | |
17 | 18 | #include "sclp.h" |
18 | 19 | #include "sclp_rw.h" |
19 | 20 | |
20 | 21 | |
... | ... | @@ -22,46 +23,12 @@ |
22 | 23 | #define SDIAS_RETRIES 300 |
23 | 24 | #define SDIAS_SLEEP_TICKS 50 |
24 | 25 | |
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 | - | |
34 | 26 | static struct debug_info *sdias_dbf; |
35 | 27 | |
36 | 28 | static struct sclp_register sclp_sdias_register = { |
37 | 29 | .send_mask = EVTYP_SDIAS_MASK, |
38 | 30 | }; |
39 | 31 | |
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 | - | |
65 | 32 | static struct sdias_sccb sccb __attribute__((aligned(4096))); |
66 | 33 | static struct sdias_evbuf sdias_evbuf; |
67 | 34 | |
... | ... | @@ -148,8 +115,8 @@ |
148 | 115 | sccb.hdr.length = sizeof(sccb); |
149 | 116 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); |
150 | 117 | 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; | |
153 | 120 | sccb.evbuf.event_id = 4712; |
154 | 121 | sccb.evbuf.dbs = 1; |
155 | 122 | |
156 | 123 | |
157 | 124 | |
... | ... | @@ -208,13 +175,13 @@ |
208 | 175 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); |
209 | 176 | sccb.evbuf.hdr.type = EVTYP_SDIAS; |
210 | 177 | 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; | |
213 | 180 | sccb.evbuf.event_id = 4712; |
214 | 181 | #ifdef CONFIG_64BIT |
215 | - sccb.evbuf.asa_size = ASA_SIZE_64; | |
182 | + sccb.evbuf.asa_size = SDIAS_ASA_SIZE_64; | |
216 | 183 | #else |
217 | - sccb.evbuf.asa_size = ASA_SIZE_32; | |
184 | + sccb.evbuf.asa_size = SDIAS_ASA_SIZE_32; | |
218 | 185 | #endif |
219 | 186 | sccb.evbuf.event_status = 0; |
220 | 187 | sccb.evbuf.blk_cnt = nr_blks; |
... | ... | @@ -240,20 +207,19 @@ |
240 | 207 | } |
241 | 208 | |
242 | 209 | 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; | |
257 | 223 | } |
258 | 224 | out: |
259 | 225 | mutex_unlock(&sdias_mutex); |
drivers/s390/char/sclp_sdias.h
1 | +/* | |
2 | + * SCLP "store data in absolute storage" | |
3 | + * | |
4 | + * Copyright IBM Corp. 2003, 2013 | |
5 | + */ | |
6 | + | |
7 | +#ifndef SCLP_SDIAS_H | |
8 | +#define SCLP_SDIAS_H | |
9 | + | |
10 | +#include "sclp.h" | |
11 | + | |
12 | +#define SDIAS_EQ_STORE_DATA 0x0 | |
13 | +#define SDIAS_EQ_SIZE 0x1 | |
14 | +#define SDIAS_DI_FCP_DUMP 0x0 | |
15 | +#define SDIAS_ASA_SIZE_32 0x0 | |
16 | +#define SDIAS_ASA_SIZE_64 0x1 | |
17 | +#define SDIAS_EVSTATE_ALL_STORED 0x0 | |
18 | +#define SDIAS_EVSTATE_NO_DATA 0x3 | |
19 | +#define SDIAS_EVSTATE_PART_STORED 0x10 | |
20 | + | |
21 | +struct sdias_evbuf { | |
22 | + struct evbuf_header hdr; | |
23 | + u8 event_qual; | |
24 | + u8 data_id; | |
25 | + u64 reserved2; | |
26 | + u32 event_id; | |
27 | + u16 reserved3; | |
28 | + u8 asa_size; | |
29 | + u8 event_status; | |
30 | + u32 reserved4; | |
31 | + u32 blk_cnt; | |
32 | + u64 asa; | |
33 | + u32 reserved5; | |
34 | + u32 fbn; | |
35 | + u32 reserved6; | |
36 | + u32 lbn; | |
37 | + u16 reserved7; | |
38 | + u16 dbs; | |
39 | +} __packed; | |
40 | + | |
41 | +struct sdias_sccb { | |
42 | + struct sccb_header hdr; | |
43 | + struct sdias_evbuf evbuf; | |
44 | +} __packed; | |
45 | + | |
46 | +#endif /* SCLP_SDIAS_H */ |