chsc.h 1.8 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 9
#define CHSC_SDA_OC_MSS   0x2

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

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

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

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

36
struct channel_path;
L
Linus Torvalds 已提交
37

38 39
extern int css_get_ssd_info(struct subchannel *);
extern int chsc_process_crw(void);
L
Linus Torvalds 已提交
40 41 42 43 44 45 46 47 48 49

struct css_general_char {
	u64 : 41;
	u32 aif : 1;     /* bit 41 */
	u32 : 3;
	u32 mcss : 1;    /* bit 45 */
	u32 : 2;
	u32 ext_mb : 1;  /* bit 48 */
	u32 : 7;
	u32 aif_tdd : 1; /* bit 56 */
50 51 52
	u32 : 1;
	u32 qebsm : 1;   /* bit 58 */
	u32 : 8;
L
Linus Torvalds 已提交
53 54 55 56 57 58
	u32 aif_osa : 1; /* bit 67 */
	u32 : 28;
}__attribute__((packed));

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

extern struct css_general_char css_general_characteristics;
extern struct css_chsc_char css_chsc_characteristics;

extern int chsc_determine_css_characteristics(void);
extern int css_characteristics_avail;

75
extern int chsc_enable_facility(int);
76 77
struct channel_subsystem;
extern int chsc_secm(struct channel_subsystem *, int);
78

79 80 81 82 83 84
int chsc_chp_vary(struct chp_id chpid, int on);
int chsc_determine_channel_path_description(struct chp_id chpid,
					    struct channel_path_desc *desc);
int chsc_chp_online(struct chp_id chpid);
void chsc_chp_offline(struct chp_id chpid);
int chsc_get_channel_measurement_chars(struct channel_path *chp);
85

L
Linus Torvalds 已提交
86
#endif