diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/s390/char/sclp_sdias.c | 78 | ||||
| -rw-r--r-- | drivers/s390/char/sclp_sdias.h | 46 |
2 files changed, 68 insertions, 56 deletions
diff --git a/drivers/s390/char/sclp_sdias.c b/drivers/s390/char/sclp_sdias.c index b1032931a1c4..561a0414b352 100644 --- a/drivers/s390/char/sclp_sdias.c +++ b/drivers/s390/char/sclp_sdias.c | |||
| @@ -1,7 +1,7 @@ | |||
| 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 | * Author(s): Michael Holzheu | 5 | * Author(s): Michael Holzheu |
| 6 | */ | 6 | */ |
| 7 | 7 | ||
| @@ -14,6 +14,7 @@ | |||
| 14 | #include <asm/debug.h> | 14 | #include <asm/debug.h> |
| 15 | #include <asm/ipl.h> | 15 | #include <asm/ipl.h> |
| 16 | 16 | ||
| 17 | #include "sclp_sdias.h" | ||
| 17 | #include "sclp.h" | 18 | #include "sclp.h" |
| 18 | #include "sclp_rw.h" | 19 | #include "sclp_rw.h" |
| 19 | 20 | ||
| @@ -22,46 +23,12 @@ | |||
| 22 | #define SDIAS_RETRIES 300 | 23 | #define SDIAS_RETRIES 300 |
| 23 | #define SDIAS_SLEEP_TICKS 50 | 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 | static struct debug_info *sdias_dbf; | 26 | static struct debug_info *sdias_dbf; |
| 35 | 27 | ||
| 36 | static struct sclp_register sclp_sdias_register = { | 28 | static struct sclp_register sclp_sdias_register = { |
| 37 | .send_mask = EVTYP_SDIAS_MASK, | 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 | static struct sdias_sccb sccb __attribute__((aligned(4096))); | 32 | static struct sdias_sccb sccb __attribute__((aligned(4096))); |
| 66 | static struct sdias_evbuf sdias_evbuf; | 33 | static struct sdias_evbuf sdias_evbuf; |
| 67 | 34 | ||
| @@ -148,8 +115,8 @@ int sclp_sdias_blk_count(void) | |||
| 148 | sccb.hdr.length = sizeof(sccb); | 115 | sccb.hdr.length = sizeof(sccb); |
| 149 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); | 116 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); |
| 150 | sccb.evbuf.hdr.type = EVTYP_SDIAS; | 117 | sccb.evbuf.hdr.type = EVTYP_SDIAS; |
| 151 | sccb.evbuf.event_qual = EQ_SIZE; | 118 | sccb.evbuf.event_qual = SDIAS_EQ_SIZE; |
| 152 | sccb.evbuf.data_id = DI_FCP_DUMP; | 119 | sccb.evbuf.data_id = SDIAS_DI_FCP_DUMP; |
| 153 | sccb.evbuf.event_id = 4712; | 120 | sccb.evbuf.event_id = 4712; |
| 154 | sccb.evbuf.dbs = 1; | 121 | sccb.evbuf.dbs = 1; |
| 155 | 122 | ||
| @@ -208,13 +175,13 @@ int sclp_sdias_copy(void *dest, int start_blk, int nr_blks) | |||
| 208 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); | 175 | sccb.evbuf.hdr.length = sizeof(struct sdias_evbuf); |
| 209 | sccb.evbuf.hdr.type = EVTYP_SDIAS; | 176 | sccb.evbuf.hdr.type = EVTYP_SDIAS; |
| 210 | sccb.evbuf.hdr.flags = 0; | 177 | sccb.evbuf.hdr.flags = 0; |
| 211 | sccb.evbuf.event_qual = EQ_STORE_DATA; | 178 | sccb.evbuf.event_qual = SDIAS_EQ_STORE_DATA; |
| 212 | sccb.evbuf.data_id = DI_FCP_DUMP; | 179 | sccb.evbuf.data_id = SDIAS_DI_FCP_DUMP; |
| 213 | sccb.evbuf.event_id = 4712; | 180 | sccb.evbuf.event_id = 4712; |
| 214 | #ifdef CONFIG_64BIT | 181 | #ifdef CONFIG_64BIT |
| 215 | sccb.evbuf.asa_size = ASA_SIZE_64; | 182 | sccb.evbuf.asa_size = SDIAS_ASA_SIZE_64; |
| 216 | #else | 183 | #else |
| 217 | sccb.evbuf.asa_size = ASA_SIZE_32; | 184 | sccb.evbuf.asa_size = SDIAS_ASA_SIZE_32; |
| 218 | #endif | 185 | #endif |
| 219 | sccb.evbuf.event_status = 0; | 186 | sccb.evbuf.event_status = 0; |
| 220 | sccb.evbuf.blk_cnt = nr_blks; | 187 | sccb.evbuf.blk_cnt = nr_blks; |
| @@ -240,20 +207,19 @@ int sclp_sdias_copy(void *dest, int start_blk, int nr_blks) | |||
| 240 | } | 207 | } |
| 241 | 208 | ||
| 242 | switch (sdias_evbuf.event_status) { | 209 | switch (sdias_evbuf.event_status) { |
| 243 | case EVSTATE_ALL_STORED: | 210 | case SDIAS_EVSTATE_ALL_STORED: |
| 244 | TRACE("all stored\n"); | 211 | TRACE("all stored\n"); |
| 245 | break; | 212 | break; |
| 246 | case EVSTATE_PART_STORED: | 213 | case SDIAS_EVSTATE_PART_STORED: |
| 247 | TRACE("part stored: %i\n", sdias_evbuf.blk_cnt); | 214 | TRACE("part stored: %i\n", sdias_evbuf.blk_cnt); |
| 248 | break; | 215 | break; |
| 249 | case EVSTATE_NO_DATA: | 216 | case SDIAS_EVSTATE_NO_DATA: |
| 250 | TRACE("no data\n"); | 217 | TRACE("no data\n"); |
| 251 | /* fall through */ | 218 | /* fall through */ |
| 252 | default: | 219 | default: |
| 253 | pr_err("Error from SCLP while copying hsa. " | 220 | pr_err("Error from SCLP while copying hsa. Event status = %x\n", |
| 254 | "Event status = %x\n", | 221 | sdias_evbuf.event_status); |
| 255 | sdias_evbuf.event_status); | 222 | rc = -EIO; |
| 256 | rc = -EIO; | ||
| 257 | } | 223 | } |
| 258 | out: | 224 | out: |
| 259 | mutex_unlock(&sdias_mutex); | 225 | mutex_unlock(&sdias_mutex); |
diff --git a/drivers/s390/char/sclp_sdias.h b/drivers/s390/char/sclp_sdias.h new file mode 100644 index 000000000000..f2431c414150 --- /dev/null +++ b/drivers/s390/char/sclp_sdias.h | |||
| @@ -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 */ | ||
