2005-04-16 15:20:36 -07:00
# ifndef S390_CHSC_H
# define S390_CHSC_H
2007-04-27 16:01:26 +02:00
# include <linux/types.h>
# include <linux/device.h>
2012-08-28 16:43:36 +02:00
# include <asm/css_chars.h>
2007-04-27 16:01:31 +02:00
# include <asm/chpid.h>
2008-07-14 09:59:05 +02:00
# include <asm/chsc.h>
# include <asm/schid.h>
2013-06-05 18:58:35 +02:00
# include <asm/qdio.h>
2007-04-27 16:01:26 +02:00
2006-01-06 00:19:25 -08:00
# define CHSC_SDA_OC_MSS 0x2
2006-03-24 03:15:14 -08:00
# define NR_MEASUREMENT_CHARS 5
struct cmg_chars {
u32 values [ NR_MEASUREMENT_CHARS ] ;
2007-02-05 21:17:40 +01:00
} __attribute__ ( ( packed ) ) ;
2006-03-24 03:15:14 -08:00
# define NR_MEASUREMENT_ENTRIES 8
struct cmg_entry {
u32 values [ NR_MEASUREMENT_ENTRIES ] ;
2007-02-05 21:17:40 +01:00
} __attribute__ ( ( packed ) ) ;
2006-03-24 03:15:14 -08:00
2011-01-05 12:47:56 +01:00
struct channel_path_desc_fmt1 {
u8 flags ;
u8 lsn ;
u8 desc ;
u8 chpid ;
u32 : 24 ;
u8 chpp ;
2013-05-15 13:43:29 +02:00
u32 unused [ 2 ] ;
u16 chid ;
u32 : 16 ;
2011-01-05 12:47:56 +01:00
u16 mdc ;
u16 : 13 ;
u8 r : 1 ;
u8 s : 1 ;
u8 f : 1 ;
u32 zeros [ 2 ] ;
} __attribute__ ( ( packed ) ) ;
2007-04-27 16:01:28 +02:00
struct channel_path ;
2005-04-16 15:20:36 -07:00
struct css_chsc_char {
u64 res ;
2006-03-24 03:15:14 -08:00
u64 : 20 ;
u32 secm : 1 ; /* bit 84 */
u32 : 1 ;
u32 scmc : 1 ; /* bit 86 */
u32 : 20 ;
2005-04-16 15:20:36 -07:00
u32 scssc : 1 ; /* bit 107 */
u32 scsscf : 1 ; /* bit 108 */
2013-04-24 12:00:23 +02:00
u32 : 7 ;
u32 pnso : 1 ; /* bit 116 */
u32 : 11 ;
2005-04-16 15:20:36 -07:00
} __attribute__ ( ( packed ) ) ;
extern struct css_chsc_char css_chsc_characteristics ;
2007-04-27 16:01:35 +02:00
struct chsc_ssd_info {
u8 path_mask ;
u8 fla_valid_mask ;
struct chp_id chpid [ 8 ] ;
u16 fla [ 8 ] ;
} ;
2010-10-25 16:10:30 +02:00
2013-06-05 18:58:35 +02:00
struct chsc_ssqd_area {
struct chsc_header request ;
u16 : 10 ;
u8 ssid : 2 ;
u8 fmt : 4 ;
u16 first_sch ;
u16 : 16 ;
u16 last_sch ;
u32 : 32 ;
struct chsc_header response ;
u32 : 32 ;
struct qdio_ssqd_desc qdio_ssqd ;
} __packed ;
2013-06-05 18:59:22 +02:00
struct chsc_scssc_area {
struct chsc_header request ;
u16 operation_code ;
u16 : 16 ;
u32 : 32 ;
u32 : 32 ;
u64 summary_indicator_addr ;
u64 subchannel_indicator_addr ;
u32 ks : 4 ;
u32 kc : 4 ;
u32 : 21 ;
u32 isc : 3 ;
u32 word_with_d_bit ;
u32 : 32 ;
struct subchannel_id schid ;
u32 reserved [ 1004 ] ;
struct chsc_header response ;
u32 : 32 ;
} __packed ;
2010-10-25 16:10:30 +02:00
struct chsc_scpd {
struct chsc_header request ;
u32 : 2 ;
u32 m : 1 ;
u32 c : 1 ;
u32 fmt : 4 ;
u32 cssid : 8 ;
u32 : 4 ;
u32 rfmt : 4 ;
u32 first_chpid : 8 ;
u32 : 24 ;
u32 last_chpid : 8 ;
u32 zeroes1 ;
struct chsc_header response ;
u8 data [ PAGE_SIZE - 20 ] ;
} __attribute__ ( ( packed ) ) ;
2007-04-27 16:01:35 +02:00
extern int chsc_get_ssd_info ( struct subchannel_id schid ,
struct chsc_ssd_info * ssd ) ;
2005-04-16 15:20:36 -07:00
extern int chsc_determine_css_characteristics ( void ) ;
2010-10-25 16:10:28 +02:00
extern int chsc_init ( void ) ;
extern void chsc_init_cleanup ( void ) ;
2005-04-16 15:20:36 -07:00
2006-01-06 00:19:25 -08:00
extern int chsc_enable_facility ( int ) ;
2006-03-24 03:15:14 -08:00
struct channel_subsystem ;
extern int chsc_secm ( struct channel_subsystem * , int ) ;
2010-10-25 16:10:29 +02:00
int __chsc_do_secm ( struct channel_subsystem * css , int enable ) ;
2006-01-06 00:19:25 -08:00
2007-04-27 16:01:28 +02:00
int chsc_chp_vary ( struct chp_id chpid , int on ) ;
2008-07-14 09:59:05 +02:00
int chsc_determine_channel_path_desc ( struct chp_id chpid , int fmt , int rfmt ,
2010-10-25 16:10:30 +02:00
int c , int m , void * page ) ;
2008-07-14 09:59:05 +02:00
int chsc_determine_base_channel_path_desc ( struct chp_id chpid ,
struct channel_path_desc * desc ) ;
2011-01-05 12:47:56 +01:00
int chsc_determine_fmt1_channel_path_desc ( struct chp_id chpid ,
struct channel_path_desc_fmt1 * desc ) ;
2007-04-27 16:01:34 +02:00
void chsc_chp_online ( struct chp_id chpid ) ;
2007-04-27 16:01:28 +02:00
void chsc_chp_offline ( struct chp_id chpid ) ;
int chsc_get_channel_measurement_chars ( struct channel_path * chp ) ;
2013-06-05 18:58:35 +02:00
int chsc_ssqd ( struct subchannel_id schid , struct chsc_ssqd_area * ssqd ) ;
2013-06-05 18:59:22 +02:00
int chsc_sadc ( struct subchannel_id schid , struct chsc_scssc_area * scssc ,
u64 summary_indicator_addr , u64 subchannel_indicator_addr ) ;
2008-07-17 17:16:47 +02:00
int chsc_error_from_response ( int response ) ;
2010-08-09 18:12:50 +02:00
int chsc_siosl ( struct subchannel_id schid ) ;
2012-08-28 16:45:42 +02:00
/* Functions and definitions to query storage-class memory. */
struct sale {
u64 sa ;
u32 p : 4 ;
u32 op_state : 4 ;
u32 data_state : 4 ;
u32 rank : 4 ;
u32 r : 1 ;
u32 : 7 ;
u32 rid : 8 ;
u32 : 32 ;
} __packed ;
struct chsc_scm_info {
struct chsc_header request ;
u32 : 32 ;
u64 reqtok ;
u32 reserved1 [ 4 ] ;
struct chsc_header response ;
u64 : 56 ;
u8 rq ;
u32 mbc ;
u64 msa ;
u16 is ;
u16 mmc ;
u32 mci ;
u64 nr_scm_ini ;
u64 nr_scm_unini ;
u32 reserved2 [ 10 ] ;
u64 restok ;
struct sale scmal [ 248 ] ;
} __packed ;
int chsc_scm_info ( struct chsc_scm_info * scm_area , u64 token ) ;
2013-04-24 12:00:23 +02:00
struct chsc_brinfo_resume_token {
u64 t1 ;
u64 t2 ;
} __packed ;
struct chsc_brinfo_naihdr {
struct chsc_brinfo_resume_token resume_token ;
u32 : 32 ;
u32 instance ;
u32 : 24 ;
u8 naids ;
u32 reserved [ 3 ] ;
} __packed ;
struct chsc_pnso_area {
struct chsc_header request ;
u8 : 2 ;
u8 m : 1 ;
u8 : 5 ;
u8 : 2 ;
u8 ssid : 2 ;
u8 fmt : 4 ;
u16 sch ;
u8 : 8 ;
u8 cssid ;
u16 : 16 ;
u8 oc ;
u32 : 24 ;
struct chsc_brinfo_resume_token resume_token ;
u32 n : 1 ;
u32 : 31 ;
u32 reserved [ 3 ] ;
struct chsc_header response ;
u32 : 32 ;
struct chsc_brinfo_naihdr naihdr ;
union {
struct qdio_brinfo_entry_l3_ipv6 l3_ipv6 [ 0 ] ;
struct qdio_brinfo_entry_l3_ipv4 l3_ipv4 [ 0 ] ;
struct qdio_brinfo_entry_l2 l2 [ 0 ] ;
} entries ;
} __packed ;
int chsc_pnso_brinfo ( struct subchannel_id schid ,
struct chsc_pnso_area * brinfo_area ,
struct chsc_brinfo_resume_token resume_token ,
int cnc ) ;
2012-08-28 16:47:02 +02:00
# ifdef CONFIG_SCM_BUS
int scm_update_information ( void ) ;
2013-02-28 12:07:55 +01:00
int scm_process_availability_information ( void ) ;
2012-08-28 16:47:02 +02:00
# else /* CONFIG_SCM_BUS */
2013-01-28 19:34:26 +01:00
static inline int scm_update_information ( void ) { return 0 ; }
2013-02-28 12:07:55 +01:00
static inline int scm_process_availability_information ( void ) { return 0 ; }
2012-08-28 16:47:02 +02:00
# endif /* CONFIG_SCM_BUS */
2005-04-16 15:20:36 -07:00
# endif