8 #ifndef _ASM_S390_SCSW_H_
9 #define _ASM_S390_SCSW_H_
11 #include <linux/types.h>
144 #define SCSW_FCTL_CLEAR_FUNC 0x1
145 #define SCSW_FCTL_HALT_FUNC 0x2
146 #define SCSW_FCTL_START_FUNC 0x4
148 #define SCSW_ACTL_SUSPENDED 0x1
149 #define SCSW_ACTL_DEVACT 0x2
150 #define SCSW_ACTL_SCHACT 0x4
151 #define SCSW_ACTL_CLEAR_PEND 0x8
152 #define SCSW_ACTL_HALT_PEND 0x10
153 #define SCSW_ACTL_START_PEND 0x20
154 #define SCSW_ACTL_RESUME_PEND 0x40
156 #define SCSW_STCTL_STATUS_PEND 0x1
157 #define SCSW_STCTL_SEC_STATUS 0x2
158 #define SCSW_STCTL_PRIM_STATUS 0x4
159 #define SCSW_STCTL_INTER_STATUS 0x8
160 #define SCSW_STCTL_ALERT_STATUS 0x10
162 #define DEV_STAT_ATTENTION 0x80
163 #define DEV_STAT_STAT_MOD 0x40
164 #define DEV_STAT_CU_END 0x20
165 #define DEV_STAT_BUSY 0x10
166 #define DEV_STAT_CHN_END 0x08
167 #define DEV_STAT_DEV_END 0x04
168 #define DEV_STAT_UNIT_CHECK 0x02
169 #define DEV_STAT_UNIT_EXCEP 0x01
171 #define SCHN_STAT_PCI 0x80
172 #define SCHN_STAT_INCORR_LEN 0x40
173 #define SCHN_STAT_PROG_CHECK 0x20
174 #define SCHN_STAT_PROT_CHECK 0x10
175 #define SCHN_STAT_CHN_DATA_CHK 0x08
176 #define SCHN_STAT_CHN_CTRL_CHK 0x04
177 #define SCHN_STAT_INTF_CTRL_CHK 0x02
178 #define SCHN_STAT_CHAIN_CHECK 0x01
183 #define SNS0_CMD_REJECT 0x80
184 #define SNS_CMD_REJECT SNS0_CMD_REJEC
185 #define SNS0_INTERVENTION_REQ 0x40
186 #define SNS0_BUS_OUT_CHECK 0x20
187 #define SNS0_EQUIPMENT_CHECK 0x10
188 #define SNS0_DATA_CHECK 0x08
189 #define SNS0_OVERRUN 0x04
190 #define SNS0_INCOMPL_DOMAIN 0x01
195 #define SNS1_PERM_ERR 0x80
196 #define SNS1_INV_TRACK_FORMAT 0x40
197 #define SNS1_EOC 0x20
198 #define SNS1_MESSAGE_TO_OPER 0x10
199 #define SNS1_NO_REC_FOUND 0x08
200 #define SNS1_FILE_PROTECTED 0x04
201 #define SNS1_WRITE_INHIBITED 0x02
202 #define SNS1_INPRECISE_END 0x01
207 #define SNS2_REQ_INH_WRITE 0x80
208 #define SNS2_CORRECTABLE 0x40
209 #define SNS2_FIRST_LOG_ERR 0x20
210 #define SNS2_ENV_DATA_PRESENT 0x10
211 #define SNS2_INPRECISE_END 0x04
220 static inline int scsw_is_tm(
union scsw *
scsw)
234 if (scsw_is_tm(scsw))
237 return scsw->
cmd.key;
247 static inline u32 scsw_eswf(
union scsw *scsw)
249 if (scsw_is_tm(scsw))
250 return scsw->
tm.eswf;
252 return scsw->
cmd.eswf;
262 static inline u32 scsw_cc(
union scsw *scsw)
264 if (scsw_is_tm(scsw))
277 static inline u32 scsw_ectl(
union scsw *scsw)
279 if (scsw_is_tm(scsw))
280 return scsw->
tm.ectl;
282 return scsw->
cmd.ectl;
292 static inline u32 scsw_pno(
union scsw *scsw)
294 if (scsw_is_tm(scsw))
297 return scsw->
cmd.pno;
307 static inline u32 scsw_fctl(
union scsw *scsw)
309 if (scsw_is_tm(scsw))
310 return scsw->
tm.fctl;
312 return scsw->
cmd.fctl;
322 static inline u32 scsw_actl(
union scsw *scsw)
324 if (scsw_is_tm(scsw))
325 return scsw->
tm.actl;
327 return scsw->
cmd.actl;
337 static inline u32 scsw_stctl(
union scsw *scsw)
339 if (scsw_is_tm(scsw))
340 return scsw->
tm.stctl;
342 return scsw->
cmd.stctl;
352 static inline u32 scsw_dstat(
union scsw *scsw)
354 if (scsw_is_tm(scsw))
355 return scsw->
tm.dstat;
357 return scsw->
cmd.dstat;
367 static inline u32 scsw_cstat(
union scsw *scsw)
369 if (scsw_is_tm(scsw))
370 return scsw->
tm.cstat;
372 return scsw->
cmd.cstat;
382 static inline int scsw_cmd_is_valid_key(
union scsw *scsw)
394 static inline int scsw_cmd_is_valid_sctl(
union scsw *scsw)
406 static inline int scsw_cmd_is_valid_eswf(
union scsw *scsw)
418 static inline int scsw_cmd_is_valid_cc(
union scsw *scsw)
431 static inline int scsw_cmd_is_valid_fmt(
union scsw *scsw)
443 static inline int scsw_cmd_is_valid_pfch(
union scsw *scsw)
455 static inline int scsw_cmd_is_valid_isic(
union scsw *scsw)
467 static inline int scsw_cmd_is_valid_alcc(
union scsw *scsw)
479 static inline int scsw_cmd_is_valid_ssi(
union scsw *scsw)
491 static inline int scsw_cmd_is_valid_zcc(
union scsw *scsw)
504 static inline int scsw_cmd_is_valid_ectl(
union scsw *scsw)
518 static inline int scsw_cmd_is_valid_pno(
union scsw *scsw)
520 return (scsw->
cmd.fctl != 0) &&
534 static inline int scsw_cmd_is_valid_fctl(
union scsw *scsw)
547 static inline int scsw_cmd_is_valid_actl(
union scsw *scsw)
560 static inline int scsw_cmd_is_valid_stctl(
union scsw *scsw)
573 static inline int scsw_cmd_is_valid_dstat(
union scsw *scsw)
586 static inline int scsw_cmd_is_valid_cstat(
union scsw *scsw)
599 static inline int scsw_tm_is_valid_key(
union scsw *scsw)
611 static inline int scsw_tm_is_valid_eswf(
union scsw *scsw)
623 static inline int scsw_tm_is_valid_cc(
union scsw *scsw)
636 static inline int scsw_tm_is_valid_fmt(
union scsw *scsw)
648 static inline int scsw_tm_is_valid_x(
union scsw *scsw)
660 static inline int scsw_tm_is_valid_q(
union scsw *scsw)
672 static inline int scsw_tm_is_valid_ectl(
union scsw *scsw)
686 static inline int scsw_tm_is_valid_pno(
union scsw *scsw)
688 return (scsw->
tm.fctl != 0) &&
702 static inline int scsw_tm_is_valid_fctl(
union scsw *scsw)
715 static inline int scsw_tm_is_valid_actl(
union scsw *scsw)
728 static inline int scsw_tm_is_valid_stctl(
union scsw *scsw)
741 static inline int scsw_tm_is_valid_dstat(
union scsw *scsw)
754 static inline int scsw_tm_is_valid_cstat(
union scsw *scsw)
767 static inline int scsw_tm_is_valid_fcxs(
union scsw *scsw)
779 static inline int scsw_tm_is_valid_schxs(
union scsw *scsw)
795 static inline int scsw_is_valid_actl(
union scsw *scsw)
797 if (scsw_is_tm(scsw))
798 return scsw_tm_is_valid_actl(scsw);
800 return scsw_cmd_is_valid_actl(scsw);
811 static inline int scsw_is_valid_cc(
union scsw *scsw)
813 if (scsw_is_tm(scsw))
814 return scsw_tm_is_valid_cc(scsw);
816 return scsw_cmd_is_valid_cc(scsw);
827 static inline int scsw_is_valid_cstat(
union scsw *scsw)
829 if (scsw_is_tm(scsw))
830 return scsw_tm_is_valid_cstat(scsw);
832 return scsw_cmd_is_valid_cstat(scsw);
843 static inline int scsw_is_valid_dstat(
union scsw *scsw)
845 if (scsw_is_tm(scsw))
846 return scsw_tm_is_valid_dstat(scsw);
848 return scsw_cmd_is_valid_dstat(scsw);
859 static inline int scsw_is_valid_ectl(
union scsw *scsw)
861 if (scsw_is_tm(scsw))
862 return scsw_tm_is_valid_ectl(scsw);
864 return scsw_cmd_is_valid_ectl(scsw);
875 static inline int scsw_is_valid_eswf(
union scsw *scsw)
877 if (scsw_is_tm(scsw))
878 return scsw_tm_is_valid_eswf(scsw);
880 return scsw_cmd_is_valid_eswf(scsw);
891 static inline int scsw_is_valid_fctl(
union scsw *scsw)
893 if (scsw_is_tm(scsw))
894 return scsw_tm_is_valid_fctl(scsw);
896 return scsw_cmd_is_valid_fctl(scsw);
907 static inline int scsw_is_valid_key(
union scsw *scsw)
909 if (scsw_is_tm(scsw))
910 return scsw_tm_is_valid_key(scsw);
912 return scsw_cmd_is_valid_key(scsw);
923 static inline int scsw_is_valid_pno(
union scsw *scsw)
925 if (scsw_is_tm(scsw))
926 return scsw_tm_is_valid_pno(scsw);
928 return scsw_cmd_is_valid_pno(scsw);
939 static inline int scsw_is_valid_stctl(
union scsw *scsw)
941 if (scsw_is_tm(scsw))
942 return scsw_tm_is_valid_stctl(scsw);
944 return scsw_cmd_is_valid_stctl(scsw);
954 static inline int scsw_cmd_is_solicited(
union scsw *scsw)
956 return (scsw->
cmd.cc != 0) || (scsw->
cmd.stctl !=
967 static inline int scsw_tm_is_solicited(
union scsw *scsw)
969 return (scsw->
tm.cc != 0) || (scsw->
tm.stctl !=
980 static inline int scsw_is_solicited(
union scsw *scsw)
982 if (scsw_is_tm(scsw))
983 return scsw_tm_is_solicited(scsw);
985 return scsw_cmd_is_solicited(scsw);