Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E47CC33C9E for ; Mon, 3 Feb 2020 03:33:30 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 336BD20679 for ; Mon, 3 Feb 2020 03:33:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 336BD20679 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ozlabs.ru Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iySUL-0006kL-Dg for qemu-devel@archiver.kernel.org; Sun, 02 Feb 2020 22:33:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iySRP-0002jD-7S for qemu-devel@nongnu.org; Sun, 02 Feb 2020 22:30:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iySRO-0006oH-7g for qemu-devel@nongnu.org; Sun, 02 Feb 2020 22:30:27 -0500 Received: from [107.174.27.60] (port=38986 helo=ozlabs.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1iySRN-0006mY-AV; Sun, 02 Feb 2020 22:30:25 -0500 Received: from fstn1-p1.ozlabs.ibm.com (localhost [IPv6:::1]) by ozlabs.ru (Postfix) with ESMTP id 315B3AE80382; Sun, 2 Feb 2020 22:28:27 -0500 (EST) From: Alexey Kardashevskiy To: qemu-devel@nongnu.org Subject: [PATCH qemu v6 3/6] spapr/spapr: Make vty_getchars public Date: Mon, 3 Feb 2020 14:29:40 +1100 Message-Id: <20200203032943.121178-4-aik@ozlabs.ru> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200203032943.121178-1-aik@ozlabs.ru> References: <20200203032943.121178-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: Peter Maydell , Paolo Bonzini , qemu-ppc@nongnu.org, Alexey Kardashevskiy , David Gibson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" 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 *crq); 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) } } -static int vty_getchars(SpaprVioDevice *sdev, uint8_t *buf, int max) +int vty_getchars(SpaprVioDevice *sdev, uint8_t *buf, int max) { SpaprVioVty *dev = VIO_SPAPR_VTY_DEVICE(sdev); int n = 0; -- 2.17.1