From nobody Mon Feb 9 20:35:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582179621; cv=none; d=zohomail.com; s=zohoarc; b=SmDvOf/qgR66rUl/ITTmYu31rl3USJAcgn+5hbeESLsmuMABBpoA+N/z2tyQDAvucmD1h9ygg82anLnyMcN8vNz0B4lNXJDT3a5xIPlS8LYYn6TFfukc3F3AwpDE/zQ1hx74P/26JXjv7QDFYi1MHBu6QW1jN3Mdeiv05rXHnfE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582179621; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=8up9HTeW4kqNnPJRs7f1VfMqWkVIyeNZrNUAByfD6Z4=; b=oDYyM1ITVt+PV7vMbDyGwO08hRml/y7c7wr3sS0W6AsRSmxFw97CP2L6Gl2tt0tc1H6RffTa503yAgI5mHVJyWnBvVC2cbPFspPcO0YPbbAWTOkdRAJ+ag8FJWg8HG4YFRTsCF+q3bQGzz+lwTNEoBrpMLVnbGOsYCEeNPl2LDg= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582179621304526.026221937712; Wed, 19 Feb 2020 22:20:21 -0800 (PST) Received: from localhost ([::1]:36716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4fC8-00057Q-CY for importer@patchew.org; Thu, 20 Feb 2020 01:20:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56390) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4f8z-0000Gy-47 for qemu-devel@nongnu.org; Thu, 20 Feb 2020 01:17:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4f8y-0005FI-6h for qemu-devel@nongnu.org; Thu, 20 Feb 2020 01:17:05 -0500 Received: from [107.174.27.60] (port=52622 helo=ozlabs.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j4f8y-0005FA-1Y; Thu, 20 Feb 2020 01:17:04 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id EDF16AE8056B; Thu, 20 Feb 2020 01:14:59 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Subject: [PATCH qemu v7 2/5] spapr/spapr: Make vty_getchars public Date: Thu, 20 Feb 2020 17:16:19 +1100 Message-Id: <20200220061622.15064-3-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200220061622.15064-1-aik@ozlabs.ru> References: <20200220061622.15064-1-aik@ozlabs.ru> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 107.174.27.60 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexey Kardashevskiy , Paolo Bonzini , qemu-ppc@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" A serial device fetches the data from the chardev backend as soon as input happens and stores it in its internal device specific buffer, every char device implements it again. Since there is no unified interface to read such buffer, we will have to read characters directly from VIO_SPAPR_VTY_DEVICE. The OF client is going to need this. Signed-off-by: Alexey Kardashevskiy --- include/hw/ppc/spapr_vio.h | 1 + hw/char/spapr_vty.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/ppc/spapr_vio.h b/include/hw/ppc/spapr_vio.h index bed7df60e35c..77e9b73bdfe0 100644 --- a/include/hw/ppc/spapr_vio.h +++ b/include/hw/ppc/spapr_vio.h @@ -130,6 +130,7 @@ int spapr_vio_send_crq(SpaprVioDevice *dev, uint8_t *cr= q); =20 SpaprVioDevice *vty_lookup(SpaprMachineState *spapr, target_ulong reg); void vty_putchars(SpaprVioDevice *sdev, uint8_t *buf, int len); +int vty_getchars(SpaprVioDevice *sdev, uint8_t *buf, int max); void spapr_vty_create(SpaprVioBus *bus, Chardev *chardev); void spapr_vlan_create(SpaprVioBus *bus, NICInfo *nd); void spapr_vscsi_create(SpaprVioBus *bus); diff --git a/hw/char/spapr_vty.c b/hw/char/spapr_vty.c index ecb94f5673ca..1c00da75b4f1 100644 --- a/hw/char/spapr_vty.c +++ b/hw/char/spapr_vty.c @@ -52,7 +52,7 @@ static void vty_receive(void *opaque, const uint8_t *buf,= int size) } } =20 -static int vty_getchars(SpaprVioDevice *sdev, uint8_t *buf, int max) +int vty_getchars(SpaprVioDevice *sdev, uint8_t *buf, int max) { SpaprVioVty *dev =3D VIO_SPAPR_VTY_DEVICE(sdev); int n =3D 0; --=20 2.17.1