From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: RS485 implementation questions (primarly in atmel_serial.c)
Date: Wed, 30 Jan 2013 17:57:40 +0000 (UTC) [thread overview]
Message-ID: <kebmuj$64o$1@ger.gmane.org> (raw)
In-Reply-To: CAJa4H3ebkp=J6+==nW0JpTTO8pkM_8J7EEfxTytwe-p+zweqog@mail.gmail.com
On 2013-01-30, Guido Classen <clagix@gmail.com> wrote:
>> What I'm thinking about doing is instead of using a tty driver,
>> writing a char driver. That eliminates the whole tty/ldisc tangle and
>> allows you to implement read()/write() as packet operations rather
>> than bytestream operations. You can still implement whatever subset
>> of the termios ioctl() calls make sense along with whatever new
>> ioctl() calls are needed to control/configure things like inter-byte
>> timeouts, 9th-bit addressing modes, frame-recognition state-machines,
>> etc.
>
> If I understand this right, you suggest to introduce a new subsystem for
> half-duplex field-bus style communication which is fully independent from
> the existing POSIX tty subsystem. This subsystem will include own ioctls
> for settings timeouts, addressing, turn on and turn off times and so on,
> will support some temios ioctls which are applicable like setting baud-rates.
It wouldn't have to be half-duplex.
> There will be plugable frame-recognition state-machines. How will the
> low-level side look like? Will it use the existing serial drivers
> (over some kind of new interface?)
I haven't gotten that far. Since the existing serial drivers assume
the existance and use of the tty layer, they probably can't be used
as-is.
> Or will it have it's own set of serial drivers which are designed for
> frame based half duplex communication. This means duplicate drivers
> for each kind of UART hardware (8250, atmel, ...)
Unfortunately, that's probably what it would take.
> I am not sure if this is a good design, but on other hand there are
> already duplicate drivers for 16550 style UARTs in the kernel for
> special purposes like bluetooth, irda and MIDI-interfaces.
>
> From userspace view this will make thinks much easier, so I
> personally will support this approach. But we have to be aware that
> this will introduce a new API which is not standardized and portable
> to other OSs.
That's a very real issue. The applications I'm initially interested
in porting aren't Unix/Linux apps anyway, so for my particular project
the applications have to be ported to something, and the existing tty
API just doesn't provide the required features.
> Furthermore there must be some way to have access to the same
> hardware either over this API or over the TTY API.
That's not one of my requirements. My plan is that you either enable
the serial_core driver or my "low-level char/frame" driver -- you
can't use both. You could, of course, build them both as modules and
switch back and forth without rebooting.
There's no reason that the driver I'm thinking about can't be
partially API compatible so that you can use the same libc calls to do
common things like set baud rate/parity, get/set modem status/control
lines, and so on.
--
Grant Edwards grant.b.edwards Yow! I can't decide which
at WRONG TURN to make first!!
gmail.com I wonder if BOB GUCCIONE
has these problems!
next prev parent reply other threads:[~2013-01-30 17:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-23 22:56 RS485 implementation questions (primarly in atmel_serial.c) Guido Classen
2013-01-24 0:10 ` Grant Edwards
2013-01-25 9:13 ` Guido Classen
2013-01-25 15:39 ` Grant Edwards
2013-01-29 21:56 ` Guido Classen
2013-01-29 22:29 ` Grant Edwards
2013-01-30 15:24 ` Guido Classen
2013-01-30 17:57 ` Grant Edwards [this message]
2013-01-30 14:35 ` Jean-Pierre Tosoni
2013-01-31 14:42 ` Grant Edwards
[not found] <CAJa4H3cYT6QOaacWEy2yZjb0hM3m4p+0L2_fXBYv8tWajYkmGw@mail.gmail.com>
2013-01-30 10:30 ` Claudio Scordino
[not found] ` <510A3740.6060809@evidence.eu.com>
[not found] ` <CAJa4H3dG4V6viRbVQBgHQKtJr4Sz26mkhj8-kT7RFaLGRFXW1g@mail.gmail.com>
[not found] ` <51125488.7090408@evidence.eu.com>
[not found] ` <CAJa4H3eNAS7B+aGnN0D3WJMPVtE=sxp5HhRMutq-TrBOmXb7dw@mail.gmail.com>
[not found] ` <5114B500.7050007@evidence.eu.com>
2013-02-08 12:12 ` Guido Classen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='kebmuj$64o$1@ger.gmane.org' \
--to=grant.b.edwards@gmail.com \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).