xref: /openbmc/linux/drivers/s390/char/sclp_diag.h (revision f3539c12)
1 /*
2  *    Copyright IBM Corp. 2013
3  *    Author(s): Ralf Hoppe (rhoppe@de.ibm.com)
4  */
5 
6 #ifndef _SCLP_DIAG_H
7 #define _SCLP_DIAG_H
8 
9 #include <linux/types.h>
10 
11 /* return codes for Diagnostic Test FTP Service, as indicated in member
12  * sclp_diag_ftp::ldflg
13  */
14 #define SCLP_DIAG_FTP_OK	0x80U /* success */
15 #define SCLP_DIAG_FTP_LDFAIL	0x01U /* load failed */
16 #define SCLP_DIAG_FTP_LDNPERM	0x02U /* not allowed */
17 #define SCLP_DIAG_FTP_LDRUNS	0x03U /* LD runs */
18 #define SCLP_DIAG_FTP_LDNRUNS	0x04U /* LD does not run */
19 
20 #define SCLP_DIAG_FTP_XPCX	0x80 /* PCX communication code */
21 #define SCLP_DIAG_FTP_ROUTE	4 /* routing code for new FTP service */
22 
23 /*
24  * length of Diagnostic Test FTP Service event buffer
25  */
26 #define SCLP_DIAG_FTP_EVBUF_LEN				\
27 	(offsetof(struct sclp_diag_evbuf, mdd) +	\
28 	 sizeof(struct sclp_diag_ftp))
29 
30 /**
31  * struct sclp_diag_ftp - Diagnostic Test FTP Service model-dependent data
32  * @pcx: code for PCX communication (should be 0x80)
33  * @ldflg: load flag (see defines above)
34  * @cmd: FTP command
35  * @pgsize: page size (0 = 4kB, 1 = large page size)
36  * @srcflg: source flag
37  * @spare: reserved (zeroes)
38  * @offset: file offset
39  * @fsize: file size
40  * @length: buffer size resp. bytes transferred
41  * @failaddr: failing address
42  * @bufaddr: buffer address, virtual
43  * @asce: region or segment table designation
44  * @fident: file name (ASCII, zero-terminated)
45  */
46 struct sclp_diag_ftp {
47 	u8 pcx;
48 	u8 ldflg;
49 	u8 cmd;
50 	u8 pgsize;
51 	u8 srcflg;
52 	u8 spare;
53 	u64 offset;
54 	u64 fsize;
55 	u64 length;
56 	u64 failaddr;
57 	u64 bufaddr;
58 	u64 asce;
59 
60 	u8 fident[256];
61 } __packed;
62 
63 /**
64  * struct sclp_diag_evbuf - Diagnostic Test (ET7) Event Buffer
65  * @hdr: event buffer header
66  * @route: diagnostic route
67  * @mdd: model-dependent data (@route dependent)
68  */
69 struct sclp_diag_evbuf {
70 	struct evbuf_header hdr;
71 	u16 route;
72 
73 	union {
74 		struct sclp_diag_ftp ftp;
75 	} mdd;
76 } __packed;
77 
78 /**
79  * struct sclp_diag_sccb - Diagnostic Test (ET7) SCCB
80  * @hdr: SCCB header
81  * @evbuf: event buffer
82  */
83 struct sclp_diag_sccb {
84 
85 	struct sccb_header hdr;
86 	struct sclp_diag_evbuf evbuf;
87 } __packed;
88 
89 #endif /* _SCLP_DIAG_H */
90