blob: 2949c85b6d9205ae84a8b16723966d462c3e9e2c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef S390_CHSC_H
2#define S390_CHSC_H
3
Peter Oberparleiterf86635f2007-04-27 16:01:26 +02004#include <linux/types.h>
5#include <linux/device.h>
6#include "chpid.h"
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#define CHSC_SEI_ACC_CHPID 1
9#define CHSC_SEI_ACC_LINKADDR 2
10#define CHSC_SEI_ACC_FULLLINKADDR 3
11
Cornelia Huckfb6958a2006-01-06 00:19:25 -080012#define CHSC_SDA_OC_MSS 0x2
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014struct chsc_header {
15 u16 length;
16 u16 code;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010017} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070018
Cornelia Huck495a5b42006-03-24 03:15:14 -080019#define NR_MEASUREMENT_CHARS 5
20struct cmg_chars {
21 u32 values[NR_MEASUREMENT_CHARS];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010022} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080023
24#define NR_MEASUREMENT_ENTRIES 8
25struct cmg_entry {
26 u32 values[NR_MEASUREMENT_ENTRIES];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010027} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080028
Linus Torvalds1da177e2005-04-16 15:20:36 -070029struct channel_path_desc {
30 u8 flags;
31 u8 lsn;
32 u8 desc;
33 u8 chpid;
34 u8 swla;
35 u8 zeroes;
36 u8 chla;
37 u8 chpp;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010038} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
40struct channel_path {
Peter Oberparleiterf86635f2007-04-27 16:01:26 +020041 struct chp_id chpid;
Linus Torvalds1da177e2005-04-16 15:20:36 -070042 int state;
43 struct channel_path_desc desc;
Cornelia Huck495a5b42006-03-24 03:15:14 -080044 /* Channel-measurement related stuff: */
45 int cmg;
46 int shared;
47 void *cmg_chars;
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 struct device dev;
49};
50
51extern void s390_process_css( void );
52extern void chsc_validate_chpids(struct subchannel *);
Peter Oberparleiterf86635f2007-04-27 16:01:26 +020053extern void chpid_is_actually_online(struct chp_id);
Heiko Carstens2b67fc42007-02-05 21:16:47 +010054extern int css_get_ssd_info(struct subchannel *);
55extern int chsc_process_crw(void);
56extern int chp_process_crw(int, int);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58struct css_general_char {
59 u64 : 41;
60 u32 aif : 1; /* bit 41 */
61 u32 : 3;
62 u32 mcss : 1; /* bit 45 */
63 u32 : 2;
64 u32 ext_mb : 1; /* bit 48 */
65 u32 : 7;
66 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080067 u32 : 1;
68 u32 qebsm : 1; /* bit 58 */
69 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 u32 aif_osa : 1; /* bit 67 */
71 u32 : 28;
72}__attribute__((packed));
73
74struct css_chsc_char {
75 u64 res;
Cornelia Huck495a5b42006-03-24 03:15:14 -080076 u64 : 20;
77 u32 secm : 1; /* bit 84 */
78 u32 : 1;
79 u32 scmc : 1; /* bit 86 */
80 u32 : 20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070081 u32 scssc : 1; /* bit 107 */
82 u32 scsscf : 1; /* bit 108 */
83 u32 : 19;
84}__attribute__((packed));
85
86extern struct css_general_char css_general_characteristics;
87extern struct css_chsc_char css_chsc_characteristics;
88
89extern int chsc_determine_css_characteristics(void);
90extern int css_characteristics_avail;
91
92extern void *chsc_get_chp_desc(struct subchannel*, int);
Cornelia Hucka28c6942006-01-06 00:19:23 -080093
Cornelia Huckfb6958a2006-01-06 00:19:25 -080094extern int chsc_enable_facility(int);
Cornelia Huck495a5b42006-03-24 03:15:14 -080095struct channel_subsystem;
96extern int chsc_secm(struct channel_subsystem *, int);
Cornelia Huckfb6958a2006-01-06 00:19:25 -080097
Cornelia Huck501fe312006-02-03 03:03:52 -080098#define to_channelpath(device) container_of(device, struct channel_path, dev)
Cornelia Hucka28c6942006-01-06 00:19:23 -080099
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100#endif