Message ID | 20230405054730.3850-7-daniel.starke@siemens.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp77768vqo; Tue, 4 Apr 2023 22:50:32 -0700 (PDT) X-Google-Smtp-Source: AKy350b7v7bCO6c7mQahgAy93aWDIxAInUV8eq0S7bZK05t1bsUutO709NuYr4vtPIG1bdNlPhOu X-Received: by 2002:aa7:d516:0:b0:4fa:8aa4:8d8b with SMTP id y22-20020aa7d516000000b004fa8aa48d8bmr725886edq.7.1680673832515; Tue, 04 Apr 2023 22:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680673832; cv=none; d=google.com; s=arc-20160816; b=eOMCewn9UKcuQfW2gIOdmsniSRG3EAFiuCPem/nOFfYWPysPIRKSugBn9gFvcZkJdU PWl5G+7uxD+V2eUr0niWENcFh6M3aKtVKLQ/yPQGg8JJNBh8yZFO04Hf4StOIidqH90H 01OyOJSUOx+A/f69+riiETqht4SDoUTPilq+JXehyLv8cJjjijRyrOcIWrlzLtdmTZ+/ YQf3p9jBH/1874T7pa/W+liVtOCTe8qOOm9zMkVyX29zy9Z+AmUpeVCH2Xj4+2KM6zQe RIy20f1hRw6vFkh+B5J1mDa6gFnG26DyyMs7qtfdzl6HQf1ZywmETj1XtviPIuHbds+u hRkQ== 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=TFt+C5BrvavywiqvORD4lxZZuzc6pzPiidKcYuSljTk=; b=Lhh8IFfnC7yzvZZlv864AQ/t4WcO8iwgqdgyxy4gU/DJ//d3vdVpp7MoHdXVPqzggE yCDJgPYPJzsa29Eu/XUpAFkTQIjJQnGWLmWYP7MpLw0hSrlB2Op1CsJlh4gbTg/7JqU1 wf22uO/dSPNRB8MYtb+oq/OA8NhT20W2jTk/wVuZg6etP/q83TTCdYjhujChYQ158yDG 7u99/cDkIyfV6J4D+PtBvr10h+yLTbfoUbjS7sGABWrC2nmyHOsITGWZo3tdP2aLk1nR UIBL2Kiu/UlHrulA5mzspKjvEwmyLDPmfLiT89ph1CA+a7JWLnIl4MCWrOco5r+u7Te2 6nXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="EDHpM/HF"; 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=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d11-20020a056402516b00b005024c85f879si4107116ede.481.2023.04.04.22.50.08; Tue, 04 Apr 2023 22:50:32 -0700 (PDT) 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="EDHpM/HF"; 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=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236950AbjDEFtA (ORCPT <rfc822;lkml4gm@gmail.com> + 99 others); Wed, 5 Apr 2023 01:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236919AbjDEFsp (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Apr 2023 01:48:45 -0400 Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net [185.136.64.228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDD1240EE for <linux-kernel@vger.kernel.org>; Tue, 4 Apr 2023 22:48:43 -0700 (PDT) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20230405054841f3cf610f578aa093fb for <linux-kernel@vger.kernel.org>; Wed, 05 Apr 2023 07:48:41 +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=TFt+C5BrvavywiqvORD4lxZZuzc6pzPiidKcYuSljTk=; b=EDHpM/HFdWDdIOOLBJ3jyOja5SOVbRjyjQSYWoGey9yxeuKEBClaUkgtsFO59Lw0AeItvp r9F+CL2KaF68LsI9cHYPpuVXmtP+gPPeu2c7kdCtluhztqxDWJmaoqo2DCREz1xyjVZPsHmq V8wuN4RRXPNzDKqYEY22kCvSW5dRc=; From: "D. Starke" <daniel.starke@siemens.com> To: linux-serial@vger.kernel.org, gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com Cc: linux-kernel@vger.kernel.org, Daniel Starke <daniel.starke@siemens.com> Subject: [PATCH 7/9] tty: n_gsm: increase gsm_mux unsupported counted where appropriate Date: Wed, 5 Apr 2023 07:47:28 +0200 Message-Id: <20230405054730.3850-7-daniel.starke@siemens.com> In-Reply-To: <20230405054730.3850-1-daniel.starke@siemens.com> References: <20230405054730.3850-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=-0.2 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762314244805640992?= X-GMAIL-MSGID: =?utf-8?q?1762314244805640992?= |
Series |
[1/9] tty: n_gsm: fix redundant assignment of gsm->encoding
|
|
Commit Message
D. Starke
April 5, 2023, 5:47 a.m. UTC
From: Daniel Starke <daniel.starke@siemens.com> The structure gsm_mux contains the 'unsupported' field. However, there is currently no place in the code which increases this counter. Increase the 'unsupported' statistics counter in the following case: - an unsupported frame type has been requested by the peer via parameter negotiation - a control frame with an unsupported but known command has been received Signed-off-by: Daniel Starke <daniel.starke@siemens.com> --- drivers/tty/n_gsm.c | 3 +++ 1 file changed, 3 insertions(+)
Comments
On Wed, 5 Apr 2023, D. Starke wrote: > From: Daniel Starke <daniel.starke@siemens.com> > > The structure gsm_mux contains the 'unsupported' field. However, there is > currently no place in the code which increases this counter. > > Increase the 'unsupported' statistics counter in the following case: > - an unsupported frame type has been requested by the peer via parameter > negotiation > - a control frame with an unsupported but known command has been received So inconsistent/unsupported adaptation doesn't fall under the second bullet? (Please excuse my ignorance, I'm trying to review your patches with somewhat limited knowledge about how things work).
> > From: Daniel Starke <daniel.starke@siemens.com> > > > > The structure gsm_mux contains the 'unsupported' field. However, there is > > currently no place in the code which increases this counter. > > > > Increase the 'unsupported' statistics counter in the following case: > > - an unsupported frame type has been requested by the peer via parameter > > negotiation > > - a control frame with an unsupported but known command has been received > > So inconsistent/unsupported adaptation doesn't fall under the second > bullet? > > (Please excuse my ignorance, I'm trying to review your patches with > somewhat limited knowledge about how things work). A wrong adaption is nothing we can detect with sufficient accuracy as this changes the structure of the UI/UIH frames. E.g. a one byte header is added in case of convergence layer type 2 instead of 1 and contains the modem signal octet with the state of the signal lines. There is no checksum or other value which indicates of this field is correct or should be present. Therefore, we can only assume protocol correctness here. See also function 'gsm_dlci_data' where this is handled. Best regards, Daniel Starke
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 317aa67ed169..49cb2dbfa233 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -1589,6 +1589,7 @@ static int gsm_process_negotiation(struct gsm_mux *gsm, unsigned int addr, if (debug & DBG_ERRORS) pr_info("%s unsupported I frame request in PN\n", __func__); + gsm->unsupported++; return -EINVAL; default: if (debug & DBG_ERRORS) @@ -1896,6 +1897,8 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, /* Optional unsupported commands */ case CMD_RPN: /* Remote port negotiation */ case CMD_SNC: /* Service negotiation command */ + gsm->unsupported++; + fallthrough; default: /* Reply to bad commands with an NSC */ buf[0] = command;