From patchwork Tue Feb 28 06:29:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "D. Starke" X-Patchwork-Id: 62276 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2846866wrd; Mon, 27 Feb 2023 22:32:53 -0800 (PST) X-Google-Smtp-Source: AK7set+TWd+LJTQ1N8g8+XOCP/gBOJaSf9bQ2XR9hJ7Mu/EBHvK4Oji7pc2/r6yNGJcIDpc08Unb X-Received: by 2002:a17:903:22ca:b0:19d:90f:6c6c with SMTP id y10-20020a17090322ca00b0019d090f6c6cmr2291015plg.17.1677565973110; Mon, 27 Feb 2023 22:32:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677565973; cv=none; d=google.com; s=arc-20160816; b=qzf8kddhfaYFm/JAapqd4RyVpIb0Tq4zimHtFpTTZqfhbc1CC/8WyPpuOWRdRAh1yR IF3plNl/bBB8e66440mzZR28Wg/BnzrswjCQzlkO402MStPJdrZNQg6jG33OJzUFBFMp bV1ujn2GC7sNI173CYGPGAOGd+Wz2rYO4tOXT29094C9y4b0UmU8HGzLy+nqXYlyEljl I+Aalx1L1FBMSMnJv0aDJ2T7BeInxo1Wfmkukg2F0qCchW9bYPbSoJjgwlCGqc2GVTc9 iatGMyt17qpgJmMBWiW/tWF03ztGKXm/s5xGDcAaVcMvCigK8uZDwimdNa6EyTrPsctn FARQ== 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=BSVe7O2t8AoVIgNh+LgCt8w0mdAVj5U58ZYwaeF0sSM=; b=WhLe2/yGT4owqzi5xnlZ9IR3R/M0teqYSHwHJpV8NbavXsM/IgldEqQ3cc1nXlCZLU vKu7MYHMZMx/Tysid3A2YB2Jflr9p0F/EttEs6sS37E0/L9QEXaG0U1X9/f08jg9/UQ+ FzAI1pmFPnRVY468UjhLI/ZXt016ieI0ro6sxQuH/Tlew1Nhy1YyKrz5bvK1Yk6E9JJy E386op84serOo69bi0Eic4h6FH+sqn36RkX6a/u1pmNEny/D2UpuL7sS/wTxAoqZn4MR H3LlXLVBybG2u5mMXkkFAjf1D0XtUBQNiz6RxPQYUIfWePdrcy3kYAArdlMZ5ZltdQao H4sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QnNnaNTn; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902f78700b0019a6d34a6c6si8874913pln.624.2023.02.27.22.32.40; Mon, 27 Feb 2023 22:32:53 -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=QnNnaNTn; 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 S229451AbjB1GcV (ORCPT + 99 others); Tue, 28 Feb 2023 01:32:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjB1GcT (ORCPT ); Tue, 28 Feb 2023 01:32:19 -0500 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 6572C29141 for ; Mon, 27 Feb 2023 22:32:16 -0800 (PST) Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20230228063214fc6f5f3fde900ef331 for ; Tue, 28 Feb 2023 07:32:14 +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:References:In-Reply-To; bh=BSVe7O2t8AoVIgNh+LgCt8w0mdAVj5U58ZYwaeF0sSM=; b=QnNnaNTnzcsDKbjZj/qUHE8nt3ZOu4Idg1HVRljSi8KYXns0oKFs++JbAWvhPK+4DV+fvb 1+M+3Nt3oq276FpxXD2dh131GO/HQq/Ydo6f+xaBZ/J7GO5oGdEtRuFZMVw8w/AZG6+aucIB twYrCJSUOJExzy1ISWZepS2GVs0LU=; From: "D. Starke" 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 Subject: [PATCH 2/3] tty: n_gsm: allow window size configuration Date: Tue, 28 Feb 2023 07:29:56 +0100 Message-Id: <20230228062957.3150-2-daniel.starke@siemens.com> In-Reply-To: <20230228062957.3150-1-daniel.starke@siemens.com> References: <20230228062957.3150-1-daniel.starke@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-314044:519-21489:flowmailer X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759055417987535336?= X-GMAIL-MSGID: =?utf-8?q?1759055417987535336?= 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 6 describes the error recovery mode option which is based on I frames. The k parameter defines the maximum number of I frames that a DLC can have unacknowledged as described in chapter 5.7.4. The current n_gsm implementation does not support the error recovery mode option. However, the k parameter is also part of the parameter negotiation message as described in chapter 5.4.6.3.1. Chapter 5.7.4 also notes that the allowed value range for k is 1-7. That means a 0 is counted as invalid here. This means that the user needs to configure a valid value here even if the function itself is not supported. Otherwise, parameter negotiation may fail. Allow setting of k via ioctl in gsm_config(). Range checks are already included. Signed-off-by: Daniel Starke --- drivers/tty/n_gsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c index 3ca33149c339..494657e8535d 100644 --- a/drivers/tty/n_gsm.c +++ b/drivers/tty/n_gsm.c @@ -3276,8 +3276,8 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) int need_close = 0; int need_restart = 0; - /* Stuff we don't support yet - UI or I frame transport, windowing */ - if ((c->adaption != 1 && c->adaption != 2) || c->k) + /* Stuff we don't support yet - UI or I frame transport */ + if (c->adaption != 1 && c->adaption != 2) return -EOPNOTSUPP; /* Check the MRU/MTU range looks sane */ if (c->mru < MIN_MTU || c->mtu < MIN_MTU)