From: Peter Stuge <peter@stuge.se>
To: linux-kernel@vger.kernel.org
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Hardware initialization in line discipline - ldisc_open() ?
Date: Thu, 15 Oct 2009 22:58:03 +0200 [thread overview]
Message-ID: <20091015205803.30544.qmail@stuge.se> (raw)
I'm writing a line discipline for a serial port multiplexing hardware
which turns one "upstream" serial port into 0-8 slower "downstream"
serial ports, according to the number of modules installed on the
multiplexer.
The attaching program transfers no data on the upstream port, all
data will be to/from the ldisc itself, or to/from the downstream
ports.
To know which modules are installed, and their configuration, the
ldisc needs to perform a handshake using the same packet format as
downstream port data transfers.
It would be nice to do this handshake in ldisc_open() so that the
attach can fail if the hardware is not responding or just not
connected.
Since the packet format is the same it would be easy to reuse the
normal ldisc receive path for the handshake, however the ldisc would
not see the response until after ldisc_open() has succeeded.
Catch-22!
I'm hoping to use ldattach for attaching the ldisc because it's nice
to have a standard utility, because it's nice to not duplicate the
packet formatting/parsing code, and because the ldisc has to know
which modules are installed in the hardware anyway, to create the
correct downstream ports.
Can you suggest a solution to this problem? Ideally one that can be
contained in the ldisc.
Thanks
//Peter
next reply other threads:[~2009-10-15 21:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-15 20:58 Peter Stuge [this message]
2009-10-15 21:31 ` Alan Cox
2009-10-15 21:46 ` Peter Stuge
2009-10-15 22:08 ` Alan Cox
2009-10-18 16:27 ` Peter Stuge
2009-10-18 22:33 ` Adding an ioctl or three Peter Stuge
2009-10-18 22:39 ` Randy Dunlap
2009-10-18 22:56 ` Peter Stuge
2009-10-21 17:32 ` [PATCH] docs: large update to ioctl-number.txt Randy Dunlap
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=20091015205803.30544.qmail@stuge.se \
--to=peter@stuge.se \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@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
all inboxes | Powered by JetHome®