From patchwork Tue May 30 13:58:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 9754639 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 45670602BF for ; Tue, 30 May 2017 14:02:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B6726223 for ; Tue, 30 May 2017 14:02:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B2482846B; Tue, 30 May 2017 14:02:43 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8654626223 for ; Tue, 30 May 2017 14:02:42 +0000 (UTC) Received: from localhost ([::1]:53992 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFhjN-0007VT-5P for patchwork-qemu-devel@patchwork.kernel.org; Tue, 30 May 2017 10:02:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dFhfc-0005G8-UK for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dFhfZ-0007Il-1e for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:49 -0400 Received: from mail-he1eur01on0136.outbound.protection.outlook.com ([104.47.0.136]:15171 helo=EUR01-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dFhfY-0007GL-MA for qemu-devel@nongnu.org; Tue, 30 May 2017 09:58:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=lgzykeikIs8SbTLiFio4FWL7mDYQV+pLPbkxy9JzU+g=; b=BJTAAi1OgAh4UWPkOy+Yz7aduMkHzylux9oy487sVC1F1oHMKBCmQ1ZXKVv/n84JPnaYTTx8u++COo0+YpfH5e3jh0WymOuLgH9QvlD6L+KHcWw3TuTj5Aqbm2eEl2BC8dZNY7iDhS/S8KOXI6665e5PONcR2IoKRTlo9nEvsKQ= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by HE1PR0801MB1993.eurprd08.prod.outlook.com (2603:10a6:3:4f::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1124.9; Tue, 30 May 2017 13:58:37 +0000 From: Anton Nefedov To: Date: Tue, 30 May 2017 16:58:02 +0300 Message-ID: <1496152683-102751-13-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496152683-102751-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1496152683-102751-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR02CA0033.eurprd02.prod.outlook.com (2603:10a6:6:15::46) To HE1PR0801MB1993.eurprd08.prod.outlook.com (2603:10a6:3:4f::23) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0801MB1993: X-MS-Office365-Filtering-Correlation-Id: e92e51a0-03dd-497b-5070-08d4a763f88a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR0801MB1993; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 3:LzNtKuDKcmHslRqHr/3kYZEDxL8Im5QxjPU6juhn8096HYwoIBrNOG/ftuJH7rIr+xN9QmD+gLj7GtcU/safO1iZkf2jzMbADvEPsqRrvA/VESklXR58szaV8x4SL9UvXEZQ2rZauHy/gq0txdqYbpPWezBYM2quOctlVZSheTBDH+Sau+mPZkE7FWJgJ8GVkU+SEq7NaKE/3vEVt4AoqM7Obcs//svErCw4EbUwC4KrFmGIVouvGRSUMv7iQcktmPoM/6Ygkij1+PhOGpnYsCSKK0935KTcV+H4l+8yrffwYpRnU4fwGi2jgurQav/yACsNVBLsh3BkNqDQXRiXuA==; 25:4THc1GiOBfUn8yFeuh7rMyGNFoG2DjGIm7bMdW4iVAVHRsPMzZRd9gMX6Lij32umhjCEFhXwh9/dPnVfyW/OSIYrhwV5mZL7m0DpCUOpV6+1Qz1lgmzoVbRyL9KSlF/4n6hve7IL6bRSyBVhZdlLSmfwUpzab/X9Z61BhdDgRA8KzbXU+aPb9TokmNmuANcrg6d6FzHKhHBo593Yg/ZOQIxEWuJnm1PZ/KiXOsnEj9pDlTKHtb9tkj68Dn/JMTPrpsCRPhPpphWUWSf+CVOXT3cK92StpooHhYzek0hNLTU1glb4C+xUEQwS4lk/EDdkBFy9MOQmPIpJTQsrg5WzZ09G1baG7zKHo+4dJEEnyx8/m8ifYx9F+UXyX3jQ43IHb8hyZiC5hxy+lG2qfjY394BgZgQfJM9W8Is9RFT7wdgBZdG5mYwE7IrDRYi37+JCn73X+pzJWKbve4z0eHoj7/6MYuC3kyh5n0C0tOMVk8s= X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 31:1MpBkilmUFytWHLDDgL9dtWDkUGHbAkCGwEjaBNeaCUh7f0YdYOgRpGxnJrvxeqJpoyvN47y/XlNoNU0VdFlT7Q6sPvjQGQIPBD2A0/23IWF9/nfphrYTy4QD0bx5kkrCDMGOzzgItG+y6DL3GBqa2z0SW16YI0bltUaiMZVq2IKGZWttEvpFva2GxhiCXvM1GdHh4aPsVGHbu0bNBykAOPziip0oT3xfsHoPqvAbN0=; 20:0j4m0j6b2ZPjR9FUSzta0IkVKfzyH73KVX7qWAdpzwEeCh2zf0pxq/ci8WcEby+5YBuE7Pf4Z0Vp+jesNOIwSki799Dl40u51L6aw81YWFIcVrjtwrq+YdA40YMfL1iwBmoMdi9ENET5OM8sl53Ac+U0Ct0oLA4M+o0Yjfqj5LqTxHPnPF7PAcEqzIqqxCC2rxvHIYjL3/8JYHeVMjzXir8JpLz5B2S2VwBCNKOO/bfZmkMxdukMcUzxST3gD8qdBVWg5+JIVlSScnjpCIiacbEfLPeF/8CCy/IFOz8dzEoRq9cnU6hAu7QlyPvZcLw/Y+LlD4sqZqij80PHK77AZDzmv8bnEnFbQCcmbvsQdgrnj58n9tmwcZXlKgWlpcKrnizhxrtSm7yAEUlQq6uN1SIE0RgvNEFMqpeS5CRoOho= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700073)(100105000095)(100000701073)(100105300095)(100000702073)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(100000703073)(100105400095)(10201501046)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(20161123558100)(20161123555025)(6072148)(100000704073)(100105200095)(100000705073)(100105500095); SRVR:HE1PR0801MB1993; BCL:0; PCL:0; RULEID:(100000800073)(100110000095)(100000801073)(100110300095)(100000802073)(100110100095)(100000803073)(100110400095)(100000804073)(100110200095)(100000805073)(100110500095); SRVR:HE1PR0801MB1993; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1993; 4:MAvNNDGdKIorFnyuWfjv1Juyx1l8ZaTslmxuoqGq?= =?us-ascii?Q?ujrDubuipx/+lXWvSzJ0Wmmo1v80/nFaiwk9OJoVBNOpQqqh3216SU2D62AW?= =?us-ascii?Q?O4uN87j9UAHuU28jByKWW9vcF1LIkgmyF1+4xZdgAWeN5z0rFsshXH9oEmcV?= =?us-ascii?Q?s2b8MTjx/W+k8NE7YQI1yGR+cKo4QxzA3KUwH4fitEeWn4ypHSURWnZQrOaz?= =?us-ascii?Q?pJt+pRIHNW3hGlq6p5vXpZtSTyX0IWgIUA/4ODOlrlDFRVABVOofNXgxQH8M?= =?us-ascii?Q?SWU+NaMstjgvR3Xr9g7Zy+41ir4jZYXjwm8RGqqPE3suugaEe3abnnp+K5DK?= =?us-ascii?Q?KM0JwBmOxhZ1X3G4P7+YhZ9nEyJ8+G4WL+wrHBWBy+QYEaTe6O789e4iHzLs?= =?us-ascii?Q?VSFymLtA+J7bqVn6r6QH6LE1TaeRPhf5ZaEEXmoxsal/iL37SKyIzzFPobI8?= =?us-ascii?Q?/EGe13RGzWRi0X9wsUFuxRAZ4d7mzxuiM3jHNrS8GEgQ/6vhNHb/VSsQp+Fz?= =?us-ascii?Q?5VIa78ntMcPj+vgEopkjeZIH3DoSWXssskVa4R6VBKElVrzi3AePAGQI4+X+?= =?us-ascii?Q?fyIxXmAlQbEKCcxBUWVVdKQvZZuANa8+6m8rVj8AzE4iduLetH03hkgj18Kp?= =?us-ascii?Q?MSkkatfRaVA9vi7kl6FsFUQBWLQNFZqi74ulabOUp0oDjSEDr/im9mEKJXTu?= =?us-ascii?Q?Sit2gulfexBVa/9gUmDjf+ipvJDIQOFUsPKTSEumrlsgQGF4EQI6NfgUF/An?= =?us-ascii?Q?EykZgy5RpPpeBnJgflyCmMMUXCzFaqT+mxAb97yTIHkYLYKGiH+FmRsjimtV?= =?us-ascii?Q?78Dug7OZTaFeqZMT13E7ZY6nyCDOqwb9EItxhL8fy6Tmh9VQl/Pl8oe0Rkgc?= =?us-ascii?Q?5lwo/JZmATSQp3ObBsLje5DWyzcgqL+STteYmKOlWL74g/Y7SWIpDmvSJoql?= =?us-ascii?Q?IUwHiSmYvtUcILwsYrQpDEzGe4Ui1WslmdAiX3B8/LEZLlUuiYSH5asRJdQw?= =?us-ascii?Q?nG0NWcxBbFBn66fmcTN7gsJ6sbNGY7zqzE8Vsw9S61HCuSjAfDTYaJLOuJ8f?= =?us-ascii?Q?KM4HCrwI2g7g/XcQ870sE4x4BcZDWaCCyLNNE/9qkvToT9FOF/mgfXtYSrp+?= =?us-ascii?Q?htmyqTG0hXm2dRjQX0//rV9z7+8K5ADt?= X-Forefront-PRVS: 032334F434 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39830400002)(39450400003)(39410400002)(39400400002)(6506006)(6486002)(86362001)(15650500001)(6916009)(2950100002)(6666003)(54906002)(38730400002)(53936002)(6512007)(25786009)(478600001)(5660300001)(47776003)(305945005)(7736002)(66066001)(110136004)(189998001)(23676002)(2906002)(4326008)(50226002)(3846002)(5820100001)(8676002)(81166006)(6116002)(53416004)(50466002)(2351001)(76176999)(42186005)(50986999)(2870700001)(33646002)(36756003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1993; H:xantnef-ws.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0801MB1993; 23:AtWMj8JkhO+aSmb26TUymbtmdPjfyAvvjdo0zV/?= =?us-ascii?Q?nWSnxa2I3orOlSSuTFR0KU+LJNpkjBITzZ6UA45D1xKpeb8T38kU4nkSwkDE?= =?us-ascii?Q?Z04nhADGFIOMZ73pJ98KK09spowqaATbovb5bBLeGq/RmTbHF/TpvzrWn9VI?= =?us-ascii?Q?f2Cuu6kL4kY/76wzmz9NxW7E42VSKpM+ZnOZups0ZKxfgx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RcKfyI5t15X1bip2A6IQUZ/rYofjfjwHWvv2AGJI8SaHIqbeXmpFJEdxw07U4UeWh08RIoswxdrTxugdNX062Cgrq+0pFbL8reacn6; 24:zCJ0wIq8aUp02uWwWzX4w+8lxffrEogjJN9l1SfmQs2ji1YQ7gbXdK9FWaVMrpI29zNcZFIOjc80W4z/wwLgZ585ujRrYq7Pcc3eytVZPLI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1993; 7:Rj4GN7krgAajLRy4FEEYS2qfYrhTB/bE566sT3Anmhn/vMK6fxF7H7GYqNU+zBmfQVu5LR4Abl+tNckNXK4Xr4v3B72Mgo+AGQIj9BGr1hKEmHmsCoMFhQR5j/by6P9U+4FH4tlvHad70+CzPxvov2Eag6zBGf+pi2PwSOy51CcbseclxEJKSVrrEX7eW3Y4fN3JVrG+GVlrtDJ7JLBuI5uM7BXPoZjyD6NgwbZjM2TDac4tPRhpDSYnmEFBWipZTnWR70ZVos+wGu31kIlzWvdPs4hvhifRGzMXn3VU+HJoeOc7OlDpnt629OMMy9qX7PvcbBpDoo/8CRlbB/70uA==; 20:qIs0HYrmBpl2K+vWigJIuMDAe0hfkIkCBLEAPmSHwKV6VDHy8ACCjsBjQjyUJ1uIT3wIXRvps9JnVu9H7UID41wNEpuL+W5kQMI5LUcgcH32ox4ojxvfGdRUS69/mbJrOU2bGMu+25tAbf0+Yxr/MjVveOVI6aevKP6AWejSvdA= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2017 13:58:37.0630 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1993 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.0.136 Subject: [Qemu-devel] [PATCH v3 12/13] serial: move TIOCM update to a separate function 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: pbonzini@redhat.com, Anton Nefedov , "Michael S . Tsirkin" , den@virtuozzo.com, marcandre.lureau@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP will be used by the following patch Signed-off-by: Anton Nefedov Reviewed-by: Vladimir Sementsov-Ogievskiy CC: Michael S. Tsirkin CC: Paolo Bonzini Reviewed-by: Marc-André Lureau --- hw/char/serial.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/hw/char/serial.c b/hw/char/serial.c index d8d34d0..1e6bdeb 100644 --- a/hw/char/serial.c +++ b/hw/char/serial.c @@ -312,6 +312,24 @@ static void serial_write_fcr(SerialState *s, uint8_t val) } } +static void serial_update_tiocm(SerialState *s) +{ + int flags; + + qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_GET_TIOCM, &flags); + + flags &= ~(CHR_TIOCM_RTS | CHR_TIOCM_DTR); + + if (s->mcr & UART_MCR_RTS) { + flags |= CHR_TIOCM_RTS; + } + if (s->mcr & UART_MCR_DTR) { + flags |= CHR_TIOCM_DTR; + } + + qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_TIOCM, &flags); +} + static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { @@ -426,24 +444,13 @@ static void serial_ioport_write(void *opaque, hwaddr addr, uint64_t val, break; case 4: { - int flags; int old_mcr = s->mcr; s->mcr = val & 0x1f; if (val & UART_MCR_LOOP) break; if (s->poll_msl >= 0 && old_mcr != s->mcr) { - - qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_GET_TIOCM, &flags); - - flags &= ~(CHR_TIOCM_RTS | CHR_TIOCM_DTR); - - if (val & UART_MCR_RTS) - flags |= CHR_TIOCM_RTS; - if (val & UART_MCR_DTR) - flags |= CHR_TIOCM_DTR; - - qemu_chr_fe_ioctl(&s->chr, CHR_IOCTL_SERIAL_SET_TIOCM, &flags); + serial_update_tiocm(s); /* Update the modem status after a one-character-send wait-time, since there may be a response from the device/computer at the other end of the serial line */ timer_mod(s->modem_status_poll, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) + s->char_transmit_time);