aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/css.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-01-26 08:10:45 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-01-26 08:11:01 -0500
commitb279a4f56d5476a0b9b0a97397f7a7bbe00b9b2f (patch)
tree8f6fe1b5e68ecc0684a88fb67bd6179cf6c59707 /drivers/s390/cio/css.c
parent4e8e56c6713398f417317d449f50c08bf2756c66 (diff)
[S390] cio: I/O subchannel specific fields.
Some fields may be !0 only for I/O subchannels. Add some checks where required. Also adapt cio_enable_subchannel() to make the caller specify the intparm, which makes it more generic. Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r--drivers/s390/cio/css.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 2520a44fb93d..4d98a0fddedf 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -237,11 +237,25 @@ get_subchannel_by_schid(struct subchannel_id schid)
237 return dev ? to_subchannel(dev) : NULL; 237 return dev ? to_subchannel(dev) : NULL;
238} 238}
239 239
240/**
241 * css_sch_is_valid() - check if a subchannel is valid
242 * @schib: subchannel information block for the subchannel
243 */
244int css_sch_is_valid(struct schib *schib)
245{
246 if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv)
247 return 0;
248 return 1;
249}
250EXPORT_SYMBOL_GPL(css_sch_is_valid);
251
240static int css_get_subchannel_status(struct subchannel *sch) 252static int css_get_subchannel_status(struct subchannel *sch)
241{ 253{
242 struct schib schib; 254 struct schib schib;
243 255
244 if (stsch(sch->schid, &schib) || !schib.pmcw.dnv) 256 if (stsch(sch->schid, &schib))
257 return CIO_GONE;
258 if (!css_sch_is_valid(&schib))
245 return CIO_GONE; 259 return CIO_GONE;
246 if (sch->schib.pmcw.dnv && (schib.pmcw.dev != sch->schib.pmcw.dev)) 260 if (sch->schib.pmcw.dnv && (schib.pmcw.dev != sch->schib.pmcw.dev))
247 return CIO_REVALIDATE; 261 return CIO_REVALIDATE;
@@ -349,7 +363,7 @@ static int css_evaluate_new_subchannel(struct subchannel_id schid, int slow)
349 /* Will be done on the slow path. */ 363 /* Will be done on the slow path. */
350 return -EAGAIN; 364 return -EAGAIN;
351 } 365 }
352 if (stsch_err(schid, &schib) || !schib.pmcw.dnv) { 366 if (stsch_err(schid, &schib) || !css_sch_is_valid(&schib)) {
353 /* Unusable - ignore. */ 367 /* Unusable - ignore. */
354 return 0; 368 return 0;
355 } 369 }