]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] cio: Base message subchannel handling.
authorCornelia Huck <cornelia.huck@de.ibm.com>
Mon, 14 Jul 2008 07:58:48 +0000 (09:58 +0200)
committerHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 14 Jul 2008 08:02:06 +0000 (10:02 +0200)
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>
drivers/s390/cio/cio.c
drivers/s390/cio/cio.h
drivers/s390/cio/css.c

index be53f0ee2b1ca104c937c37a0fd7b859f2b1a941..0511fe31d0491e195c8a1b15573c26238c4f8dbd 100644 (file)
@@ -498,13 +498,8 @@ int cio_create_sch_lock(struct subchannel *sch)
        return 0;
 }
 
-static int cio_validate_io_subchannel(struct subchannel *sch)
+static int cio_check_devno_blacklisted(struct subchannel *sch)
 {
-       /* Initialization for io subchannels. */
-       if (!css_sch_is_valid(&sch->schib))
-               return -ENODEV;
-
-       /* Devno is valid. */
        if (is_blacklisted(sch->schid.ssid, sch->schib.pmcw.dev)) {
                /*
                 * This device must not be known to Linux. So we simply
@@ -518,6 +513,26 @@ static int cio_validate_io_subchannel(struct subchannel *sch)
        return 0;
 }
 
+static int cio_validate_io_subchannel(struct subchannel *sch)
+{
+       /* Initialization for io subchannels. */
+       if (!css_sch_is_valid(&sch->schib))
+               return -ENODEV;
+
+       /* Devno is valid. */
+       return cio_check_devno_blacklisted(sch);
+}
+
+static int cio_validate_msg_subchannel(struct subchannel *sch)
+{
+       /* Initialization for message subchannels. */
+       if (!css_sch_is_valid(&sch->schib))
+               return -ENODEV;
+
+       /* Devno is valid. */
+       return cio_check_devno_blacklisted(sch);
+}
+
 /**
  * cio_validate_subchannel - basic validation of subchannel
  * @sch: subchannel structure to be filled out
@@ -573,6 +588,9 @@ int cio_validate_subchannel(struct subchannel *sch, struct subchannel_id schid)
        case SUBCHANNEL_TYPE_IO:
                err = cio_validate_io_subchannel(sch);
                break;
+       case SUBCHANNEL_TYPE_MSG:
+               err = cio_validate_msg_subchannel(sch);
+               break;
        default:
                err = 0;
        }
index 4062748e83463e970250ada7cb83497d88d89ee0..efdb9fd4a84a974089eaf52f22e1520ed773459c 100644 (file)
@@ -14,7 +14,7 @@
 struct pmcw {
        u32 intparm;            /* interruption parameter */
        u32 qf   : 1;           /* qdio facility */
-       u32 res0 : 1;           /* reserved zeros */
+       u32 w    : 1;
        u32 isc  : 3;           /* interruption sublass */
        u32 res5 : 3;           /* reserved zeros */
        u32 ena  : 1;           /* enabled */
index bc3a8e4a49f78d7884c77b087e12aaf9845d845d..062716cf0f0c87d4d20f00dda52f078138c5a8c9 100644 (file)
@@ -332,6 +332,8 @@ int css_sch_is_valid(struct schib *schib)
 {
        if ((schib->pmcw.st == SUBCHANNEL_TYPE_IO) && !schib->pmcw.dnv)
                return 0;
+       if ((schib->pmcw.st == SUBCHANNEL_TYPE_MSG) && !schib->pmcw.w)
+               return 0;
        return 1;
 }
 EXPORT_SYMBOL_GPL(css_sch_is_valid);