Lines Matching refs:scsw
3 * Helper functions for scsw access.
135 * union scsw - subchannel status word
140 union scsw {
219 * scsw_is_tm - check for transport mode scsw
220 * @scsw: pointer to scsw
222 * Return non-zero if the specified scsw is a transport mode scsw, zero
225 static inline int scsw_is_tm(union scsw *scsw)
227 return css_general_characteristics.fcx && (scsw->tm.x == 1);
231 * scsw_key - return scsw key field
232 * @scsw: pointer to scsw
234 * Return the value of the key field of the specified scsw, regardless of
235 * whether it is a transport mode or command mode scsw.
237 static inline u32 scsw_key(union scsw *scsw)
239 if (scsw_is_tm(scsw))
240 return scsw->tm.key;
242 return scsw->cmd.key;
246 * scsw_eswf - return scsw eswf field
247 * @scsw: pointer to scsw
249 * Return the value of the eswf field of the specified scsw, regardless of
250 * whether it is a transport mode or command mode scsw.
252 static inline u32 scsw_eswf(union scsw *scsw)
254 if (scsw_is_tm(scsw))
255 return scsw->tm.eswf;
257 return scsw->cmd.eswf;
261 * scsw_cc - return scsw cc field
262 * @scsw: pointer to scsw
264 * Return the value of the cc field of the specified scsw, regardless of
265 * whether it is a transport mode or command mode scsw.
267 static inline u32 scsw_cc(union scsw *scsw)
269 if (scsw_is_tm(scsw))
270 return scsw->tm.cc;
272 return scsw->cmd.cc;
276 * scsw_ectl - return scsw ectl field
277 * @scsw: pointer to scsw
279 * Return the value of the ectl field of the specified scsw, regardless of
280 * whether it is a transport mode or command mode scsw.
282 static inline u32 scsw_ectl(union scsw *scsw)
284 if (scsw_is_tm(scsw))
285 return scsw->tm.ectl;
287 return scsw->cmd.ectl;
291 * scsw_pno - return scsw pno field
292 * @scsw: pointer to scsw
294 * Return the value of the pno field of the specified scsw, regardless of
295 * whether it is a transport mode or command mode scsw.
297 static inline u32 scsw_pno(union scsw *scsw)
299 if (scsw_is_tm(scsw))
300 return scsw->tm.pno;
302 return scsw->cmd.pno;
306 * scsw_fctl - return scsw fctl field
307 * @scsw: pointer to scsw
309 * Return the value of the fctl field of the specified scsw, regardless of
310 * whether it is a transport mode or command mode scsw.
312 static inline u32 scsw_fctl(union scsw *scsw)
314 if (scsw_is_tm(scsw))
315 return scsw->tm.fctl;
317 return scsw->cmd.fctl;
321 * scsw_actl - return scsw actl field
322 * @scsw: pointer to scsw
324 * Return the value of the actl field of the specified scsw, regardless of
325 * whether it is a transport mode or command mode scsw.
327 static inline u32 scsw_actl(union scsw *scsw)
329 if (scsw_is_tm(scsw))
330 return scsw->tm.actl;
332 return scsw->cmd.actl;
336 * scsw_stctl - return scsw stctl field
337 * @scsw: pointer to scsw
339 * Return the value of the stctl field of the specified scsw, regardless of
340 * whether it is a transport mode or command mode scsw.
342 static inline u32 scsw_stctl(union scsw *scsw)
344 if (scsw_is_tm(scsw))
345 return scsw->tm.stctl;
347 return scsw->cmd.stctl;
351 * scsw_dstat - return scsw dstat field
352 * @scsw: pointer to scsw
354 * Return the value of the dstat field of the specified scsw, regardless of
355 * whether it is a transport mode or command mode scsw.
357 static inline u32 scsw_dstat(union scsw *scsw)
359 if (scsw_is_tm(scsw))
360 return scsw->tm.dstat;
362 return scsw->cmd.dstat;
366 * scsw_cstat - return scsw cstat field
367 * @scsw: pointer to scsw
369 * Return the value of the cstat field of the specified scsw, regardless of
370 * whether it is a transport mode or command mode scsw.
372 static inline u32 scsw_cstat(union scsw *scsw)
374 if (scsw_is_tm(scsw))
375 return scsw->tm.cstat;
377 return scsw->cmd.cstat;
382 * @scsw: pointer to scsw
384 * Return non-zero if the key field of the specified command mode scsw is
387 static inline int scsw_cmd_is_valid_key(union scsw *scsw)
389 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
394 * @scsw: pointer to scsw
396 * Return non-zero if the sctl field of the specified command mode scsw is
399 static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
401 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
406 * @scsw: pointer to scsw
408 * Return non-zero if the eswf field of the specified command mode scsw is
411 static inline int scsw_cmd_is_valid_eswf(union scsw *scsw)
413 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
418 * @scsw: pointer to scsw
420 * Return non-zero if the cc field of the specified command mode scsw is
423 static inline int scsw_cmd_is_valid_cc(union scsw *scsw)
425 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
426 (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
431 * @scsw: pointer to scsw
433 * Return non-zero if the fmt field of the specified command mode scsw is
436 static inline int scsw_cmd_is_valid_fmt(union scsw *scsw)
438 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
443 * @scsw: pointer to scsw
445 * Return non-zero if the pfch field of the specified command mode scsw is
448 static inline int scsw_cmd_is_valid_pfch(union scsw *scsw)
450 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
455 * @scsw: pointer to scsw
457 * Return non-zero if the isic field of the specified command mode scsw is
460 static inline int scsw_cmd_is_valid_isic(union scsw *scsw)
462 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
467 * @scsw: pointer to scsw
469 * Return non-zero if the alcc field of the specified command mode scsw is
472 static inline int scsw_cmd_is_valid_alcc(union scsw *scsw)
474 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
479 * @scsw: pointer to scsw
481 * Return non-zero if the ssi field of the specified command mode scsw is
484 static inline int scsw_cmd_is_valid_ssi(union scsw *scsw)
486 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
491 * @scsw: pointer to scsw
493 * Return non-zero if the zcc field of the specified command mode scsw is
496 static inline int scsw_cmd_is_valid_zcc(union scsw *scsw)
498 return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
499 (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
504 * @scsw: pointer to scsw
506 * Return non-zero if the ectl field of the specified command mode scsw is
509 static inline int scsw_cmd_is_valid_ectl(union scsw *scsw)
511 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
512 !(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
513 (scsw->cmd.stctl & SCSW_STCTL_ALERT_STATUS);
518 * @scsw: pointer to scsw
520 * Return non-zero if the pno field of the specified command mode scsw is
523 static inline int scsw_cmd_is_valid_pno(union scsw *scsw)
525 return (scsw->cmd.fctl != 0) &&
526 (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
527 (!(scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) ||
528 ((scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS) &&
529 (scsw->cmd.actl & SCSW_ACTL_SUSPENDED)));
534 * @scsw: pointer to scsw
536 * Return non-zero if the fctl field of the specified command mode scsw is
539 static inline int scsw_cmd_is_valid_fctl(union scsw *scsw)
547 * @scsw: pointer to scsw
549 * Return non-zero if the actl field of the specified command mode scsw is
552 static inline int scsw_cmd_is_valid_actl(union scsw *scsw)
560 * @scsw: pointer to scsw
562 * Return non-zero if the stctl field of the specified command mode scsw is
565 static inline int scsw_cmd_is_valid_stctl(union scsw *scsw)
573 * @scsw: pointer to scsw
575 * Return non-zero if the dstat field of the specified command mode scsw is
578 static inline int scsw_cmd_is_valid_dstat(union scsw *scsw)
580 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
581 (scsw->cmd.cc != 3);
586 * @scsw: pointer to scsw
588 * Return non-zero if the cstat field of the specified command mode scsw is
591 static inline int scsw_cmd_is_valid_cstat(union scsw *scsw)
593 return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
594 (scsw->cmd.cc != 3);
599 * @scsw: pointer to scsw
601 * Return non-zero if the key field of the specified transport mode scsw is
604 static inline int scsw_tm_is_valid_key(union scsw *scsw)
606 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
611 * @scsw: pointer to scsw
613 * Return non-zero if the eswf field of the specified transport mode scsw is
616 static inline int scsw_tm_is_valid_eswf(union scsw *scsw)
618 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
623 * @scsw: pointer to scsw
625 * Return non-zero if the cc field of the specified transport mode scsw is
628 static inline int scsw_tm_is_valid_cc(union scsw *scsw)
630 return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
631 (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
636 * @scsw: pointer to scsw
638 * Return non-zero if the fmt field of the specified transport mode scsw is
641 static inline int scsw_tm_is_valid_fmt(union scsw *scsw)
648 * @scsw: pointer to scsw
650 * Return non-zero if the x field of the specified transport mode scsw is
653 static inline int scsw_tm_is_valid_x(union scsw *scsw)
660 * @scsw: pointer to scsw
662 * Return non-zero if the q field of the specified transport mode scsw is
665 static inline int scsw_tm_is_valid_q(union scsw *scsw)
672 * @scsw: pointer to scsw
674 * Return non-zero if the ectl field of the specified transport mode scsw is
677 static inline int scsw_tm_is_valid_ectl(union scsw *scsw)
679 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
680 !(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
681 (scsw->tm.stctl & SCSW_STCTL_ALERT_STATUS);
686 * @scsw: pointer to scsw
688 * Return non-zero if the pno field of the specified transport mode scsw is
691 static inline int scsw_tm_is_valid_pno(union scsw *scsw)
693 return (scsw->tm.fctl != 0) &&
694 (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
695 (!(scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) ||
696 ((scsw->tm.stctl & SCSW_STCTL_INTER_STATUS) &&
697 (scsw->tm.actl & SCSW_ACTL_SUSPENDED)));
702 * @scsw: pointer to scsw
704 * Return non-zero if the fctl field of the specified transport mode scsw is
707 static inline int scsw_tm_is_valid_fctl(union scsw *scsw)
715 * @scsw: pointer to scsw
717 * Return non-zero if the actl field of the specified transport mode scsw is
720 static inline int scsw_tm_is_valid_actl(union scsw *scsw)
728 * @scsw: pointer to scsw
730 * Return non-zero if the stctl field of the specified transport mode scsw is
733 static inline int scsw_tm_is_valid_stctl(union scsw *scsw)
741 * @scsw: pointer to scsw
743 * Return non-zero if the dstat field of the specified transport mode scsw is
746 static inline int scsw_tm_is_valid_dstat(union scsw *scsw)
748 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
749 (scsw->tm.cc != 3);
754 * @scsw: pointer to scsw
756 * Return non-zero if the cstat field of the specified transport mode scsw is
759 static inline int scsw_tm_is_valid_cstat(union scsw *scsw)
761 return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
762 (scsw->tm.cc != 3);
767 * @scsw: pointer to scsw
769 * Return non-zero if the fcxs field of the specified transport mode scsw is
772 static inline int scsw_tm_is_valid_fcxs(union scsw *scsw)
779 * @scsw: pointer to scsw
781 * Return non-zero if the schxs field of the specified transport mode scsw is
784 static inline int scsw_tm_is_valid_schxs(union scsw *scsw)
786 return (scsw->tm.cstat & (SCHN_STAT_PROG_CHECK |
794 * @scsw: pointer to scsw
796 * Return non-zero if the actl field of the specified scsw is valid,
797 * regardless of whether it is a transport mode or command mode scsw.
800 static inline int scsw_is_valid_actl(union scsw *scsw)
802 if (scsw_is_tm(scsw))
803 return scsw_tm_is_valid_actl(scsw);
805 return scsw_cmd_is_valid_actl(scsw);
810 * @scsw: pointer to scsw
812 * Return non-zero if the cc field of the specified scsw is valid,
813 * regardless of whether it is a transport mode or command mode scsw.
816 static inline int scsw_is_valid_cc(union scsw *scsw)
818 if (scsw_is_tm(scsw))
819 return scsw_tm_is_valid_cc(scsw);
821 return scsw_cmd_is_valid_cc(scsw);
826 * @scsw: pointer to scsw
828 * Return non-zero if the cstat field of the specified scsw is valid,
829 * regardless of whether it is a transport mode or command mode scsw.
832 static inline int scsw_is_valid_cstat(union scsw *scsw)
834 if (scsw_is_tm(scsw))
835 return scsw_tm_is_valid_cstat(scsw);
837 return scsw_cmd_is_valid_cstat(scsw);
842 * @scsw: pointer to scsw
844 * Return non-zero if the dstat field of the specified scsw is valid,
845 * regardless of whether it is a transport mode or command mode scsw.
848 static inline int scsw_is_valid_dstat(union scsw *scsw)
850 if (scsw_is_tm(scsw))
851 return scsw_tm_is_valid_dstat(scsw);
853 return scsw_cmd_is_valid_dstat(scsw);
858 * @scsw: pointer to scsw
860 * Return non-zero if the ectl field of the specified scsw is valid,
861 * regardless of whether it is a transport mode or command mode scsw.
864 static inline int scsw_is_valid_ectl(union scsw *scsw)
866 if (scsw_is_tm(scsw))
867 return scsw_tm_is_valid_ectl(scsw);
869 return scsw_cmd_is_valid_ectl(scsw);
874 * @scsw: pointer to scsw
876 * Return non-zero if the eswf field of the specified scsw is valid,
877 * regardless of whether it is a transport mode or command mode scsw.
880 static inline int scsw_is_valid_eswf(union scsw *scsw)
882 if (scsw_is_tm(scsw))
883 return scsw_tm_is_valid_eswf(scsw);
885 return scsw_cmd_is_valid_eswf(scsw);
890 * @scsw: pointer to scsw
892 * Return non-zero if the fctl field of the specified scsw is valid,
893 * regardless of whether it is a transport mode or command mode scsw.
896 static inline int scsw_is_valid_fctl(union scsw *scsw)
898 if (scsw_is_tm(scsw))
899 return scsw_tm_is_valid_fctl(scsw);
901 return scsw_cmd_is_valid_fctl(scsw);
906 * @scsw: pointer to scsw
908 * Return non-zero if the key field of the specified scsw is valid,
909 * regardless of whether it is a transport mode or command mode scsw.
912 static inline int scsw_is_valid_key(union scsw *scsw)
914 if (scsw_is_tm(scsw))
915 return scsw_tm_is_valid_key(scsw);
917 return scsw_cmd_is_valid_key(scsw);
922 * @scsw: pointer to scsw
924 * Return non-zero if the pno field of the specified scsw is valid,
925 * regardless of whether it is a transport mode or command mode scsw.
928 static inline int scsw_is_valid_pno(union scsw *scsw)
930 if (scsw_is_tm(scsw))
931 return scsw_tm_is_valid_pno(scsw);
933 return scsw_cmd_is_valid_pno(scsw);
938 * @scsw: pointer to scsw
940 * Return non-zero if the stctl field of the specified scsw is valid,
941 * regardless of whether it is a transport mode or command mode scsw.
944 static inline int scsw_is_valid_stctl(union scsw *scsw)
946 if (scsw_is_tm(scsw))
947 return scsw_tm_is_valid_stctl(scsw);
949 return scsw_cmd_is_valid_stctl(scsw);
953 * scsw_cmd_is_solicited - check for solicited scsw
954 * @scsw: pointer to scsw
956 * Return non-zero if the command mode scsw indicates that the associated
959 static inline int scsw_cmd_is_solicited(union scsw *scsw)
961 return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
966 * scsw_tm_is_solicited - check for solicited scsw
967 * @scsw: pointer to scsw
969 * Return non-zero if the transport mode scsw indicates that the associated
972 static inline int scsw_tm_is_solicited(union scsw *scsw)
974 return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
979 * scsw_is_solicited - check for solicited scsw
980 * @scsw: pointer to scsw
982 * Return non-zero if the transport or command mode scsw indicates that the
985 static inline int scsw_is_solicited(union scsw *scsw)
987 if (scsw_is_tm(scsw))
988 return scsw_tm_is_solicited(scsw);
990 return scsw_cmd_is_solicited(scsw);