aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/cio.c
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/s390/cio/cio.c
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/s390/cio/cio.c')
-rw-r--r--drivers/s390/cio/cio.c30
1 files changed, 24 insertions, 6 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 }