aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/riscom8.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-01 02:27:24 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-01 03:39:20 -0400
commitc7bce3097c0f9bbed76ee6fd03742f2624031a45 (patch)
tree6a9690926d5afd84545ca364dd3ca173d9aca1eb /drivers/char/riscom8.c
parent00988a3514bbc0cce781c067cf52559741d88b80 (diff)
[PATCH] serial: Fix up offenders peering at baud bits directly
Stop some other people peering into the baud bits on their own and make them use the tty_get_baud_rate() helper as a preperation for the move to the new termios. Corrected dependancy previous one had on new termios structs Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/riscom8.c')
-rw-r--r--drivers/char/riscom8.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/drivers/char/riscom8.c b/drivers/char/riscom8.c
index f1c94f771af5..06b9f78a95d9 100644
--- a/drivers/char/riscom8.c
+++ b/drivers/char/riscom8.c
@@ -675,26 +675,12 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port)
675 port->COR2 = 0; 675 port->COR2 = 0;
676 port->MSVR = MSVR_RTS; 676 port->MSVR = MSVR_RTS;
677 677
678 baud = C_BAUD(tty); 678 baud = tty_get_baud_rate(tty);
679
680 if (baud & CBAUDEX) {
681 baud &= ~CBAUDEX;
682 if (baud < 1 || baud > 2)
683 port->tty->termios->c_cflag &= ~CBAUDEX;
684 else
685 baud += 15;
686 }
687 if (baud == 15) {
688 if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
689 baud ++;
690 if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
691 baud += 2;
692 }
693 679
694 /* Select port on the board */ 680 /* Select port on the board */
695 rc_out(bp, CD180_CAR, port_No(port)); 681 rc_out(bp, CD180_CAR, port_No(port));
696 682
697 if (!baud_table[baud]) { 683 if (!baud) {
698 /* Drop DTR & exit */ 684 /* Drop DTR & exit */
699 bp->DTR |= (1u << port_No(port)); 685 bp->DTR |= (1u << port_No(port));
700 rc_out(bp, RC_DTR, bp->DTR); 686 rc_out(bp, RC_DTR, bp->DTR);
@@ -710,7 +696,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port)
710 */ 696 */
711 697
712 /* Set baud rate for port */ 698 /* Set baud rate for port */
713 tmp = (((RC_OSCFREQ + baud_table[baud]/2) / baud_table[baud] + 699 tmp = (((RC_OSCFREQ + baud/2) / baud +
714 CD180_TPC/2) / CD180_TPC); 700 CD180_TPC/2) / CD180_TPC);
715 701
716 rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff); 702 rc_out(bp, CD180_RBPRH, (tmp >> 8) & 0xff);
@@ -718,7 +704,7 @@ static void rc_change_speed(struct riscom_board *bp, struct riscom_port *port)
718 rc_out(bp, CD180_RBPRL, tmp & 0xff); 704 rc_out(bp, CD180_RBPRL, tmp & 0xff);
719 rc_out(bp, CD180_TBPRL, tmp & 0xff); 705 rc_out(bp, CD180_TBPRL, tmp & 0xff);
720 706
721 baud = (baud_table[baud] + 5) / 10; /* Estimated CPS */ 707 baud = (baud + 5) / 10; /* Estimated CPS */
722 708
723 /* Two timer ticks seems enough to wakeup something like SLIP driver */ 709 /* Two timer ticks seems enough to wakeup something like SLIP driver */
724 tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO; 710 tmp = ((baud + HZ/2) / HZ) * 2 - CD180_NFIFO;