Lines Matching +full:non +full:- +full:zero
1 /* SPDX-License-Identifier: GPL-2.0 */
14 #include <asm/dma-types.h>
18 * struct cmd_scsw - command-mode subchannel status word
25 * @isic: initial-status interruption control
26 * @alcc: address-limit checking control
27 * @ssi: suppress-suspended interruption
28 * @zcc: zero condition code
64 * struct tm_scsw - transport-mode subchannel status word
69 * @x: IRB-format control
70 * @q: interrogate-complete
80 * @schxs: subchannel-extended status
106 * struct eadm_scsw - subchannel status word for eadm subchannels
136 * union scsw - subchannel status word
137 * @cmd: command-mode SCSW
138 * @tm: transport-mode SCSW
225 * scsw_is_tm - check for transport mode scsw
228 * Return non-zero if the specified scsw is a transport mode scsw, zero
233 return css_general_characteristics.fcx && (scsw->tm.x == 1); in scsw_is_tm()
237 * scsw_key - return scsw key field
246 return scsw->tm.key; in scsw_key()
248 return scsw->cmd.key; in scsw_key()
252 * scsw_eswf - return scsw eswf field
261 return scsw->tm.eswf; in scsw_eswf()
263 return scsw->cmd.eswf; in scsw_eswf()
267 * scsw_cc - return scsw cc field
276 return scsw->tm.cc; in scsw_cc()
278 return scsw->cmd.cc; in scsw_cc()
282 * scsw_ectl - return scsw ectl field
291 return scsw->tm.ectl; in scsw_ectl()
293 return scsw->cmd.ectl; in scsw_ectl()
297 * scsw_pno - return scsw pno field
306 return scsw->tm.pno; in scsw_pno()
308 return scsw->cmd.pno; in scsw_pno()
312 * scsw_fctl - return scsw fctl field
321 return scsw->tm.fctl; in scsw_fctl()
323 return scsw->cmd.fctl; in scsw_fctl()
327 * scsw_actl - return scsw actl field
336 return scsw->tm.actl; in scsw_actl()
338 return scsw->cmd.actl; in scsw_actl()
342 * scsw_stctl - return scsw stctl field
351 return scsw->tm.stctl; in scsw_stctl()
353 return scsw->cmd.stctl; in scsw_stctl()
357 * scsw_dstat - return scsw dstat field
366 return scsw->tm.dstat; in scsw_dstat()
368 return scsw->cmd.dstat; in scsw_dstat()
372 * scsw_cstat - return scsw cstat field
381 return scsw->tm.cstat; in scsw_cstat()
383 return scsw->cmd.cstat; in scsw_cstat()
387 * scsw_cmd_is_valid_key - check key field validity
390 * Return non-zero if the key field of the specified command mode scsw is
391 * valid, zero otherwise.
395 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_key()
399 * scsw_cmd_is_valid_sctl - check sctl field validity
402 * Return non-zero if the sctl field of the specified command mode scsw is
403 * valid, zero otherwise.
407 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_sctl()
411 * scsw_cmd_is_valid_eswf - check eswf field validity
414 * Return non-zero if the eswf field of the specified command mode scsw is
415 * valid, zero otherwise.
419 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND); in scsw_cmd_is_valid_eswf()
423 * scsw_cmd_is_valid_cc - check cc field validity
426 * Return non-zero if the cc field of the specified command mode scsw is
427 * valid, zero otherwise.
431 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) && in scsw_cmd_is_valid_cc()
432 (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND); in scsw_cmd_is_valid_cc()
436 * scsw_cmd_is_valid_fmt - check fmt field validity
439 * Return non-zero if the fmt field of the specified command mode scsw is
440 * valid, zero otherwise.
444 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_fmt()
448 * scsw_cmd_is_valid_pfch - check pfch field validity
451 * Return non-zero if the pfch field of the specified command mode scsw is
452 * valid, zero otherwise.
456 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_pfch()
460 * scsw_cmd_is_valid_isic - check isic field validity
463 * Return non-zero if the isic field of the specified command mode scsw is
464 * valid, zero otherwise.
468 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_isic()
472 * scsw_cmd_is_valid_alcc - check alcc field validity
475 * Return non-zero if the alcc field of the specified command mode scsw is
476 * valid, zero otherwise.
480 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_alcc()
484 * scsw_cmd_is_valid_ssi - check ssi field validity
487 * Return non-zero if the ssi field of the specified command mode scsw is
488 * valid, zero otherwise.
492 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC); in scsw_cmd_is_valid_ssi()
496 * scsw_cmd_is_valid_zcc - check zcc field validity
499 * Return non-zero if the zcc field of the specified command mode scsw is
500 * valid, zero otherwise.
504 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) && in scsw_cmd_is_valid_zcc()
505 (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS); in scsw_cmd_is_valid_zcc()
509 * scsw_cmd_is_valid_ectl - check ectl field validity
512 * Return non-zero if the ectl field of the specified command mode scsw is
513 * valid, zero otherwise.
518 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND)) in scsw_cmd_is_valid_ectl()
522 if (!(scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS)) in scsw_cmd_is_valid_ectl()
528 if (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) in scsw_cmd_is_valid_ectl()
535 * scsw_cmd_is_valid_pno - check pno field validity
538 * Return non-zero if the pno field of the specified command mode scsw is
539 * valid, zero otherwise.
544 if (!scsw->cmd.fctl) in scsw_cmd_is_valid_pno()
548 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND)) in scsw_cmd_is_valid_pno()
554 if (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS)) in scsw_cmd_is_valid_pno()
558 if (scsw->cmd.actl & SCSW_ACTL_SUSPENDED) in scsw_cmd_is_valid_pno()
565 * scsw_cmd_is_valid_fctl - check fctl field validity
568 * Return non-zero if the fctl field of the specified command mode scsw is
569 * valid, zero otherwise.
578 * scsw_cmd_is_valid_actl - check actl field validity
581 * Return non-zero if the actl field of the specified command mode scsw is
582 * valid, zero otherwise.
591 * scsw_cmd_is_valid_stctl - check stctl field validity
594 * Return non-zero if the stctl field of the specified command mode scsw is
595 * valid, zero otherwise.
604 * scsw_cmd_is_valid_dstat - check dstat field validity
607 * Return non-zero if the dstat field of the specified command mode scsw is
608 * valid, zero otherwise.
612 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) && in scsw_cmd_is_valid_dstat()
613 (scsw->cmd.cc != 3); in scsw_cmd_is_valid_dstat()
617 * scsw_cmd_is_valid_cstat - check cstat field validity
620 * Return non-zero if the cstat field of the specified command mode scsw is
621 * valid, zero otherwise.
625 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) && in scsw_cmd_is_valid_cstat()
626 (scsw->cmd.cc != 3); in scsw_cmd_is_valid_cstat()
630 * scsw_tm_is_valid_key - check key field validity
633 * Return non-zero if the key field of the specified transport mode scsw is
634 * valid, zero otherwise.
638 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC); in scsw_tm_is_valid_key()
642 * scsw_tm_is_valid_eswf - check eswf field validity
645 * Return non-zero if the eswf field of the specified transport mode scsw is
646 * valid, zero otherwise.
650 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND); in scsw_tm_is_valid_eswf()
654 * scsw_tm_is_valid_cc - check cc field validity
657 * Return non-zero if the cc field of the specified transport mode scsw is
658 * valid, zero otherwise.
662 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) && in scsw_tm_is_valid_cc()
663 (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND); in scsw_tm_is_valid_cc()
667 * scsw_tm_is_valid_fmt - check fmt field validity
670 * Return non-zero if the fmt field of the specified transport mode scsw is
671 * valid, zero otherwise.
679 * scsw_tm_is_valid_x - check x field validity
682 * Return non-zero if the x field of the specified transport mode scsw is
683 * valid, zero otherwise.
691 * scsw_tm_is_valid_q - check q field validity
694 * Return non-zero if the q field of the specified transport mode scsw is
695 * valid, zero otherwise.
703 * scsw_tm_is_valid_ectl - check ectl field validity
706 * Return non-zero if the ectl field of the specified transport mode scsw is
707 * valid, zero otherwise.
712 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) in scsw_tm_is_valid_ectl()
716 if (!(scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS)) in scsw_tm_is_valid_ectl()
722 if (scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) in scsw_tm_is_valid_ectl()
729 * scsw_tm_is_valid_pno - check pno field validity
732 * Return non-zero if the pno field of the specified transport mode scsw is
733 * valid, zero otherwise.
738 if (!scsw->tm.fctl) in scsw_tm_is_valid_pno()
742 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND)) in scsw_tm_is_valid_pno()
748 if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)) in scsw_tm_is_valid_pno()
752 if (scsw->tm.actl & SCSW_ACTL_SUSPENDED) in scsw_tm_is_valid_pno()
759 * scsw_tm_is_valid_fctl - check fctl field validity
762 * Return non-zero if the fctl field of the specified transport mode scsw is
763 * valid, zero otherwise.
772 * scsw_tm_is_valid_actl - check actl field validity
775 * Return non-zero if the actl field of the specified transport mode scsw is
776 * valid, zero otherwise.
785 * scsw_tm_is_valid_stctl - check stctl field validity
788 * Return non-zero if the stctl field of the specified transport mode scsw is
789 * valid, zero otherwise.
798 * scsw_tm_is_valid_dstat - check dstat field validity
801 * Return non-zero if the dstat field of the specified transport mode scsw is
802 * valid, zero otherwise.
806 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) && in scsw_tm_is_valid_dstat()
807 (scsw->tm.cc != 3); in scsw_tm_is_valid_dstat()
811 * scsw_tm_is_valid_cstat - check cstat field validity
814 * Return non-zero if the cstat field of the specified transport mode scsw is
815 * valid, zero otherwise.
819 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) && in scsw_tm_is_valid_cstat()
820 (scsw->tm.cc != 3); in scsw_tm_is_valid_cstat()
824 * scsw_tm_is_valid_fcxs - check fcxs field validity
827 * Return non-zero if the fcxs field of the specified transport mode scsw is
828 * valid, zero otherwise.
836 * scsw_tm_is_valid_schxs - check schxs field validity
839 * Return non-zero if the schxs field of the specified transport mode scsw is
840 * valid, zero otherwise.
844 return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK | in scsw_tm_is_valid_schxs()
851 * scsw_is_valid_actl - check actl field validity
854 * Return non-zero if the actl field of the specified scsw is valid,
856 * Return zero if the field does not contain a valid value.
867 * scsw_is_valid_cc - check cc field validity
870 * Return non-zero if the cc field of the specified scsw is valid,
872 * Return zero if the field does not contain a valid value.
883 * scsw_is_valid_cstat - check cstat field validity
886 * Return non-zero if the cstat field of the specified scsw is valid,
888 * Return zero if the field does not contain a valid value.
899 * scsw_is_valid_dstat - check dstat field validity
902 * Return non-zero if the dstat field of the specified scsw is valid,
904 * Return zero if the field does not contain a valid value.
915 * scsw_is_valid_ectl - check ectl field validity
918 * Return non-zero if the ectl field of the specified scsw is valid,
920 * Return zero if the field does not contain a valid value.
931 * scsw_is_valid_eswf - check eswf field validity
934 * Return non-zero if the eswf field of the specified scsw is valid,
936 * Return zero if the field does not contain a valid value.
947 * scsw_is_valid_fctl - check fctl field validity
950 * Return non-zero if the fctl field of the specified scsw is valid,
952 * Return zero if the field does not contain a valid value.
963 * scsw_is_valid_key - check key field validity
966 * Return non-zero if the key field of the specified scsw is valid,
968 * Return zero if the field does not contain a valid value.
979 * scsw_is_valid_pno - check pno field validity
982 * Return non-zero if the pno field of the specified scsw is valid,
984 * Return zero if the field does not contain a valid value.
995 * scsw_is_valid_stctl - check stctl field validity
998 * Return non-zero if the stctl field of the specified scsw is valid,
1000 * Return zero if the field does not contain a valid value.
1011 * scsw_cmd_is_solicited - check for solicited scsw
1014 * Return non-zero if the command mode scsw indicates that the associated
1015 * status condition is solicited, zero if it is unsolicited.
1019 return (scsw->cmd.cc != 0) || (scsw->cmd.stctl != in scsw_cmd_is_solicited()
1024 * scsw_tm_is_solicited - check for solicited scsw
1027 * Return non-zero if the transport mode scsw indicates that the associated
1028 * status condition is solicited, zero if it is unsolicited.
1032 return (scsw->tm.cc != 0) || (scsw->tm.stctl != in scsw_tm_is_solicited()
1037 * scsw_is_solicited - check for solicited scsw
1040 * Return non-zero if the transport or command mode scsw indicates that the
1041 * associated status condition is solicited, zero if it is unsolicited.