Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp261457pxb; Thu, 17 Feb 2022 03:39:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJww8XlKbFhz3lwpan/rMLQyl2koRI2Ci+SUOTovno1BjEjhwG7q2nS6seLy3+q2mpdMQLvA X-Received: by 2002:a17:906:2a1b:b0:6ce:a15b:a561 with SMTP id j27-20020a1709062a1b00b006cea15ba561mr2057384eje.403.1645097959328; Thu, 17 Feb 2022 03:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645097959; cv=none; d=google.com; s=arc-20160816; b=ihslaMp44WzbUmZLnej2w2L+OQm15zEk85XE/aNeat4RpjR00gEW/lD1wb8pQCS565 dqNnBp3VDjIv9E6y9rymjdtTw3lTP8FjgXUI9tfWlJkmKiVGSi9CBlRHu6Xnna7IZ7L5 j+O0VdyveI3mOwPFJRMbbCVzWeI4q/7Om4bR3xiqwC7bT2xim09J46NziBSwe0S9LQ8Z c9X300V72LX0mXf9osM0WHSJobncBvlf5KHAFwR5wL9NcpbYG7lb38muhdz3IDpK7tp6 B+EXNTZDmmQGiaAf2vhwvSR70yi5fYEG4gcZJGhzzdueLuLjsEsx4GLZzPmvDmSCnINp 9xhA== 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=RRy+DIv07iZaeoGUjiYfF61tGHDCmKHqvFw2o4yGOoBHAyjE4jZZeQz8/PkP+4Pldc 47G4lwlzdgN051i0tLpXBSSHjhELwjSe1VJk2qlHJRAKkZimdgiA//bjhduKk1lBQppL PrwpcdF9rzVbUHTPB12VyuVb49ZE2M4nu6uI4ebJ+AsT7VvpflXPql/0ZtCOBeFOwp1B uvFnkFB4tpwBWCc4o2Uqir+L3LHRNSFGRvANeyPFmtnq0g2aeYdPAk7Y/sz9wHfs2jfQ z4zCXEMHLC4akFUqO1bv1u/byJrQqx9QZ6GpXMJ3k4K0I3gB4a5JV9ipQ3A6jO7J9AJP ClZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=f97meTGn; 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 hp1si2050395ejc.79.2022.02.17.03.38.56; Thu, 17 Feb 2022 03:39:19 -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=f97meTGn; 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 S236781AbiBQIHU (ORCPT + 99 others); Thu, 17 Feb 2022 03:07:20 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236345AbiBQIHP (ORCPT ); Thu, 17 Feb 2022 03:07:15 -0500 X-Greylist: delayed 63 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 17 Feb 2022 00:07:01 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 D8CD227DF3B for ; Thu, 17 Feb 2022 00:07:01 -0800 (PST) Received: by mta-64-227.siemens.flowmailer.net with ESMTPSA id 20220217080556eb13713ff72e72840b for ; Thu, 17 Feb 2022 09:05:56 +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=f97meTGniVSpdNfFcFarDXigvz7uWji+MTf5hGOp8qubvwq83E1cM5SdMSIHkqVP+oe4Hl KH/I5NNV+hkBjygxJsoPt9qJHImsFcqpdulpGz6F/JRocBRExn2qeUT+x3wuZUBDTljGDUGW WZuK1p/NXoxlM5GAV41p/AjpFeoPQ=; 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/1] tty: n_gsm: fix encoding of control signal octet bit DV Date: Thu, 17 Feb 2022 00:05:49 -0800 Message-Id: <20220217080555.5387-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