* Add new ASYNC_SPD_WARP13?
@ 2011-04-06 16:48 Grant Edwards
2011-04-06 16:53 ` Alan Cox
0 siblings, 1 reply; 8+ messages in thread
From: Grant Edwards @ 2011-04-06 16:48 UTC (permalink / raw)
To: linux-serial
I'm working on a driver for a serial board that supports 921600 bps,
and it would be awfully nice if there was a way to specify that using
the ASYNC_SPD_xxxxx mechanism. Is there any reason why this wouldn't
work?
#define ASYNC_SPD_HI (1U << ASYNCB_SPD_HI)
#define ASYNC_SPD_VHI (1U << ASYNCB_SPD_VHI)
#define ASYNC_SPD_SHI (1U << ASYNCB_SPD_SHI)
#define ASYNC_SPD_CUST (ASYNC_SPD_HI|ASYNC_SPD_VHI)
#define ASYNC_SPD_WARP (ASYNC_SPD_HI|ASYNC_SPD_SHI)
+ #define ASYNC_SPD_WARP13 (ASYNC_SPD_HI|ASYNC_SPD_SHI|ASYNC_SPD_SHI)
#define ASYNC_SPD_MASK (ASYNC_SPD_HI|ASYNC_SPD_VHI|ASYNC_SPD_SHI)
--
Grant Edwards grant.b.edwards Yow! I'm wearing PAMPERS!!
at
gmail.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 16:48 Add new ASYNC_SPD_WARP13? Grant Edwards
@ 2011-04-06 16:53 ` Alan Cox
2011-04-06 17:06 ` Grant Edwards
2011-04-06 17:14 ` Grant Edwards
0 siblings, 2 replies; 8+ messages in thread
From: Alan Cox @ 2011-04-06 16:53 UTC (permalink / raw)
To: Grant Edwards; +Cc: linux-serial
On Wed, 6 Apr 2011 16:48:49 +0000 (UTC)
Grant Edwards <grant.b.edwards@gmail.com> wrote:
> I'm working on a driver for a serial board that supports 921600 bps,
> and it would be awfully nice if there was a way to specify that using
> the ASYNC_SPD_xxxxx mechanism. Is there any reason why this wouldn't
> work?
The ASYNC_SPD_xxxx mechanism is obsolete. Just set the baud rate to
921600, the kernel has supported arbitary baud rates for some time.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 16:53 ` Alan Cox
@ 2011-04-06 17:06 ` Grant Edwards
2011-04-06 19:14 ` Alan Cox
2011-04-06 17:14 ` Grant Edwards
1 sibling, 1 reply; 8+ messages in thread
From: Grant Edwards @ 2011-04-06 17:06 UTC (permalink / raw)
To: linux-serial
On 2011-04-06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Wed, 6 Apr 2011 16:48:49 +0000 (UTC)
> Grant Edwards <grant.b.edwards@gmail.com> wrote:
>
>> I'm working on a driver for a serial board that supports 921600 bps,
>> and it would be awfully nice if there was a way to specify that using
>> the ASYNC_SPD_xxxxx mechanism. Is there any reason why this wouldn't
>> work?
>
> The ASYNC_SPD_xxxx mechanism is obsolete.
I know -- unfortunately, so are many customer applications.
> Just set the baud rate to 921600, the kernel has supported arbitary
> baud rates for some time.
Yep, but there are customers with existing, fielded, applications that
depend on the ASYNC_SPD_xxxx mechanism to map 38400 to <whatever>
[where <whatever> is determined by the SPD_xxxx flags controlled by
setserial].
In the past, we've provided a customized version of setserial that
supported a SPD_WARP13 flag setting for 921600, but it only worked
with a particular driver. I'd like to ditch that and in future use
the standard setserial and standard SPD_xxxx flags. But, there is no
standard way to set flags for 921600.
I could tell them to go the SPD_CUST route to get 921600, but I was
hoping to provide an option that would support 921600 the same way
that 57600, 230400, and 460800 are supported.
--
Grant Edwards grant.b.edwards Yow! I'm dressing up in
at an ill-fitting IVY-LEAGUE
gmail.com SUIT!! Too late...
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 16:53 ` Alan Cox
2011-04-06 17:06 ` Grant Edwards
@ 2011-04-06 17:14 ` Grant Edwards
2011-04-06 19:23 ` Alan Cox
1 sibling, 1 reply; 8+ messages in thread
From: Grant Edwards @ 2011-04-06 17:14 UTC (permalink / raw)
To: linux-serial
On 2011-04-06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> The ASYNC_SPD_xxxx mechanism is obsolete. Just set the baud rate to
> 921600, the kernel has supported arbitary baud rates for some time.
This raises a question I've been wondering about for some time. While
the kernel and the serial driver API support arbitrary baud rates,
termios doesn't AFAICT.
How does one use the standard POSIX serial port API to obtain an
abritrary baud rate?
The only way I can find to get arbitrary baud rates from a user
perspective is to use the ASYNC_SPD_xxxx mechanism.
--
Grant Edwards grant.b.edwards Yow! Catsup and Mustard all
at over the place! It's the
gmail.com Human Hamburger!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 17:06 ` Grant Edwards
@ 2011-04-06 19:14 ` Alan Cox
2011-04-06 19:20 ` Grant Edwards
0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2011-04-06 19:14 UTC (permalink / raw)
To: Grant Edwards; +Cc: linux-serial
> I could tell them to go the SPD_CUST route to get 921600, but I was
> hoping to provide an option that would support 921600 the same way
> that 57600, 230400, and 460800 are supported.
And no doubt in time other speeds as well.
ASYNC_SPD_xxx is legacy, it remains simply because we provided it as a
historic interface to some drivers and we don't want to break stuff
So please use SPD_CUST if you must do this.
Alan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 19:14 ` Alan Cox
@ 2011-04-06 19:20 ` Grant Edwards
0 siblings, 0 replies; 8+ messages in thread
From: Grant Edwards @ 2011-04-06 19:20 UTC (permalink / raw)
To: linux-serial
On 2011-04-06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> I could tell them to go the SPD_CUST route to get 921600, but I was
>> hoping to provide an option that would support 921600 the same way
>> that 57600, 230400, and 460800 are supported.
>
> And no doubt in time other speeds as well.
>
> ASYNC_SPD_xxx is legacy, it remains simply because we provided it as a
> historic interface to some drivers and we don't want to break stuff
>
> So please use SPD_CUST if you must do this.
I don't understand: what's the non-legacy alternative to using SPD_CUST?
--
Grant Edwards grant.b.edwards Yow! I'm having a
at tax-deductible experience!
gmail.com I need an energy crunch!!
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 17:14 ` Grant Edwards
@ 2011-04-06 19:23 ` Alan Cox
2011-04-06 19:38 ` Grant Edwards
0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2011-04-06 19:23 UTC (permalink / raw)
To: Grant Edwards; +Cc: linux-serial
> This raises a question I've been wondering about for some time. While
> the kernel and the serial driver API support arbitrary baud rates,
> termios doesn't AFAICT.
>
> How does one use the standard POSIX serial port API to obtain an
> abritrary baud rate?
The POSIX API is completely broken in this respect. So the kernel
provides its own interface.
> The only way I can find to get arbitrary baud rates from a user
> perspective is to use the ASYNC_SPD_xxxx mechanism.
Which is also not POSIX
Simple example app:
http://www.kerneltrap.com/mailarchive/linux-usb/2008/10/2/3484644
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Add new ASYNC_SPD_WARP13?
2011-04-06 19:23 ` Alan Cox
@ 2011-04-06 19:38 ` Grant Edwards
0 siblings, 0 replies; 8+ messages in thread
From: Grant Edwards @ 2011-04-06 19:38 UTC (permalink / raw)
To: linux-serial
On 2011-04-06, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>> This raises a question I've been wondering about for some time. While
>> the kernel and the serial driver API support arbitrary baud rates,
>> termios doesn't AFAICT.
>>
>> How does one use the standard POSIX serial port API to obtain an
>> abritrary baud rate?
>
> The POSIX API is completely broken in this respect. So the kernel
> provides its own interface.
>
>> The only way I can find to get arbitrary baud rates from a user
>> perspective is to use the ASYNC_SPD_xxxx mechanism.
>
> Which is also not POSIX
Right.
> Simple example app:
>
> http://www.kerneltrap.com/mailarchive/linux-usb/2008/10/2/3484644
Brilliant!
I've been looking for that (off and on) for months. I knew that the
kernel/driver API supported arbitrary baud rates and that termios
didn't. So I figured there must be an alternative to SPD_CUST, but
hadn't been able to figure out what it was.
I had found the BSD IOSSIOSPEED ioctl, but hadn't stumbled across the
Linux equivalent.
--
Grant Edwards grant.b.edwards Yow! Look DEEP into the
at OPENINGS!! Do you see any
gmail.com ELVES or EDSELS ... or a
HIGHBALL?? ...
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-04-06 19:38 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-06 16:48 Add new ASYNC_SPD_WARP13? Grant Edwards
2011-04-06 16:53 ` Alan Cox
2011-04-06 17:06 ` Grant Edwards
2011-04-06 19:14 ` Alan Cox
2011-04-06 19:20 ` Grant Edwards
2011-04-06 17:14 ` Grant Edwards
2011-04-06 19:23 ` Alan Cox
2011-04-06 19:38 ` Grant Edwards
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).