blob: 0e40defc60874c221ef51771621865751194d4a5 [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
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;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010013} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
Cornelia Huck495a5b42006-03-24 03:15:14 -080015#define NR_MEASUREMENT_CHARS 5
16struct cmg_chars {
17 u32 values[NR_MEASUREMENT_CHARS];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010018} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080019
20#define NR_MEASUREMENT_ENTRIES 8
21struct cmg_entry {
22 u32 values[NR_MEASUREMENT_ENTRIES];
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010023} __attribute__ ((packed));
Cornelia Huck495a5b42006-03-24 03:15:14 -080024
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;
Peter Oberparleiter0f008aa2007-02-05 21:17:40 +010034} __attribute__ ((packed));
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020036struct channel_path;
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Heiko Carstens2b67fc42007-02-05 21:16:47 +010038extern int css_get_ssd_info(struct subchannel *);
39extern int chsc_process_crw(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41struct css_general_char {
42 u64 : 41;
43 u32 aif : 1; /* bit 41 */
44 u32 : 3;
45 u32 mcss : 1; /* bit 45 */
46 u32 : 2;
47 u32 ext_mb : 1; /* bit 48 */
48 u32 : 7;
49 u32 aif_tdd : 1; /* bit 56 */
Frank Pavlic8129ee12006-01-06 00:19:20 -080050 u32 : 1;
51 u32 qebsm : 1; /* bit 58 */
52 u32 : 8;
Linus Torvalds1da177e2005-04-16 15:20:36 -070053 u32 aif_osa : 1; /* bit 67 */
54 u32 : 28;
55}__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
72extern int chsc_determine_css_characteristics(void);
73extern int css_characteristics_avail;
74
Cornelia Huckfb6958a2006-01-06 00:19:25 -080075extern int chsc_enable_facility(int);
Cornelia Huck495a5b42006-03-24 03:15:14 -080076struct channel_subsystem;
77extern int chsc_secm(struct channel_subsystem *, int);
Cornelia Huckfb6958a2006-01-06 00:19:25 -080078
Peter Oberparleitere6b6e102007-04-27 16:01:28 +020079int chsc_chp_vary(struct chp_id chpid, int on);
80int chsc_determine_channel_path_description(struct chp_id chpid,
81 struct channel_path_desc *desc);
82int chsc_chp_online(struct chp_id chpid);
83void chsc_chp_offline(struct chp_id chpid);
84int chsc_get_channel_measurement_chars(struct channel_path *chp);
Cornelia Hucka28c6942006-01-06 00:19:23 -080085
Linus Torvalds1da177e2005-04-16 15:20:36 -070086#endif