All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Westermann <mw@microdata-pos.de>
To: linux-serial@vger.kernel.org
Subject: Re: Non-standard baud rate setting 14400 ..Possible?
Date: Fri, 20 Feb 2004 16:17:56 +0100	[thread overview]
Message-ID: <20040220161756.N11138@microdata-pos.de> (raw)
In-Reply-To: <007101c38f3e$e6419d70$cf14a8c0@sampath>; from sampath@spartanlabs.com on Fri, Oct 10, 2003 at 08:27:59PM +0530

Hello a little bit late answer ;-)

On Fri, Oct 10, 2003 at 08:27:59PM +0530, Sampath Kumar wrote:
> Hello ,
> 
> Is there a way to set the serial port on the i386 Linux 2.4.17 at non
> standard baud rates like 14400,28800,etc.?

I it is a way.

cflags -> B38400;  /* set the baud to 38400 */  

static int pos_set_28800(int fd) {
     struct serial_struct serinfo;
     int ret;
     if ((ret = ioctl(fd, TIOCGSERIAL, &serinfo)) < 0) {
    	   fprintf(stderr,"Cannot get serial info\n"); 
     } else {
    	   serinfo.custom_divisor = 4;
			/*  Baudbase 115200/4 = 28800 
				     115200/8 = 14400 */

	   serinfo.flags &=  ~ASYNC_SPD_MASK;
	   serinfo.flags |=  ASYNC_SPD_CUST;		
	   if ((ret = ioctl(fd, TIOCSSERIAL, &serinfo)) < 0) {
	        fprintf(stderr, "Cannot set serial info\n");
	   }
     }
     return 0;
}

or set it with setserial.

It's running with kernel 2.4.xx

Michael Westermann

      parent reply	other threads:[~2004-02-20 15:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10 14:57 Non-standard baud rate setting 14400 ..Possible? Sampath Kumar
2003-10-10 17:58 ` Gerald Emig
2003-10-10 21:41   ` rich+ml
2003-10-10 23:08 ` David Lawyer
2003-10-13 13:02   ` How to check whether the last character in the serial port is flushed/sent Sampath Kumar
2004-02-20 15:17 ` Michael Westermann [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=20040220161756.N11138@microdata-pos.de \
    --to=mw@microdata-pos.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.