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: 658068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33C2FC64ED6 for ; Tue, 28 Feb 2023 06:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229889AbjB1GcU (ORCPT ); Tue, 28 Feb 2023 01:32:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbjB1GcT (ORCPT ); Tue, 28 Feb 2023 01:32:19 -0500 Received: from mta-65-225.siemens.flowmailer.net (mta-65-225.siemens.flowmailer.net [185.136.65.225]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C84F628D09 for ; Mon, 27 Feb 2023 22:32:16 -0800 (PST) Received: by mta-65-225.siemens.flowmailer.net with ESMTPSA id 20230228063214c31253521ce7a0998d 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 Precedence: bulk List-ID: X-Mailing-List: linux-serial@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 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)