Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752713AbdF2LpW (ORCPT ); Thu, 29 Jun 2017 07:45:22 -0400 Received: from zimbra.gr13.net ([46.4.151.110]:60927 "EHLO zimbra.gr13.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752744AbdF2LpE (ORCPT ); Thu, 29 Jun 2017 07:45:04 -0400 Subject: Re: Directly accessing serial ports from drivers w/o TTYs ? To: Alan Cox References: <20170626155115.13617ed6@alans-desktop> Cc: linux-kernel@vger.kernel.org From: "Enrico Weigelt, metux IT consult" Message-ID: Date: Thu, 29 Jun 2017 11:44:58 +0000 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170626155115.13617ed6@alans-desktop> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1013 Lines: 28 On 26.06.2017 14:51, Alan Cox wrote: Hi, > You can write your own driver for the physical hardware and claim it in > your driver. Shouldn't normally be needed except for bizarre cases when a > serial link is used for something very non tty like (eg as GPIO lines). In my case, it's not really a serial link, but an backplane w/ FIFOs, which looks like a serial ports to the host (AFAIK, historically coming from older systems which actually had various serial controllers, eg. rs232, rs485/mvb, etc). The backplane seems to simulate the lower layers of an mvb network. > Otherwise all the low level tty device locking, queues and interfaces > assume there is a tty_struct attached to it, so yes you need a tty > struct. I was thinking about something that looks like serdev from consumer side, but instead directly works on struct uart_port, w/o actually allocating a tty (and also the funny things like signals, etc). > Why do you need to do otherwise ? Maybe it could offer better performance ? --mtx