Skip to content

Commit f8049e3

Browse files
Michael HolzheuMartin Schwidefsky
authored andcommitted
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>
1 parent 7d59432 commit f8049e3

2 files changed

Lines changed: 68 additions & 56 deletions

File tree

‎drivers/s390/char/sclp_sdias.c‎

Lines changed: 22 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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

@@ -14,6 +14,7 @@
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

@@ -22,46 +23,12 @@
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-
3426
static struct debug_info *sdias_dbf;
3527

3628
static 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-
6532
static struct sdias_sccb sccb __attribute__((aligned(4096)));
6633
static 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
}
258224
out:
259225
mutex_unlock(&sdias_mutex);

‎drivers/s390/char/sclp_sdias.h‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 */

0 commit comments

Comments
 (0)