aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2008-07-14 03:58:48 -0400
committerHeiko Carstens <heiko.carstens@de.ibm.com>2008-07-14 04:02:06 -0400
commitb3a686f47a3615fcfec0a01c4103c50bb9621369 (patch)
tree5929e2a7cbca0148d68b822e50887bf61aa73f66 /drivers
parent44a1c19e3b47a7ac596808177ccd250b95f5e688 (diff)
[S390] cio: Base message subchannel handling.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/s390/cio/cio.c30
-rw-r--r--drivers/s390/cio/cio.h2
-rw-r--r--drivers/s390/cio/css.c2
3 files changed, 27 insertions, 7 deletions
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index be53f0ee2b1c..0511fe31d049 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -498,13 +498,8 @@ int cio_create_sch_lock(struct subchannel *sch)
498 return 0; 498 return 0;
499} 499}
500 500
501static int cio_validate_io_subchannel(struct subchannel *sch) 501static int cio_check_devno_blacklisted(struct subchannel *sch)
502{ 502{
503 /* Initialization for io subchannels. */
504 if (!css_sch_is_valid(&sch->schib))
505 return -ENODEV;
506
507 /* Devno is valid. */
508 if (is_blacklisted(sch->schid.ssid, sch->schib.pmcw.dev)) { 503 if (is_blacklisted(sch->schid.ssid, sch->schib.pmcw.dev)) {
509 /* 504 /*
510 * This device must not be known to Linux. So we simply 505 * This device must not be known to Linux. So we simply
@@ -518,6 +513,26 @@ static int cio_validate_io_subchannel(struct subchannel *sch)
518 return 0; 513 return 0;
519} 514}
520 515
516static int cio_validate_io_subchannel(struct subchannel *sch)
517{
518 /* Initialization for io subchannels. */
519 if (!css_sch_is_valid(&sch->schib))
520 return -ENODEV;
521
522 /* Devno is valid. */
523 return cio_check_devno_blacklisted(sch);
524}
525
526static int cio_validate_msg_subchannel(struct subchannel *sch)
527{
528 /* Initialization for message subchannels. */
529 if (!css_sch_is_valid(&sch->schib))
530 return -ENODEV;
531
532 /* Devno is valid. */
533 return cio_check_devno_blacklisted(sch);
534}
535
521/** 536/**
522 * cio_validate_subchannel - basic validation of subchannel 537 * cio_validate_subchannel - basic validation of subchannel
523 * @sch: subchannel structure to be filled out 538 * @sch: subchannel structure to be filled out
@@ -573,6 +588,9 @@ int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid)
573 case SUBCHANNEL_TYPE_IO: 588 case SUBCHANNEL_TYPE_IO:
574 err = cio_validate_io_subchannel(sch); 589 err = cio_validate_io_subchannel(sch);
575 break; 590 break;
591 case SUBCHANNEL_TYPE_MSG:
592 err = cio_validate_msg_subchannel(sch);
593 break;
576 default: 594 default:
577 err = 0; 595 err = 0;
578 } 596 }
diff --git a/drivers/s390/cio/cio.h b/drivers/s390/cio/cio.h
index 4062748e8346..efdb9fd4a84a 100644
--- a/drivers/s390/cio/cio.h
+++ b/drivers/s390/cio/cio.h
@@ -14,7 +14,7 @@
14struct pmcw { 14struct pmcw {
15 u32 intparm; /* interruption parameter */ 15 u32 intparm; /* interruption parameter */
16 u32 qf : 1; /* qdio facility */ 16 u32 qf : 1; /* qdio facility */
17 u32 res0 : 1; /* reserved zeros */ 17 u32 w : 1;
18 u32 isc : 3; /* interruption sublass */ 18 u32 isc : 3; /* interruption sublass */
19 u32 res5 : 3; /* reserved zeros */ 19 u32 res5 : 3; /* reserved zeros */
20 u32 ena : 1; /* enabled */ 20 u32 ena : 1; /* enabled */
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index bc3a8e4a49f7..062716cf0f0c 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -332,6 +332,8 @@ int css_sch_is_valid(struct schib *schib)
332{ 332{
333 if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv) 333 if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv)
334 return 0; 334 return 0;
335 if ((schib->pmcw.st == SUBCHANNEL_TYPE_MSG) && !schib->pmcw.w)
336 return 0;
335 return 1; 337 return 1;
336} 338}
337EXPORT_SYMBOL_GPL(css_sch_is_valid); 339EXPORT_SYMBOL_GPL(css_sch_is_valid);