brintos

brintos / linux-shallow public Read only

0
0
Text · 4.9 KiB · 24cd65d Raw
229 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2#ifndef S390_CHSC_H3#define S390_CHSC_H4 5#include <linux/types.h>6#include <linux/device.h>7#include <asm/css_chars.h>8#include <asm/chpid.h>9#include <asm/chsc.h>10#include <asm/schid.h>11#include <asm/qdio.h>12 13#define CHSC_SDA_OC_MSS   0x214 15#define NR_MEASUREMENT_CHARS 516struct cmg_chars {17	u32 values[NR_MEASUREMENT_CHARS];18};19 20#define NR_MEASUREMENT_ENTRIES 821struct cmg_entry {22	u32 values[NR_MEASUREMENT_ENTRIES];23};24 25#define NR_EXT_MEASUREMENT_ENTRIES 1626struct cmg_ext_entry {27	u32 values[NR_EXT_MEASUREMENT_ENTRIES];28};29 30struct channel_path_desc_fmt1 {31	u8 flags;32	u8 lsn;33	u8 desc;34	u8 chpid;35	u32:16;36	u8 esc;37	u8 chpp;38	u32 unused[2];39	u16 chid;40	u32:16;41	u16 mdc;42	u16:13;43	u8 r:1;44	u8 s:1;45	u8 f:1;46	u32 zeros[2];47};48 49struct channel_path_desc_fmt3 {50	struct channel_path_desc_fmt1 fmt1_desc;51	u8 util_str[64];52};53 54struct channel_path;55 56struct css_chsc_char {57	u64 res;58	u64 : 20;59	u32 secm : 1; /* bit 84 */60	u32 : 1;61	u32 scmc : 1; /* bit 86 */62	u32 : 20;63	u32 scssc : 1;  /* bit 107 */64	u32 scsscf : 1; /* bit 108 */65	u32:7;66	u32 pnso:1; /* bit 116 */67	u32:11;68} __packed;69 70extern struct css_chsc_char css_chsc_characteristics;71 72struct chsc_ssd_info {73	u8 path_mask;74	u8 fla_valid_mask;75	struct chp_id chpid[8];76	u16 fla[8];77};78 79struct chsc_ssqd_area {80	struct chsc_header request;81	u16:10;82	u8 ssid:2;83	u8 fmt:4;84	u16 first_sch;85	u16:16;86	u16 last_sch;87	u32:32;88	struct chsc_header response;89	u32:32;90	struct qdio_ssqd_desc qdio_ssqd;91} __packed __aligned(PAGE_SIZE);92 93struct chsc_scssc_area {94	struct chsc_header request;95	u16 operation_code;96	u16:16;97	u32:32;98	u32:32;99	dma64_t summary_indicator_addr;100	dma64_t subchannel_indicator_addr;101	u32 ks:4;102	u32 kc:4;103	u32:21;104	u32 isc:3;105	u32 word_with_d_bit;106	u32:32;107	struct subchannel_id schid;108	u32 reserved[1004];109	struct chsc_header response;110	u32:32;111} __packed __aligned(PAGE_SIZE);112 113struct chsc_scpd {114	struct chsc_header request;115	u32:2;116	u32 m:1;117	u32 c:1;118	u32 fmt:4;119	u32 cssid:8;120	u32:4;121	u32 rfmt:4;122	u32 first_chpid:8;123	u32:24;124	u32 last_chpid:8;125	u32 zeroes1;126	struct chsc_header response;127	u32:32;128	u8 data[];129} __packed __aligned(PAGE_SIZE);130 131struct chsc_sda_area {132	struct chsc_header request;133	u8 :4;134	u8 format:4;135	u8 :8;136	u16 operation_code;137	u32 :32;138	u32 :32;139	u32 operation_data_area[252];140	struct chsc_header response;141	u32 :4;142	u32 format2:4;143	u32 :24;144} __packed __aligned(PAGE_SIZE);145 146extern int chsc_get_ssd_info(struct subchannel_id schid,147			     struct chsc_ssd_info *ssd);148extern int chsc_determine_css_characteristics(void);149extern int chsc_init(void);150extern void chsc_init_cleanup(void);151 152int __chsc_enable_facility(struct chsc_sda_area *sda_area, int operation_code);153extern int chsc_enable_facility(int);154struct channel_subsystem;155extern int chsc_secm(struct channel_subsystem *, int);156int __chsc_do_secm(struct channel_subsystem *css, int enable);157 158int chsc_chp_vary(struct chp_id chpid, int on);159int chsc_determine_channel_path_desc(struct chp_id chpid, int fmt, int rfmt,160				     int c, int m, void *page);161int chsc_determine_fmt0_channel_path_desc(struct chp_id chpid,162					  struct channel_path_desc_fmt0 *desc);163int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,164					  struct channel_path_desc_fmt1 *desc);165int chsc_determine_fmt3_channel_path_desc(struct chp_id chpid,166					  struct channel_path_desc_fmt3 *desc);167void chsc_chp_online(struct chp_id chpid);168void chsc_chp_offline(struct chp_id chpid);169int chsc_get_channel_measurement_chars(struct channel_path *chp);170int chsc_ssqd(struct subchannel_id schid, struct chsc_ssqd_area *ssqd);171int chsc_sadc(struct subchannel_id schid, struct chsc_scssc_area *scssc,172	      dma64_t summary_indicator_addr, dma64_t subchannel_indicator_addr,173	      u8 isc);174int chsc_sgib(u32 origin);175int chsc_error_from_response(int response);176 177int chsc_siosl(struct subchannel_id schid);178 179/* Functions and definitions to query storage-class memory. */180struct sale {181	u64 sa;182	u32 p:4;183	u32 op_state:4;184	u32 data_state:4;185	u32 rank:4;186	u32 r:1;187	u32:7;188	u32 rid:8;189	u32:32;190} __packed;191 192struct chsc_scm_info {193	struct chsc_header request;194	u32:32;195	u64 reqtok;196	u32 reserved1[4];197	struct chsc_header response;198	u64:56;199	u8 rq;200	u32 mbc;201	u64 msa;202	u16 is;203	u16 mmc;204	u32 mci;205	u64 nr_scm_ini;206	u64 nr_scm_unini;207	u32 reserved2[10];208	u64 restok;209	struct sale scmal[248];210} __packed __aligned(PAGE_SIZE);211 212int chsc_scm_info(struct chsc_scm_info *scm_area, u64 token);213 214int chsc_pnso(struct subchannel_id schid, struct chsc_pnso_area *pnso_area,215	      u8 oc, struct chsc_pnso_resume_token resume_token, int cnc);216 217int __init chsc_get_cssid_iid(int idx, u8 *cssid, u8 *iid);218 219#ifdef CONFIG_SCM_BUS220int scm_update_information(void);221int scm_process_availability_information(void);222#else /* CONFIG_SCM_BUS */223static inline int scm_update_information(void) { return 0; }224static inline int scm_process_availability_information(void) { return 0; }225#endif /* CONFIG_SCM_BUS */226 227 228#endif229