summaryrefslogtreecommitdiff
path: root/drivers/s390/char/sclp_diag.h
blob: 796c5311b865def1a6dd8175b95aa23484f2f6f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *    Copyright IBM Corp. 2013
 *    Author(s): Ralf Hoppe (rhoppe@de.ibm.com)
 */

#ifndef _SCLP_DIAG_H
#define _SCLP_DIAG_H

#include <linux/types.h>

/* return codes for Diagnostic Test FTP Service, as indicated in member
 * sclp_diag_ftp::ldflg
 */
#define SCLP_DIAG_FTP_OK	0x80U /* success */
#define SCLP_DIAG_FTP_LDFAIL	0x01U /* load failed */
#define SCLP_DIAG_FTP_LDNPERM	0x02U /* not allowed */
#define SCLP_DIAG_FTP_LDRUNS	0x03U /* LD runs */
#define SCLP_DIAG_FTP_LDNRUNS	0x04U /* LD does not run */

#define SCLP_DIAG_FTP_XPCX	0x80 /* PCX communication code */
#define SCLP_DIAG_FTP_ROUTE	4 /* routing code for new FTP service */

/*
 * length of Diagnostic Test FTP Service event buffer
 */
#define SCLP_DIAG_FTP_EVBUF_LEN				\
	(offsetof(struct sclp_diag_evbuf, mdd) +	\
	 sizeof(struct sclp_diag_ftp))

/**
 * struct sclp_diag_ftp - Diagnostic Test FTP Service model-dependent data
 * @pcx: code for PCX communication (should be 0x80)
 * @ldflg: load flag (see defines above)
 * @cmd: FTP command
 * @pgsize: page size (0 = 4kB, 1 = large page size)
 * @srcflg: source flag
 * @spare: reserved (zeroes)
 * @offset: file offset
 * @fsize: file size
 * @length: buffer size resp. bytes transferred
 * @failaddr: failing address
 * @bufaddr: buffer address, virtual
 * @asce: region or segment table designation
 * @fident: file name (ASCII, zero-terminated)
 */
struct sclp_diag_ftp {
	u8 pcx;
	u8 ldflg;
	u8 cmd;
	u8 pgsize;
	u8 srcflg;
	u8 spare;
	u64 offset;
	u64 fsize;
	u64 length;
	u64 failaddr;
	u64 bufaddr;
	u64 asce;

	u8 fident[256];
} __packed;

/**
 * struct sclp_diag_evbuf - Diagnostic Test (ET7) Event Buffer
 * @hdr: event buffer header
 * @route: diagnostic route
 * @mdd: model-dependent data (@route dependent)
 */
struct sclp_diag_evbuf {
	struct evbuf_header hdr;
	u16 route;

	union {
		struct sclp_diag_ftp ftp;
	} mdd;
} __packed;

/**
 * struct sclp_diag_sccb - Diagnostic Test (ET7) SCCB
 * @hdr: SCCB header
 * @evbuf: event buffer
 */
struct sclp_diag_sccb {

	struct sccb_header hdr;
	struct sclp_diag_evbuf evbuf;
} __packed;

#endif /* _SCLP_DIAG_H */