]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.arch/s390-17-perf-10-cio-scsw-helper.patch
Fix oinkmaster patch.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.arch / s390-17-perf-10-cio-scsw-helper.patch
CommitLineData
82094b55
AF
1From: Gerald Schaefer <geraldsc@de.ibm.com>
2Subject: [PATCH] cio: move scsw helper functions to header file
3References: bnc#532063,LTC#55526
4
5From: Heiko Carstens <heiko.carstens@de.ibm.com>
6
7All scsw helper functions are very short and usage of them shouldn't
8result in function calls. Therefore we move them to a separate header
9file.
10Also saves a lot of EXPORT_SYMBOLs.
11
12Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14
15Acked-by: John Jolly <jjolly@suse.de>
16---
17
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(-)
25
26Index: 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)
33
34+#ifdef __KERNEL__
35+
36+struct css_general_char {
37+ u64 : 12;
38+ u32 dynio : 1; /* bit 12 */
39+ u32 : 28;
40+ u32 aif : 1; /* bit 41 */
41+ u32 : 3;
42+ u32 mcss : 1; /* bit 45 */
43+ u32 fcs : 1; /* bit 46 */
44+ u32 : 1;
45+ u32 ext_mb : 1; /* bit 48 */
46+ u32 : 7;
47+ u32 aif_tdd : 1; /* bit 56 */
48+ u32 : 1;
49+ u32 qebsm : 1; /* bit 58 */
50+ u32 : 8;
51+ u32 aif_osa : 1; /* bit 67 */
52+ u32 : 14;
53+ u32 cib : 1; /* bit 82 */
54+ u32 : 5;
55+ u32 fcx : 1; /* bit 88 */
56+ u32 : 7;
57+}__attribute__((packed));
58+
59+extern struct css_general_char css_general_characteristics;
60+
61+#endif /* __KERNEL__ */
62 #endif
63Index: 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
67@@ -15,228 +15,7 @@
68 #define LPM_ANYPATH 0xff
69 #define __MAX_CSSID 0
70
71-/**
72- * struct cmd_scsw - command-mode subchannel status word
73- * @key: subchannel key
74- * @sctl: suspend control
75- * @eswf: esw format
76- * @cc: deferred condition code
77- * @fmt: format
78- * @pfch: prefetch
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
85- * @res: reserved
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
93- */
94-struct cmd_scsw {
95- __u32 key : 4;
96- __u32 sctl : 1;
97- __u32 eswf : 1;
98- __u32 cc : 2;
99- __u32 fmt : 1;
100- __u32 pfch : 1;
101- __u32 isic : 1;
102- __u32 alcc : 1;
103- __u32 ssi : 1;
104- __u32 zcc : 1;
105- __u32 ectl : 1;
106- __u32 pno : 1;
107- __u32 res : 1;
108- __u32 fctl : 3;
109- __u32 actl : 7;
110- __u32 stctl : 5;
111- __u32 cpa;
112- __u32 dstat : 8;
113- __u32 cstat : 8;
114- __u32 count : 16;
115-} __attribute__ ((packed));
116-
117-/**
118- * struct tm_scsw - transport-mode subchannel status word
119- * @key: subchannel key
120- * @eswf: esw format
121- * @cc: deferred condition code
122- * @fmt: format
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
135- */
136-struct tm_scsw {
137- u32 key:4;
138- u32 :1;
139- u32 eswf:1;
140- u32 cc:2;
141- u32 fmt:3;
142- u32 x:1;
143- u32 q:1;
144- u32 :1;
145- u32 ectl:1;
146- u32 pno:1;
147- u32 :1;
148- u32 fctl:3;
149- u32 actl:7;
150- u32 stctl:5;
151- u32 tcw;
152- u32 dstat:8;
153- u32 cstat:8;
154- u32 fcxs:8;
155- u32 schxs:8;
156-} __attribute__ ((packed));
157-
158-/**
159- * union scsw - subchannel status word
160- * @cmd: command-mode SCSW
161- * @tm: transport-mode SCSW
162- */
163-union scsw {
164- struct cmd_scsw cmd;
165- struct tm_scsw tm;
166-} __attribute__ ((packed));
167-
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);
224-
225-#define SCSW_FCTL_CLEAR_FUNC 0x1
226-#define SCSW_FCTL_HALT_FUNC 0x2
227-#define SCSW_FCTL_START_FUNC 0x4
228-
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
236-
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
242-
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
251-
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
260-
261-/*
262- * architectured values for first sense byte
263- */
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
272-
273-/*
274- * architectured values for second sense byte
275- */
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
284-
285-/*
286- * architectured values for third sense byte
287- */
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>
294
295 /**
296 * struct ccw1 - channel command word
297Index: linux-sles11/arch/s390/include/asm/scsw.h
298===================================================================
299--- /dev/null
300+++ linux-sles11/arch/s390/include/asm/scsw.h
301@@ -0,0 +1,956 @@
302+/*
303+ * Helper functions for scsw access.
304+ *
305+ * Copyright IBM Corp. 2008,2009
306+ * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
307+ */
308+
309+#ifndef _ASM_S390_SCSW_H_
310+#define _ASM_S390_SCSW_H_
311+
312+#include <linux/types.h>
313+#include <asm/chsc.h>
314+#include <asm/cio.h>
315+
316+/**
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
322+ * @fmt: format
323+ * @pfch: prefetch
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
330+ * @res: reserved
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
338+ */
339+struct cmd_scsw {
340+ __u32 key : 4;
341+ __u32 sctl : 1;
342+ __u32 eswf : 1;
343+ __u32 cc : 2;
344+ __u32 fmt : 1;
345+ __u32 pfch : 1;
346+ __u32 isic : 1;
347+ __u32 alcc : 1;
348+ __u32 ssi : 1;
349+ __u32 zcc : 1;
350+ __u32 ectl : 1;
351+ __u32 pno : 1;
352+ __u32 res : 1;
353+ __u32 fctl : 3;
354+ __u32 actl : 7;
355+ __u32 stctl : 5;
356+ __u32 cpa;
357+ __u32 dstat : 8;
358+ __u32 cstat : 8;
359+ __u32 count : 16;
360+} __attribute__ ((packed));
361+
362+/**
363+ * struct tm_scsw - transport-mode subchannel status word
364+ * @key: subchannel key
365+ * @eswf: esw format
366+ * @cc: deferred condition code
367+ * @fmt: format
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
380+ */
381+struct tm_scsw {
382+ u32 key:4;
383+ u32 :1;
384+ u32 eswf:1;
385+ u32 cc:2;
386+ u32 fmt:3;
387+ u32 x:1;
388+ u32 q:1;
389+ u32 :1;
390+ u32 ectl:1;
391+ u32 pno:1;
392+ u32 :1;
393+ u32 fctl:3;
394+ u32 actl:7;
395+ u32 stctl:5;
396+ u32 tcw;
397+ u32 dstat:8;
398+ u32 cstat:8;
399+ u32 fcxs:8;
400+ u32 schxs:8;
401+} __attribute__ ((packed));
402+
403+/**
404+ * union scsw - subchannel status word
405+ * @cmd: command-mode SCSW
406+ * @tm: transport-mode SCSW
407+ */
408+union scsw {
409+ struct cmd_scsw cmd;
410+ struct tm_scsw tm;
411+} __attribute__ ((packed));
412+
413+#define SCSW_FCTL_CLEAR_FUNC 0x1
414+#define SCSW_FCTL_HALT_FUNC 0x2
415+#define SCSW_FCTL_START_FUNC 0x4
416+
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
424+
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
430+
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
439+
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
448+
449+/*
450+ * architectured values for first sense byte
451+ */
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
460+
461+/*
462+ * architectured values for second sense byte
463+ */
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
472+
473+/*
474+ * architectured values for third sense byte
475+ */
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
481+
482+/**
483+ * scsw_is_tm - check for transport mode scsw
484+ * @scsw: pointer to scsw
485+ *
486+ * Return non-zero if the specified scsw is a transport mode scsw, zero
487+ * otherwise.
488+ */
489+static inline int scsw_is_tm(union scsw *scsw)
490+{
491+ return css_general_characteristics.fcx && (scsw->tm.x == 1);
492+}
493+
494+/**
495+ * scsw_key - return scsw key field
496+ * @scsw: pointer to scsw
497+ *
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.
500+ */
501+static inline u32 scsw_key(union scsw *scsw)
502+{
503+ if (scsw_is_tm(scsw))
504+ return scsw->tm.key;
505+ else
506+ return scsw->cmd.key;
507+}
508+
509+/**
510+ * scsw_eswf - return scsw eswf field
511+ * @scsw: pointer to scsw
512+ *
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.
515+ */
516+static inline u32 scsw_eswf(union scsw *scsw)
517+{
518+ if (scsw_is_tm(scsw))
519+ return scsw->tm.eswf;
520+ else
521+ return scsw->cmd.eswf;
522+}
523+
524+/**
525+ * scsw_cc - return scsw cc field
526+ * @scsw: pointer to scsw
527+ *
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.
530+ */
531+static inline u32 scsw_cc(union scsw *scsw)
532+{
533+ if (scsw_is_tm(scsw))
534+ return scsw->tm.cc;
535+ else
536+ return scsw->cmd.cc;
537+}
538+
539+/**
540+ * scsw_ectl - return scsw ectl field
541+ * @scsw: pointer to scsw
542+ *
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.
545+ */
546+static inline u32 scsw_ectl(union scsw *scsw)
547+{
548+ if (scsw_is_tm(scsw))
549+ return scsw->tm.ectl;
550+ else
551+ return scsw->cmd.ectl;
552+}
553+
554+/**
555+ * scsw_pno - return scsw pno field
556+ * @scsw: pointer to scsw
557+ *
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.
560+ */
561+static inline u32 scsw_pno(union scsw *scsw)
562+{
563+ if (scsw_is_tm(scsw))
564+ return scsw->tm.pno;
565+ else
566+ return scsw->cmd.pno;
567+}
568+
569+/**
570+ * scsw_fctl - return scsw fctl field
571+ * @scsw: pointer to scsw
572+ *
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.
575+ */
576+static inline u32 scsw_fctl(union scsw *scsw)
577+{
578+ if (scsw_is_tm(scsw))
579+ return scsw->tm.fctl;
580+ else
581+ return scsw->cmd.fctl;
582+}
583+
584+/**
585+ * scsw_actl - return scsw actl field
586+ * @scsw: pointer to scsw
587+ *
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.
590+ */
591+static inline u32 scsw_actl(union scsw *scsw)
592+{
593+ if (scsw_is_tm(scsw))
594+ return scsw->tm.actl;
595+ else
596+ return scsw->cmd.actl;
597+}
598+
599+/**
600+ * scsw_stctl - return scsw stctl field
601+ * @scsw: pointer to scsw
602+ *
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.
605+ */
606+static inline u32 scsw_stctl(union scsw *scsw)
607+{
608+ if (scsw_is_tm(scsw))
609+ return scsw->tm.stctl;
610+ else
611+ return scsw->cmd.stctl;
612+}
613+
614+/**
615+ * scsw_dstat - return scsw dstat field
616+ * @scsw: pointer to scsw
617+ *
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.
620+ */
621+static inline u32 scsw_dstat(union scsw *scsw)
622+{
623+ if (scsw_is_tm(scsw))
624+ return scsw->tm.dstat;
625+ else
626+ return scsw->cmd.dstat;
627+}
628+
629+/**
630+ * scsw_cstat - return scsw cstat field
631+ * @scsw: pointer to scsw
632+ *
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.
635+ */
636+static inline u32 scsw_cstat(union scsw *scsw)
637+{
638+ if (scsw_is_tm(scsw))
639+ return scsw->tm.cstat;
640+ else
641+ return scsw->cmd.cstat;
642+}
643+
644+/**
645+ * scsw_cmd_is_valid_key - check key field validity
646+ * @scsw: pointer to scsw
647+ *
648+ * Return non-zero if the key field of the specified command mode scsw is
649+ * valid, zero otherwise.
650+ */
651+static inline int scsw_cmd_is_valid_key(union scsw *scsw)
652+{
653+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
654+}
655+
656+/**
657+ * scsw_cmd_is_valid_sctl - check fctl field validity
658+ * @scsw: pointer to scsw
659+ *
660+ * Return non-zero if the fctl field of the specified command mode scsw is
661+ * valid, zero otherwise.
662+ */
663+static inline int scsw_cmd_is_valid_sctl(union scsw *scsw)
664+{
665+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
666+}
667+
668+/**
669+ * scsw_cmd_is_valid_eswf - check eswf field validity
670+ * @scsw: pointer to scsw
671+ *
672+ * Return non-zero if the eswf field of the specified command mode scsw is
673+ * valid, zero otherwise.
674+ */
675+static inline int scsw_cmd_is_valid_eswf(union scsw *scsw)
676+{
677+ return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
678+}
679+
680+/**
681+ * scsw_cmd_is_valid_cc - check cc field validity
682+ * @scsw: pointer to scsw
683+ *
684+ * Return non-zero if the cc field of the specified command mode scsw is
685+ * valid, zero otherwise.
686+ */
687+static inline int scsw_cmd_is_valid_cc(union scsw *scsw)
688+{
689+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
690+ (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
691+}
692+
693+/**
694+ * scsw_cmd_is_valid_fmt - check fmt field validity
695+ * @scsw: pointer to scsw
696+ *
697+ * Return non-zero if the fmt field of the specified command mode scsw is
698+ * valid, zero otherwise.
699+ */
700+static inline int scsw_cmd_is_valid_fmt(union scsw *scsw)
701+{
702+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
703+}
704+
705+/**
706+ * scsw_cmd_is_valid_pfch - check pfch field validity
707+ * @scsw: pointer to scsw
708+ *
709+ * Return non-zero if the pfch field of the specified command mode scsw is
710+ * valid, zero otherwise.
711+ */
712+static inline int scsw_cmd_is_valid_pfch(union scsw *scsw)
713+{
714+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
715+}
716+
717+/**
718+ * scsw_cmd_is_valid_isic - check isic field validity
719+ * @scsw: pointer to scsw
720+ *
721+ * Return non-zero if the isic field of the specified command mode scsw is
722+ * valid, zero otherwise.
723+ */
724+static inline int scsw_cmd_is_valid_isic(union scsw *scsw)
725+{
726+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
727+}
728+
729+/**
730+ * scsw_cmd_is_valid_alcc - check alcc field validity
731+ * @scsw: pointer to scsw
732+ *
733+ * Return non-zero if the alcc field of the specified command mode scsw is
734+ * valid, zero otherwise.
735+ */
736+static inline int scsw_cmd_is_valid_alcc(union scsw *scsw)
737+{
738+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
739+}
740+
741+/**
742+ * scsw_cmd_is_valid_ssi - check ssi field validity
743+ * @scsw: pointer to scsw
744+ *
745+ * Return non-zero if the ssi field of the specified command mode scsw is
746+ * valid, zero otherwise.
747+ */
748+static inline int scsw_cmd_is_valid_ssi(union scsw *scsw)
749+{
750+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
751+}
752+
753+/**
754+ * scsw_cmd_is_valid_zcc - check zcc field validity
755+ * @scsw: pointer to scsw
756+ *
757+ * Return non-zero if the zcc field of the specified command mode scsw is
758+ * valid, zero otherwise.
759+ */
760+static inline int scsw_cmd_is_valid_zcc(union scsw *scsw)
761+{
762+ return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
763+ (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
764+}
765+
766+/**
767+ * scsw_cmd_is_valid_ectl - check ectl field validity
768+ * @scsw: pointer to scsw
769+ *
770+ * Return non-zero if the ectl field of the specified command mode scsw is
771+ * valid, zero otherwise.
772+ */
773+static inline int scsw_cmd_is_valid_ectl(union scsw *scsw)
774+{
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);
778+}
779+
780+/**
781+ * scsw_cmd_is_valid_pno - check pno field validity
782+ * @scsw: pointer to scsw
783+ *
784+ * Return non-zero if the pno field of the specified command mode scsw is
785+ * valid, zero otherwise.
786+ */
787+static inline int scsw_cmd_is_valid_pno(union scsw *scsw)
788+{
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)));
794+}
795+
796+/**
797+ * scsw_cmd_is_valid_fctl - check fctl field validity
798+ * @scsw: pointer to scsw
799+ *
800+ * Return non-zero if the fctl field of the specified command mode scsw is
801+ * valid, zero otherwise.
802+ */
803+static inline int scsw_cmd_is_valid_fctl(union scsw *scsw)
804+{
805+ /* Only valid if pmcw.dnv == 1*/
806+ return 1;
807+}
808+
809+/**
810+ * scsw_cmd_is_valid_actl - check actl field validity
811+ * @scsw: pointer to scsw
812+ *
813+ * Return non-zero if the actl field of the specified command mode scsw is
814+ * valid, zero otherwise.
815+ */
816+static inline int scsw_cmd_is_valid_actl(union scsw *scsw)
817+{
818+ /* Only valid if pmcw.dnv == 1*/
819+ return 1;
820+}
821+
822+/**
823+ * scsw_cmd_is_valid_stctl - check stctl field validity
824+ * @scsw: pointer to scsw
825+ *
826+ * Return non-zero if the stctl field of the specified command mode scsw is
827+ * valid, zero otherwise.
828+ */
829+static inline int scsw_cmd_is_valid_stctl(union scsw *scsw)
830+{
831+ /* Only valid if pmcw.dnv == 1*/
832+ return 1;
833+}
834+
835+/**
836+ * scsw_cmd_is_valid_dstat - check dstat field validity
837+ * @scsw: pointer to scsw
838+ *
839+ * Return non-zero if the dstat field of the specified command mode scsw is
840+ * valid, zero otherwise.
841+ */
842+static inline int scsw_cmd_is_valid_dstat(union scsw *scsw)
843+{
844+ return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
845+ (scsw->cmd.cc != 3);
846+}
847+
848+/**
849+ * scsw_cmd_is_valid_cstat - check cstat field validity
850+ * @scsw: pointer to scsw
851+ *
852+ * Return non-zero if the cstat field of the specified command mode scsw is
853+ * valid, zero otherwise.
854+ */
855+static inline int scsw_cmd_is_valid_cstat(union scsw *scsw)
856+{
857+ return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
858+ (scsw->cmd.cc != 3);
859+}
860+
861+/**
862+ * scsw_tm_is_valid_key - check key field validity
863+ * @scsw: pointer to scsw
864+ *
865+ * Return non-zero if the key field of the specified transport mode scsw is
866+ * valid, zero otherwise.
867+ */
868+static inline int scsw_tm_is_valid_key(union scsw *scsw)
869+{
870+ return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
871+}
872+
873+/**
874+ * scsw_tm_is_valid_eswf - check eswf field validity
875+ * @scsw: pointer to scsw
876+ *
877+ * Return non-zero if the eswf field of the specified transport mode scsw is
878+ * valid, zero otherwise.
879+ */
880+static inline int scsw_tm_is_valid_eswf(union scsw *scsw)
881+{
882+ return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
883+}
884+
885+/**
886+ * scsw_tm_is_valid_cc - check cc field validity
887+ * @scsw: pointer to scsw
888+ *
889+ * Return non-zero if the cc field of the specified transport mode scsw is
890+ * valid, zero otherwise.
891+ */
892+static inline int scsw_tm_is_valid_cc(union scsw *scsw)
893+{
894+ return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
895+ (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
896+}
897+
898+/**
899+ * scsw_tm_is_valid_fmt - check fmt field validity
900+ * @scsw: pointer to scsw
901+ *
902+ * Return non-zero if the fmt field of the specified transport mode scsw is
903+ * valid, zero otherwise.
904+ */
905+static inline int scsw_tm_is_valid_fmt(union scsw *scsw)
906+{
907+ return 1;
908+}
909+
910+/**
911+ * scsw_tm_is_valid_x - check x field validity
912+ * @scsw: pointer to scsw
913+ *
914+ * Return non-zero if the x field of the specified transport mode scsw is
915+ * valid, zero otherwise.
916+ */
917+static inline int scsw_tm_is_valid_x(union scsw *scsw)
918+{
919+ return 1;
920+}
921+
922+/**
923+ * scsw_tm_is_valid_q - check q field validity
924+ * @scsw: pointer to scsw
925+ *
926+ * Return non-zero if the q field of the specified transport mode scsw is
927+ * valid, zero otherwise.
928+ */
929+static inline int scsw_tm_is_valid_q(union scsw *scsw)
930+{
931+ return 1;
932+}
933+
934+/**
935+ * scsw_tm_is_valid_ectl - check ectl field validity
936+ * @scsw: pointer to scsw
937+ *
938+ * Return non-zero if the ectl field of the specified transport mode scsw is
939+ * valid, zero otherwise.
940+ */
941+static inline int scsw_tm_is_valid_ectl(union scsw *scsw)
942+{
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);
946+}
947+
948+/**
949+ * scsw_tm_is_valid_pno - check pno field validity
950+ * @scsw: pointer to scsw
951+ *
952+ * Return non-zero if the pno field of the specified transport mode scsw is
953+ * valid, zero otherwise.
954+ */
955+static inline int scsw_tm_is_valid_pno(union scsw *scsw)
956+{
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)));
962+}
963+
964+/**
965+ * scsw_tm_is_valid_fctl - check fctl field validity
966+ * @scsw: pointer to scsw
967+ *
968+ * Return non-zero if the fctl field of the specified transport mode scsw is
969+ * valid, zero otherwise.
970+ */
971+static inline int scsw_tm_is_valid_fctl(union scsw *scsw)
972+{
973+ /* Only valid if pmcw.dnv == 1*/
974+ return 1;
975+}
976+
977+/**
978+ * scsw_tm_is_valid_actl - check actl field validity
979+ * @scsw: pointer to scsw
980+ *
981+ * Return non-zero if the actl field of the specified transport mode scsw is
982+ * valid, zero otherwise.
983+ */
984+static inline int scsw_tm_is_valid_actl(union scsw *scsw)
985+{
986+ /* Only valid if pmcw.dnv == 1*/
987+ return 1;
988+}
989+
990+/**
991+ * scsw_tm_is_valid_stctl - check stctl field validity
992+ * @scsw: pointer to scsw
993+ *
994+ * Return non-zero if the stctl field of the specified transport mode scsw is
995+ * valid, zero otherwise.
996+ */
997+static inline int scsw_tm_is_valid_stctl(union scsw *scsw)
998+{
999+ /* Only valid if pmcw.dnv == 1*/
1000+ return 1;
1001+}
1002+
1003+/**
1004+ * scsw_tm_is_valid_dstat - check dstat field validity
1005+ * @scsw: pointer to scsw
1006+ *
1007+ * Return non-zero if the dstat field of the specified transport mode scsw is
1008+ * valid, zero otherwise.
1009+ */
1010+static inline int scsw_tm_is_valid_dstat(union scsw *scsw)
1011+{
1012+ return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1013+ (scsw->tm.cc != 3);
1014+}
1015+
1016+/**
1017+ * scsw_tm_is_valid_cstat - check cstat field validity
1018+ * @scsw: pointer to scsw
1019+ *
1020+ * Return non-zero if the cstat field of the specified transport mode scsw is
1021+ * valid, zero otherwise.
1022+ */
1023+static inline int scsw_tm_is_valid_cstat(union scsw *scsw)
1024+{
1025+ return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1026+ (scsw->tm.cc != 3);
1027+}
1028+
1029+/**
1030+ * scsw_tm_is_valid_fcxs - check fcxs field validity
1031+ * @scsw: pointer to scsw
1032+ *
1033+ * Return non-zero if the fcxs field of the specified transport mode scsw is
1034+ * valid, zero otherwise.
1035+ */
1036+static inline int scsw_tm_is_valid_fcxs(union scsw *scsw)
1037+{
1038+ return 1;
1039+}
1040+
1041+/**
1042+ * scsw_tm_is_valid_schxs - check schxs field validity
1043+ * @scsw: pointer to scsw
1044+ *
1045+ * Return non-zero if the schxs field of the specified transport mode scsw is
1046+ * valid, zero otherwise.
1047+ */
1048+static inline int scsw_tm_is_valid_schxs(union scsw *scsw)
1049+{
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));
1054+}
1055+
1056+/**
1057+ * scsw_is_valid_actl - check actl field validity
1058+ * @scsw: pointer to scsw
1059+ *
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.
1063+ */
1064+static inline int scsw_is_valid_actl(union scsw *scsw)
1065+{
1066+ if (scsw_is_tm(scsw))
1067+ return scsw_tm_is_valid_actl(scsw);
1068+ else
1069+ return scsw_cmd_is_valid_actl(scsw);
1070+}
1071+
1072+/**
1073+ * scsw_is_valid_cc - check cc field validity
1074+ * @scsw: pointer to scsw
1075+ *
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.
1079+ */
1080+static inline int scsw_is_valid_cc(union scsw *scsw)
1081+{
1082+ if (scsw_is_tm(scsw))
1083+ return scsw_tm_is_valid_cc(scsw);
1084+ else
1085+ return scsw_cmd_is_valid_cc(scsw);
1086+}
1087+
1088+/**
1089+ * scsw_is_valid_cstat - check cstat field validity
1090+ * @scsw: pointer to scsw
1091+ *
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.
1095+ */
1096+static inline int scsw_is_valid_cstat(union scsw *scsw)
1097+{
1098+ if (scsw_is_tm(scsw))
1099+ return scsw_tm_is_valid_cstat(scsw);
1100+ else
1101+ return scsw_cmd_is_valid_cstat(scsw);
1102+}
1103+
1104+/**
1105+ * scsw_is_valid_dstat - check dstat field validity
1106+ * @scsw: pointer to scsw
1107+ *
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.
1111+ */
1112+static inline int scsw_is_valid_dstat(union scsw *scsw)
1113+{
1114+ if (scsw_is_tm(scsw))
1115+ return scsw_tm_is_valid_dstat(scsw);
1116+ else
1117+ return scsw_cmd_is_valid_dstat(scsw);
1118+}
1119+
1120+/**
1121+ * scsw_is_valid_ectl - check ectl field validity
1122+ * @scsw: pointer to scsw
1123+ *
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.
1127+ */
1128+static inline int scsw_is_valid_ectl(union scsw *scsw)
1129+{
1130+ if (scsw_is_tm(scsw))
1131+ return scsw_tm_is_valid_ectl(scsw);
1132+ else
1133+ return scsw_cmd_is_valid_ectl(scsw);
1134+}
1135+
1136+/**
1137+ * scsw_is_valid_eswf - check eswf field validity
1138+ * @scsw: pointer to scsw
1139+ *
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.
1143+ */
1144+static inline int scsw_is_valid_eswf(union scsw *scsw)
1145+{
1146+ if (scsw_is_tm(scsw))
1147+ return scsw_tm_is_valid_eswf(scsw);
1148+ else
1149+ return scsw_cmd_is_valid_eswf(scsw);
1150+}
1151+
1152+/**
1153+ * scsw_is_valid_fctl - check fctl field validity
1154+ * @scsw: pointer to scsw
1155+ *
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.
1159+ */
1160+static inline int scsw_is_valid_fctl(union scsw *scsw)
1161+{
1162+ if (scsw_is_tm(scsw))
1163+ return scsw_tm_is_valid_fctl(scsw);
1164+ else
1165+ return scsw_cmd_is_valid_fctl(scsw);
1166+}
1167+
1168+/**
1169+ * scsw_is_valid_key - check key field validity
1170+ * @scsw: pointer to scsw
1171+ *
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.
1175+ */
1176+static inline int scsw_is_valid_key(union scsw *scsw)
1177+{
1178+ if (scsw_is_tm(scsw))
1179+ return scsw_tm_is_valid_key(scsw);
1180+ else
1181+ return scsw_cmd_is_valid_key(scsw);
1182+}
1183+
1184+/**
1185+ * scsw_is_valid_pno - check pno field validity
1186+ * @scsw: pointer to scsw
1187+ *
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.
1191+ */
1192+static inline int scsw_is_valid_pno(union scsw *scsw)
1193+{
1194+ if (scsw_is_tm(scsw))
1195+ return scsw_tm_is_valid_pno(scsw);
1196+ else
1197+ return scsw_cmd_is_valid_pno(scsw);
1198+}
1199+
1200+/**
1201+ * scsw_is_valid_stctl - check stctl field validity
1202+ * @scsw: pointer to scsw
1203+ *
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.
1207+ */
1208+static inline int scsw_is_valid_stctl(union scsw *scsw)
1209+{
1210+ if (scsw_is_tm(scsw))
1211+ return scsw_tm_is_valid_stctl(scsw);
1212+ else
1213+ return scsw_cmd_is_valid_stctl(scsw);
1214+}
1215+
1216+/**
1217+ * scsw_cmd_is_solicited - check for solicited scsw
1218+ * @scsw: pointer to scsw
1219+ *
1220+ * Return non-zero if the command mode scsw indicates that the associated
1221+ * status condition is solicited, zero if it is unsolicited.
1222+ */
1223+static inline int scsw_cmd_is_solicited(union scsw *scsw)
1224+{
1225+ return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
1226+ (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
1227+}
1228+
1229+/**
1230+ * scsw_tm_is_solicited - check for solicited scsw
1231+ * @scsw: pointer to scsw
1232+ *
1233+ * Return non-zero if the transport mode scsw indicates that the associated
1234+ * status condition is solicited, zero if it is unsolicited.
1235+ */
1236+static inline int scsw_tm_is_solicited(union scsw *scsw)
1237+{
1238+ return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
1239+ (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
1240+}
1241+
1242+/**
1243+ * scsw_is_solicited - check for solicited scsw
1244+ * @scsw: pointer to scsw
1245+ *
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.
1248+ */
1249+static inline int scsw_is_solicited(union scsw *scsw)
1250+{
1251+ if (scsw_is_tm(scsw))
1252+ return scsw_tm_is_solicited(scsw);
1253+ else
1254+ return scsw_cmd_is_solicited(scsw);
1255+}
1256+
1257+#endif /* _ASM_S390_SCSW_H_ */
1258Index: 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 {
1263
1264 struct channel_path;
1265
1266-struct css_general_char {
1267- u64 : 12;
1268- u32 dynio : 1; /* bit 12 */
1269- u32 : 28;
1270- u32 aif : 1; /* bit 41 */
1271- u32 : 3;
1272- u32 mcss : 1; /* bit 45 */
1273- u32 fcs : 1; /* bit 46 */
1274- u32 : 1;
1275- u32 ext_mb : 1; /* bit 48 */
1276- u32 : 7;
1277- u32 aif_tdd : 1; /* bit 56 */
1278- u32 : 1;
1279- u32 qebsm : 1; /* bit 58 */
1280- u32 : 8;
1281- u32 aif_osa : 1; /* bit 67 */
1282- u32 : 14;
1283- u32 cib : 1; /* bit 82 */
1284- u32 : 5;
1285- u32 fcx : 1; /* bit 88 */
1286- u32 : 7;
1287-}__attribute__((packed));
1288-
1289 struct css_chsc_char {
1290 u64 res;
1291 u64 : 20;
1292@@ -72,7 +49,6 @@ struct css_chsc_char {
1293 u32 : 19;
1294 }__attribute__((packed));
1295
1296-extern struct css_general_char css_general_characteristics;
1297 extern struct css_chsc_char css_chsc_characteristics;
1298
1299 struct chsc_ssd_info {
1300Index: linux-sles11/drivers/s390/cio/Makefile
1301===================================================================
1302--- linux-sles11.orig/drivers/s390/cio/Makefile
1303+++ linux-sles11/drivers/s390/cio/Makefile
1304@@ -2,7 +2,7 @@
1305 # Makefile for the S/390 common i/o drivers
1306 #
1307
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 \
1310 fcx.o itcw.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
1313Index: linux-sles11/drivers/s390/cio/scsw.c
1314===================================================================
1315--- linux-sles11.orig/drivers/s390/cio/scsw.c
1316+++ /dev/null
1317@@ -1,843 +0,0 @@
1318-/*
1319- * Helper functions for scsw access.
1320- *
1321- * Copyright IBM Corp. 2008
1322- * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
1323- */
1324-
1325-#include <linux/types.h>
1326-#include <linux/module.h>
1327-#include <asm/cio.h>
1328-#include "css.h"
1329-#include "chsc.h"
1330-
1331-/**
1332- * scsw_is_tm - check for transport mode scsw
1333- * @scsw: pointer to scsw
1334- *
1335- * Return non-zero if the specified scsw is a transport mode scsw, zero
1336- * otherwise.
1337- */
1338-int scsw_is_tm(union scsw *scsw)
1339-{
1340- return css_general_characteristics.fcx && (scsw->tm.x == 1);
1341-}
1342-EXPORT_SYMBOL(scsw_is_tm);
1343-
1344-/**
1345- * scsw_key - return scsw key field
1346- * @scsw: pointer to scsw
1347- *
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.
1350- */
1351-u32 scsw_key(union scsw *scsw)
1352-{
1353- if (scsw_is_tm(scsw))
1354- return scsw->tm.key;
1355- else
1356- return scsw->cmd.key;
1357-}
1358-EXPORT_SYMBOL(scsw_key);
1359-
1360-/**
1361- * scsw_eswf - return scsw eswf field
1362- * @scsw: pointer to scsw
1363- *
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.
1366- */
1367-u32 scsw_eswf(union scsw *scsw)
1368-{
1369- if (scsw_is_tm(scsw))
1370- return scsw->tm.eswf;
1371- else
1372- return scsw->cmd.eswf;
1373-}
1374-EXPORT_SYMBOL(scsw_eswf);
1375-
1376-/**
1377- * scsw_cc - return scsw cc field
1378- * @scsw: pointer to scsw
1379- *
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.
1382- */
1383-u32 scsw_cc(union scsw *scsw)
1384-{
1385- if (scsw_is_tm(scsw))
1386- return scsw->tm.cc;
1387- else
1388- return scsw->cmd.cc;
1389-}
1390-EXPORT_SYMBOL(scsw_cc);
1391-
1392-/**
1393- * scsw_ectl - return scsw ectl field
1394- * @scsw: pointer to scsw
1395- *
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.
1398- */
1399-u32 scsw_ectl(union scsw *scsw)
1400-{
1401- if (scsw_is_tm(scsw))
1402- return scsw->tm.ectl;
1403- else
1404- return scsw->cmd.ectl;
1405-}
1406-EXPORT_SYMBOL(scsw_ectl);
1407-
1408-/**
1409- * scsw_pno - return scsw pno field
1410- * @scsw: pointer to scsw
1411- *
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.
1414- */
1415-u32 scsw_pno(union scsw *scsw)
1416-{
1417- if (scsw_is_tm(scsw))
1418- return scsw->tm.pno;
1419- else
1420- return scsw->cmd.pno;
1421-}
1422-EXPORT_SYMBOL(scsw_pno);
1423-
1424-/**
1425- * scsw_fctl - return scsw fctl field
1426- * @scsw: pointer to scsw
1427- *
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.
1430- */
1431-u32 scsw_fctl(union scsw *scsw)
1432-{
1433- if (scsw_is_tm(scsw))
1434- return scsw->tm.fctl;
1435- else
1436- return scsw->cmd.fctl;
1437-}
1438-EXPORT_SYMBOL(scsw_fctl);
1439-
1440-/**
1441- * scsw_actl - return scsw actl field
1442- * @scsw: pointer to scsw
1443- *
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.
1446- */
1447-u32 scsw_actl(union scsw *scsw)
1448-{
1449- if (scsw_is_tm(scsw))
1450- return scsw->tm.actl;
1451- else
1452- return scsw->cmd.actl;
1453-}
1454-EXPORT_SYMBOL(scsw_actl);
1455-
1456-/**
1457- * scsw_stctl - return scsw stctl field
1458- * @scsw: pointer to scsw
1459- *
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.
1462- */
1463-u32 scsw_stctl(union scsw *scsw)
1464-{
1465- if (scsw_is_tm(scsw))
1466- return scsw->tm.stctl;
1467- else
1468- return scsw->cmd.stctl;
1469-}
1470-EXPORT_SYMBOL(scsw_stctl);
1471-
1472-/**
1473- * scsw_dstat - return scsw dstat field
1474- * @scsw: pointer to scsw
1475- *
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.
1478- */
1479-u32 scsw_dstat(union scsw *scsw)
1480-{
1481- if (scsw_is_tm(scsw))
1482- return scsw->tm.dstat;
1483- else
1484- return scsw->cmd.dstat;
1485-}
1486-EXPORT_SYMBOL(scsw_dstat);
1487-
1488-/**
1489- * scsw_cstat - return scsw cstat field
1490- * @scsw: pointer to scsw
1491- *
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.
1494- */
1495-u32 scsw_cstat(union scsw *scsw)
1496-{
1497- if (scsw_is_tm(scsw))
1498- return scsw->tm.cstat;
1499- else
1500- return scsw->cmd.cstat;
1501-}
1502-EXPORT_SYMBOL(scsw_cstat);
1503-
1504-/**
1505- * scsw_cmd_is_valid_key - check key field validity
1506- * @scsw: pointer to scsw
1507- *
1508- * Return non-zero if the key field of the specified command mode scsw is
1509- * valid, zero otherwise.
1510- */
1511-int scsw_cmd_is_valid_key(union scsw *scsw)
1512-{
1513- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1514-}
1515-EXPORT_SYMBOL(scsw_cmd_is_valid_key);
1516-
1517-/**
1518- * scsw_cmd_is_valid_sctl - check fctl field validity
1519- * @scsw: pointer to scsw
1520- *
1521- * Return non-zero if the fctl field of the specified command mode scsw is
1522- * valid, zero otherwise.
1523- */
1524-int scsw_cmd_is_valid_sctl(union scsw *scsw)
1525-{
1526- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1527-}
1528-EXPORT_SYMBOL(scsw_cmd_is_valid_sctl);
1529-
1530-/**
1531- * scsw_cmd_is_valid_eswf - check eswf field validity
1532- * @scsw: pointer to scsw
1533- *
1534- * Return non-zero if the eswf field of the specified command mode scsw is
1535- * valid, zero otherwise.
1536- */
1537-int scsw_cmd_is_valid_eswf(union scsw *scsw)
1538-{
1539- return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
1540-}
1541-EXPORT_SYMBOL(scsw_cmd_is_valid_eswf);
1542-
1543-/**
1544- * scsw_cmd_is_valid_cc - check cc field validity
1545- * @scsw: pointer to scsw
1546- *
1547- * Return non-zero if the cc field of the specified command mode scsw is
1548- * valid, zero otherwise.
1549- */
1550-int scsw_cmd_is_valid_cc(union scsw *scsw)
1551-{
1552- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
1553- (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND);
1554-}
1555-EXPORT_SYMBOL(scsw_cmd_is_valid_cc);
1556-
1557-/**
1558- * scsw_cmd_is_valid_fmt - check fmt field validity
1559- * @scsw: pointer to scsw
1560- *
1561- * Return non-zero if the fmt field of the specified command mode scsw is
1562- * valid, zero otherwise.
1563- */
1564-int scsw_cmd_is_valid_fmt(union scsw *scsw)
1565-{
1566- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1567-}
1568-EXPORT_SYMBOL(scsw_cmd_is_valid_fmt);
1569-
1570-/**
1571- * scsw_cmd_is_valid_pfch - check pfch field validity
1572- * @scsw: pointer to scsw
1573- *
1574- * Return non-zero if the pfch field of the specified command mode scsw is
1575- * valid, zero otherwise.
1576- */
1577-int scsw_cmd_is_valid_pfch(union scsw *scsw)
1578-{
1579- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1580-}
1581-EXPORT_SYMBOL(scsw_cmd_is_valid_pfch);
1582-
1583-/**
1584- * scsw_cmd_is_valid_isic - check isic field validity
1585- * @scsw: pointer to scsw
1586- *
1587- * Return non-zero if the isic field of the specified command mode scsw is
1588- * valid, zero otherwise.
1589- */
1590-int scsw_cmd_is_valid_isic(union scsw *scsw)
1591-{
1592- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1593-}
1594-EXPORT_SYMBOL(scsw_cmd_is_valid_isic);
1595-
1596-/**
1597- * scsw_cmd_is_valid_alcc - check alcc field validity
1598- * @scsw: pointer to scsw
1599- *
1600- * Return non-zero if the alcc field of the specified command mode scsw is
1601- * valid, zero otherwise.
1602- */
1603-int scsw_cmd_is_valid_alcc(union scsw *scsw)
1604-{
1605- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1606-}
1607-EXPORT_SYMBOL(scsw_cmd_is_valid_alcc);
1608-
1609-/**
1610- * scsw_cmd_is_valid_ssi - check ssi field validity
1611- * @scsw: pointer to scsw
1612- *
1613- * Return non-zero if the ssi field of the specified command mode scsw is
1614- * valid, zero otherwise.
1615- */
1616-int scsw_cmd_is_valid_ssi(union scsw *scsw)
1617-{
1618- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC);
1619-}
1620-EXPORT_SYMBOL(scsw_cmd_is_valid_ssi);
1621-
1622-/**
1623- * scsw_cmd_is_valid_zcc - check zcc field validity
1624- * @scsw: pointer to scsw
1625- *
1626- * Return non-zero if the zcc field of the specified command mode scsw is
1627- * valid, zero otherwise.
1628- */
1629-int scsw_cmd_is_valid_zcc(union scsw *scsw)
1630-{
1631- return (scsw->cmd.fctl & SCSW_FCTL_START_FUNC) &&
1632- (scsw->cmd.stctl & SCSW_STCTL_INTER_STATUS);
1633-}
1634-EXPORT_SYMBOL(scsw_cmd_is_valid_zcc);
1635-
1636-/**
1637- * scsw_cmd_is_valid_ectl - check ectl field validity
1638- * @scsw: pointer to scsw
1639- *
1640- * Return non-zero if the ectl field of the specified command mode scsw is
1641- * valid, zero otherwise.
1642- */
1643-int scsw_cmd_is_valid_ectl(union scsw *scsw)
1644-{
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);
1648-}
1649-EXPORT_SYMBOL(scsw_cmd_is_valid_ectl);
1650-
1651-/**
1652- * scsw_cmd_is_valid_pno - check pno field validity
1653- * @scsw: pointer to scsw
1654- *
1655- * Return non-zero if the pno field of the specified command mode scsw is
1656- * valid, zero otherwise.
1657- */
1658-int scsw_cmd_is_valid_pno(union scsw *scsw)
1659-{
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)));
1665-}
1666-EXPORT_SYMBOL(scsw_cmd_is_valid_pno);
1667-
1668-/**
1669- * scsw_cmd_is_valid_fctl - check fctl field validity
1670- * @scsw: pointer to scsw
1671- *
1672- * Return non-zero if the fctl field of the specified command mode scsw is
1673- * valid, zero otherwise.
1674- */
1675-int scsw_cmd_is_valid_fctl(union scsw *scsw)
1676-{
1677- /* Only valid if pmcw.dnv == 1*/
1678- return 1;
1679-}
1680-EXPORT_SYMBOL(scsw_cmd_is_valid_fctl);
1681-
1682-/**
1683- * scsw_cmd_is_valid_actl - check actl field validity
1684- * @scsw: pointer to scsw
1685- *
1686- * Return non-zero if the actl field of the specified command mode scsw is
1687- * valid, zero otherwise.
1688- */
1689-int scsw_cmd_is_valid_actl(union scsw *scsw)
1690-{
1691- /* Only valid if pmcw.dnv == 1*/
1692- return 1;
1693-}
1694-EXPORT_SYMBOL(scsw_cmd_is_valid_actl);
1695-
1696-/**
1697- * scsw_cmd_is_valid_stctl - check stctl field validity
1698- * @scsw: pointer to scsw
1699- *
1700- * Return non-zero if the stctl field of the specified command mode scsw is
1701- * valid, zero otherwise.
1702- */
1703-int scsw_cmd_is_valid_stctl(union scsw *scsw)
1704-{
1705- /* Only valid if pmcw.dnv == 1*/
1706- return 1;
1707-}
1708-EXPORT_SYMBOL(scsw_cmd_is_valid_stctl);
1709-
1710-/**
1711- * scsw_cmd_is_valid_dstat - check dstat field validity
1712- * @scsw: pointer to scsw
1713- *
1714- * Return non-zero if the dstat field of the specified command mode scsw is
1715- * valid, zero otherwise.
1716- */
1717-int scsw_cmd_is_valid_dstat(union scsw *scsw)
1718-{
1719- return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1720- (scsw->cmd.cc != 3);
1721-}
1722-EXPORT_SYMBOL(scsw_cmd_is_valid_dstat);
1723-
1724-/**
1725- * scsw_cmd_is_valid_cstat - check cstat field validity
1726- * @scsw: pointer to scsw
1727- *
1728- * Return non-zero if the cstat field of the specified command mode scsw is
1729- * valid, zero otherwise.
1730- */
1731-int scsw_cmd_is_valid_cstat(union scsw *scsw)
1732-{
1733- return (scsw->cmd.stctl & SCSW_STCTL_STATUS_PEND) &&
1734- (scsw->cmd.cc != 3);
1735-}
1736-EXPORT_SYMBOL(scsw_cmd_is_valid_cstat);
1737-
1738-/**
1739- * scsw_tm_is_valid_key - check key field validity
1740- * @scsw: pointer to scsw
1741- *
1742- * Return non-zero if the key field of the specified transport mode scsw is
1743- * valid, zero otherwise.
1744- */
1745-int scsw_tm_is_valid_key(union scsw *scsw)
1746-{
1747- return (scsw->tm.fctl & SCSW_FCTL_START_FUNC);
1748-}
1749-EXPORT_SYMBOL(scsw_tm_is_valid_key);
1750-
1751-/**
1752- * scsw_tm_is_valid_eswf - check eswf field validity
1753- * @scsw: pointer to scsw
1754- *
1755- * Return non-zero if the eswf field of the specified transport mode scsw is
1756- * valid, zero otherwise.
1757- */
1758-int scsw_tm_is_valid_eswf(union scsw *scsw)
1759-{
1760- return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
1761-}
1762-EXPORT_SYMBOL(scsw_tm_is_valid_eswf);
1763-
1764-/**
1765- * scsw_tm_is_valid_cc - check cc field validity
1766- * @scsw: pointer to scsw
1767- *
1768- * Return non-zero if the cc field of the specified transport mode scsw is
1769- * valid, zero otherwise.
1770- */
1771-int scsw_tm_is_valid_cc(union scsw *scsw)
1772-{
1773- return (scsw->tm.fctl & SCSW_FCTL_START_FUNC) &&
1774- (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND);
1775-}
1776-EXPORT_SYMBOL(scsw_tm_is_valid_cc);
1777-
1778-/**
1779- * scsw_tm_is_valid_fmt - check fmt field validity
1780- * @scsw: pointer to scsw
1781- *
1782- * Return non-zero if the fmt field of the specified transport mode scsw is
1783- * valid, zero otherwise.
1784- */
1785-int scsw_tm_is_valid_fmt(union scsw *scsw)
1786-{
1787- return 1;
1788-}
1789-EXPORT_SYMBOL(scsw_tm_is_valid_fmt);
1790-
1791-/**
1792- * scsw_tm_is_valid_x - check x field validity
1793- * @scsw: pointer to scsw
1794- *
1795- * Return non-zero if the x field of the specified transport mode scsw is
1796- * valid, zero otherwise.
1797- */
1798-int scsw_tm_is_valid_x(union scsw *scsw)
1799-{
1800- return 1;
1801-}
1802-EXPORT_SYMBOL(scsw_tm_is_valid_x);
1803-
1804-/**
1805- * scsw_tm_is_valid_q - check q field validity
1806- * @scsw: pointer to scsw
1807- *
1808- * Return non-zero if the q field of the specified transport mode scsw is
1809- * valid, zero otherwise.
1810- */
1811-int scsw_tm_is_valid_q(union scsw *scsw)
1812-{
1813- return 1;
1814-}
1815-EXPORT_SYMBOL(scsw_tm_is_valid_q);
1816-
1817-/**
1818- * scsw_tm_is_valid_ectl - check ectl field validity
1819- * @scsw: pointer to scsw
1820- *
1821- * Return non-zero if the ectl field of the specified transport mode scsw is
1822- * valid, zero otherwise.
1823- */
1824-int scsw_tm_is_valid_ectl(union scsw *scsw)
1825-{
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);
1829-}
1830-EXPORT_SYMBOL(scsw_tm_is_valid_ectl);
1831-
1832-/**
1833- * scsw_tm_is_valid_pno - check pno field validity
1834- * @scsw: pointer to scsw
1835- *
1836- * Return non-zero if the pno field of the specified transport mode scsw is
1837- * valid, zero otherwise.
1838- */
1839-int scsw_tm_is_valid_pno(union scsw *scsw)
1840-{
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)));
1846-}
1847-EXPORT_SYMBOL(scsw_tm_is_valid_pno);
1848-
1849-/**
1850- * scsw_tm_is_valid_fctl - check fctl field validity
1851- * @scsw: pointer to scsw
1852- *
1853- * Return non-zero if the fctl field of the specified transport mode scsw is
1854- * valid, zero otherwise.
1855- */
1856-int scsw_tm_is_valid_fctl(union scsw *scsw)
1857-{
1858- /* Only valid if pmcw.dnv == 1*/
1859- return 1;
1860-}
1861-EXPORT_SYMBOL(scsw_tm_is_valid_fctl);
1862-
1863-/**
1864- * scsw_tm_is_valid_actl - check actl field validity
1865- * @scsw: pointer to scsw
1866- *
1867- * Return non-zero if the actl field of the specified transport mode scsw is
1868- * valid, zero otherwise.
1869- */
1870-int scsw_tm_is_valid_actl(union scsw *scsw)
1871-{
1872- /* Only valid if pmcw.dnv == 1*/
1873- return 1;
1874-}
1875-EXPORT_SYMBOL(scsw_tm_is_valid_actl);
1876-
1877-/**
1878- * scsw_tm_is_valid_stctl - check stctl field validity
1879- * @scsw: pointer to scsw
1880- *
1881- * Return non-zero if the stctl field of the specified transport mode scsw is
1882- * valid, zero otherwise.
1883- */
1884-int scsw_tm_is_valid_stctl(union scsw *scsw)
1885-{
1886- /* Only valid if pmcw.dnv == 1*/
1887- return 1;
1888-}
1889-EXPORT_SYMBOL(scsw_tm_is_valid_stctl);
1890-
1891-/**
1892- * scsw_tm_is_valid_dstat - check dstat field validity
1893- * @scsw: pointer to scsw
1894- *
1895- * Return non-zero if the dstat field of the specified transport mode scsw is
1896- * valid, zero otherwise.
1897- */
1898-int scsw_tm_is_valid_dstat(union scsw *scsw)
1899-{
1900- return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1901- (scsw->tm.cc != 3);
1902-}
1903-EXPORT_SYMBOL(scsw_tm_is_valid_dstat);
1904-
1905-/**
1906- * scsw_tm_is_valid_cstat - check cstat field validity
1907- * @scsw: pointer to scsw
1908- *
1909- * Return non-zero if the cstat field of the specified transport mode scsw is
1910- * valid, zero otherwise.
1911- */
1912-int scsw_tm_is_valid_cstat(union scsw *scsw)
1913-{
1914- return (scsw->tm.stctl & SCSW_STCTL_STATUS_PEND) &&
1915- (scsw->tm.cc != 3);
1916-}
1917-EXPORT_SYMBOL(scsw_tm_is_valid_cstat);
1918-
1919-/**
1920- * scsw_tm_is_valid_fcxs - check fcxs field validity
1921- * @scsw: pointer to scsw
1922- *
1923- * Return non-zero if the fcxs field of the specified transport mode scsw is
1924- * valid, zero otherwise.
1925- */
1926-int scsw_tm_is_valid_fcxs(union scsw *scsw)
1927-{
1928- return 1;
1929-}
1930-EXPORT_SYMBOL(scsw_tm_is_valid_fcxs);
1931-
1932-/**
1933- * scsw_tm_is_valid_schxs - check schxs field validity
1934- * @scsw: pointer to scsw
1935- *
1936- * Return non-zero if the schxs field of the specified transport mode scsw is
1937- * valid, zero otherwise.
1938- */
1939-int scsw_tm_is_valid_schxs(union scsw *scsw)
1940-{
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));
1945-}
1946-EXPORT_SYMBOL(scsw_tm_is_valid_schxs);
1947-
1948-/**
1949- * scsw_is_valid_actl - check actl field validity
1950- * @scsw: pointer to scsw
1951- *
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.
1955- */
1956-int scsw_is_valid_actl(union scsw *scsw)
1957-{
1958- if (scsw_is_tm(scsw))
1959- return scsw_tm_is_valid_actl(scsw);
1960- else
1961- return scsw_cmd_is_valid_actl(scsw);
1962-}
1963-EXPORT_SYMBOL(scsw_is_valid_actl);
1964-
1965-/**
1966- * scsw_is_valid_cc - check cc field validity
1967- * @scsw: pointer to scsw
1968- *
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.
1972- */
1973-int scsw_is_valid_cc(union scsw *scsw)
1974-{
1975- if (scsw_is_tm(scsw))
1976- return scsw_tm_is_valid_cc(scsw);
1977- else
1978- return scsw_cmd_is_valid_cc(scsw);
1979-}
1980-EXPORT_SYMBOL(scsw_is_valid_cc);
1981-
1982-/**
1983- * scsw_is_valid_cstat - check cstat field validity
1984- * @scsw: pointer to scsw
1985- *
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.
1989- */
1990-int scsw_is_valid_cstat(union scsw *scsw)
1991-{
1992- if (scsw_is_tm(scsw))
1993- return scsw_tm_is_valid_cstat(scsw);
1994- else
1995- return scsw_cmd_is_valid_cstat(scsw);
1996-}
1997-EXPORT_SYMBOL(scsw_is_valid_cstat);
1998-
1999-/**
2000- * scsw_is_valid_dstat - check dstat field validity
2001- * @scsw: pointer to scsw
2002- *
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.
2006- */
2007-int scsw_is_valid_dstat(union scsw *scsw)
2008-{
2009- if (scsw_is_tm(scsw))
2010- return scsw_tm_is_valid_dstat(scsw);
2011- else
2012- return scsw_cmd_is_valid_dstat(scsw);
2013-}
2014-EXPORT_SYMBOL(scsw_is_valid_dstat);
2015-
2016-/**
2017- * scsw_is_valid_ectl - check ectl field validity
2018- * @scsw: pointer to scsw
2019- *
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.
2023- */
2024-int scsw_is_valid_ectl(union scsw *scsw)
2025-{
2026- if (scsw_is_tm(scsw))
2027- return scsw_tm_is_valid_ectl(scsw);
2028- else
2029- return scsw_cmd_is_valid_ectl(scsw);
2030-}
2031-EXPORT_SYMBOL(scsw_is_valid_ectl);
2032-
2033-/**
2034- * scsw_is_valid_eswf - check eswf field validity
2035- * @scsw: pointer to scsw
2036- *
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.
2040- */
2041-int scsw_is_valid_eswf(union scsw *scsw)
2042-{
2043- if (scsw_is_tm(scsw))
2044- return scsw_tm_is_valid_eswf(scsw);
2045- else
2046- return scsw_cmd_is_valid_eswf(scsw);
2047-}
2048-EXPORT_SYMBOL(scsw_is_valid_eswf);
2049-
2050-/**
2051- * scsw_is_valid_fctl - check fctl field validity
2052- * @scsw: pointer to scsw
2053- *
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.
2057- */
2058-int scsw_is_valid_fctl(union scsw *scsw)
2059-{
2060- if (scsw_is_tm(scsw))
2061- return scsw_tm_is_valid_fctl(scsw);
2062- else
2063- return scsw_cmd_is_valid_fctl(scsw);
2064-}
2065-EXPORT_SYMBOL(scsw_is_valid_fctl);
2066-
2067-/**
2068- * scsw_is_valid_key - check key field validity
2069- * @scsw: pointer to scsw
2070- *
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.
2074- */
2075-int scsw_is_valid_key(union scsw *scsw)
2076-{
2077- if (scsw_is_tm(scsw))
2078- return scsw_tm_is_valid_key(scsw);
2079- else
2080- return scsw_cmd_is_valid_key(scsw);
2081-}
2082-EXPORT_SYMBOL(scsw_is_valid_key);
2083-
2084-/**
2085- * scsw_is_valid_pno - check pno field validity
2086- * @scsw: pointer to scsw
2087- *
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.
2091- */
2092-int scsw_is_valid_pno(union scsw *scsw)
2093-{
2094- if (scsw_is_tm(scsw))
2095- return scsw_tm_is_valid_pno(scsw);
2096- else
2097- return scsw_cmd_is_valid_pno(scsw);
2098-}
2099-EXPORT_SYMBOL(scsw_is_valid_pno);
2100-
2101-/**
2102- * scsw_is_valid_stctl - check stctl field validity
2103- * @scsw: pointer to scsw
2104- *
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.
2108- */
2109-int scsw_is_valid_stctl(union scsw *scsw)
2110-{
2111- if (scsw_is_tm(scsw))
2112- return scsw_tm_is_valid_stctl(scsw);
2113- else
2114- return scsw_cmd_is_valid_stctl(scsw);
2115-}
2116-EXPORT_SYMBOL(scsw_is_valid_stctl);
2117-
2118-/**
2119- * scsw_cmd_is_solicited - check for solicited scsw
2120- * @scsw: pointer to scsw
2121- *
2122- * Return non-zero if the command mode scsw indicates that the associated
2123- * status condition is solicited, zero if it is unsolicited.
2124- */
2125-int scsw_cmd_is_solicited(union scsw *scsw)
2126-{
2127- return (scsw->cmd.cc != 0) || (scsw->cmd.stctl !=
2128- (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
2129-}
2130-EXPORT_SYMBOL(scsw_cmd_is_solicited);
2131-
2132-/**
2133- * scsw_tm_is_solicited - check for solicited scsw
2134- * @scsw: pointer to scsw
2135- *
2136- * Return non-zero if the transport mode scsw indicates that the associated
2137- * status condition is solicited, zero if it is unsolicited.
2138- */
2139-int scsw_tm_is_solicited(union scsw *scsw)
2140-{
2141- return (scsw->tm.cc != 0) || (scsw->tm.stctl !=
2142- (SCSW_STCTL_STATUS_PEND | SCSW_STCTL_ALERT_STATUS));
2143-}
2144-EXPORT_SYMBOL(scsw_tm_is_solicited);
2145-
2146-/**
2147- * scsw_is_solicited - check for solicited scsw
2148- * @scsw: pointer to scsw
2149- *
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.
2152- */
2153-int scsw_is_solicited(union scsw *scsw)
2154-{
2155- if (scsw_is_tm(scsw))
2156- return scsw_tm_is_solicited(scsw);
2157- else
2158- return scsw_cmd_is_solicited(scsw);
2159-}
2160-EXPORT_SYMBOL(scsw_is_solicited);