From: "Tosoni" <jp.tosoni@acksys.fr>
To: 'Christopher Gibson' <chris@toftronix.com.au>,
'linux-serial' <linux-serial@vger.kernel.org>
Subject: RE: [PATCH v1] 8250: add support for DTR/DSR hardware flow control
Date: Mon, 1 Sep 2008 10:23:27 +0200 [thread overview]
Message-ID: <000a01c90c0c$031ca6c0$2e01a8c0@acksys.local> (raw)
In-Reply-To: <1220024020.2506.79.camel@thetriton.toftronix.com.au>
Your analysis and the new struct are fine to me.
Maybe 'delay_rts_before_send' should be named simply 'delay_before_send'
since it applies to dtr as well. Same for delay_rts_after_send.
Jean-Pierre Tosoni
> -----Original Message-----
> From: linux-serial-owner@vger.kernel.org
> [mailto:linux-serial-owner@vger.kernel.org]On Behalf Of Christopher
> Gibson
> Sent: Friday, August 29, 2008 5:34 PM
> To: linux-serial
> Subject: Re: [PATCH v1] 8250: add support for DTR/DSR hardware flow
> control
>
>
> I've had a look at the asm-cris rs485 implementation, as JP Tosoni
> suggested, and say that that interface would satisfy my requirements,
> and would also provide a suitable interface for controlling out dated
> radio modems. I would say though that some additional consideration
> should be given to the interface.
>
> I had assumed that the rts_on_send, and rts_after_send were time delay
> figures until I read the suggested rework by Alan Cox, then
> read through
> the crisv10.c code. In the crisv10 serial driver code the rts_on_send
> specifies the state that the RTS line should change to when a call to
> the TIOCSERWRRS485 ioctl is made the rts_after_send is the state that
> RTS is changed to after the transmission has completed. So in two of
> the four possible combinations user space control of RTS is still
> required in order to get any directional control activity out
> of the RTS
> line. I would be so bold as to say that this combination of user /
> automatic direction control would be unlikely to be ever used
> by anyone.
> If this is correct then the two flags could be replaced with one
> rts_tx_level indicating if RTS should be high or low during a
> transmission, and pre-transmission delay. Would this be clearer?
>
> The other observation about the crsv10.c implementation is
> that the call
> to TIOCSERWRRS485 ioctl, or write() if the enabled flag is
> set, does not
> return until the transmission has completed and the line has
> been turned
> around. This functionality could be restrictive in some situations
> (single threaded user applications that wish to do other stuff during
> transmission).
>
> My suggestion would be to scrap the TIOCSERWRRS485 ioctl, in favour of
> using the standard write(fd) and drain(fd) function calls,
> but to stick
> with the TIOCSERSETRS485 ioctl for automatic direction control port
> setup. I would be suggesting a control structure (based on Alan Cox's
> suggested modifications of the include/asm-cris/rs485.h) as follows:
>
> /*
> * Serial interface for controlling RS485 settings on chips
> with suitable
> * support. Set with TIOCSRS485 and get with TIOCGRS485 if
> supported by your
> * platform. The set function returns the new state, with any
> unsupported bits
> * reverted appropriately.
> */
>
> struct serial_rs485 {
> __u32 flags; /* RS485 feature flags */
> #define SER_RS485_MODES (7 << 0)
> /* Mask for mode bits. */
> #define SER_RS485_MODE_DISABLED (0 << 0)
> #define SER_RS485_MODE_RTS_TX_HIGH (2 << 0)
> #define SER_RS485_MODE_RTS_TX_LOW (3 << 0)
> #define SER_RS485_MODE_DTR_TX_HIGH (4 << 0)
> #define SER_RS485_MODE_DTR_TX_LOW (5 << 0)
> __u16 delay_rts_before_send; /* Milliseconds */
> __u16 delay_rts_after_send; /* Milliseconds */
> __u32 padding[6]; /* Memory is cheap, new structs
> are a royal PITA .. */
> };
>
> Any comments?
>
> The above would allow for RTS and DTR direction control as well as
> settings for lead in and lead out timing.
>
> --
> Christopher Gibson <chris@toftronix.com.au>
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-serial" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
next prev parent reply other threads:[~2008-09-01 8:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-29 15:33 [PATCH v1] 8250: add support for DTR/DSR hardware flow control Christopher Gibson
2008-09-01 8:23 ` Tosoni [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-08-06 21:14 Aristeu Rozanski
2008-08-07 8:32 ` Laurent Pinchart
2008-08-07 9:14 ` Alan Cox
2008-08-07 12:54 ` Tosoni
2008-08-13 11:39 ` Alan Cox
2008-08-18 15:25 ` Alan Cox
2008-08-20 21:43 ` Aristeu Rozanski
2008-08-21 10:23 ` Alan Cox
2008-08-21 18:59 ` 'Aristeu Rozanski'
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='000a01c90c0c$031ca6c0$2e01a8c0@acksys.local' \
--to=jp.tosoni@acksys.fr \
--cc=chris@toftronix.com.au \
--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