Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1084663pxb; Thu, 17 Feb 2022 23:47:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzUybxHpgJRYqvNV+THSFX25JAluJS/Y+1xL/8oGMGhJGLWKhqAhmx0lt60sDzL8Ixo+tL1 X-Received: by 2002:a05:6a00:22cc:b0:4e1:bee1:937 with SMTP id f12-20020a056a0022cc00b004e1bee10937mr6567879pfj.13.1645170465514; Thu, 17 Feb 2022 23:47:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645170465; cv=none; d=google.com; s=arc-20160816; b=sH4zt+92Hq1MuuZgchbJwiDj7LR+/JpL7EZ3x7YPFhmFUevt1qY0wJ0ZGCMAf1EVZN DSZ5ncGg+olF6Jp8axVB7nFgL8tuncr8wOHrf/BBjD6H2VPquATaROGM7w4WHw6UjLP8 +yKL4TsdGa2er0t9041A68TXFVlXAPERrk2jm8uCa0zhgo7Lfe3NM/5hniDbgX9qtx4F louD+IDCzm7+/Upt4dpNMsaVZL35grkPJHQHq/3RbMTRpi/njCOLpvx/lyevNW24U1N3 s9qrkQgMbKUcRTEZkTiSk8sRgZBb7s8XJV5ddowOoQnh8H96Sy6E5KWxOIRdoD04kmCt mt7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=1PPSTDXqlzyXQhlxtHT8JuIds5BO+gt8oYzfP79dzIw=; b=sH5noxdyXLymDYuMmx3hdX6e/kdjRV1vy2ppWgBrtXcasJH5SMUF/+lD1iQTIjMJi6 0YwRPBFMbXaJOisQIN+6QPjqetfKkMhqrp/zbzEl3gWnjBR62vuh9SK/9s81VdxmSRg3 KmdpM9lJnUipG7UUgxRN9z1sphV5CfuHxdt/Kz6UCBYNeFtWrTc5AcPj6BjyTIc32Y9L J/puIruO0h68SMBvB+0ZCN2tcga/R5SlABTZg/CETEhRVgpLm+MgyHLShNeBtyodSos8 5kMMQ2vv0Xy0lCA7KSHp5O+BZXSaUIqICrhBJqA7P/rwQXYW1zeE7H5qs1wUk6KKGQ+3 cZTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=bZ1LeMGv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4si22107883plt.331.2022.02.17.23.47.30; Thu, 17 Feb 2022 23:47:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=bZ1LeMGv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231710AbiBRHct (ORCPT + 99 others); Fri, 18 Feb 2022 02:32:49 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:39048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231896AbiBRHcr (ORCPT ); Fri, 18 Feb 2022 02:32:47 -0500 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 23:32:30 PST Received: from mta-64-227.siemens.flowmailer.net (mta-64-227.siemens.flowmailer.net [185.136.64.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73FF29692B for ; Thu, 17 Feb 2022 23:32:30 -0800 (PST) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 202202180731240bb70884d26969ae15 for ; Fri, 18 Feb 2022 08:31:25 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=daniel.starke@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=1PPSTDXqlzyXQhlxtHT8JuIds5BO+gt8oYzfP79dzIw=; b=bZ1LeMGvLLSM/hVoEES8r4kSm0rDxTN0W/PmveyTFElnwXlfBl7Vl98OmgpdP1+tpcUn6i XvMOdXhxVPg9+3VVPK8v9P0JfXHElTHjfN8ENssc4ScvuZQgjpJEC/2OdjdslBkmvz7ihWCk yu/zSNYESP+S1iyE9nEY/BbhYmYmY=; From: daniel.starke@siemens.com To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 1/7] tty: n_gsm: fix encoding of control signal octet bit DV Date: Thu, 17 Feb 2022 23:31:17 -0800 Message-Id: <20220218073123.2121-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-7517:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org n_gsm is based on the 3GPP 07.010 and its newer version is the 3GPP 27.010. See https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1516 The changes from 07.010 to 27.010 are non-functional. Therefore, I refer to the newer 27.010 here. Chapter 5.4.6.3.7 describes the encoding of the control signal octet used by the MSC (modem status command). The same encoding is also used in convergence layer type 2 as described in chapter 5.5.2. Table 7 and 24 both require the DV (data valid) bit to be set 1 for outgoing control signal octets sent by the DTE (data terminal equipment), i.e. for the initiator side. Currently, the DV bit is only set if CD (carrier detect) is on, regardless of the side. This patch fixes this behavior by setting the DV bit on the initiator side unconditionally. Fixes: e1eaea46bb40 ("tty: n_gsm line discipline") Cc: stable@vger.kernel.org Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 0b1808e3a912..e199315a158e 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -439,7 +439,7 @@ static u8 gsm_encode_modem(const struct gsm_dlci *dlci) modembits |= MDM_RTR; if (dlci->modem_tx & TIOCM_RI) modembits |= MDM_IC; - if (dlci->modem_tx & TIOCM_CD) + if (dlci->modem_tx & TIOCM_CD || dlci->gsm->initiator) modembits |= MDM_DV; return modembits; } -- 2.25.1