Lines Matching defs:scsw

3  *  Helper functions for scsw access.
136 * union scsw - subchannel status word
141 union scsw {
225 * scsw_is_tm - check for transport mode scsw
226 * @scsw: pointer to scsw
228 * Return non-zero if the specified scsw is a transport mode scsw, zero
231 static inline int scsw_is_tm(union scsw *scsw)
233 return css_general_characteristics.fcx && (scsw->tm.x == 1);
237 * scsw_key - return scsw key field
238 * @scsw: pointer to scsw
240 * Return the value of the key field of the specified scsw, regardless of
241 * whether it is a transport mode or command mode scsw.
243 static inline u32 scsw_key(union scsw *scsw)
245 if (scsw_is_tm(scsw))
246 return scsw->tm.key;
248 return scsw->cmd.key;
252 * scsw_eswf - return scsw eswf field
253 * @scsw: pointer to scsw
255 * Return the value of the eswf field of the specified scsw, regardless of
256 * whether it is a transport mode or command mode scsw.
258 static inline u32 scsw_eswf(union scsw *scsw)
260 if (scsw_is_tm(scsw))
261 return scsw->tm.eswf;
263 return scsw->cmd.eswf;
267 * scsw_cc - return scsw cc field
268 * @scsw: pointer to scsw
270 * Return the value of the cc field of the specified scsw, regardless of
271 * whether it is a transport mode or command mode scsw.
273 static inline u32 scsw_cc(union scsw *scsw)
275 if (scsw_is_tm(scsw))
276 return scsw->tm.cc;
278 return scsw->cmd.cc;
282 * scsw_ectl - return scsw ectl field
283 * @scsw: pointer to scsw
285 * Return the value of the ectl field of the specified scsw, regardless of
286 * whether it is a transport mode or command mode scsw.
288 static inline u32 scsw_ectl(union scsw *scsw)
290 if (scsw_is_tm(scsw))
291 return scsw->tm.ectl;
293 return scsw->cmd.ectl;
297 * scsw_pno - return scsw pno field
298 * @scsw: pointer to scsw
300 * Return the value of the pno field of the specified scsw, regardless of
301 * whether it is a transport mode or command mode scsw.
303 static inline u32 scsw_pno(union scsw *scsw)
305 if (scsw_is_tm(scsw))
306 return scsw->tm.pno;
308 return scsw->cmd.pno;
312 * scsw_fctl - return scsw fctl field
313 * @scsw: pointer to scsw
315 * Return the value of the fctl field of the specified scsw, regardless of
316 * whether it is a transport mode or command mode scsw.
318 static inline u32 scsw_fctl(union scsw *scsw)
320 if (scsw_is_tm(scsw))
321 return scsw->tm.fctl;
323 return scsw->cmd.fctl;
327 * scsw_actl - return scsw actl field
328 * @scsw: pointer to scsw
330 * Return the value of the actl field of the specified scsw, regardless of
331 * whether it is a transport mode or command mode scsw.
333 static inline u32 scsw_actl(union scsw *scsw)
335 if (scsw_is_tm(scsw))
336 return scsw->tm.actl;
338 return scsw->cmd.actl;
342 * scsw_stctl - return scsw stctl field
343 * @scsw: pointer to scsw
345 * Return the value of the stctl field of the specified scsw, regardless of
346 * whether it is a transport mode or command mode scsw.
348 static inline u32 scsw_stctl(union scsw *scsw)
350 if (scsw_is_tm(scsw))
351 return scsw->tm.stctl;
353 return scsw->cmd.stctl;
357 * scsw_dstat - return scsw dstat field
358 * @scsw: pointer to scsw
360 * Return the value of the dstat field of the specified scsw, regardless of
361 * whether it is a transport mode or command mode scsw.
363 static inline u32 scsw_dstat(union scsw *scsw)
365 if (scsw_is_tm(scsw))
366 return scsw->tm.dstat;
368 return scsw->cmd.dstat;
372 * scsw_cstat - return scsw cstat field
373 * @scsw: pointer to scsw
375 * Return the value of the cstat field of the specified scsw, regardless of
376 * whether it is a transport mode or command mode scsw.
378 static inline u32 scsw_cstat(union scsw *scsw)
380 if (scsw_is_tm(scsw))
381 return scsw->tm.cstat;
383 return scsw->cmd.cstat;
388 * @scsw: pointer to scsw
390 * Return non-zero if the key field of the specified command mode scsw is
393 static inline int scsw_cmd_is_valid_key(union scsw *scsw)
395 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
400 * @scsw: pointer to scsw
402 * Return non-zero if the sctl field of the specified command mode scsw is
405 static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
407 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
412 * @scsw: pointer to scsw
414 * Return non-zero if the eswf field of the specified command mode scsw is
417 static inline int scsw_cmd_is_valid_eswf(union scsw *scsw)
419 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
424 * @scsw: pointer to scsw
426 * Return non-zero if the cc field of the specified command mode scsw is
429 static inline int scsw_cmd_is_valid_cc(union scsw *scsw)
431 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
432 (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
437 * @scsw: pointer to scsw
439 * Return non-zero if the fmt field of the specified command mode scsw is
442 static inline int scsw_cmd_is_valid_fmt(union scsw *scsw)
444 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
449 * @scsw: pointer to scsw
451 * Return non-zero if the pfch field of the specified command mode scsw is
454 static inline int scsw_cmd_is_valid_pfch(union scsw *scsw)
456 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
461 * @scsw: pointer to scsw
463 * Return non-zero if the isic field of the specified command mode scsw is
466 static inline int scsw_cmd_is_valid_isic(union scsw *scsw)
468 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
473 * @scsw: pointer to scsw
475 * Return non-zero if the alcc field of the specified command mode scsw is
478 static inline int scsw_cmd_is_valid_alcc(union scsw *scsw)
480 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
485 * @scsw: pointer to scsw
487 * Return non-zero if the ssi field of the specified command mode scsw is
490 static inline int scsw_cmd_is_valid_ssi(union scsw *scsw)
492 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
497 * @scsw: pointer to scsw
499 * Return non-zero if the zcc field of the specified command mode scsw is
502 static inline int scsw_cmd_is_valid_zcc(union scsw *scsw)
504 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
505 (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
510 * @scsw: pointer to scsw
512 * Return non-zero if the ectl field of the specified command mode scsw is
515 static inline int scsw_cmd_is_valid_ectl(union scsw *scsw)
518 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND))
522 if (!(scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS))
528 if (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS)
536 * @scsw: pointer to scsw
538 * Return non-zero if the pno field of the specified command mode scsw is
541 static inline int scsw_cmd_is_valid_pno(union scsw *scsw)
544 if (!scsw->cmd.fctl)
548 if (!(scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND))
554 if (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS))
558 if (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)
566 * @scsw: pointer to scsw
568 * Return non-zero if the fctl field of the specified command mode scsw is
571 static inline int scsw_cmd_is_valid_fctl(union scsw *scsw)
579 * @scsw: pointer to scsw
581 * Return non-zero if the actl field of the specified command mode scsw is
584 static inline int scsw_cmd_is_valid_actl(union scsw *scsw)
592 * @scsw: pointer to scsw
594 * Return non-zero if the stctl field of the specified command mode scsw is
597 static inline int scsw_cmd_is_valid_stctl(union scsw *scsw)
605 * @scsw: pointer to scsw
607 * Return non-zero if the dstat field of the specified command mode scsw is
610 static inline int scsw_cmd_is_valid_dstat(union scsw *scsw)
612 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
613 (scsw->cmd.cc != 3);
618 * @scsw: pointer to scsw
620 * Return non-zero if the cstat field of the specified command mode scsw is
623 static inline int scsw_cmd_is_valid_cstat(union scsw *scsw)
625 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
626 (scsw->cmd.cc != 3);
631 * @scsw: pointer to scsw
633 * Return non-zero if the key field of the specified transport mode scsw is
636 static inline int scsw_tm_is_valid_key(union scsw *scsw)
638 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
643 * @scsw: pointer to scsw
645 * Return non-zero if the eswf field of the specified transport mode scsw is
648 static inline int scsw_tm_is_valid_eswf(union scsw *scsw)
650 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
655 * @scsw: pointer to scsw
657 * Return non-zero if the cc field of the specified transport mode scsw is
660 static inline int scsw_tm_is_valid_cc(union scsw *scsw)
662 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
663 (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
668 * @scsw: pointer to scsw
670 * Return non-zero if the fmt field of the specified transport mode scsw is
673 static inline int scsw_tm_is_valid_fmt(union scsw *scsw)
680 * @scsw: pointer to scsw
682 * Return non-zero if the x field of the specified transport mode scsw is
685 static inline int scsw_tm_is_valid_x(union scsw *scsw)
692 * @scsw: pointer to scsw
694 * Return non-zero if the q field of the specified transport mode scsw is
697 static inline int scsw_tm_is_valid_q(union scsw *scsw)
704 * @scsw: pointer to scsw
706 * Return non-zero if the ectl field of the specified transport mode scsw is
709 static inline int scsw_tm_is_valid_ectl(union scsw *scsw)
712 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND))
716 if (!(scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS))
722 if (scsw->tm.stctl & SCSW_STCTL_INTER_STATUS)
730 * @scsw: pointer to scsw
732 * Return non-zero if the pno field of the specified transport mode scsw is
735 static inline int scsw_tm_is_valid_pno(union scsw *scsw)
738 if (!scsw->tm.fctl)
742 if (!(scsw->tm.stctl & SCSW_STCTL_STATUS_PEND))
748 if (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS))
752 if (scsw->tm.actl & SCSW_ACTL_SUSPENDED)
760 * @scsw: pointer to scsw
762 * Return non-zero if the fctl field of the specified transport mode scsw is
765 static inline int scsw_tm_is_valid_fctl(union scsw *scsw)
773 * @scsw: pointer to scsw
775 * Return non-zero if the actl field of the specified transport mode scsw is
778 static inline int scsw_tm_is_valid_actl(union scsw *scsw)
786 * @scsw: pointer to scsw
788 * Return non-zero if the stctl field of the specified transport mode scsw is
791 static inline int scsw_tm_is_valid_stctl(union scsw *scsw)
799 * @scsw: pointer to scsw
801 * Return non-zero if the dstat field of the specified transport mode scsw is
804 static inline int scsw_tm_is_valid_dstat(union scsw *scsw)
806 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
807 (scsw->tm.cc != 3);
812 * @scsw: pointer to scsw
814 * Return non-zero if the cstat field of the specified transport mode scsw is
817 static inline int scsw_tm_is_valid_cstat(union scsw *scsw)
819 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
820 (scsw->tm.cc != 3);
825 * @scsw: pointer to scsw
827 * Return non-zero if the fcxs field of the specified transport mode scsw is
830 static inline int scsw_tm_is_valid_fcxs(union scsw *scsw)
837 * @scsw: pointer to scsw
839 * Return non-zero if the schxs field of the specified transport mode scsw is
842 static inline int scsw_tm_is_valid_schxs(union scsw *scsw)
844 return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK |
852 * @scsw: pointer to scsw
854 * Return non-zero if the actl field of the specified scsw is valid,
855 * regardless of whether it is a transport mode or command mode scsw.
858 static inline int scsw_is_valid_actl(union scsw *scsw)
860 if (scsw_is_tm(scsw))
861 return scsw_tm_is_valid_actl(scsw);
863 return scsw_cmd_is_valid_actl(scsw);
868 * @scsw: pointer to scsw
870 * Return non-zero if the cc field of the specified scsw is valid,
871 * regardless of whether it is a transport mode or command mode scsw.
874 static inline int scsw_is_valid_cc(union scsw *scsw)
876 if (scsw_is_tm(scsw))
877 return scsw_tm_is_valid_cc(scsw);
879 return scsw_cmd_is_valid_cc(scsw);
884 * @scsw: pointer to scsw
886 * Return non-zero if the cstat field of the specified scsw is valid,
887 * regardless of whether it is a transport mode or command mode scsw.
890 static inline int scsw_is_valid_cstat(union scsw *scsw)
892 if (scsw_is_tm(scsw))
893 return scsw_tm_is_valid_cstat(scsw);
895 return scsw_cmd_is_valid_cstat(scsw);
900 * @scsw: pointer to scsw
902 * Return non-zero if the dstat field of the specified scsw is valid,
903 * regardless of whether it is a transport mode or command mode scsw.
906 static inline int scsw_is_valid_dstat(union scsw *scsw)
908 if (scsw_is_tm(scsw))
909 return scsw_tm_is_valid_dstat(scsw);
911 return scsw_cmd_is_valid_dstat(scsw);
916 * @scsw: pointer to scsw
918 * Return non-zero if the ectl field of the specified scsw is valid,
919 * regardless of whether it is a transport mode or command mode scsw.
922 static inline int scsw_is_valid_ectl(union scsw *scsw)
924 if (scsw_is_tm(scsw))
925 return scsw_tm_is_valid_ectl(scsw);
927 return scsw_cmd_is_valid_ectl(scsw);
932 * @scsw: pointer to scsw
934 * Return non-zero if the eswf field of the specified scsw is valid,
935 * regardless of whether it is a transport mode or command mode scsw.
938 static inline int scsw_is_valid_eswf(union scsw *scsw)
940 if (scsw_is_tm(scsw))
941 return scsw_tm_is_valid_eswf(scsw);
943 return scsw_cmd_is_valid_eswf(scsw);
948 * @scsw: pointer to scsw
950 * Return non-zero if the fctl field of the specified scsw is valid,
951 * regardless of whether it is a transport mode or command mode scsw.
954 static inline int scsw_is_valid_fctl(union scsw *scsw)
956 if (scsw_is_tm(scsw))
957 return scsw_tm_is_valid_fctl(scsw);
959 return scsw_cmd_is_valid_fctl(scsw);
964 * @scsw: pointer to scsw
966 * Return non-zero if the key field of the specified scsw is valid,
967 * regardless of whether it is a transport mode or command mode scsw.
970 static inline int scsw_is_valid_key(union scsw *scsw)
972 if (scsw_is_tm(scsw))
973 return scsw_tm_is_valid_key(scsw);
975 return scsw_cmd_is_valid_key(scsw);
980 * @scsw: pointer to scsw
982 * Return non-zero if the pno field of the specified scsw is valid,
983 * regardless of whether it is a transport mode or command mode scsw.
986 static inline int scsw_is_valid_pno(union scsw *scsw)
988 if (scsw_is_tm(scsw))
989 return scsw_tm_is_valid_pno(scsw);
991 return scsw_cmd_is_valid_pno(scsw);
996 * @scsw: pointer to scsw
998 * Return non-zero if the stctl field of the specified scsw is valid,
999 * regardless of whether it is a transport mode or command mode scsw.
1002 static inline int scsw_is_valid_stctl(union scsw *scsw)
1004 if (scsw_is_tm(scsw))
1005 return scsw_tm_is_valid_stctl(scsw);
1007 return scsw_cmd_is_valid_stctl(scsw);
1011 * scsw_cmd_is_solicited - check for solicited scsw
1012 * @scsw: pointer to scsw
1014 * Return non-zero if the command mode scsw indicates that the associated
1017 static inline int scsw_cmd_is_solicited(union scsw *scsw)
1019 return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
1024 * scsw_tm_is_solicited - check for solicited scsw
1025 * @scsw: pointer to scsw
1027 * Return non-zero if the transport mode scsw indicates that the associated
1030 static inline int scsw_tm_is_solicited(union scsw *scsw)
1032 return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
1037 * scsw_is_solicited - check for solicited scsw
1038 * @scsw: pointer to scsw
1040 * Return non-zero if the transport or command mode scsw indicates that the
1043 static inline int scsw_is_solicited(union scsw *scsw)
1045 if (scsw_is_tm(scsw))
1046 return scsw_tm_is_solicited(scsw);
1048 return scsw_cmd_is_solicited(scsw);