1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/types.h>
6 #include <linux/device.h>
7 #include <asm/css_chars.h>
10 #include <asm/schid.h>
13 #define CHSC_SDA_OC_MSS 0x2
15 #define NR_MEASUREMENT_CHARS 5
17 u32 values[NR_MEASUREMENT_CHARS];
18 } __attribute__ ((packed));
20 #define NR_MEASUREMENT_ENTRIES 8
22 u32 values[NR_MEASUREMENT_ENTRIES];
23 } __attribute__ ((packed));
25 struct channel_path_desc_fmt1 {
41 } __attribute__ ((packed));
45 struct css_chsc_char {
48 u32 secm : 1; /* bit 84 */
50 u32 scmc : 1; /* bit 86 */
52 u32 scssc : 1; /* bit 107 */
53 u32 scsscf : 1; /* bit 108 */
55 u32 pnso:1; /* bit 116 */
57 }__attribute__((packed));
59 extern struct css_chsc_char css_chsc_characteristics;
61 struct chsc_ssd_info {
64 struct chp_id chpid[8];
68 struct chsc_ssqd_area {
69 struct chsc_header request;
77 struct chsc_header response;
79 struct qdio_ssqd_desc qdio_ssqd;
82 struct chsc_scssc_area {
83 struct chsc_header request;
88 u64 summary_indicator_addr;
89 u64 subchannel_indicator_addr;
96 struct subchannel_id schid;
98 struct chsc_header response;
103 struct chsc_header request;
115 struct chsc_header response;
120 struct chsc_sda_area {
121 struct chsc_header request;
128 u32 operation_data_area[252];
129 struct chsc_header response;
133 } __packed __aligned(PAGE_SIZE);
135 extern int chsc_get_ssd_info(struct subchannel_id schid,
136 struct chsc_ssd_info *ssd);
137 extern int chsc_determine_css_characteristics(void);
138 extern int chsc_init(void);
139 extern void chsc_init_cleanup(void);
141 int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code);
142 extern int chsc_enable_facility(int);
143 struct channel_subsystem;
144 extern int chsc_secm(struct channel_subsystem *, int);
145 int __chsc_do_secm(struct channel_subsystem *css, int enable);
147 int chsc_chp_vary(struct chp_id chpid, int on);
148 int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,
149 int c, int m, void *page);
150 int chsc_determine_base_channel_path_desc(struct chp_id chpid,
151 struct channel_path_desc *desc);
152 int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
153 struct channel_path_desc_fmt1 *desc);
154 void chsc_chp_online(struct chp_id chpid);
155 void chsc_chp_offline(struct chp_id chpid);
156 int chsc_get_channel_measurement_chars(struct channel_path *chp);
157 int chsc_ssqd(struct subchannel_id schid, struct chsc_ssqd_area *ssqd);
158 int chsc_sadc(struct subchannel_id schid, struct chsc_scssc_area *scssc,
159 u64 summary_indicator_addr, u64 subchannel_indicator_addr);
160 int chsc_error_from_response(int response);
162 int chsc_siosl(struct subchannel_id schid);
164 /* Functions and definitions to query storage-class memory. */
177 struct chsc_scm_info {
178 struct chsc_header request;
182 struct chsc_header response;
194 struct sale scmal[248];
197 int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token);
199 struct chsc_brinfo_resume_token {
204 struct chsc_brinfo_naihdr {
205 struct chsc_brinfo_resume_token resume_token;
213 struct chsc_pnso_area {
214 struct chsc_header request;
227 struct chsc_brinfo_resume_token resume_token;
231 struct chsc_header response;
233 struct chsc_brinfo_naihdr naihdr;
235 struct qdio_brinfo_entry_l3_ipv6 l3_ipv6[0];
236 struct qdio_brinfo_entry_l3_ipv4 l3_ipv4[0];
237 struct qdio_brinfo_entry_l2 l2[0];
241 int chsc_pnso_brinfo(struct subchannel_id schid,
242 struct chsc_pnso_area *brinfo_area,
243 struct chsc_brinfo_resume_token resume_token,
246 int __init chsc_get_cssid(int idx);
248 #ifdef CONFIG_SCM_BUS
249 int scm_update_information(void);
250 int scm_process_availability_information(void);
251 #else /* CONFIG_SCM_BUS */
252 static inline int scm_update_information(void) { return 0; }
253 static inline int scm_process_availability_information(void) { return 0; }
254 #endif /* CONFIG_SCM_BUS */