blob: ba59bceace987968823330fb74abf048286b96e1 [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>
Cornelia Huck9d92a7e2008-07-14 09:59:05 +02007#include <asm/chsc.h>
8#include <asm/schid.h>
Peter Oberparleiterf86635f2007-04-27 16:01:26 +02009
Cornelia Huckfb6958a2006-01-06 00:19:25 -080010#define CHSC_SDA_OC_MSS 0x2
11
Linus Torvalds1da177e2005-04-16 15:20:36 -070012struct chsc_header {
13 u16 length;
14 u16 code;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010015} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070016
Cornelia Huck495a5b42006-03-24 03:15:14 -080017#define NR_MEASUREMENT_CHARS 5
18struct cmg_chars {
19 u32 values[NR_MEASUREMENT_CHARS];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010020} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080021
22#define NR_MEASUREMENT_ENTRIES 8
23struct cmg_entry {
24 u32 values[NR_MEASUREMENT_ENTRIES];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010025} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080026
Linus Torvalds1da177e2005-04-16 15:20:36 -070027struct channel_path_desc {
28 u8 flags;
29 u8 lsn;
30 u8 desc;
31 u8 chpid;
32 u8 swla;
33 u8 zeroes;
34 u8 chla;
35 u8 chpp;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010036} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020038struct channel_path;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Linus Torvalds1da177e2005-04-16 15:20:36 -070040struct css_general_char {
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020041 u64 : 12;
42 u32 dynio : 1; /* bit 12 */
43 u32 : 28;
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 u32 aif : 1; /* bit 41 */
45 u32 : 3;
46 u32 mcss : 1; /* bit 45 */
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020047 u32 fcs : 1; /* bit 46 */
48 u32 : 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 u32 ext_mb : 1; /* bit 48 */
50 u32 : 7;
51 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080052 u32 : 1;
53 u32 qebsm : 1; /* bit 58 */
54 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070055 u32 aif_osa : 1; /* bit 67 */
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020056 u32 : 14;
57 u32 cib : 1; /* bit 82 */
58 u32 : 5;
Peter Oberparleiter4f2bd922008-07-14 09:58:49 +020059 u32 fcx : 1; /* bit 88 */
60 u32 : 7;
Linus Torvalds1da177e2005-04-16 15:20:36 -070061}__attribute__((packed));
62
63struct css_chsc_char {
64 u64 res;
Cornelia Huck495a5b42006-03-24 03:15:14 -080065 u64 : 20;
66 u32 secm : 1; /* bit 84 */
67 u32 : 1;
68 u32 scmc : 1; /* bit 86 */
69 u32 : 20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 u32 scssc : 1; /* bit 107 */
71 u32 scsscf : 1; /* bit 108 */
72 u32 : 19;
73}__attribute__((packed));
74
75extern struct css_general_char css_general_characteristics;
76extern struct css_chsc_char css_chsc_characteristics;
77
Peter Oberparleiter7ad6a242007-04-27 16:01:35 +020078struct chsc_ssd_info {
79 u8 path_mask;
80 u8 fla_valid_mask;
81 struct chp_id chpid[8];
82 u16 fla[8];
83};
84extern int chsc_get_ssd_info(struct subchannel_id schid,
85 struct chsc_ssd_info *ssd);
Linus Torvalds1da177e2005-04-16 15:20:36 -070086extern int chsc_determine_css_characteristics(void);
Cornelia Huck4434a382007-07-27 12:29:21 +020087extern int chsc_alloc_sei_area(void);
88extern void chsc_free_sei_area(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
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
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020094int chsc_chp_vary(struct chp_id chpid, int on);
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020095int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
96 int c, int m,
97 struct chsc_response_struct *resp);
98int chsc_determine_base_channel_path_desc(struct chp_id chpid,
99 struct channel_path_desc *desc);
Peter Oberparleiter83b33702007-04-27 16:01:34 +0200100void chsc_chp_online(struct chp_id chpid);
Peter Oberparleitere6b6e102007-04-27 16:01:28 +0200101void chsc_chp_offline(struct chp_id chpid);
102int chsc_get_channel_measurement_chars(struct channel_path *chp);
Cornelia Hucka28c6942006-01-06 00:19:23 -0800103
Cornelia Huckdae39842008-07-17 17:16:47 +0200104int chsc_error_from_response(int response);
105
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106#endif