chsc.h 2.5 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef S390_CHSC_H
#define S390_CHSC_H

4 5
#include <linux/types.h>
#include <linux/device.h>
6
#include <asm/chpid.h>
7 8
#include <asm/chsc.h>
#include <asm/schid.h>
9

10 11
#define CHSC_SDA_OC_MSS   0x2

L
Linus Torvalds 已提交
12 13 14
struct chsc_header {
	u16 length;
	u16 code;
15
} __attribute__ ((packed));
L
Linus Torvalds 已提交
16

17 18 19
#define NR_MEASUREMENT_CHARS 5
struct cmg_chars {
	u32 values[NR_MEASUREMENT_CHARS];
20
} __attribute__ ((packed));
21 22 23 24

#define NR_MEASUREMENT_ENTRIES 8
struct cmg_entry {
	u32 values[NR_MEASUREMENT_ENTRIES];
25
} __attribute__ ((packed));
26

L
Linus Torvalds 已提交
27 28 29 30 31 32 33 34 35
struct channel_path_desc {
	u8 flags;
	u8 lsn;
	u8 desc;
	u8 chpid;
	u8 swla;
	u8 zeroes;
	u8 chla;
	u8 chpp;
36
} __attribute__ ((packed));
L
Linus Torvalds 已提交
37

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
struct channel_path_desc_fmt1 {
	u8 flags;
	u8 lsn;
	u8 desc;
	u8 chpid;
	u32:24;
	u8 chpp;
	u32 unused[3];
	u16 mdc;
	u16:13;
	u8 r:1;
	u8 s:1;
	u8 f:1;
	u32 zeros[2];
} __attribute__ ((packed));

54
struct channel_path;
L
Linus Torvalds 已提交
55 56 57

struct css_chsc_char {
	u64 res;
58 59 60 61 62
	u64 : 20;
	u32 secm : 1; /* bit 84 */
	u32 : 1;
	u32 scmc : 1; /* bit 86 */
	u32 : 20;
L
Linus Torvalds 已提交
63 64 65 66 67 68 69
	u32 scssc : 1;  /* bit 107 */
	u32 scsscf : 1; /* bit 108 */
	u32 : 19;
}__attribute__((packed));

extern struct css_chsc_char css_chsc_characteristics;

70 71 72 73 74 75
struct chsc_ssd_info {
	u8 path_mask;
	u8 fla_valid_mask;
	struct chp_id chpid[8];
	u16 fla[8];
};
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94

struct chsc_scpd {
	struct chsc_header request;
	u32:2;
	u32 m:1;
	u32 c:1;
	u32 fmt:4;
	u32 cssid:8;
	u32:4;
	u32 rfmt:4;
	u32 first_chpid:8;
	u32:24;
	u32 last_chpid:8;
	u32 zeroes1;
	struct chsc_header response;
	u8 data[PAGE_SIZE - 20];
} __attribute__ ((packed));


95 96
extern int chsc_get_ssd_info(struct subchannel_id schid,
			     struct chsc_ssd_info *ssd);
L
Linus Torvalds 已提交
97
extern int chsc_determine_css_characteristics(void);
S
Sebastian Ott 已提交
98 99
extern int chsc_init(void);
extern void chsc_init_cleanup(void);
L
Linus Torvalds 已提交
100

101
extern int chsc_enable_facility(int);
102 103
struct channel_subsystem;
extern int chsc_secm(struct channel_subsystem *, int);
104
int __chsc_do_secm(struct channel_subsystem *css, int enable);
105

106
int chsc_chp_vary(struct chp_id chpid, int on);
107
int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
108
				     int c, int m, void *page);
109 110
int chsc_determine_base_channel_path_desc(struct chp_id chpid,
					  struct channel_path_desc *desc);
111 112
int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
					  struct channel_path_desc_fmt1 *desc);
113
void chsc_chp_online(struct chp_id chpid);
114 115
void chsc_chp_offline(struct chp_id chpid);
int chsc_get_channel_measurement_chars(struct channel_path *chp);
116

117 118
int chsc_error_from_response(int response);

M
Michael Ernst 已提交
119 120
int chsc_siosl(struct subchannel_id schid);

L
Linus Torvalds 已提交
121
#endif