From patchwork Mon Aug 13 17:16:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Ott X-Patchwork-Id: 1314321 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2F266400E6 for ; Mon, 13 Aug 2012 17:16:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753337Ab2HMRQz (ORCPT ); Mon, 13 Aug 2012 13:16:55 -0400 Received: from e06smtp12.uk.ibm.com ([195.75.94.108]:59058 "EHLO e06smtp12.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753236Ab2HMRQy (ORCPT ); Mon, 13 Aug 2012 13:16:54 -0400 Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Aug 2012 18:16:52 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp12.uk.ibm.com (192.168.101.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 13 Aug 2012 18:16:51 +0100 Received: from d06av03.portsmouth.uk.ibm.com (d06av03.portsmouth.uk.ibm.com [9.149.37.213]) by b06cxnps4076.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7DHGin317432778; Mon, 13 Aug 2012 17:16:44 GMT Received: from d06av03.portsmouth.uk.ibm.com (localhost.localdomain [127.0.0.1]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7DHGnFp014265; Mon, 13 Aug 2012 11:16:50 -0600 Received: from icon-9-167-213-28.megacenter.de.ibm.com (icon-9-167-213-28.megacenter.de.ibm.com [9.167.213.28]) by d06av03.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q7DHGmGf014236 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Aug 2012 11:16:49 -0600 Date: Mon, 13 Aug 2012 19:16:48 +0200 (CEST) From: Sebastian Ott X-X-Sender: sebott@c4eb To: Cornelia Huck cc: KVM , linux-s390 , qemu-devel , Avi Kivity , Marcelo Tosatti , Anthony Liguori , Rusty Russell , Christian Borntraeger , Carsten Otte , Alexander Graf , Heiko Carstens , Martin Schwidefsky Subject: Re: [PATCH 2/4] s390: Add a mechanism to get the subchannel id. In-Reply-To: <1344351168-2568-3-git-send-email-cornelia.huck@de.ibm.com> Message-ID: References: <1344351168-2568-1-git-send-email-cornelia.huck@de.ibm.com> <1344351168-2568-3-git-send-email-cornelia.huck@de.ibm.com> User-Agent: Alpine 2.02 (LFD 1266 2009-07-14) Organization: =?ISO-8859-15?Q?=22IBM_Deutschland_Research_&_Development_GmbH_=2F_Vorsitzende_des_Aufsichtsrats=3A_Martina_Koederitz_Gesch=E4ftsf=FChrung=3A_Dirk_Wittkopp_Sitz_der_Gesellschaft=3A_B=F6blingen_=2F_Registergericht?= =?ISO-8859-15?Q?=3A_Amtsgericht_Stuttgart=2C_HRB_243294=22?= MIME-Version: 1.0 x-cbid: 12081317-8372-0000-0000-00000374777F Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Tue, 7 Aug 2012, Cornelia Huck wrote: > This will be needed by the new virtio-ccw transport. We already have ccw_device_get_subchannel_id which is currently used by qdio only and thus buried in an internal header file. So it would be better to just clean up this one and make it available to virtio-ccw. The function looks a little different to what you suggested by it should do the trick. --- arch/s390/include/asm/ccwdev.h | 2 ++ drivers/s390/cio/device.c | 11 ----------- drivers/s390/cio/device.h | 2 -- drivers/s390/cio/device_ops.c | 13 +++++++++++++ 4 files changed, 15 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/arch/s390/include/asm/ccwdev.h +++ b/arch/s390/include/asm/ccwdev.h @@ -10,6 +10,7 @@ #include #include +#include #include #include @@ -226,5 +227,6 @@ int ccw_device_siosl(struct ccw_device * // FIXME: these have to go extern int _ccw_device_get_subchannel_number(struct ccw_device *); +extern struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *); extern void *ccw_device_get_chp_desc(struct ccw_device *, int); #endif /* _S390_CCWDEV_H_ */ --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -2037,16 +2037,6 @@ void ccw_driver_unregister(struct ccw_dr driver_unregister(&cdriver->driver); } -/* Helper func for qdio. */ -struct subchannel_id -ccw_device_get_subchannel_id(struct ccw_device *cdev) -{ - struct subchannel *sch; - - sch = to_subchannel(cdev->dev.parent); - return sch->schid; -} - static void ccw_device_todo(struct work_struct *work) { struct ccw_device_private *priv; @@ -2139,4 +2129,3 @@ EXPORT_SYMBOL(ccw_device_set_offline); EXPORT_SYMBOL(ccw_driver_register); EXPORT_SYMBOL(ccw_driver_unregister); EXPORT_SYMBOL(get_ccwdev_by_busid); -EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id); --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h @@ -142,9 +142,7 @@ int ccw_device_notify(struct ccw_device void ccw_device_set_disconnected(struct ccw_device *cdev); void ccw_device_set_notoper(struct ccw_device *cdev); -/* qdio needs this. */ void ccw_device_set_timeout(struct ccw_device *, int); -extern struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *); /* Channel measurement facility related */ void retry_set_schib(struct ccw_device *cdev); --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -763,6 +763,19 @@ _ccw_device_get_subchannel_number(struct return cdev->private->schid.sch_no; } +/** + * ccw_device_get_subchannel_id - obtain a subchannel id + * @cdev: device to obtain the id for + * Return struct subchannel_id of the parent subchannel. + */ +struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *cdev) +{ + struct subchannel *sch; + + sch = to_subchannel(cdev->dev.parent); + return sch->schid; +} +EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id); MODULE_LICENSE("GPL"); EXPORT_SYMBOL(ccw_device_set_options_mask);