changeset 3880:6015d65900eb

6522110 6403830 regresses the ability to use TCSETA to set line speed
author zk194757
date Thu, 22 Mar 2007 06:40:26 -0700
parents f09f624a7372
children 6e67ad54ba09
files usr/src/uts/sun4/io/su_driver.c
diffstat 1 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/sun4/io/su_driver.c	Thu Mar 22 01:51:00 2007 -0700
+++ b/usr/src/uts/sun4/io/su_driver.c	Thu Mar 22 06:40:26 2007 -0700
@@ -23,7 +23,7 @@
 /*	  All Rights Reserved					*/
 
 /*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
@@ -2733,6 +2733,29 @@
 					mutex_exit(asy->asy_excl);
 					return;
 				}
+
+				/*
+				 * TCSETA, TCSETAW, and TCSETAF make use of
+				 * the termio structure and therefore have
+				 * no concept of any speed except what can
+				 * be represented by CBAUD. This is because
+				 * of legacy SVR4 code. Therefore, if we see
+				 * one of the aforementioned IOCTL commands
+				 * we should zero out CBAUDEXT, CIBAUD, and
+				 * CIBAUDEXT as to not break legacy
+				 * functionality. This is because CBAUDEXT,
+				 * CIBAUD, and CIBAUDEXT can't be stored in
+				 * an unsigned short. By zeroing out CBAUDEXT,
+				 * CIBAUD, and CIBAUDEXT in the t_cflag of the
+				 * termios structure asy_program() will set the
+				 * input baud rate to the output baud rate.
+				 */
+				if (iocp->ioc_cmd == TCSETA ||
+				    iocp->ioc_cmd == TCSETAW ||
+				    iocp->ioc_cmd == TCSETAF)
+					tp->t_cflag &= ~(CIBAUD |
+					    CIBAUDEXT | CBAUDEXT);
+
 				error = asy_program(asy, ASY_NOINIT);
 				mutex_exit(asy->asy_excl_hi);
 			}