Lines Matching refs:scsw
3 * Helper functions for scsw access.
135 * union scsw - subchannel status word
140 union scsw {
224 * scsw_is_tm - check for transport mode scsw
225 * @scsw: pointer to scsw
227 * Return non-zero if the specified scsw is a transport mode scsw, zero
230 static inline int scsw_is_tm(union scsw *scsw)
232 return css_general_characteristics.fcx && (scsw->tm.x == 1);
236 * scsw_key - return scsw key field
237 * @scsw: pointer to scsw
239 * Return the value of the key field of the specified scsw, regardless of
240 * whether it is a transport mode or command mode scsw.
242 static inline u32 scsw_key(union scsw *scsw)
244 if (scsw_is_tm(scsw))
245 return scsw->tm.key;
247 return scsw->cmd.key;
251 * scsw_eswf - return scsw eswf field
252 * @scsw: pointer to scsw
254 * Return the value of the eswf field of the specified scsw, regardless of
255 * whether it is a transport mode or command mode scsw.
257 static inline u32 scsw_eswf(union scsw *scsw)
259 if (scsw_is_tm(scsw))
260 return scsw->tm.eswf;
262 return scsw->cmd.eswf;
266 * scsw_cc - return scsw cc field
267 * @scsw: pointer to scsw
269 * Return the value of the cc field of the specified scsw, regardless of
270 * whether it is a transport mode or command mode scsw.
272 static inline u32 scsw_cc(union scsw *scsw)
274 if (scsw_is_tm(scsw))
275 return scsw->tm.cc;
277 return scsw->cmd.cc;
281 * scsw_ectl - return scsw ectl field
282 * @scsw: pointer to scsw
284 * Return the value of the ectl field of the specified scsw, regardless of
285 * whether it is a transport mode or command mode scsw.
287 static inline u32 scsw_ectl(union scsw *scsw)
289 if (scsw_is_tm(scsw))
290 return scsw->tm.ectl;
292 return scsw->cmd.ectl;
296 * scsw_pno - return scsw pno field
297 * @scsw: pointer to scsw
299 * Return the value of the pno field of the specified scsw, regardless of
300 * whether it is a transport mode or command mode scsw.
302 static inline u32 scsw_pno(union scsw *scsw)
304 if (scsw_is_tm(scsw))
305 return scsw->tm.pno;
307 return scsw->cmd.pno;
311 * scsw_fctl - return scsw fctl field
312 * @scsw: pointer to scsw
314 * Return the value of the fctl field of the specified scsw, regardless of
315 * whether it is a transport mode or command mode scsw.
317 static inline u32 scsw_fctl(union scsw *scsw)
319 if (scsw_is_tm(scsw))
320 return scsw->tm.fctl;
322 return scsw->cmd.fctl;
326 * scsw_actl - return scsw actl field
327 * @scsw: pointer to scsw
329 * Return the value of the actl field of the specified scsw, regardless of
330 * whether it is a transport mode or command mode scsw.
332 static inline u32 scsw_actl(union scsw *scsw)
334 if (scsw_is_tm(scsw))
335 return scsw->tm.actl;
337 return scsw->cmd.actl;
341 * scsw_stctl - return scsw stctl field
342 * @scsw: pointer to scsw
344 * Return the value of the stctl field of the specified scsw, regardless of
345 * whether it is a transport mode or command mode scsw.
347 static inline u32 scsw_stctl(union scsw *scsw)
349 if (scsw_is_tm(scsw))
350 return scsw->tm.stctl;
352 return scsw->cmd.stctl;
356 * scsw_dstat - return scsw dstat field
357 * @scsw: pointer to scsw
359 * Return the value of the dstat field of the specified scsw, regardless of
360 * whether it is a transport mode or command mode scsw.
362 static inline u32 scsw_dstat(union scsw *scsw)
364 if (scsw_is_tm(scsw))
365 return scsw->tm.dstat;
367 return scsw->cmd.dstat;
371 * scsw_cstat - return scsw cstat field
372 * @scsw: pointer to scsw
374 * Return the value of the cstat field of the specified scsw, regardless of
375 * whether it is a transport mode or command mode scsw.
377 static inline u32 scsw_cstat(union scsw *scsw)
379 if (scsw_is_tm(scsw))
380 return scsw->tm.cstat;
382 return scsw->cmd.cstat;
387 * @scsw: pointer to scsw
389 * Return non-zero if the key field of the specified command mode scsw is
392 static inline int scsw_cmd_is_valid_key(union scsw *scsw)
394 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
399 * @scsw: pointer to scsw
401 * Return non-zero if the sctl field of the specified command mode scsw is
404 static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
406 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
411 * @scsw: pointer to scsw
413 * Return non-zero if the eswf field of the specified command mode scsw is
416 static inline int scsw_cmd_is_valid_eswf(union scsw *scsw)
418 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
423 * @scsw: pointer to scsw
425 * Return non-zero if the cc field of the specified command mode scsw is
428 static inline int scsw_cmd_is_valid_cc(union scsw *scsw)
430 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
431 (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
436 * @scsw: pointer to scsw
438 * Return non-zero if the fmt field of the specified command mode scsw is
441 static inline int scsw_cmd_is_valid_fmt(union scsw *scsw)
443 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
448 * @scsw: pointer to scsw
450 * Return non-zero if the pfch field of the specified command mode scsw is
453 static inline int scsw_cmd_is_valid_pfch(union scsw *scsw)
455 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
460 * @scsw: pointer to scsw
462 * Return non-zero if the isic field of the specified command mode scsw is
465 static inline int scsw_cmd_is_valid_isic(union scsw *scsw)
467 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
472 * @scsw: pointer to scsw
474 * Return non-zero if the alcc field of the specified command mode scsw is
477 static inline int scsw_cmd_is_valid_alcc(union scsw *scsw)
479 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
484 * @scsw: pointer to scsw
486 * Return non-zero if the ssi field of the specified command mode scsw is
489 static inline int scsw_cmd_is_valid_ssi(union scsw *scsw)
491 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
496 * @scsw: pointer to scsw
498 * Return non-zero if the zcc field of the specified command mode scsw is
501 static inline int scsw_cmd_is_valid_zcc(union scsw *scsw)
503 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
504 (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
509 * @scsw: pointer to scsw
511 * Return non-zero if the ectl field of the specified command mode scsw is
514 static inline int scsw_cmd_is_valid_ectl(union scsw *scsw)
517 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND))
521 if (!(scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS))
527 if (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS)
535 * @scsw: pointer to scsw
537 * Return non-zero if the pno field of the specified command mode scsw is
540 static inline int scsw_cmd_is_valid_pno(union scsw *scsw)
543 if (!scsw->cmd.fctl)
547 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND))
553 if (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS))
557 if (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)
565 * @scsw: pointer to scsw
567 * Return non-zero if the fctl field of the specified command mode scsw is
570 static inline int scsw_cmd_is_valid_fctl(union scsw *scsw)
578 * @scsw: pointer to scsw
580 * Return non-zero if the actl field of the specified command mode scsw is
583 static inline int scsw_cmd_is_valid_actl(union scsw *scsw)
591 * @scsw: pointer to scsw
593 * Return non-zero if the stctl field of the specified command mode scsw is
596 static inline int scsw_cmd_is_valid_stctl(union scsw *scsw)
604 * @scsw: pointer to scsw
606 * Return non-zero if the dstat field of the specified command mode scsw is
609 static inline int scsw_cmd_is_valid_dstat(union scsw *scsw)
611 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
612 (scsw->cmd.cc != 3);
617 * @scsw: pointer to scsw
619 * Return non-zero if the cstat field of the specified command mode scsw is
622 static inline int scsw_cmd_is_valid_cstat(union scsw *scsw)
624 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
625 (scsw->cmd.cc != 3);
630 * @scsw: pointer to scsw
632 * Return non-zero if the key field of the specified transport mode scsw is
635 static inline int scsw_tm_is_valid_key(union scsw *scsw)
637 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
642 * @scsw: pointer to scsw
644 * Return non-zero if the eswf field of the specified transport mode scsw is
647 static inline int scsw_tm_is_valid_eswf(union scsw *scsw)
649 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
654 * @scsw: pointer to scsw
656 * Return non-zero if the cc field of the specified transport mode scsw is
659 static inline int scsw_tm_is_valid_cc(union scsw *scsw)
661 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
662 (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
667 * @scsw: pointer to scsw
669 * Return non-zero if the fmt field of the specified transport mode scsw is
672 static inline int scsw_tm_is_valid_fmt(union scsw *scsw)
679 * @scsw: pointer to scsw
681 * Return non-zero if the x field of the specified transport mode scsw is
684 static inline int scsw_tm_is_valid_x(union scsw *scsw)
691 * @scsw: pointer to scsw
693 * Return non-zero if the q field of the specified transport mode scsw is
696 static inline int scsw_tm_is_valid_q(union scsw *scsw)
703 * @scsw: pointer to scsw
705 * Return non-zero if the ectl field of the specified transport mode scsw is
708 static inline int scsw_tm_is_valid_ectl(union scsw *scsw)
711 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND))
715 if (!(scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS))
721 if (scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)
729 * @scsw: pointer to scsw
731 * Return non-zero if the pno field of the specified transport mode scsw is
734 static inline int scsw_tm_is_valid_pno(union scsw *scsw)
737 if (!scsw->tm.fctl)
741 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND))
747 if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS))
751 if (scsw->tm.actl & SCSW_ACTL_SUSPENDED)
759 * @scsw: pointer to scsw
761 * Return non-zero if the fctl field of the specified transport mode scsw is
764 static inline int scsw_tm_is_valid_fctl(union scsw *scsw)
772 * @scsw: pointer to scsw
774 * Return non-zero if the actl field of the specified transport mode scsw is
777 static inline int scsw_tm_is_valid_actl(union scsw *scsw)
785 * @scsw: pointer to scsw
787 * Return non-zero if the stctl field of the specified transport mode scsw is
790 static inline int scsw_tm_is_valid_stctl(union scsw *scsw)
798 * @scsw: pointer to scsw
800 * Return non-zero if the dstat field of the specified transport mode scsw is
803 static inline int scsw_tm_is_valid_dstat(union scsw *scsw)
805 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
806 (scsw->tm.cc != 3);
811 * @scsw: pointer to scsw
813 * Return non-zero if the cstat field of the specified transport mode scsw is
816 static inline int scsw_tm_is_valid_cstat(union scsw *scsw)
818 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
819 (scsw->tm.cc != 3);
824 * @scsw: pointer to scsw
826 * Return non-zero if the fcxs field of the specified transport mode scsw is
829 static inline int scsw_tm_is_valid_fcxs(union scsw *scsw)
836 * @scsw: pointer to scsw
838 * Return non-zero if the schxs field of the specified transport mode scsw is
841 static inline int scsw_tm_is_valid_schxs(union scsw *scsw)
843 return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK |
851 * @scsw: pointer to scsw
853 * Return non-zero if the actl field of the specified scsw is valid,
854 * regardless of whether it is a transport mode or command mode scsw.
857 static inline int scsw_is_valid_actl(union scsw *scsw)
859 if (scsw_is_tm(scsw))
860 return scsw_tm_is_valid_actl(scsw);
862 return scsw_cmd_is_valid_actl(scsw);
867 * @scsw: pointer to scsw
869 * Return non-zero if the cc field of the specified scsw is valid,
870 * regardless of whether it is a transport mode or command mode scsw.
873 static inline int scsw_is_valid_cc(union scsw *scsw)
875 if (scsw_is_tm(scsw))
876 return scsw_tm_is_valid_cc(scsw);
878 return scsw_cmd_is_valid_cc(scsw);
883 * @scsw: pointer to scsw
885 * Return non-zero if the cstat field of the specified scsw is valid,
886 * regardless of whether it is a transport mode or command mode scsw.
889 static inline int scsw_is_valid_cstat(union scsw *scsw)
891 if (scsw_is_tm(scsw))
892 return scsw_tm_is_valid_cstat(scsw);
894 return scsw_cmd_is_valid_cstat(scsw);
899 * @scsw: pointer to scsw
901 * Return non-zero if the dstat field of the specified scsw is valid,
902 * regardless of whether it is a transport mode or command mode scsw.
905 static inline int scsw_is_valid_dstat(union scsw *scsw)
907 if (scsw_is_tm(scsw))
908 return scsw_tm_is_valid_dstat(scsw);
910 return scsw_cmd_is_valid_dstat(scsw);
915 * @scsw: pointer to scsw
917 * Return non-zero if the ectl field of the specified scsw is valid,
918 * regardless of whether it is a transport mode or command mode scsw.
921 static inline int scsw_is_valid_ectl(union scsw *scsw)
923 if (scsw_is_tm(scsw))
924 return scsw_tm_is_valid_ectl(scsw);
926 return scsw_cmd_is_valid_ectl(scsw);
931 * @scsw: pointer to scsw
933 * Return non-zero if the eswf field of the specified scsw is valid,
934 * regardless of whether it is a transport mode or command mode scsw.
937 static inline int scsw_is_valid_eswf(union scsw *scsw)
939 if (scsw_is_tm(scsw))
940 return scsw_tm_is_valid_eswf(scsw);
942 return scsw_cmd_is_valid_eswf(scsw);
947 * @scsw: pointer to scsw
949 * Return non-zero if the fctl field of the specified scsw is valid,
950 * regardless of whether it is a transport mode or command mode scsw.
953 static inline int scsw_is_valid_fctl(union scsw *scsw)
955 if (scsw_is_tm(scsw))
956 return scsw_tm_is_valid_fctl(scsw);
958 return scsw_cmd_is_valid_fctl(scsw);
963 * @scsw: pointer to scsw
965 * Return non-zero if the key field of the specified scsw is valid,
966 * regardless of whether it is a transport mode or command mode scsw.
969 static inline int scsw_is_valid_key(union scsw *scsw)
971 if (scsw_is_tm(scsw))
972 return scsw_tm_is_valid_key(scsw);
974 return scsw_cmd_is_valid_key(scsw);
979 * @scsw: pointer to scsw
981 * Return non-zero if the pno field of the specified scsw is valid,
982 * regardless of whether it is a transport mode or command mode scsw.
985 static inline int scsw_is_valid_pno(union scsw *scsw)
987 if (scsw_is_tm(scsw))
988 return scsw_tm_is_valid_pno(scsw);
990 return scsw_cmd_is_valid_pno(scsw);
995 * @scsw: pointer to scsw
997 * Return non-zero if the stctl field of the specified scsw is valid,
998 * regardless of whether it is a transport mode or command mode scsw.
1001 static inline int scsw_is_valid_stctl(union scsw *scsw)
1003 if (scsw_is_tm(scsw))
1004 return scsw_tm_is_valid_stctl(scsw);
1006 return scsw_cmd_is_valid_stctl(scsw);
1010 * scsw_cmd_is_solicited - check for solicited scsw
1011 * @scsw: pointer to scsw
1013 * Return non-zero if the command mode scsw indicates that the associated
1016 static inline int scsw_cmd_is_solicited(union scsw *scsw)
1018 return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
1023 * scsw_tm_is_solicited - check for solicited scsw
1024 * @scsw: pointer to scsw
1026 * Return non-zero if the transport mode scsw indicates that the associated
1029 static inline int scsw_tm_is_solicited(union scsw *scsw)
1031 return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
1036 * scsw_is_solicited - check for solicited scsw
1037 * @scsw: pointer to scsw
1039 * Return non-zero if the transport or command mode scsw indicates that the
1042 static inline int scsw_is_solicited(union scsw *scsw)
1044 if (scsw_is_tm(scsw))
1045 return scsw_tm_is_solicited(scsw);
1047 return scsw_cmd_is_solicited(scsw);