Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp62304lfe; Fri, 15 Apr 2022 19:36:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXByxmt/wMzAm2GSFeZ9Zqcwk5P1PJnB12SoXnY3u1/Iki1f1jK12YddZe/bjZxgwUGC9E X-Received: by 2002:a65:490d:0:b0:39e:58cb:b1eb with SMTP id p13-20020a65490d000000b0039e58cbb1ebmr1464035pgs.390.1650076563972; Fri, 15 Apr 2022 19:36:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650076563; cv=none; d=google.com; s=arc-20160816; b=e8Z87ePfLkjJBMZxDgurWtgA/8zgYLy/WJ+9PxZnVlcy9S/vFVAZCxzXWHX3oIwxFA erQRJHwIpMCWd6EbQneihPGheQxErwVoEMRD3F9x9n8CXiUP1AaJzTAcpEs9Gglj8T8o oc/1VTR0NFXS2u0aRQhKh+OnJV0xb014LGPgbw6CmYljRY2cpR6+Jzeijxqo/hmqVqxl d7AHtYvmj2lybcfXFAlh8pNZmZoXBSH7A0XbcfYT2MTu0EfE4nYhbxaSHMTamLYkXrU2 RRVLVeuMxXwNzPHM2G5z9F0QfvCzXedWxK/tIi4PPJuzyor3RoQB606D9DT136rRR0Pb mM0w== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qo+J4Lih8268JeqdwObz7YR4B/SLCefExJgGvrS1nSY=; b=sGK/6Y5tAH2jqcdgX/DXOIt/MPywHMZ+tk5XVDcx/lgHzoAElKQCtNnIhYXI3ECHeq zYoDVaGEaoF40agv3iysbrQqungO4aNEF94QsKP41MsI3r1/ip4b6V9nGV01pMOpzsr1 khJPfTdq7GPPjwelgIIfGBFZ2V/DqoZs0eoMAil/f0twZVNdolU23tRkGw7x72xO4raV Gjia6oiMhBl1NSh7fZlku3xJ0F0viZS/iG4EXEn0ZVu92KSEcV5nAOpyGoGpVvcBr8SX qojBEZWV+OX3xK2pnc/9RlZ+XmKDA8dAejVWAubYOvUROqIvrWrYXnXz2pPTUgsHa36s YfYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=jsHEiAIF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q4-20020a63f944000000b00398580e51c9si2945246pgk.76.2022.04.15.19.36.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:36:03 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=jsHEiAIF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3EA61124768; Fri, 15 Apr 2022 18:45:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235219AbiDNJsn (ORCPT + 99 others); Thu, 14 Apr 2022 05:48:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241961AbiDNJql (ORCPT ); Thu, 14 Apr 2022 05:46:41 -0400 X-Greylist: delayed 62 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 14 Apr 2022 02:44:00 PDT Received: from mta-65-226.siemens.flowmailer.net (mta-65-226.siemens.flowmailer.net [185.136.65.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9AB3716C0 for ; Thu, 14 Apr 2022 02:44:00 -0700 (PDT) Received: by mta-65-226.siemens.flowmailer.net with ESMTPSA id 20220414094252b3c44950e05427b1f3 for ; Thu, 14 Apr 2022 11:42:57 +0200 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:References:In-Reply-To; bh=qo+J4Lih8268JeqdwObz7YR4B/SLCefExJgGvrS1nSY=; b=jsHEiAIF2Jf6ldjL7SBTyTHT55mj4nYgv6c0+epwdy+uBGwb9KUizKzVG1KGiSJZZcx2q7 uemSzfZw7idF4wiY2HiQgt2xYGgtcPtXPdzhuxi1/ei02mxHSQFJOk9RTEDjw/Dtbc91SCQ3 9HqZDdg/aeWd/BrYVXjGyfEooWstE=; From: "D. Starke" To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, Daniel Starke Subject: [PATCH 18/20] tty: n_gsm: fix implicit CR bit encoding in address field Date: Thu, 14 Apr 2022 02:42:23 -0700 Message-Id: <20220414094225.4527-18-daniel.starke@siemens.com> In-Reply-To: <20220414094225.4527-1-daniel.starke@siemens.com> References: <20220414094225.4527-1-daniel.starke@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Daniel Starke 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.2.1.2 describes the encoding of the address field within the frame header. It is made up of the DLCI address, command/response (CR) bit and EA bit. Use the predefined CR value instead of a plain 2 in alignment to the remaining code and to make the encoding obvious. 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 1e135a71860f..ecd2ecc61b14 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -754,7 +754,7 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) *--dp = msg->ctrl; if (gsm->initiator) - *--dp = (msg->addr << 2) | 2 | EA; + *--dp = (msg->addr << 2) | CR | EA; else *--dp = (msg->addr << 2) | EA; *fcs = gsm_fcs_add_block(INIT_FCS, dp , msg->data - dp); -- 2.25.1