blob: a259245780ae7465d1be49fe442c076d32324585 [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);
50
51struct css_general_char {
52 u64 : 41;
53 u32 aif : 1; /* bit 41 */
54 u32 : 3;
55 u32 mcss : 1; /* bit 45 */
56 u32 : 2;
57 u32 ext_mb : 1; /* bit 48 */
58 u32 : 7;
59 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080060 u32 : 1;
61 u32 qebsm : 1; /* bit 58 */
62 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070063 u32 aif_osa : 1; /* bit 67 */
64 u32 : 28;
65}__attribute__((packed));
66
67struct css_chsc_char {
68 u64 res;
Cornelia Huck495a5b42006-03-24 03:15:14 -080069 u64 : 20;
70 u32 secm : 1; /* bit 84 */
71 u32 : 1;
72 u32 scmc : 1; /* bit 86 */
73 u32 : 20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070074 u32 scssc : 1; /* bit 107 */
75 u32 scsscf : 1; /* bit 108 */
76 u32 : 19;
77}__attribute__((packed));
78
79extern struct css_general_char css_general_characteristics;
80extern struct css_chsc_char css_chsc_characteristics;
81
82extern int chsc_determine_css_characteristics(void);
83extern int css_characteristics_avail;
84
85extern void *chsc_get_chp_desc(struct subchannel*, int);
Cornelia Hucka28c6942006-01-06 00:19:23 -080086
Cornelia Huckfb6958a2006-01-06 00:19:25 -080087extern int chsc_enable_facility(int);
Cornelia Huck495a5b42006-03-24 03:15:14 -080088struct channel_subsystem;
89extern int chsc_secm(struct channel_subsystem *, int);
Cornelia Huckfb6958a2006-01-06 00:19:25 -080090
Cornelia Huck501fe312006-02-03 03:03:52 -080091#define to_channelpath(device) container_of(device, struct channel_path, dev)
Cornelia Hucka28c6942006-01-06 00:19:23 -080092
Linus Torvalds1da177e2005-04-16 15:20:36 -070093#endif