Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9040434ybi; Wed, 10 Jul 2019 03:42:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxdzjcz3xO30VD/CgZ5raWGVJeJw1sWuNMGUqB1vZWKl/D83C96ZgnypyCQStXNlk4GN8VM X-Received: by 2002:a65:508c:: with SMTP id r12mr33895296pgp.1.1562755339167; Wed, 10 Jul 2019 03:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562755339; cv=none; d=google.com; s=arc-20160816; b=wsIqbszqtkFk2StmRhVJtEl3EoXPb4gBm3lDwIVvUprD6ABjQGodAFpu59FcY5RUZp PWqoJhgvCi+8OulcsUeNmitoCmgEMApQUFbu8up36pAplwxDwXmjMJ9+CMRMlUOVGXOe e8ax7/WfM601f7fWbOMNL4+uvH2Cb+sYaByjV5xEoHrxbIhkcE12CBfJy5wzQdsVI2Jh i4IfJxWj6r92JreflHwOJOIFi3+iZiCQd1HFopmDEeE5C7g/vflK8uGTZk+bPYELd1Fw lOGY0/empL+TlMYbdBeoUFTWH8u+Aq0+sgDatnsu70bWtn3j8DCXp3R/gJfOj2TNZcVF Ch3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GFmuOK9B1qgIGPpP3ej5oVBo5yd6HCKhfI4NjSTgNkQ=; b=mCfDdKlGWuy8gnzt7eT9fo1lffiGTY1oK3iIjLCCFHkNonps1a65Kb4AozA19PLGW5 RcSBRhApRnipBsch7q/W2GIaBFZINx2O4332/GTjxnz0dlmpSC0uDH/8Al3H5e765b0v MqafMd/dwYkHdUqyL86npE+94ZYXe6xnLsFFZa/rOCVO0RDTCBaRBmh/GQgAC0qZkzLV dBsONpaHwyszEcXuidyz8qBqyz/RTrJ7MsrYUdVJyDimu2qCkiXYFXa5J3p/SLw+hb8p 1ezU7Bf452MhPTVyfTx1LXS/F+x5W7rE1b2iyH2Et02uBMLqDzBtc/pZ8NllBpXS/9O9 Yi4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=FhQnwWbj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si1793189plq.91.2019.07.10.03.42.02; Wed, 10 Jul 2019 03:42:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=FhQnwWbj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727366AbfGJJvc (ORCPT + 99 others); Wed, 10 Jul 2019 05:51:32 -0400 Received: from first.geanix.com ([116.203.34.67]:51562 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbfGJJvc (ORCPT ); Wed, 10 Jul 2019 05:51:32 -0400 Received: from [192.168.8.20] (unknown [85.184.140.241]) by first.geanix.com (Postfix) with ESMTPSA id 9058830A; Wed, 10 Jul 2019 09:51:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1562752289; bh=Anc3qLvqQqoj+ZC+cEIfZy5xFnlWI1L+yTCIBGrNCic=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=FhQnwWbjze5et81xbmPl9z5dFlZn1VgxDyMkuXvple33vECzwqTcG6vjeYZE1RJoc aPmsHqpExoxCA9L9/F2BcIm0SZAxGna89sLrzng+L5hI9Ke85ybJsz7F1eHOH/XESm 1AViR1A9jY+i8U91ZwXXcoMGbnmZ200j4PFNPjMdy6B46S8+OJyDdRiePMuwmHxGQd jKsCdY395FaJcxzATw8HF7o/6odn0XBLJl2VHFZ4NN4f1otj8Pz3ctbNQVCisuJ46H 6YdDEFIycghTaEU3wr0HUf8xiH0VX9l4sMYZwvutOCu4W8aslofUpwnM/15p31R1Qb RukcQ9UTXldTw== Subject: Re: [PATCH 4/4] tty: n_gsm: add ioctl to map serial device to mux'ed tty To: Alan Cox Cc: Greg Kroah-Hartman , Jiri Slaby , linux-kernel@vger.kernel.org, =?UTF-8?Q?Sean_Nyekj=c3=a6r?= , Esben Haabendal References: <20190708190252.24628-1-martin@geanix.com> <20190708190252.24628-4-martin@geanix.com> <20190709162221.623f99ce@alans-desktop> From: =?UTF-8?Q?Martin_Hundeb=c3=b8ll?= Message-ID: <789b9d92-8110-d9e6-796e-e372d440fe51@geanix.com> Date: Wed, 10 Jul 2019 11:51:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190709162221.623f99ce@alans-desktop> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US-large Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on 8945dcc0271d Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/07/2019 17.22, Alan Cox wrote: >> + int base; >> >> /* open the serial port connected to the modem */ >> fd = open(SERIAL_PORT, O_RDWR | O_NOCTTY | O_NDELAY); >> @@ -58,6 +61,11 @@ Major parts of the initialization program : >> c.mtu = 127; >> /* set the new configuration */ >> ioctl(fd, GSMIOC_SETCONF, &c); >> + /* get and print base gsmtty device node */ >> + ioctl(fd, GSMIOC_GETBASE, &base); > Can we at least use a specific sized type ? uint32_t or whatever is fine. Sure. I am also considering whether returning the base (i.e. the unexposed control line) just confuses users. It might be better to use GSMIOC_GETFIRST instead, which would then return 1 for the first mux, and 65 for the second, and so forth. // Martin