1 From: Gerald Schaefer <geraldsc@de.ibm.com>
2 Subject: [PATCH] cio: move scsw helper functions to header file
3 References: bnc#532063,LTC#55526
5 From: Heiko Carstens <heiko.carstens@de.ibm.com>
7 All scsw helper functions are very short and usage of them shouldn't
8 result in function calls. Therefore we move them to a separate header
10 Also saves a lot of EXPORT_SYMBOLs.
12 Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13 Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
15 Acked-by: John Jolly <jjolly@suse.de>
18 arch/s390/include/asm/chsc.h | 28 +
19 arch/s390/include/asm/cio.h | 223 ----------
20 arch/s390/include/asm/scsw.h | 956 +++++++++++++++++++++++++++++++++++++++++++
21 drivers/s390/cio/Makefile | 2
22 drivers/s390/cio/chsc.h | 24 -
23 drivers/s390/cio/scsw.c | 843 -------------------------------------
24 6 files changed, 986 insertions(+), 1090 deletions(-)
26 Index: linux-sles11/arch/s390/include/asm/chsc.h
27 ===================================================================
28 --- linux-sles11.orig/arch/s390/include/asm/chsc.h
29 +++ linux-sles11/arch/s390/include/asm/chsc.h
30 @@ -124,4 +124,32 @@ struct chsc_cpd_info {
31 #define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
32 #define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
36 +struct css_general_char {
38 + u32 dynio : 1; /* bit 12 */
40 + u32 aif : 1; /* bit 41 */
42 + u32 mcss : 1; /* bit 45 */
43 + u32 fcs : 1; /* bit 46 */
45 + u32 ext_mb : 1; /* bit 48 */
47 + u32 aif_tdd : 1; /* bit 56 */
49 + u32 qebsm : 1; /* bit 58 */
51 + u32 aif_osa : 1; /* bit 67 */
53 + u32 cib : 1; /* bit 82 */
55 + u32 fcx : 1; /* bit 88 */
57 +}__attribute__((packed));
59 +extern struct css_general_char css_general_characteristics;
61 +#endif /* __KERNEL__ */
63 Index: linux-sles11/arch/s390/include/asm/cio.h
64 ===================================================================
65 --- linux-sles11.orig/arch/s390/include/asm/cio.h
66 +++ linux-sles11/arch/s390/include/asm/cio.h
68 #define LPM_ANYPATH 0xff
72 - * struct cmd_scsw - command-mode subchannel status word
73 - * @key: subchannel key
74 - * @sctl: suspend control
76 - * @cc: deferred condition code
79 - * @isic: initial-status interruption control
80 - * @alcc: address-limit checking control
81 - * @ssi: suppress-suspended interruption
82 - * @zcc: zero condition code
83 - * @ectl: extended control
84 - * @pno: path not operational
86 - * @fctl: function control
87 - * @actl: activity control
88 - * @stctl: status control
89 - * @cpa: channel program address
90 - * @dstat: device status
91 - * @cstat: subchannel status
92 - * @count: residual count
115 -} __attribute__ ((packed));
118 - * struct tm_scsw - transport-mode subchannel status word
119 - * @key: subchannel key
120 - * @eswf: esw format
121 - * @cc: deferred condition code
123 - * @x: IRB-format control
124 - * @q: interrogate-complete
125 - * @ectl: extended control
126 - * @pno: path not operational
127 - * @fctl: function control
128 - * @actl: activity control
129 - * @stctl: status control
130 - * @tcw: TCW address
131 - * @dstat: device status
132 - * @cstat: subchannel status
133 - * @fcxs: FCX status
134 - * @schxs: subchannel-extended status
156 -} __attribute__ ((packed));
159 - * union scsw - subchannel status word
160 - * @cmd: command-mode SCSW
161 - * @tm: transport-mode SCSW
164 - struct cmd_scsw cmd;
166 -} __attribute__ ((packed));
168 -int scsw_is_tm(union scsw *scsw);
169 -u32 scsw_key(union scsw *scsw);
170 -u32 scsw_eswf(union scsw *scsw);
171 -u32 scsw_cc(union scsw *scsw);
172 -u32 scsw_ectl(union scsw *scsw);
173 -u32 scsw_pno(union scsw *scsw);
174 -u32 scsw_fctl(union scsw *scsw);
175 -u32 scsw_actl(union scsw *scsw);
176 -u32 scsw_stctl(union scsw *scsw);
177 -u32 scsw_dstat(union scsw *scsw);
178 -u32 scsw_cstat(union scsw *scsw);
179 -int scsw_is_solicited(union scsw *scsw);
180 -int scsw_is_valid_key(union scsw *scsw);
181 -int scsw_is_valid_eswf(union scsw *scsw);
182 -int scsw_is_valid_cc(union scsw *scsw);
183 -int scsw_is_valid_ectl(union scsw *scsw);
184 -int scsw_is_valid_pno(union scsw *scsw);
185 -int scsw_is_valid_fctl(union scsw *scsw);
186 -int scsw_is_valid_actl(union scsw *scsw);
187 -int scsw_is_valid_stctl(union scsw *scsw);
188 -int scsw_is_valid_dstat(union scsw *scsw);
189 -int scsw_is_valid_cstat(union scsw *scsw);
190 -int scsw_cmd_is_valid_key(union scsw *scsw);
191 -int scsw_cmd_is_valid_sctl(union scsw *scsw);
192 -int scsw_cmd_is_valid_eswf(union scsw *scsw);
193 -int scsw_cmd_is_valid_cc(union scsw *scsw);
194 -int scsw_cmd_is_valid_fmt(union scsw *scsw);
195 -int scsw_cmd_is_valid_pfch(union scsw *scsw);
196 -int scsw_cmd_is_valid_isic(union scsw *scsw);
197 -int scsw_cmd_is_valid_alcc(union scsw *scsw);
198 -int scsw_cmd_is_valid_ssi(union scsw *scsw);
199 -int scsw_cmd_is_valid_zcc(union scsw *scsw);
200 -int scsw_cmd_is_valid_ectl(union scsw *scsw);
201 -int scsw_cmd_is_valid_pno(union scsw *scsw);
202 -int scsw_cmd_is_valid_fctl(union scsw *scsw);
203 -int scsw_cmd_is_valid_actl(union scsw *scsw);
204 -int scsw_cmd_is_valid_stctl(union scsw *scsw);
205 -int scsw_cmd_is_valid_dstat(union scsw *scsw);
206 -int scsw_cmd_is_valid_cstat(union scsw *scsw);
207 -int scsw_cmd_is_solicited(union scsw *scsw);
208 -int scsw_tm_is_valid_key(union scsw *scsw);
209 -int scsw_tm_is_valid_eswf(union scsw *scsw);
210 -int scsw_tm_is_valid_cc(union scsw *scsw);
211 -int scsw_tm_is_valid_fmt(union scsw *scsw);
212 -int scsw_tm_is_valid_x(union scsw *scsw);
213 -int scsw_tm_is_valid_q(union scsw *scsw);
214 -int scsw_tm_is_valid_ectl(union scsw *scsw);
215 -int scsw_tm_is_valid_pno(union scsw *scsw);
216 -int scsw_tm_is_valid_fctl(union scsw *scsw);
217 -int scsw_tm_is_valid_actl(union scsw *scsw);
218 -int scsw_tm_is_valid_stctl(union scsw *scsw);
219 -int scsw_tm_is_valid_dstat(union scsw *scsw);
220 -int scsw_tm_is_valid_cstat(union scsw *scsw);
221 -int scsw_tm_is_valid_fcxs(union scsw *scsw);
222 -int scsw_tm_is_valid_schxs(union scsw *scsw);
223 -int scsw_tm_is_solicited(union scsw *scsw);
225 -#define SCSW_FCTL_CLEAR_FUNC 0x1
226 -#define SCSW_FCTL_HALT_FUNC 0x2
227 -#define SCSW_FCTL_START_FUNC 0x4
229 -#define SCSW_ACTL_SUSPENDED 0x1
230 -#define SCSW_ACTL_DEVACT 0x2
231 -#define SCSW_ACTL_SCHACT 0x4
232 -#define SCSW_ACTL_CLEAR_PEND 0x8
233 -#define SCSW_ACTL_HALT_PEND 0x10
234 -#define SCSW_ACTL_START_PEND 0x20
235 -#define SCSW_ACTL_RESUME_PEND 0x40
237 -#define SCSW_STCTL_STATUS_PEND 0x1
238 -#define SCSW_STCTL_SEC_STATUS 0x2
239 -#define SCSW_STCTL_PRIM_STATUS 0x4
240 -#define SCSW_STCTL_INTER_STATUS 0x8
241 -#define SCSW_STCTL_ALERT_STATUS 0x10
243 -#define DEV_STAT_ATTENTION 0x80
244 -#define DEV_STAT_STAT_MOD 0x40
245 -#define DEV_STAT_CU_END 0x20
246 -#define DEV_STAT_BUSY 0x10
247 -#define DEV_STAT_CHN_END 0x08
248 -#define DEV_STAT_DEV_END 0x04
249 -#define DEV_STAT_UNIT_CHECK 0x02
250 -#define DEV_STAT_UNIT_EXCEP 0x01
252 -#define SCHN_STAT_PCI 0x80
253 -#define SCHN_STAT_INCORR_LEN 0x40
254 -#define SCHN_STAT_PROG_CHECK 0x20
255 -#define SCHN_STAT_PROT_CHECK 0x10
256 -#define SCHN_STAT_CHN_DATA_CHK 0x08
257 -#define SCHN_STAT_CHN_CTRL_CHK 0x04
258 -#define SCHN_STAT_INTF_CTRL_CHK 0x02
259 -#define SCHN_STAT_CHAIN_CHECK 0x01
262 - * architectured values for first sense byte
264 -#define SNS0_CMD_REJECT 0x80
265 -#define SNS_CMD_REJECT SNS0_CMD_REJEC
266 -#define SNS0_INTERVENTION_REQ 0x40
267 -#define SNS0_BUS_OUT_CHECK 0x20
268 -#define SNS0_EQUIPMENT_CHECK 0x10
269 -#define SNS0_DATA_CHECK 0x08
270 -#define SNS0_OVERRUN 0x04
271 -#define SNS0_INCOMPL_DOMAIN 0x01
274 - * architectured values for second sense byte
276 -#define SNS1_PERM_ERR 0x80
277 -#define SNS1_INV_TRACK_FORMAT 0x40
278 -#define SNS1_EOC 0x20
279 -#define SNS1_MESSAGE_TO_OPER 0x10
280 -#define SNS1_NO_REC_FOUND 0x08
281 -#define SNS1_FILE_PROTECTED 0x04
282 -#define SNS1_WRITE_INHIBITED 0x02
283 -#define SNS1_INPRECISE_END 0x01
286 - * architectured values for third sense byte
288 -#define SNS2_REQ_INH_WRITE 0x80
289 -#define SNS2_CORRECTABLE 0x40
290 -#define SNS2_FIRST_LOG_ERR 0x20
291 -#define SNS2_ENV_DATA_PRESENT 0x10
292 -#define SNS2_INPRECISE_END 0x04
293 +#include <asm/scsw.h>
296 * struct ccw1 - channel command word
297 Index: linux-sles11/arch/s390/include/asm/scsw.h
298 ===================================================================
300 +++ linux-sles11/arch/s390/include/asm/scsw.h
303 + * Helper functions for scsw access.
305 + * Copyright IBM Corp. 2008,2009
306 + * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
309 +#ifndef _ASM_S390_SCSW_H_
310 +#define _ASM_S390_SCSW_H_
312 +#include <linux/types.h>
313 +#include <asm/chsc.h>
314 +#include <asm/cio.h>
317 + * struct cmd_scsw - command-mode subchannel status word
318 + * @key: subchannel key
319 + * @sctl: suspend control
320 + * @eswf: esw format
321 + * @cc: deferred condition code
324 + * @isic: initial-status interruption control
325 + * @alcc: address-limit checking control
326 + * @ssi: suppress-suspended interruption
327 + * @zcc: zero condition code
328 + * @ectl: extended control
329 + * @pno: path not operational
331 + * @fctl: function control
332 + * @actl: activity control
333 + * @stctl: status control
334 + * @cpa: channel program address
335 + * @dstat: device status
336 + * @cstat: subchannel status
337 + * @count: residual count
360 +} __attribute__ ((packed));
363 + * struct tm_scsw - transport-mode subchannel status word
364 + * @key: subchannel key
365 + * @eswf: esw format
366 + * @cc: deferred condition code
368 + * @x: IRB-format control
369 + * @q: interrogate-complete
370 + * @ectl: extended control
371 + * @pno: path not operational
372 + * @fctl: function control
373 + * @actl: activity control
374 + * @stctl: status control
375 + * @tcw: TCW address
376 + * @dstat: device status
377 + * @cstat: subchannel status
378 + * @fcxs: FCX status
379 + * @schxs: subchannel-extended status
401 +} __attribute__ ((packed));
404 + * union scsw - subchannel status word
405 + * @cmd: command-mode SCSW
406 + * @tm: transport-mode SCSW
409 + struct cmd_scsw cmd;
411 +} __attribute__ ((packed));
413 +#define SCSW_FCTL_CLEAR_FUNC 0x1
414 +#define SCSW_FCTL_HALT_FUNC 0x2
415 +#define SCSW_FCTL_START_FUNC 0x4
417 +#define SCSW_ACTL_SUSPENDED 0x1
418 +#define SCSW_ACTL_DEVACT 0x2
419 +#define SCSW_ACTL_SCHACT 0x4
420 +#define SCSW_ACTL_CLEAR_PEND 0x8
421 +#define SCSW_ACTL_HALT_PEND 0x10
422 +#define SCSW_ACTL_START_PEND 0x20
423 +#define SCSW_ACTL_RESUME_PEND 0x40
425 +#define SCSW_STCTL_STATUS_PEND 0x1
426 +#define SCSW_STCTL_SEC_STATUS 0x2
427 +#define SCSW_STCTL_PRIM_STATUS 0x4
428 +#define SCSW_STCTL_INTER_STATUS 0x8
429 +#define SCSW_STCTL_ALERT_STATUS 0x10
431 +#define DEV_STAT_ATTENTION 0x80
432 +#define DEV_STAT_STAT_MOD 0x40
433 +#define DEV_STAT_CU_END 0x20
434 +#define DEV_STAT_BUSY 0x10
435 +#define DEV_STAT_CHN_END 0x08
436 +#define DEV_STAT_DEV_END 0x04
437 +#define DEV_STAT_UNIT_CHECK 0x02
438 +#define DEV_STAT_UNIT_EXCEP 0x01
440 +#define SCHN_STAT_PCI 0x80
441 +#define SCHN_STAT_INCORR_LEN 0x40
442 +#define SCHN_STAT_PROG_CHECK 0x20
443 +#define SCHN_STAT_PROT_CHECK 0x10
444 +#define SCHN_STAT_CHN_DATA_CHK 0x08
445 +#define SCHN_STAT_CHN_CTRL_CHK 0x04
446 +#define SCHN_STAT_INTF_CTRL_CHK 0x02
447 +#define SCHN_STAT_CHAIN_CHECK 0x01
450 + * architectured values for first sense byte
452 +#define SNS0_CMD_REJECT 0x80
453 +#define SNS_CMD_REJECT SNS0_CMD_REJEC
454 +#define SNS0_INTERVENTION_REQ 0x40
455 +#define SNS0_BUS_OUT_CHECK 0x20
456 +#define SNS0_EQUIPMENT_CHECK 0x10
457 +#define SNS0_DATA_CHECK 0x08
458 +#define SNS0_OVERRUN 0x04
459 +#define SNS0_INCOMPL_DOMAIN 0x01
462 + * architectured values for second sense byte
464 +#define SNS1_PERM_ERR 0x80
465 +#define SNS1_INV_TRACK_FORMAT 0x40
466 +#define SNS1_EOC 0x20
467 +#define SNS1_MESSAGE_TO_OPER 0x10
468 +#define SNS1_NO_REC_FOUND 0x08
469 +#define SNS1_FILE_PROTECTED 0x04
470 +#define SNS1_WRITE_INHIBITED 0x02
471 +#define SNS1_INPRECISE_END 0x01
474 + * architectured values for third sense byte
476 +#define SNS2_REQ_INH_WRITE 0x80
477 +#define SNS2_CORRECTABLE 0x40
478 +#define SNS2_FIRST_LOG_ERR 0x20
479 +#define SNS2_ENV_DATA_PRESENT 0x10
480 +#define SNS2_INPRECISE_END 0x04
483 + * scsw_is_tm - check for transport mode scsw
484 + * @scsw: pointer to scsw
486 + * Return non-zero if the specified scsw is a transport mode scsw, zero
489 +static inline int scsw_is_tm(union scsw *scsw)
491 + return css_general_characteristics.fcx && (scsw->tm.x == 1);
495 + * scsw_key - return scsw key field
496 + * @scsw: pointer to scsw
498 + * Return the value of the key field of the specified scsw, regardless of
499 + * whether it is a transport mode or command mode scsw.
501 +static inline u32 scsw_key(union scsw *scsw)
503 + if (scsw_is_tm(scsw))
504 + return scsw->tm.key;
506 + return scsw->cmd.key;
510 + * scsw_eswf - return scsw eswf field
511 + * @scsw: pointer to scsw
513 + * Return the value of the eswf field of the specified scsw, regardless of
514 + * whether it is a transport mode or command mode scsw.
516 +static inline u32 scsw_eswf(union scsw *scsw)
518 + if (scsw_is_tm(scsw))
519 + return scsw->tm.eswf;
521 + return scsw->cmd.eswf;
525 + * scsw_cc - return scsw cc field
526 + * @scsw: pointer to scsw
528 + * Return the value of the cc field of the specified scsw, regardless of
529 + * whether it is a transport mode or command mode scsw.
531 +static inline u32 scsw_cc(union scsw *scsw)
533 + if (scsw_is_tm(scsw))
534 + return scsw->tm.cc;
536 + return scsw->cmd.cc;
540 + * scsw_ectl - return scsw ectl field
541 + * @scsw: pointer to scsw
543 + * Return the value of the ectl field of the specified scsw, regardless of
544 + * whether it is a transport mode or command mode scsw.
546 +static inline u32 scsw_ectl(union scsw *scsw)
548 + if (scsw_is_tm(scsw))
549 + return scsw->tm.ectl;
551 + return scsw->cmd.ectl;
555 + * scsw_pno - return scsw pno field
556 + * @scsw: pointer to scsw
558 + * Return the value of the pno field of the specified scsw, regardless of
559 + * whether it is a transport mode or command mode scsw.
561 +static inline u32 scsw_pno(union scsw *scsw)
563 + if (scsw_is_tm(scsw))
564 + return scsw->tm.pno;
566 + return scsw->cmd.pno;
570 + * scsw_fctl - return scsw fctl field
571 + * @scsw: pointer to scsw
573 + * Return the value of the fctl field of the specified scsw, regardless of
574 + * whether it is a transport mode or command mode scsw.
576 +static inline u32 scsw_fctl(union scsw *scsw)
578 + if (scsw_is_tm(scsw))
579 + return scsw->tm.fctl;
581 + return scsw->cmd.fctl;
585 + * scsw_actl - return scsw actl field
586 + * @scsw: pointer to scsw
588 + * Return the value of the actl field of the specified scsw, regardless of
589 + * whether it is a transport mode or command mode scsw.
591 +static inline u32 scsw_actl(union scsw *scsw)
593 + if (scsw_is_tm(scsw))
594 + return scsw->tm.actl;
596 + return scsw->cmd.actl;
600 + * scsw_stctl - return scsw stctl field
601 + * @scsw: pointer to scsw
603 + * Return the value of the stctl field of the specified scsw, regardless of
604 + * whether it is a transport mode or command mode scsw.
606 +static inline u32 scsw_stctl(union scsw *scsw)
608 + if (scsw_is_tm(scsw))
609 + return scsw->tm.stctl;
611 + return scsw->cmd.stctl;
615 + * scsw_dstat - return scsw dstat field
616 + * @scsw: pointer to scsw
618 + * Return the value of the dstat field of the specified scsw, regardless of
619 + * whether it is a transport mode or command mode scsw.
621 +static inline u32 scsw_dstat(union scsw *scsw)
623 + if (scsw_is_tm(scsw))
624 + return scsw->tm.dstat;
626 + return scsw->cmd.dstat;
630 + * scsw_cstat - return scsw cstat field
631 + * @scsw: pointer to scsw
633 + * Return the value of the cstat field of the specified scsw, regardless of
634 + * whether it is a transport mode or command mode scsw.
636 +static inline u32 scsw_cstat(union scsw *scsw)
638 + if (scsw_is_tm(scsw))
639 + return scsw->tm.cstat;
641 + return scsw->cmd.cstat;
645 + * scsw_cmd_is_valid_key - check key field validity
646 + * @scsw: pointer to scsw
648 + * Return non-zero if the key field of the specified command mode scsw is
649 + * valid, zero otherwise.
651 +static inline int scsw_cmd_is_valid_key(union scsw *scsw)
653 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
657 + * scsw_cmd_is_valid_sctl - check fctl field validity
658 + * @scsw: pointer to scsw
660 + * Return non-zero if the fctl field of the specified command mode scsw is
661 + * valid, zero otherwise.
663 +static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
665 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
669 + * scsw_cmd_is_valid_eswf - check eswf field validity
670 + * @scsw: pointer to scsw
672 + * Return non-zero if the eswf field of the specified command mode scsw is
673 + * valid, zero otherwise.
675 +static inline int scsw_cmd_is_valid_eswf(union scsw *scsw)
677 + return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
681 + * scsw_cmd_is_valid_cc - check cc field validity
682 + * @scsw: pointer to scsw
684 + * Return non-zero if the cc field of the specified command mode scsw is
685 + * valid, zero otherwise.
687 +static inline int scsw_cmd_is_valid_cc(union scsw *scsw)
689 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
690 + (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
694 + * scsw_cmd_is_valid_fmt - check fmt field validity
695 + * @scsw: pointer to scsw
697 + * Return non-zero if the fmt field of the specified command mode scsw is
698 + * valid, zero otherwise.
700 +static inline int scsw_cmd_is_valid_fmt(union scsw *scsw)
702 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
706 + * scsw_cmd_is_valid_pfch - check pfch field validity
707 + * @scsw: pointer to scsw
709 + * Return non-zero if the pfch field of the specified command mode scsw is
710 + * valid, zero otherwise.
712 +static inline int scsw_cmd_is_valid_pfch(union scsw *scsw)
714 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
718 + * scsw_cmd_is_valid_isic - check isic field validity
719 + * @scsw: pointer to scsw
721 + * Return non-zero if the isic field of the specified command mode scsw is
722 + * valid, zero otherwise.
724 +static inline int scsw_cmd_is_valid_isic(union scsw *scsw)
726 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
730 + * scsw_cmd_is_valid_alcc - check alcc field validity
731 + * @scsw: pointer to scsw
733 + * Return non-zero if the alcc field of the specified command mode scsw is
734 + * valid, zero otherwise.
736 +static inline int scsw_cmd_is_valid_alcc(union scsw *scsw)
738 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
742 + * scsw_cmd_is_valid_ssi - check ssi field validity
743 + * @scsw: pointer to scsw
745 + * Return non-zero if the ssi field of the specified command mode scsw is
746 + * valid, zero otherwise.
748 +static inline int scsw_cmd_is_valid_ssi(union scsw *scsw)
750 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
754 + * scsw_cmd_is_valid_zcc - check zcc field validity
755 + * @scsw: pointer to scsw
757 + * Return non-zero if the zcc field of the specified command mode scsw is
758 + * valid, zero otherwise.
760 +static inline int scsw_cmd_is_valid_zcc(union scsw *scsw)
762 + return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
763 + (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
767 + * scsw_cmd_is_valid_ectl - check ectl field validity
768 + * @scsw: pointer to scsw
770 + * Return non-zero if the ectl field of the specified command mode scsw is
771 + * valid, zero otherwise.
773 +static inline int scsw_cmd_is_valid_ectl(union scsw *scsw)
775 + return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
776 + !(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
777 + (scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS);
781 + * scsw_cmd_is_valid_pno - check pno field validity
782 + * @scsw: pointer to scsw
784 + * Return non-zero if the pno field of the specified command mode scsw is
785 + * valid, zero otherwise.
787 +static inline int scsw_cmd_is_valid_pno(union scsw *scsw)
789 + return (scsw->cmd.fctl != 0) &&
790 + (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
791 + (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) ||
792 + ((scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
793 + (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)));
797 + * scsw_cmd_is_valid_fctl - check fctl field validity
798 + * @scsw: pointer to scsw
800 + * Return non-zero if the fctl field of the specified command mode scsw is
801 + * valid, zero otherwise.
803 +static inline int scsw_cmd_is_valid_fctl(union scsw *scsw)
805 + /* Only valid if pmcw.dnv == 1*/
810 + * scsw_cmd_is_valid_actl - check actl field validity
811 + * @scsw: pointer to scsw
813 + * Return non-zero if the actl field of the specified command mode scsw is
814 + * valid, zero otherwise.
816 +static inline int scsw_cmd_is_valid_actl(union scsw *scsw)
818 + /* Only valid if pmcw.dnv == 1*/
823 + * scsw_cmd_is_valid_stctl - check stctl field validity
824 + * @scsw: pointer to scsw
826 + * Return non-zero if the stctl field of the specified command mode scsw is
827 + * valid, zero otherwise.
829 +static inline int scsw_cmd_is_valid_stctl(union scsw *scsw)
831 + /* Only valid if pmcw.dnv == 1*/
836 + * scsw_cmd_is_valid_dstat - check dstat field validity
837 + * @scsw: pointer to scsw
839 + * Return non-zero if the dstat field of the specified command mode scsw is
840 + * valid, zero otherwise.
842 +static inline int scsw_cmd_is_valid_dstat(union scsw *scsw)
844 + return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
845 + (scsw->cmd.cc != 3);
849 + * scsw_cmd_is_valid_cstat - check cstat field validity
850 + * @scsw: pointer to scsw
852 + * Return non-zero if the cstat field of the specified command mode scsw is
853 + * valid, zero otherwise.
855 +static inline int scsw_cmd_is_valid_cstat(union scsw *scsw)
857 + return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
858 + (scsw->cmd.cc != 3);
862 + * scsw_tm_is_valid_key - check key field validity
863 + * @scsw: pointer to scsw
865 + * Return non-zero if the key field of the specified transport mode scsw is
866 + * valid, zero otherwise.
868 +static inline int scsw_tm_is_valid_key(union scsw *scsw)
870 + return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
874 + * scsw_tm_is_valid_eswf - check eswf field validity
875 + * @scsw: pointer to scsw
877 + * Return non-zero if the eswf field of the specified transport mode scsw is
878 + * valid, zero otherwise.
880 +static inline int scsw_tm_is_valid_eswf(union scsw *scsw)
882 + return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
886 + * scsw_tm_is_valid_cc - check cc field validity
887 + * @scsw: pointer to scsw
889 + * Return non-zero if the cc field of the specified transport mode scsw is
890 + * valid, zero otherwise.
892 +static inline int scsw_tm_is_valid_cc(union scsw *scsw)
894 + return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
895 + (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
899 + * scsw_tm_is_valid_fmt - check fmt field validity
900 + * @scsw: pointer to scsw
902 + * Return non-zero if the fmt field of the specified transport mode scsw is
903 + * valid, zero otherwise.
905 +static inline int scsw_tm_is_valid_fmt(union scsw *scsw)
911 + * scsw_tm_is_valid_x - check x field validity
912 + * @scsw: pointer to scsw
914 + * Return non-zero if the x field of the specified transport mode scsw is
915 + * valid, zero otherwise.
917 +static inline int scsw_tm_is_valid_x(union scsw *scsw)
923 + * scsw_tm_is_valid_q - check q field validity
924 + * @scsw: pointer to scsw
926 + * Return non-zero if the q field of the specified transport mode scsw is
927 + * valid, zero otherwise.
929 +static inline int scsw_tm_is_valid_q(union scsw *scsw)
935 + * scsw_tm_is_valid_ectl - check ectl field validity
936 + * @scsw: pointer to scsw
938 + * Return non-zero if the ectl field of the specified transport mode scsw is
939 + * valid, zero otherwise.
941 +static inline int scsw_tm_is_valid_ectl(union scsw *scsw)
943 + return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
944 + !(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
945 + (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS);
949 + * scsw_tm_is_valid_pno - check pno field validity
950 + * @scsw: pointer to scsw
952 + * Return non-zero if the pno field of the specified transport mode scsw is
953 + * valid, zero otherwise.
955 +static inline int scsw_tm_is_valid_pno(union scsw *scsw)
957 + return (scsw->tm.fctl != 0) &&
958 + (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
959 + (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) ||
960 + ((scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
961 + (scsw->tm.actl & SCSW_ACTL_SUSPENDED)));
965 + * scsw_tm_is_valid_fctl - check fctl field validity
966 + * @scsw: pointer to scsw
968 + * Return non-zero if the fctl field of the specified transport mode scsw is
969 + * valid, zero otherwise.
971 +static inline int scsw_tm_is_valid_fctl(union scsw *scsw)
973 + /* Only valid if pmcw.dnv == 1*/
978 + * scsw_tm_is_valid_actl - check actl field validity
979 + * @scsw: pointer to scsw
981 + * Return non-zero if the actl field of the specified transport mode scsw is
982 + * valid, zero otherwise.
984 +static inline int scsw_tm_is_valid_actl(union scsw *scsw)
986 + /* Only valid if pmcw.dnv == 1*/
991 + * scsw_tm_is_valid_stctl - check stctl field validity
992 + * @scsw: pointer to scsw
994 + * Return non-zero if the stctl field of the specified transport mode scsw is
995 + * valid, zero otherwise.
997 +static inline int scsw_tm_is_valid_stctl(union scsw *scsw)
999 + /* Only valid if pmcw.dnv == 1*/
1004 + * scsw_tm_is_valid_dstat - check dstat field validity
1005 + * @scsw: pointer to scsw
1007 + * Return non-zero if the dstat field of the specified transport mode scsw is
1008 + * valid, zero otherwise.
1010 +static inline int scsw_tm_is_valid_dstat(union scsw *scsw)
1012 + return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1013 + (scsw->tm.cc != 3);
1017 + * scsw_tm_is_valid_cstat - check cstat field validity
1018 + * @scsw: pointer to scsw
1020 + * Return non-zero if the cstat field of the specified transport mode scsw is
1021 + * valid, zero otherwise.
1023 +static inline int scsw_tm_is_valid_cstat(union scsw *scsw)
1025 + return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1026 + (scsw->tm.cc != 3);
1030 + * scsw_tm_is_valid_fcxs - check fcxs field validity
1031 + * @scsw: pointer to scsw
1033 + * Return non-zero if the fcxs field of the specified transport mode scsw is
1034 + * valid, zero otherwise.
1036 +static inline int scsw_tm_is_valid_fcxs(union scsw *scsw)
1042 + * scsw_tm_is_valid_schxs - check schxs field validity
1043 + * @scsw: pointer to scsw
1045 + * Return non-zero if the schxs field of the specified transport mode scsw is
1046 + * valid, zero otherwise.
1048 +static inline int scsw_tm_is_valid_schxs(union scsw *scsw)
1050 + return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK |
1051 + SCHN_STAT_INTF_CTRL_CHK |
1052 + SCHN_STAT_PROT_CHECK |
1053 + SCHN_STAT_CHN_DATA_CHK));
1057 + * scsw_is_valid_actl - check actl field validity
1058 + * @scsw: pointer to scsw
1060 + * Return non-zero if the actl field of the specified scsw is valid,
1061 + * regardless of whether it is a transport mode or command mode scsw.
1062 + * Return zero if the field does not contain a valid value.
1064 +static inline int scsw_is_valid_actl(union scsw *scsw)
1066 + if (scsw_is_tm(scsw))
1067 + return scsw_tm_is_valid_actl(scsw);
1069 + return scsw_cmd_is_valid_actl(scsw);
1073 + * scsw_is_valid_cc - check cc field validity
1074 + * @scsw: pointer to scsw
1076 + * Return non-zero if the cc field of the specified scsw is valid,
1077 + * regardless of whether it is a transport mode or command mode scsw.
1078 + * Return zero if the field does not contain a valid value.
1080 +static inline int scsw_is_valid_cc(union scsw *scsw)
1082 + if (scsw_is_tm(scsw))
1083 + return scsw_tm_is_valid_cc(scsw);
1085 + return scsw_cmd_is_valid_cc(scsw);
1089 + * scsw_is_valid_cstat - check cstat field validity
1090 + * @scsw: pointer to scsw
1092 + * Return non-zero if the cstat field of the specified scsw is valid,
1093 + * regardless of whether it is a transport mode or command mode scsw.
1094 + * Return zero if the field does not contain a valid value.
1096 +static inline int scsw_is_valid_cstat(union scsw *scsw)
1098 + if (scsw_is_tm(scsw))
1099 + return scsw_tm_is_valid_cstat(scsw);
1101 + return scsw_cmd_is_valid_cstat(scsw);
1105 + * scsw_is_valid_dstat - check dstat field validity
1106 + * @scsw: pointer to scsw
1108 + * Return non-zero if the dstat field of the specified scsw is valid,
1109 + * regardless of whether it is a transport mode or command mode scsw.
1110 + * Return zero if the field does not contain a valid value.
1112 +static inline int scsw_is_valid_dstat(union scsw *scsw)
1114 + if (scsw_is_tm(scsw))
1115 + return scsw_tm_is_valid_dstat(scsw);
1117 + return scsw_cmd_is_valid_dstat(scsw);
1121 + * scsw_is_valid_ectl - check ectl field validity
1122 + * @scsw: pointer to scsw
1124 + * Return non-zero if the ectl field of the specified scsw is valid,
1125 + * regardless of whether it is a transport mode or command mode scsw.
1126 + * Return zero if the field does not contain a valid value.
1128 +static inline int scsw_is_valid_ectl(union scsw *scsw)
1130 + if (scsw_is_tm(scsw))
1131 + return scsw_tm_is_valid_ectl(scsw);
1133 + return scsw_cmd_is_valid_ectl(scsw);
1137 + * scsw_is_valid_eswf - check eswf field validity
1138 + * @scsw: pointer to scsw
1140 + * Return non-zero if the eswf field of the specified scsw is valid,
1141 + * regardless of whether it is a transport mode or command mode scsw.
1142 + * Return zero if the field does not contain a valid value.
1144 +static inline int scsw_is_valid_eswf(union scsw *scsw)
1146 + if (scsw_is_tm(scsw))
1147 + return scsw_tm_is_valid_eswf(scsw);
1149 + return scsw_cmd_is_valid_eswf(scsw);
1153 + * scsw_is_valid_fctl - check fctl field validity
1154 + * @scsw: pointer to scsw
1156 + * Return non-zero if the fctl field of the specified scsw is valid,
1157 + * regardless of whether it is a transport mode or command mode scsw.
1158 + * Return zero if the field does not contain a valid value.
1160 +static inline int scsw_is_valid_fctl(union scsw *scsw)
1162 + if (scsw_is_tm(scsw))
1163 + return scsw_tm_is_valid_fctl(scsw);
1165 + return scsw_cmd_is_valid_fctl(scsw);
1169 + * scsw_is_valid_key - check key field validity
1170 + * @scsw: pointer to scsw
1172 + * Return non-zero if the key field of the specified scsw is valid,
1173 + * regardless of whether it is a transport mode or command mode scsw.
1174 + * Return zero if the field does not contain a valid value.
1176 +static inline int scsw_is_valid_key(union scsw *scsw)
1178 + if (scsw_is_tm(scsw))
1179 + return scsw_tm_is_valid_key(scsw);
1181 + return scsw_cmd_is_valid_key(scsw);
1185 + * scsw_is_valid_pno - check pno field validity
1186 + * @scsw: pointer to scsw
1188 + * Return non-zero if the pno field of the specified scsw is valid,
1189 + * regardless of whether it is a transport mode or command mode scsw.
1190 + * Return zero if the field does not contain a valid value.
1192 +static inline int scsw_is_valid_pno(union scsw *scsw)
1194 + if (scsw_is_tm(scsw))
1195 + return scsw_tm_is_valid_pno(scsw);
1197 + return scsw_cmd_is_valid_pno(scsw);
1201 + * scsw_is_valid_stctl - check stctl field validity
1202 + * @scsw: pointer to scsw
1204 + * Return non-zero if the stctl field of the specified scsw is valid,
1205 + * regardless of whether it is a transport mode or command mode scsw.
1206 + * Return zero if the field does not contain a valid value.
1208 +static inline int scsw_is_valid_stctl(union scsw *scsw)
1210 + if (scsw_is_tm(scsw))
1211 + return scsw_tm_is_valid_stctl(scsw);
1213 + return scsw_cmd_is_valid_stctl(scsw);
1217 + * scsw_cmd_is_solicited - check for solicited scsw
1218 + * @scsw: pointer to scsw
1220 + * Return non-zero if the command mode scsw indicates that the associated
1221 + * status condition is solicited, zero if it is unsolicited.
1223 +static inline int scsw_cmd_is_solicited(union scsw *scsw)
1225 + return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
1226 + (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
1230 + * scsw_tm_is_solicited - check for solicited scsw
1231 + * @scsw: pointer to scsw
1233 + * Return non-zero if the transport mode scsw indicates that the associated
1234 + * status condition is solicited, zero if it is unsolicited.
1236 +static inline int scsw_tm_is_solicited(union scsw *scsw)
1238 + return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
1239 + (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
1243 + * scsw_is_solicited - check for solicited scsw
1244 + * @scsw: pointer to scsw
1246 + * Return non-zero if the transport or command mode scsw indicates that the
1247 + * associated status condition is solicited, zero if it is unsolicited.
1249 +static inline int scsw_is_solicited(union scsw *scsw)
1251 + if (scsw_is_tm(scsw))
1252 + return scsw_tm_is_solicited(scsw);
1254 + return scsw_cmd_is_solicited(scsw);
1257 +#endif /* _ASM_S390_SCSW_H_ */
1258 Index: linux-sles11/drivers/s390/cio/chsc.h
1259 ===================================================================
1260 --- linux-sles11.orig/drivers/s390/cio/chsc.h
1261 +++ linux-sles11/drivers/s390/cio/chsc.h
1262 @@ -37,29 +37,6 @@ struct channel_path_desc {
1264 struct channel_path;
1266 -struct css_general_char {
1268 - u32 dynio : 1; /* bit 12 */
1270 - u32 aif : 1; /* bit 41 */
1272 - u32 mcss : 1; /* bit 45 */
1273 - u32 fcs : 1; /* bit 46 */
1275 - u32 ext_mb : 1; /* bit 48 */
1277 - u32 aif_tdd : 1; /* bit 56 */
1279 - u32 qebsm : 1; /* bit 58 */
1281 - u32 aif_osa : 1; /* bit 67 */
1283 - u32 cib : 1; /* bit 82 */
1285 - u32 fcx : 1; /* bit 88 */
1287 -}__attribute__((packed));
1289 struct css_chsc_char {
1292 @@ -72,7 +49,6 @@ struct css_chsc_char {
1294 }__attribute__((packed));
1296 -extern struct css_general_char css_general_characteristics;
1297 extern struct css_chsc_char css_chsc_characteristics;
1299 struct chsc_ssd_info {
1300 Index: linux-sles11/drivers/s390/cio/Makefile
1301 ===================================================================
1302 --- linux-sles11.orig/drivers/s390/cio/Makefile
1303 +++ linux-sles11/drivers/s390/cio/Makefile
1305 # Makefile for the S/390 common i/o drivers
1308 -obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o scsw.o \
1309 +obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \
1311 ccw_device-objs += device.o device_fsm.o device_ops.o
1312 ccw_device-objs += device_id.o device_pgid.o device_status.o
1313 Index: linux-sles11/drivers/s390/cio/scsw.c
1314 ===================================================================
1315 --- linux-sles11.orig/drivers/s390/cio/scsw.c
1319 - * Helper functions for scsw access.
1321 - * Copyright IBM Corp. 2008
1322 - * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
1325 -#include <linux/types.h>
1326 -#include <linux/module.h>
1327 -#include <asm/cio.h>
1332 - * scsw_is_tm - check for transport mode scsw
1333 - * @scsw: pointer to scsw
1335 - * Return non-zero if the specified scsw is a transport mode scsw, zero
1338 -int scsw_is_tm(union scsw *scsw)
1340 - return css_general_characteristics.fcx && (scsw->tm.x == 1);
1342 -EXPORT_SYMBOL(scsw_is_tm);
1345 - * scsw_key - return scsw key field
1346 - * @scsw: pointer to scsw
1348 - * Return the value of the key field of the specified scsw, regardless of
1349 - * whether it is a transport mode or command mode scsw.
1351 -u32 scsw_key(union scsw *scsw)
1353 - if (scsw_is_tm(scsw))
1354 - return scsw->tm.key;
1356 - return scsw->cmd.key;
1358 -EXPORT_SYMBOL(scsw_key);
1361 - * scsw_eswf - return scsw eswf field
1362 - * @scsw: pointer to scsw
1364 - * Return the value of the eswf field of the specified scsw, regardless of
1365 - * whether it is a transport mode or command mode scsw.
1367 -u32 scsw_eswf(union scsw *scsw)
1369 - if (scsw_is_tm(scsw))
1370 - return scsw->tm.eswf;
1372 - return scsw->cmd.eswf;
1374 -EXPORT_SYMBOL(scsw_eswf);
1377 - * scsw_cc - return scsw cc field
1378 - * @scsw: pointer to scsw
1380 - * Return the value of the cc field of the specified scsw, regardless of
1381 - * whether it is a transport mode or command mode scsw.
1383 -u32 scsw_cc(union scsw *scsw)
1385 - if (scsw_is_tm(scsw))
1386 - return scsw->tm.cc;
1388 - return scsw->cmd.cc;
1390 -EXPORT_SYMBOL(scsw_cc);
1393 - * scsw_ectl - return scsw ectl field
1394 - * @scsw: pointer to scsw
1396 - * Return the value of the ectl field of the specified scsw, regardless of
1397 - * whether it is a transport mode or command mode scsw.
1399 -u32 scsw_ectl(union scsw *scsw)
1401 - if (scsw_is_tm(scsw))
1402 - return scsw->tm.ectl;
1404 - return scsw->cmd.ectl;
1406 -EXPORT_SYMBOL(scsw_ectl);
1409 - * scsw_pno - return scsw pno field
1410 - * @scsw: pointer to scsw
1412 - * Return the value of the pno field of the specified scsw, regardless of
1413 - * whether it is a transport mode or command mode scsw.
1415 -u32 scsw_pno(union scsw *scsw)
1417 - if (scsw_is_tm(scsw))
1418 - return scsw->tm.pno;
1420 - return scsw->cmd.pno;
1422 -EXPORT_SYMBOL(scsw_pno);
1425 - * scsw_fctl - return scsw fctl field
1426 - * @scsw: pointer to scsw
1428 - * Return the value of the fctl field of the specified scsw, regardless of
1429 - * whether it is a transport mode or command mode scsw.
1431 -u32 scsw_fctl(union scsw *scsw)
1433 - if (scsw_is_tm(scsw))
1434 - return scsw->tm.fctl;
1436 - return scsw->cmd.fctl;
1438 -EXPORT_SYMBOL(scsw_fctl);
1441 - * scsw_actl - return scsw actl field
1442 - * @scsw: pointer to scsw
1444 - * Return the value of the actl field of the specified scsw, regardless of
1445 - * whether it is a transport mode or command mode scsw.
1447 -u32 scsw_actl(union scsw *scsw)
1449 - if (scsw_is_tm(scsw))
1450 - return scsw->tm.actl;
1452 - return scsw->cmd.actl;
1454 -EXPORT_SYMBOL(scsw_actl);
1457 - * scsw_stctl - return scsw stctl field
1458 - * @scsw: pointer to scsw
1460 - * Return the value of the stctl field of the specified scsw, regardless of
1461 - * whether it is a transport mode or command mode scsw.
1463 -u32 scsw_stctl(union scsw *scsw)
1465 - if (scsw_is_tm(scsw))
1466 - return scsw->tm.stctl;
1468 - return scsw->cmd.stctl;
1470 -EXPORT_SYMBOL(scsw_stctl);
1473 - * scsw_dstat - return scsw dstat field
1474 - * @scsw: pointer to scsw
1476 - * Return the value of the dstat field of the specified scsw, regardless of
1477 - * whether it is a transport mode or command mode scsw.
1479 -u32 scsw_dstat(union scsw *scsw)
1481 - if (scsw_is_tm(scsw))
1482 - return scsw->tm.dstat;
1484 - return scsw->cmd.dstat;
1486 -EXPORT_SYMBOL(scsw_dstat);
1489 - * scsw_cstat - return scsw cstat field
1490 - * @scsw: pointer to scsw
1492 - * Return the value of the cstat field of the specified scsw, regardless of
1493 - * whether it is a transport mode or command mode scsw.
1495 -u32 scsw_cstat(union scsw *scsw)
1497 - if (scsw_is_tm(scsw))
1498 - return scsw->tm.cstat;
1500 - return scsw->cmd.cstat;
1502 -EXPORT_SYMBOL(scsw_cstat);
1505 - * scsw_cmd_is_valid_key - check key field validity
1506 - * @scsw: pointer to scsw
1508 - * Return non-zero if the key field of the specified command mode scsw is
1509 - * valid, zero otherwise.
1511 -int scsw_cmd_is_valid_key(union scsw *scsw)
1513 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1515 -EXPORT_SYMBOL(scsw_cmd_is_valid_key);
1518 - * scsw_cmd_is_valid_sctl - check fctl field validity
1519 - * @scsw: pointer to scsw
1521 - * Return non-zero if the fctl field of the specified command mode scsw is
1522 - * valid, zero otherwise.
1524 -int scsw_cmd_is_valid_sctl(union scsw *scsw)
1526 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1528 -EXPORT_SYMBOL(scsw_cmd_is_valid_sctl);
1531 - * scsw_cmd_is_valid_eswf - check eswf field validity
1532 - * @scsw: pointer to scsw
1534 - * Return non-zero if the eswf field of the specified command mode scsw is
1535 - * valid, zero otherwise.
1537 -int scsw_cmd_is_valid_eswf(union scsw *scsw)
1539 - return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
1541 -EXPORT_SYMBOL(scsw_cmd_is_valid_eswf);
1544 - * scsw_cmd_is_valid_cc - check cc field validity
1545 - * @scsw: pointer to scsw
1547 - * Return non-zero if the cc field of the specified command mode scsw is
1548 - * valid, zero otherwise.
1550 -int scsw_cmd_is_valid_cc(union scsw *scsw)
1552 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
1553 - (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
1555 -EXPORT_SYMBOL(scsw_cmd_is_valid_cc);
1558 - * scsw_cmd_is_valid_fmt - check fmt field validity
1559 - * @scsw: pointer to scsw
1561 - * Return non-zero if the fmt field of the specified command mode scsw is
1562 - * valid, zero otherwise.
1564 -int scsw_cmd_is_valid_fmt(union scsw *scsw)
1566 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1568 -EXPORT_SYMBOL(scsw_cmd_is_valid_fmt);
1571 - * scsw_cmd_is_valid_pfch - check pfch field validity
1572 - * @scsw: pointer to scsw
1574 - * Return non-zero if the pfch field of the specified command mode scsw is
1575 - * valid, zero otherwise.
1577 -int scsw_cmd_is_valid_pfch(union scsw *scsw)
1579 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1581 -EXPORT_SYMBOL(scsw_cmd_is_valid_pfch);
1584 - * scsw_cmd_is_valid_isic - check isic field validity
1585 - * @scsw: pointer to scsw
1587 - * Return non-zero if the isic field of the specified command mode scsw is
1588 - * valid, zero otherwise.
1590 -int scsw_cmd_is_valid_isic(union scsw *scsw)
1592 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1594 -EXPORT_SYMBOL(scsw_cmd_is_valid_isic);
1597 - * scsw_cmd_is_valid_alcc - check alcc field validity
1598 - * @scsw: pointer to scsw
1600 - * Return non-zero if the alcc field of the specified command mode scsw is
1601 - * valid, zero otherwise.
1603 -int scsw_cmd_is_valid_alcc(union scsw *scsw)
1605 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1607 -EXPORT_SYMBOL(scsw_cmd_is_valid_alcc);
1610 - * scsw_cmd_is_valid_ssi - check ssi field validity
1611 - * @scsw: pointer to scsw
1613 - * Return non-zero if the ssi field of the specified command mode scsw is
1614 - * valid, zero otherwise.
1616 -int scsw_cmd_is_valid_ssi(union scsw *scsw)
1618 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1620 -EXPORT_SYMBOL(scsw_cmd_is_valid_ssi);
1623 - * scsw_cmd_is_valid_zcc - check zcc field validity
1624 - * @scsw: pointer to scsw
1626 - * Return non-zero if the zcc field of the specified command mode scsw is
1627 - * valid, zero otherwise.
1629 -int scsw_cmd_is_valid_zcc(union scsw *scsw)
1631 - return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
1632 - (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
1634 -EXPORT_SYMBOL(scsw_cmd_is_valid_zcc);
1637 - * scsw_cmd_is_valid_ectl - check ectl field validity
1638 - * @scsw: pointer to scsw
1640 - * Return non-zero if the ectl field of the specified command mode scsw is
1641 - * valid, zero otherwise.
1643 -int scsw_cmd_is_valid_ectl(union scsw *scsw)
1645 - return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1646 - !(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
1647 - (scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS);
1649 -EXPORT_SYMBOL(scsw_cmd_is_valid_ectl);
1652 - * scsw_cmd_is_valid_pno - check pno field validity
1653 - * @scsw: pointer to scsw
1655 - * Return non-zero if the pno field of the specified command mode scsw is
1656 - * valid, zero otherwise.
1658 -int scsw_cmd_is_valid_pno(union scsw *scsw)
1660 - return (scsw->cmd.fctl != 0) &&
1661 - (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1662 - (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) ||
1663 - ((scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
1664 - (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)));
1666 -EXPORT_SYMBOL(scsw_cmd_is_valid_pno);
1669 - * scsw_cmd_is_valid_fctl - check fctl field validity
1670 - * @scsw: pointer to scsw
1672 - * Return non-zero if the fctl field of the specified command mode scsw is
1673 - * valid, zero otherwise.
1675 -int scsw_cmd_is_valid_fctl(union scsw *scsw)
1677 - /* Only valid if pmcw.dnv == 1*/
1680 -EXPORT_SYMBOL(scsw_cmd_is_valid_fctl);
1683 - * scsw_cmd_is_valid_actl - check actl field validity
1684 - * @scsw: pointer to scsw
1686 - * Return non-zero if the actl field of the specified command mode scsw is
1687 - * valid, zero otherwise.
1689 -int scsw_cmd_is_valid_actl(union scsw *scsw)
1691 - /* Only valid if pmcw.dnv == 1*/
1694 -EXPORT_SYMBOL(scsw_cmd_is_valid_actl);
1697 - * scsw_cmd_is_valid_stctl - check stctl field validity
1698 - * @scsw: pointer to scsw
1700 - * Return non-zero if the stctl field of the specified command mode scsw is
1701 - * valid, zero otherwise.
1703 -int scsw_cmd_is_valid_stctl(union scsw *scsw)
1705 - /* Only valid if pmcw.dnv == 1*/
1708 -EXPORT_SYMBOL(scsw_cmd_is_valid_stctl);
1711 - * scsw_cmd_is_valid_dstat - check dstat field validity
1712 - * @scsw: pointer to scsw
1714 - * Return non-zero if the dstat field of the specified command mode scsw is
1715 - * valid, zero otherwise.
1717 -int scsw_cmd_is_valid_dstat(union scsw *scsw)
1719 - return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1720 - (scsw->cmd.cc != 3);
1722 -EXPORT_SYMBOL(scsw_cmd_is_valid_dstat);
1725 - * scsw_cmd_is_valid_cstat - check cstat field validity
1726 - * @scsw: pointer to scsw
1728 - * Return non-zero if the cstat field of the specified command mode scsw is
1729 - * valid, zero otherwise.
1731 -int scsw_cmd_is_valid_cstat(union scsw *scsw)
1733 - return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1734 - (scsw->cmd.cc != 3);
1736 -EXPORT_SYMBOL(scsw_cmd_is_valid_cstat);
1739 - * scsw_tm_is_valid_key - check key field validity
1740 - * @scsw: pointer to scsw
1742 - * Return non-zero if the key field of the specified transport mode scsw is
1743 - * valid, zero otherwise.
1745 -int scsw_tm_is_valid_key(union scsw *scsw)
1747 - return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
1749 -EXPORT_SYMBOL(scsw_tm_is_valid_key);
1752 - * scsw_tm_is_valid_eswf - check eswf field validity
1753 - * @scsw: pointer to scsw
1755 - * Return non-zero if the eswf field of the specified transport mode scsw is
1756 - * valid, zero otherwise.
1758 -int scsw_tm_is_valid_eswf(union scsw *scsw)
1760 - return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
1762 -EXPORT_SYMBOL(scsw_tm_is_valid_eswf);
1765 - * scsw_tm_is_valid_cc - check cc field validity
1766 - * @scsw: pointer to scsw
1768 - * Return non-zero if the cc field of the specified transport mode scsw is
1769 - * valid, zero otherwise.
1771 -int scsw_tm_is_valid_cc(union scsw *scsw)
1773 - return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
1774 - (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
1776 -EXPORT_SYMBOL(scsw_tm_is_valid_cc);
1779 - * scsw_tm_is_valid_fmt - check fmt field validity
1780 - * @scsw: pointer to scsw
1782 - * Return non-zero if the fmt field of the specified transport mode scsw is
1783 - * valid, zero otherwise.
1785 -int scsw_tm_is_valid_fmt(union scsw *scsw)
1789 -EXPORT_SYMBOL(scsw_tm_is_valid_fmt);
1792 - * scsw_tm_is_valid_x - check x field validity
1793 - * @scsw: pointer to scsw
1795 - * Return non-zero if the x field of the specified transport mode scsw is
1796 - * valid, zero otherwise.
1798 -int scsw_tm_is_valid_x(union scsw *scsw)
1802 -EXPORT_SYMBOL(scsw_tm_is_valid_x);
1805 - * scsw_tm_is_valid_q - check q field validity
1806 - * @scsw: pointer to scsw
1808 - * Return non-zero if the q field of the specified transport mode scsw is
1809 - * valid, zero otherwise.
1811 -int scsw_tm_is_valid_q(union scsw *scsw)
1815 -EXPORT_SYMBOL(scsw_tm_is_valid_q);
1818 - * scsw_tm_is_valid_ectl - check ectl field validity
1819 - * @scsw: pointer to scsw
1821 - * Return non-zero if the ectl field of the specified transport mode scsw is
1822 - * valid, zero otherwise.
1824 -int scsw_tm_is_valid_ectl(union scsw *scsw)
1826 - return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1827 - !(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
1828 - (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS);
1830 -EXPORT_SYMBOL(scsw_tm_is_valid_ectl);
1833 - * scsw_tm_is_valid_pno - check pno field validity
1834 - * @scsw: pointer to scsw
1836 - * Return non-zero if the pno field of the specified transport mode scsw is
1837 - * valid, zero otherwise.
1839 -int scsw_tm_is_valid_pno(union scsw *scsw)
1841 - return (scsw->tm.fctl != 0) &&
1842 - (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1843 - (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) ||
1844 - ((scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
1845 - (scsw->tm.actl & SCSW_ACTL_SUSPENDED)));
1847 -EXPORT_SYMBOL(scsw_tm_is_valid_pno);
1850 - * scsw_tm_is_valid_fctl - check fctl field validity
1851 - * @scsw: pointer to scsw
1853 - * Return non-zero if the fctl field of the specified transport mode scsw is
1854 - * valid, zero otherwise.
1856 -int scsw_tm_is_valid_fctl(union scsw *scsw)
1858 - /* Only valid if pmcw.dnv == 1*/
1861 -EXPORT_SYMBOL(scsw_tm_is_valid_fctl);
1864 - * scsw_tm_is_valid_actl - check actl field validity
1865 - * @scsw: pointer to scsw
1867 - * Return non-zero if the actl field of the specified transport mode scsw is
1868 - * valid, zero otherwise.
1870 -int scsw_tm_is_valid_actl(union scsw *scsw)
1872 - /* Only valid if pmcw.dnv == 1*/
1875 -EXPORT_SYMBOL(scsw_tm_is_valid_actl);
1878 - * scsw_tm_is_valid_stctl - check stctl field validity
1879 - * @scsw: pointer to scsw
1881 - * Return non-zero if the stctl field of the specified transport mode scsw is
1882 - * valid, zero otherwise.
1884 -int scsw_tm_is_valid_stctl(union scsw *scsw)
1886 - /* Only valid if pmcw.dnv == 1*/
1889 -EXPORT_SYMBOL(scsw_tm_is_valid_stctl);
1892 - * scsw_tm_is_valid_dstat - check dstat field validity
1893 - * @scsw: pointer to scsw
1895 - * Return non-zero if the dstat field of the specified transport mode scsw is
1896 - * valid, zero otherwise.
1898 -int scsw_tm_is_valid_dstat(union scsw *scsw)
1900 - return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1901 - (scsw->tm.cc != 3);
1903 -EXPORT_SYMBOL(scsw_tm_is_valid_dstat);
1906 - * scsw_tm_is_valid_cstat - check cstat field validity
1907 - * @scsw: pointer to scsw
1909 - * Return non-zero if the cstat field of the specified transport mode scsw is
1910 - * valid, zero otherwise.
1912 -int scsw_tm_is_valid_cstat(union scsw *scsw)
1914 - return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1915 - (scsw->tm.cc != 3);
1917 -EXPORT_SYMBOL(scsw_tm_is_valid_cstat);
1920 - * scsw_tm_is_valid_fcxs - check fcxs field validity
1921 - * @scsw: pointer to scsw
1923 - * Return non-zero if the fcxs field of the specified transport mode scsw is
1924 - * valid, zero otherwise.
1926 -int scsw_tm_is_valid_fcxs(union scsw *scsw)
1930 -EXPORT_SYMBOL(scsw_tm_is_valid_fcxs);
1933 - * scsw_tm_is_valid_schxs - check schxs field validity
1934 - * @scsw: pointer to scsw
1936 - * Return non-zero if the schxs field of the specified transport mode scsw is
1937 - * valid, zero otherwise.
1939 -int scsw_tm_is_valid_schxs(union scsw *scsw)
1941 - return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK |
1942 - SCHN_STAT_INTF_CTRL_CHK |
1943 - SCHN_STAT_PROT_CHECK |
1944 - SCHN_STAT_CHN_DATA_CHK));
1946 -EXPORT_SYMBOL(scsw_tm_is_valid_schxs);
1949 - * scsw_is_valid_actl - check actl field validity
1950 - * @scsw: pointer to scsw
1952 - * Return non-zero if the actl field of the specified scsw is valid,
1953 - * regardless of whether it is a transport mode or command mode scsw.
1954 - * Return zero if the field does not contain a valid value.
1956 -int scsw_is_valid_actl(union scsw *scsw)
1958 - if (scsw_is_tm(scsw))
1959 - return scsw_tm_is_valid_actl(scsw);
1961 - return scsw_cmd_is_valid_actl(scsw);
1963 -EXPORT_SYMBOL(scsw_is_valid_actl);
1966 - * scsw_is_valid_cc - check cc field validity
1967 - * @scsw: pointer to scsw
1969 - * Return non-zero if the cc field of the specified scsw is valid,
1970 - * regardless of whether it is a transport mode or command mode scsw.
1971 - * Return zero if the field does not contain a valid value.
1973 -int scsw_is_valid_cc(union scsw *scsw)
1975 - if (scsw_is_tm(scsw))
1976 - return scsw_tm_is_valid_cc(scsw);
1978 - return scsw_cmd_is_valid_cc(scsw);
1980 -EXPORT_SYMBOL(scsw_is_valid_cc);
1983 - * scsw_is_valid_cstat - check cstat field validity
1984 - * @scsw: pointer to scsw
1986 - * Return non-zero if the cstat field of the specified scsw is valid,
1987 - * regardless of whether it is a transport mode or command mode scsw.
1988 - * Return zero if the field does not contain a valid value.
1990 -int scsw_is_valid_cstat(union scsw *scsw)
1992 - if (scsw_is_tm(scsw))
1993 - return scsw_tm_is_valid_cstat(scsw);
1995 - return scsw_cmd_is_valid_cstat(scsw);
1997 -EXPORT_SYMBOL(scsw_is_valid_cstat);
2000 - * scsw_is_valid_dstat - check dstat field validity
2001 - * @scsw: pointer to scsw
2003 - * Return non-zero if the dstat field of the specified scsw is valid,
2004 - * regardless of whether it is a transport mode or command mode scsw.
2005 - * Return zero if the field does not contain a valid value.
2007 -int scsw_is_valid_dstat(union scsw *scsw)
2009 - if (scsw_is_tm(scsw))
2010 - return scsw_tm_is_valid_dstat(scsw);
2012 - return scsw_cmd_is_valid_dstat(scsw);
2014 -EXPORT_SYMBOL(scsw_is_valid_dstat);
2017 - * scsw_is_valid_ectl - check ectl field validity
2018 - * @scsw: pointer to scsw
2020 - * Return non-zero if the ectl field of the specified scsw is valid,
2021 - * regardless of whether it is a transport mode or command mode scsw.
2022 - * Return zero if the field does not contain a valid value.
2024 -int scsw_is_valid_ectl(union scsw *scsw)
2026 - if (scsw_is_tm(scsw))
2027 - return scsw_tm_is_valid_ectl(scsw);
2029 - return scsw_cmd_is_valid_ectl(scsw);
2031 -EXPORT_SYMBOL(scsw_is_valid_ectl);
2034 - * scsw_is_valid_eswf - check eswf field validity
2035 - * @scsw: pointer to scsw
2037 - * Return non-zero if the eswf field of the specified scsw is valid,
2038 - * regardless of whether it is a transport mode or command mode scsw.
2039 - * Return zero if the field does not contain a valid value.
2041 -int scsw_is_valid_eswf(union scsw *scsw)
2043 - if (scsw_is_tm(scsw))
2044 - return scsw_tm_is_valid_eswf(scsw);
2046 - return scsw_cmd_is_valid_eswf(scsw);
2048 -EXPORT_SYMBOL(scsw_is_valid_eswf);
2051 - * scsw_is_valid_fctl - check fctl field validity
2052 - * @scsw: pointer to scsw
2054 - * Return non-zero if the fctl field of the specified scsw is valid,
2055 - * regardless of whether it is a transport mode or command mode scsw.
2056 - * Return zero if the field does not contain a valid value.
2058 -int scsw_is_valid_fctl(union scsw *scsw)
2060 - if (scsw_is_tm(scsw))
2061 - return scsw_tm_is_valid_fctl(scsw);
2063 - return scsw_cmd_is_valid_fctl(scsw);
2065 -EXPORT_SYMBOL(scsw_is_valid_fctl);
2068 - * scsw_is_valid_key - check key field validity
2069 - * @scsw: pointer to scsw
2071 - * Return non-zero if the key field of the specified scsw is valid,
2072 - * regardless of whether it is a transport mode or command mode scsw.
2073 - * Return zero if the field does not contain a valid value.
2075 -int scsw_is_valid_key(union scsw *scsw)
2077 - if (scsw_is_tm(scsw))
2078 - return scsw_tm_is_valid_key(scsw);
2080 - return scsw_cmd_is_valid_key(scsw);
2082 -EXPORT_SYMBOL(scsw_is_valid_key);
2085 - * scsw_is_valid_pno - check pno field validity
2086 - * @scsw: pointer to scsw
2088 - * Return non-zero if the pno field of the specified scsw is valid,
2089 - * regardless of whether it is a transport mode or command mode scsw.
2090 - * Return zero if the field does not contain a valid value.
2092 -int scsw_is_valid_pno(union scsw *scsw)
2094 - if (scsw_is_tm(scsw))
2095 - return scsw_tm_is_valid_pno(scsw);
2097 - return scsw_cmd_is_valid_pno(scsw);
2099 -EXPORT_SYMBOL(scsw_is_valid_pno);
2102 - * scsw_is_valid_stctl - check stctl field validity
2103 - * @scsw: pointer to scsw
2105 - * Return non-zero if the stctl field of the specified scsw is valid,
2106 - * regardless of whether it is a transport mode or command mode scsw.
2107 - * Return zero if the field does not contain a valid value.
2109 -int scsw_is_valid_stctl(union scsw *scsw)
2111 - if (scsw_is_tm(scsw))
2112 - return scsw_tm_is_valid_stctl(scsw);
2114 - return scsw_cmd_is_valid_stctl(scsw);
2116 -EXPORT_SYMBOL(scsw_is_valid_stctl);
2119 - * scsw_cmd_is_solicited - check for solicited scsw
2120 - * @scsw: pointer to scsw
2122 - * Return non-zero if the command mode scsw indicates that the associated
2123 - * status condition is solicited, zero if it is unsolicited.
2125 -int scsw_cmd_is_solicited(union scsw *scsw)
2127 - return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
2128 - (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
2130 -EXPORT_SYMBOL(scsw_cmd_is_solicited);
2133 - * scsw_tm_is_solicited - check for solicited scsw
2134 - * @scsw: pointer to scsw
2136 - * Return non-zero if the transport mode scsw indicates that the associated
2137 - * status condition is solicited, zero if it is unsolicited.
2139 -int scsw_tm_is_solicited(union scsw *scsw)
2141 - return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
2142 - (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
2144 -EXPORT_SYMBOL(scsw_tm_is_solicited);
2147 - * scsw_is_solicited - check for solicited scsw
2148 - * @scsw: pointer to scsw
2150 - * Return non-zero if the transport or command mode scsw indicates that the
2151 - * associated status condition is solicited, zero if it is unsolicited.
2153 -int scsw_is_solicited(union scsw *scsw)
2155 - if (scsw_is_tm(scsw))
2156 - return scsw_tm_is_solicited(scsw);
2158 - return scsw_cmd_is_solicited(scsw);
2160 -EXPORT_SYMBOL(scsw_is_solicited);