Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756353AbYFCRGZ (ORCPT ); Tue, 3 Jun 2008 13:06:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753274AbYFCRFt (ORCPT ); Tue, 3 Jun 2008 13:05:49 -0400 Received: from mtagate4.de.ibm.com ([195.212.29.153]:58594 "EHLO mtagate4.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbYFCRFr (ORCPT ); Tue, 3 Jun 2008 13:05:47 -0400 Message-Id: <20080603170519.787597406@de.ibm.com> References: <20080603165859.107949986@de.ibm.com> User-Agent: quilt/0.46-1 Date: Tue, 03 Jun 2008 18:59:05 +0200 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Cornelia Huck , Martin Schwidefsky Subject: [patch 06/14] cio: Base message subchannel handling. Content-Disposition: inline; filename=105-cio-msg-subchannel.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3175 Lines: 105 From: Cornelia Huck Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/cio.c | 30 ++++++++++++++++++++++++------ drivers/s390/cio/cio.h | 2 +- drivers/s390/cio/css.c | 2 ++ 3 files changed, 27 insertions(+), 7 deletions(-) Index: quilt-2.6/drivers/s390/cio/cio.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/cio.c +++ quilt-2.6/drivers/s390/cio/cio.c @@ -498,13 +498,8 @@ int cio_create_sch_lock(struct subchanne 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(st 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 subch 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: quilt-2.6/drivers/s390/cio/cio.h =================================================================== --- quilt-2.6.orig/drivers/s390/cio/cio.h +++ quilt-2.6/drivers/s390/cio/cio.h @@ -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: quilt-2.6/drivers/s390/cio/css.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/css.c +++ quilt-2.6/drivers/s390/cio/css.c @@ -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); -- blue skies, Martin. "Reality continues to ruin my life." - Calvin. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/