public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 29/70] tty-usb-console: Fix termios
Date: Fri, 20 Jun 2008 21:01:58 +0100	[thread overview]
Message-ID: <20080620200155.1479.64964.stgit@localhost.localdomain> (raw)
In-Reply-To: <20080620195406.1479.12620.stgit@localhost.localdomain>

From: Alan Cox <alan@redhat.com>

Setting CFLAG bits is all well and good but you must sort out ispeed and
ospeed properly.

Signed-off-by: Alan Cox <alan@redhat.com>
---

 drivers/usb/serial/console.c |   37 +++++--------------------------------
 1 files changed, 5 insertions(+), 32 deletions(-)


diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 9a4cd0a..7b74238 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -81,39 +81,11 @@ static int usb_console_setup(struct console *co, char *options)
 		if (*s)
 			doflow = (*s++ == 'r');
 	}
+	
+	/* Sane default */
+	if (baud == 0)
+		baud = 9600;
 
-	/* build a cflag setting */
-	switch (baud) {
-	case 1200:
-		cflag |= B1200;
-		break;
-	case 2400:
-		cflag |= B2400;
-		break;
-	case 4800:
-		cflag |= B4800;
-		break;
-	case 19200:
-		cflag |= B19200;
-		break;
-	case 38400:
-		cflag |= B38400;
-		break;
-	case 57600:
-		cflag |= B57600;
-		break;
-	case 115200:
-		cflag |= B115200;
-		break;
-	case 9600:
-	default:
-		cflag |= B9600;
-		/*
-		 * Set this to a sane value to prevent a divide error
-		 */
-		baud  = 9600;
-		break;
-	}
 	switch (bits) {
 	case 7:
 		cflag |= CS7;
@@ -188,6 +160,7 @@ static int usb_console_setup(struct console *co, char *options)
 
 		if (serial->type->set_termios) {
 			termios->c_cflag = cflag;
+			tty_termios_encode_baud_rate(termios, baud, baud);
 			serial->type->set_termios(NULL, port, &dummy);
 
 			port->port.tty = NULL;


  parent reply	other threads:[~2008-06-20 20:25 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-20 19:57 [PATCH 00/70] tty updates proposed for 2.6.27 Alan Cox
2008-06-20 19:58 ` [PATCH 01/70] tty: Ldisc revamp Alan Cox
2008-06-23 13:39   ` Louis Rilling
2008-06-23 14:11     ` Alan Cox
2008-06-20 19:58 ` [PATCH 02/70] drivers/char/rio/: remove VCS tags Alan Cox
2008-06-20 19:58 ` [PATCH 03/70] drivers/serial/: remove CVS keywords Alan Cox
2008-06-20 19:58 ` [PATCH 04/70] tty: Introduce a tty_port common structure Alan Cox
2008-06-20 19:58 ` [PATCH 05/70] tty.h: clean up Alan Cox
2008-06-20 19:59 ` [PATCH 06/70] epca: use tty_port Alan Cox
2008-06-20 19:59 ` [PATCH 07/70] esp: " Alan Cox
2008-06-20 19:59 ` [PATCH 08/70] gs: " Alan Cox
2008-06-20 19:59 ` [PATCH 09/70] riscom8: " Alan Cox
2008-06-20 19:59 ` [PATCH 10/70] riscom8: remove bogus checks Alan Cox
2008-06-20 19:59 ` [PATCH 11/70] isicom: use tty_port Alan Cox
2008-06-20 19:59 ` [PATCH 12/70] istallion: " Alan Cox
2008-06-20 19:59 ` [PATCH 13/70] moxa: " Alan Cox
2008-06-20 19:59 ` [PATCH 14/70] mxser: " Alan Cox
2008-06-20 20:00 ` [PATCH 15/70] rocket: " Alan Cox
2008-06-20 20:00 ` [PATCH 16/70] serial: " Alan Cox
2008-06-20 20:00 ` [PATCH 17/70] stallion: " Alan Cox
2008-06-20 20:00 ` [PATCH 18/70] synclink: " Alan Cox
2008-06-20 20:00 ` [PATCH 19/70] tty: Clean up tiocmset Alan Cox
2008-06-20 20:00 ` [PATCH 20/70] cyclades: use tty_port Alan Cox
2008-06-20 20:00 ` [PATCH 21/70] termios: Termios defines for other platforms Alan Cox
2008-06-20 20:00 ` [PATCH 22/70] tty: add more tty_port fields Alan Cox
2008-06-20 20:01 ` [PATCH 24/70] whiteheat: coding style Alan Cox
2008-06-20 20:01 ` [PATCH 25/70] whiteheat: fix bugs found in the tidy and audit Alan Cox
2008-06-20 20:01 ` [PATCH 26/70] belkin_sa: clean up code Alan Cox
2008-06-20 20:01 ` [PATCH 27/70] usb-serial-bus: tidy coding style Alan Cox
2008-06-20 20:01 ` [PATCH 28/70] tty-usb-console: tidy the USB console code Alan Cox
2008-06-20 20:01 ` Alan Cox [this message]
2008-06-20 20:02 ` [PATCH 30/70] cp2101: coding style Alan Cox
2008-06-20 20:02 ` [PATCH 31/70] cyberjack: Coding style Alan Cox
2008-06-20 20:02 ` [PATCH 32/70] cypress_m8: coding style Alan Cox
2008-06-20 20:02 ` [PATCH 33/70] usb-cypress: There is no 0 case to go with CS5/6/7/8 so remove the test Alan Cox
2008-06-20 20:02 ` [PATCH 34/70] digi_acceleport: coding style Alan Cox
2008-06-20 20:02 ` [PATCH 35/70] empeg: Coding style Alan Cox
2008-06-20 20:02 ` [PATCH 36/70] ftdi_sio: " Alan Cox
2008-06-20 20:02 ` [PATCH 37/70] funsoft: Switch to linux/uaccess Alan Cox
2008-06-20 20:03 ` [PATCH 38/70] garmin_gps: Coding style Alan Cox
2008-06-20 20:03 ` [PATCH 39/70] tty-usb-generic: Code cleanup Alan Cox
2008-06-20 20:03 ` [PATCH 40/70] tty-usb-hp4x: Fix overlong line Alan Cox
2008-06-20 20:03 ` [PATCH 41/70] tty-usb-visor: Coding style Alan Cox
2008-06-20 20:03 ` [PATCH 42/70] tty-usb-io_edgeport: " Alan Cox
2008-06-20 20:03 ` [PATCH 43/70] io_edgeport: Fix various bogus returns to the tty layer Alan Cox
2008-06-20 20:03 ` [PATCH 44/70] usb-serial: Coding style Alan Cox
2008-06-20 20:04 ` [PATCH 45/70] io_ti: Minor coding style Alan Cox
2008-06-20 20:04 ` [PATCH 46/70] ipaq: Coding style Alan Cox
2008-06-20 20:04 ` [PATCH 47/70] tty-usb-ipw: " Alan Cox
2008-06-20 20:04 ` [PATCH 48/70] tty-usb-ir-usb: Clean up to coding style Alan Cox
2008-06-20 20:04 ` [PATCH 49/70] tty-usb-iuu-phoenix: " Alan Cox
2008-06-20 20:04 ` [PATCH 50/70] tty-usb-keyspan: Coding style Alan Cox
2008-06-20 20:04 ` [PATCH 51/70] keyspan: Use string flip functions when possible Alan Cox
2008-06-20 20:04 ` [PATCH 52/70] tty-usb-keyspan-pda: Coding style Alan Cox
2008-06-20 20:05 ` [PATCH 53/70] tty-usb-kl5kusb105: " Alan Cox
2008-06-20 20:05 ` [PATCH 54/70] keyspan_pda: Use string flip functions Alan Cox
2008-06-20 20:05 ` [PATCH 55/70] tty-usb-kobil-sct: Coding style Alan Cox
2008-06-20 20:05 ` [PATCH 56/70] kobil_sct: Fix ioctls Alan Cox
2008-06-20 20:05 ` [PATCH 57/70] tty-usb-mct-u232: Coding style Alan Cox
2008-06-20 20:05 ` [PATCH 58/70] mct_u232: Use flip buffer functions Alan Cox
2008-06-20 20:06 ` [PATCH 59/70] tty-usb-pl2303: Coding style Alan Cox
2008-06-20 20:06 ` [PATCH 60/70] tty-usb-sierra: Coding style - minor Alan Cox
2008-06-20 20:06 ` [PATCH 61/70] tty-usb-spcp8x5: Minor coding style Alan Cox
2008-06-20 20:06 ` [PATCH 62/70] tty-usb-ti-usb: Coding style Alan Cox
2008-06-20 20:06 ` [PATCH 63/70] tty-usb-safe-serial: " Alan Cox
2008-06-20 20:06 ` [PATCH 64/70] tty-usb-oti6858: " Alan Cox
2008-06-20 20:06 ` [PATCH 65/70] tty-usb-option: " Alan Cox
2008-06-20 20:06 ` [PATCH 66/70] tty-usb-omninet: " Alan Cox
2008-06-20 20:07 ` [PATCH 67/70] omninet: Use string flip functions Alan Cox
2008-06-20 20:07 ` [PATCH 68/70] mos7840: remove loads of bogus assignments to status Alan Cox
2008-06-20 20:07 ` [PATCH 69/70] whiteheat: remove unused variable Alan Cox
2008-06-20 20:07 ` [PATCH 70/70] tty-usb-mos7720: Coding style Alan Cox
2008-06-20 23:39 ` [PATCH 00/70] tty updates proposed for 2.6.27 Johannes Weiner
2008-06-21  9:09 ` Greg KH
2008-06-21 10:17   ` (Resend of 23/70 plus reply [PATCH 00/70] tty updates proposed for 2.6.27) Alan Cox
2008-06-21 11:19     ` Adrian Bunk
2008-06-22 17:07       ` Alan Cox
2008-06-22 18:39         ` Greg KH
2008-06-21 13:23   ` [PATCH 00/70] tty updates proposed for 2.6.27 Marcel Holtmann

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=20080620200155.1479.64964.stgit@localhost.localdomain \
    --to=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