blob: 3e8ac8f7b5cd340ae299c5d88b362b5696831ac6 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef S390_CHSC_H
2#define S390_CHSC_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#define CHSC_SEI_ACC_CHPID 1
5#define CHSC_SEI_ACC_LINKADDR 2
6#define CHSC_SEI_ACC_FULLLINKADDR 3
7
Cornelia Huckfb6958a2006-01-06 00:19:25 -08008#define CHSC_SDA_OC_MSS 0x2
9
Linus Torvalds1da177e2005-04-16 15:20:36 -070010struct chsc_header {
11 u16 length;
12 u16 code;
13};
14
Cornelia Huck495a5b42006-03-24 03:15:14 -080015#define NR_MEASUREMENT_CHARS 5
16struct cmg_chars {
17 u32 values[NR_MEASUREMENT_CHARS];
18};
19
20#define NR_MEASUREMENT_ENTRIES 8
21struct cmg_entry {
22 u32 values[NR_MEASUREMENT_ENTRIES];
23};
24
Linus Torvalds1da177e2005-04-16 15:20:36 -070025struct channel_path_desc {
26 u8 flags;
27 u8 lsn;
28 u8 desc;
29 u8 chpid;
30 u8 swla;
31 u8 zeroes;
32 u8 chla;
33 u8 chpp;
34};
35
36struct channel_path {
37 int id;
38 int state;
39 struct channel_path_desc desc;
Cornelia Huck495a5b42006-03-24 03:15:14 -080040 /* Channel-measurement related stuff: */
41 int cmg;
42 int shared;
43 void *cmg_chars;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 struct device dev;
45};
46
47extern void s390_process_css( void );
48extern void chsc_validate_chpids(struct subchannel *);
49extern void chpid_is_actually_online(int);
Heiko Carstens2b67fc42007-02-05 21:16:47 +010050extern int css_get_ssd_info(struct subchannel *);
51extern int chsc_process_crw(void);
52extern int chp_process_crw(int, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
54struct css_general_char {
55 u64 : 41;
56 u32 aif : 1; /* bit 41 */
57 u32 : 3;
58 u32 mcss : 1; /* bit 45 */
59 u32 : 2;
60 u32 ext_mb : 1; /* bit 48 */
61 u32 : 7;
62 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080063 u32 : 1;
64 u32 qebsm : 1; /* bit 58 */
65 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 u32 aif_osa : 1; /* bit 67 */
67 u32 : 28;
68}__attribute__((packed));
69
70struct css_chsc_char {
71 u64 res;
Cornelia Huck495a5b42006-03-24 03:15:14 -080072 u64 : 20;
73 u32 secm : 1; /* bit 84 */
74 u32 : 1;
75 u32 scmc : 1; /* bit 86 */
76 u32 : 20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070077 u32 scssc : 1; /* bit 107 */
78 u32 scsscf : 1; /* bit 108 */
79 u32 : 19;
80}__attribute__((packed));
81
82extern struct css_general_char css_general_characteristics;
83extern struct css_chsc_char css_chsc_characteristics;
84
85extern int chsc_determine_css_characteristics(void);
86extern int css_characteristics_avail;
87
88extern void *chsc_get_chp_desc(struct subchannel*, int);
Cornelia Hucka28c6942006-01-06 00:19:23 -080089
Cornelia Huckfb6958a2006-01-06 00:19:25 -080090extern int chsc_enable_facility(int);
Cornelia Huck495a5b42006-03-24 03:15:14 -080091struct channel_subsystem;
92extern int chsc_secm(struct channel_subsystem *, int);
Cornelia Huckfb6958a2006-01-06 00:19:25 -080093
Cornelia Huck501fe312006-02-03 03:03:52 -080094#define to_channelpath(device) container_of(device, struct channel_path, dev)
Cornelia Hucka28c6942006-01-06 00:19:23 -080095
Linus Torvalds1da177e2005-04-16 15:20:36 -070096#endif