0001
0002 #ifndef S390_CIO_H
0003 #define S390_CIO_H
0004
0005 #include <linux/mutex.h>
0006 #include <linux/device.h>
0007 #include <linux/mod_devicetable.h>
0008 #include <asm/chpid.h>
0009 #include <asm/cio.h>
0010 #include <asm/fcx.h>
0011 #include <asm/schid.h>
0012 #include <asm/tpi.h>
0013 #include "chsc.h"
0014
0015
0016
0017
0018 struct pmcw {
0019 u32 intparm;
0020 u32 qf : 1;
0021 u32 w : 1;
0022 u32 isc : 3;
0023 u32 res5 : 3;
0024 u32 ena : 1;
0025 u32 lm : 2;
0026 u32 mme : 2;
0027 u32 mp : 1;
0028 u32 tf : 1;
0029 u32 dnv : 1;
0030 u32 dev : 16;
0031 u8 lpm;
0032 u8 pnom;
0033 u8 lpum;
0034 u8 pim;
0035 u16 mbi;
0036 u8 pom;
0037 u8 pam;
0038 u8 chpid[8];
0039 u32 unused1 : 8;
0040 u32 st : 3;
0041 u32 unused2 : 18;
0042 u32 mbfc : 1;
0043 u32 xmwme : 1;
0044 u32 csense : 1;
0045
0046
0047
0048 } __attribute__ ((packed));
0049
0050
0051 struct schib_config {
0052 u64 mba;
0053 u32 intparm;
0054 u16 mbi;
0055 u32 isc:3;
0056 u32 ena:1;
0057 u32 mme:2;
0058 u32 mp:1;
0059 u32 csense:1;
0060 u32 mbfc:1;
0061 } __attribute__ ((packed));
0062
0063
0064
0065
0066 struct schib {
0067 struct pmcw pmcw;
0068 union scsw scsw;
0069 __u64 mba;
0070 __u8 mda[4];
0071 } __attribute__ ((packed,aligned(4)));
0072
0073
0074
0075
0076
0077 enum sch_todo {
0078 SCH_TODO_NOTHING,
0079 SCH_TODO_EVAL,
0080 SCH_TODO_UNREG,
0081 };
0082
0083
0084 struct subchannel {
0085 struct subchannel_id schid;
0086 spinlock_t *lock;
0087 struct mutex reg_mutex;
0088 enum {
0089 SUBCHANNEL_TYPE_IO = 0,
0090 SUBCHANNEL_TYPE_CHSC = 1,
0091 SUBCHANNEL_TYPE_MSG = 2,
0092 SUBCHANNEL_TYPE_ADM = 3,
0093 } st;
0094 __u8 vpm;
0095 __u8 lpm;
0096 __u8 opm;
0097 struct schib schib;
0098 int isc;
0099 struct chsc_ssd_info ssd_info;
0100 struct device dev;
0101 struct css_driver *driver;
0102 enum sch_todo todo;
0103 struct work_struct todo_work;
0104 struct schib_config config;
0105 u64 dma_mask;
0106
0107
0108
0109
0110 const char *driver_override;
0111 } __attribute__ ((aligned(8)));
0112
0113 DECLARE_PER_CPU_ALIGNED(struct irb, cio_irb);
0114
0115 #define to_subchannel(n) container_of(n, struct subchannel, dev)
0116
0117 extern int cio_enable_subchannel(struct subchannel *, u32);
0118 extern int cio_disable_subchannel (struct subchannel *);
0119 extern int cio_cancel (struct subchannel *);
0120 extern int cio_clear (struct subchannel *);
0121 extern int cio_cancel_halt_clear(struct subchannel *, int *);
0122 extern int cio_resume (struct subchannel *);
0123 extern int cio_halt (struct subchannel *);
0124 extern int cio_start (struct subchannel *, struct ccw1 *, __u8);
0125 extern int cio_start_key (struct subchannel *, struct ccw1 *, __u8, __u8);
0126 extern int cio_set_options (struct subchannel *, int);
0127 extern int cio_update_schib(struct subchannel *sch);
0128 extern int cio_commit_config(struct subchannel *sch);
0129
0130 int cio_tm_start_key(struct subchannel *sch, struct tcw *tcw, u8 lpm, u8 key);
0131 int cio_tm_intrg(struct subchannel *sch);
0132
0133 extern int __init airq_init(void);
0134
0135
0136 #ifdef CONFIG_CCW_CONSOLE
0137 extern struct subchannel *cio_probe_console(void);
0138 extern int cio_is_console(struct subchannel_id);
0139 extern void cio_register_early_subchannels(void);
0140 extern void cio_tsch(struct subchannel *sch);
0141 #else
0142 #define cio_is_console(schid) 0
0143 static inline void cio_register_early_subchannels(void) {}
0144 #endif
0145
0146 #endif