public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Fernando Di Nucci <f.dinucci@alice.it>
Cc: linux-serial@vger.kernel.org
Subject: Re: Setting PL2303 baud rate
Date: Mon, 6 May 2013 13:43:20 -0700	[thread overview]
Message-ID: <20130506204320.GA11963@kroah.com> (raw)
In-Reply-To: <51881247.9050809@alice.it>

On Mon, May 06, 2013 at 10:27:51PM +0200, Fernando Di Nucci wrote:
> I have a PL2303HX adapter and I need to set up its baud rate to
> 1228800 or 2457600
> 
> (openwrt, linux kernel 3.3.8, coreutils 8.16 and ubuntu quantal
> 3.5.0-28, same coreutils).
> 
> I tried stty -F /dev/ttyUSB0 baudrate
> 
> Well, when baudrate is 921600 or 3000000 everything is fine, but
> when I try 1228800 or 2457600 stty complaints:
> stty: invalid argument '2457600'.
> 
> I searched stty source and added:
> 
> #ifdef B1228800
>   {"1228800", B1228800, 1228800},
> #endif
> #ifdef B2457600
>   {"2457600", B2457600, 2457600},
> #endif
> 
> and compiled but no luck. I don't know where else those values need
> also to be modified.
> 
> Can you please point me to the right direction?

I don't think stty can handle the higher baud rates, you are going to
have to do the tty ioctl commands yourself in your program.

Take a look at the cfsetospeed() man page for details.

Hope this helps,

greg k-h

      parent reply	other threads:[~2013-05-06 20:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-06 20:27 Setting PL2303 baud rate Fernando Di Nucci
2013-05-06 20:42 ` Grant Edwards
2013-05-06 20:43 ` Greg KH [this message]

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=20130506204320.GA11963@kroah.com \
    --to=greg@kroah.com \
    --cc=f.dinucci@alice.it \
    --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