blob: 2a38b5090228fbe2b0cb6c450c619567aba11457 [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>
Peter Oberparleitere5854a52007-04-27 16:01:31 +02006#include <asm/chpid.h>
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +02007#include "schid.h"
Peter Oberparleiterf86635f2007-04-27 16:01:26 +02008
Cornelia Huckfb6958a2006-01-06 00:19:25 -08009#define CHSC_SDA_OC_MSS 0x2
10
Linus Torvalds1da177e2005-04-16 15:20:36 -070011struct chsc_header {
12 u16 length;
13 u16 code;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010014} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
Cornelia Huck495a5b42006-03-24 03:15:14 -080016#define NR_MEASUREMENT_CHARS 5
17struct cmg_chars {
18 u32 values[NR_MEASUREMENT_CHARS];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010019} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080020
21#define NR_MEASUREMENT_ENTRIES 8
22struct cmg_entry {
23 u32 values[NR_MEASUREMENT_ENTRIES];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010024} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080025
Linus Torvalds1da177e2005-04-16 15:20:36 -070026struct channel_path_desc {
27 u8 flags;
28 u8 lsn;
29 u8 desc;
30 u8 chpid;
31 u8 swla;
32 u8 zeroes;
33 u8 chla;
34 u8 chpp;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010035} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020037struct channel_path;
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Linus Torvalds1da177e2005-04-16 15:20:36 -070039struct css_general_char {
40 u64 : 41;
41 u32 aif : 1; /* bit 41 */
42 u32 : 3;
43 u32 mcss : 1; /* bit 45 */
44 u32 : 2;
45 u32 ext_mb : 1; /* bit 48 */
46 u32 : 7;
47 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080048 u32 : 1;
49 u32 qebsm : 1; /* bit 58 */
50 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 u32 aif_osa : 1; /* bit 67 */
Peter Oberparleiter4f2bd922008-07-14 09:58:49 +020052 u32 : 20;
53 u32 fcx : 1; /* bit 88 */
54 u32 : 7;
Linus Torvalds1da177e2005-04-16 15:20:36 -070055}__attribute__((packed));
56
57struct css_chsc_char {
58 u64 res;
Cornelia Huck495a5b42006-03-24 03:15:14 -080059 u64 : 20;
60 u32 secm : 1; /* bit 84 */
61 u32 : 1;
62 u32 scmc : 1; /* bit 86 */
63 u32 : 20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 u32 scssc : 1; /* bit 107 */
65 u32 scsscf : 1; /* bit 108 */
66 u32 : 19;
67}__attribute__((packed));
68
69extern struct css_general_char css_general_characteristics;
70extern struct css_chsc_char css_chsc_characteristics;
71
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +020072struct chsc_ssd_info {
73 u8 path_mask;
74 u8 fla_valid_mask;
75 struct chp_id chpid[8];
76 u16 fla[8];
77};
78extern int chsc_get_ssd_info(struct subchannel_id schid,
79 struct chsc_ssd_info *ssd);
Linus Torvalds1da177e2005-04-16 15:20:36 -070080extern int chsc_determine_css_characteristics(void);
Cornelia Huck4434a382007-07-27 12:29:21 +020081extern int chsc_alloc_sei_area(void);
82extern void chsc_free_sei_area(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
Cornelia Huckfb6958a2006-01-06 00:19:25 -080084extern int chsc_enable_facility(int);
Cornelia Huck495a5b42006-03-24 03:15:14 -080085struct channel_subsystem;
86extern int chsc_secm(struct channel_subsystem *, int);
Cornelia Huckfb6958a2006-01-06 00:19:25 -080087
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020088int chsc_chp_vary(struct chp_id chpid, int on);
89int chsc_determine_channel_path_description(struct chp_id chpid,
90 struct channel_path_desc *desc);
Peter Oberparleiter83b33702007-04-27 16:01:34 +020091void chsc_chp_online(struct chp_id chpid);
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020092void chsc_chp_offline(struct chp_id chpid);
93int chsc_get_channel_measurement_chars(struct channel_path *chp);
Cornelia Hucka28c6942006-01-06 00:19:23 -080094
Linus Torvalds1da177e2005-04-16 15:20:36 -070095#endif