From patchwork Thu Apr 25 13:21:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 10917081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6706A76 for ; Thu, 25 Apr 2019 13:32:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5511628AB7 for ; Thu, 25 Apr 2019 13:32:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53233289CA; Thu, 25 Apr 2019 13:32:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ECE8B28AB7 for ; Thu, 25 Apr 2019 13:32:06 +0000 (UTC) Received: from localhost ([127.0.0.1]:57238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJeTt-0003dM-VC for patchwork-qemu-devel@patchwork.kernel.org; Thu, 25 Apr 2019 09:32:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJeK6-0003OI-7F for qemu-devel@nongnu.org; Thu, 25 Apr 2019 09:21:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJeK5-0003js-5N for qemu-devel@nongnu.org; Thu, 25 Apr 2019 09:21:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59920) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hJeK4-0003jJ-Vq; Thu, 25 Apr 2019 09:21:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3FD17307EA92; Thu, 25 Apr 2019 13:21:56 +0000 (UTC) Received: from localhost (dhcp-192-187.str.redhat.com [10.33.192.187]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1EB01001E6C; Thu, 25 Apr 2019 13:21:55 +0000 (UTC) From: Cornelia Huck To: Peter Maydell Date: Thu, 25 Apr 2019 15:21:25 +0200 Message-Id: <20190425132134.2839-11-cohuck@redhat.com> In-Reply-To: <20190425132134.2839-1-cohuck@redhat.com> References: <20190425132134.2839-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 25 Apr 2019 13:21:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 10/19] s390-bios: Extend find_dev() for non-virtio devices X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason J. Herne" , qemu-s390x@nongnu.org, qemu-devel@nongnu.org, Thomas Huth Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: "Jason J. Herne" We need a method for finding the subchannel of a dasd device. Let's modify find_dev to handle this since it mostly does what we need. Up to this point find_dev has been specific to only virtio devices. Signed-off-by: Jason J. Herne Acked-by: Halil Pasic Reviewed-by: Cornelia Huck Message-Id: <1554388475-18329-11-git-send-email-jjherne@linux.ibm.com> Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/main.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index e403b5f733e4..d04ea8972a0c 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -52,6 +52,12 @@ unsigned int get_loadparm_index(void) return atoui(loadparm_str); } +/* + * Find the subchannel connected to the given device (dev_no) and fill in the + * subchannel information block (schib) with the connected subchannel's info. + * NOTE: The global variable blk_schid is updated to contain the subchannel + * information. + */ static bool find_dev(Schib *schib, int dev_no) { int i, r; @@ -65,15 +71,15 @@ static bool find_dev(Schib *schib, int dev_no) if (!schib->pmcw.dnv) { continue; } - if (!virtio_is_supported(blk_schid)) { - continue; - } + /* Skip net devices since no IPLB is created and therefore no - * no network bootloader has been loaded + * network bootloader has been loaded */ - if (virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) { + if (virtio_is_supported(blk_schid) && + virtio_get_device_type() == VIRTIO_ID_NET && dev_no < 0) { continue; } + if ((dev_no < 0) || (schib->pmcw.dev == dev_no)) { return true; }