Ticket #2897: 0001-Adding-new-files-for-inclusion-of-FREEBSD-termios-fe.patch

File 0001-Adding-new-files-for-inclusion-of-FREEBSD-termios-fe.patch, 38.4 KB (added by Kevin Kirspel, on Feb 2, 2017 at 11:00:55 PM)

BSP updates

  • c/src/lib/libbsp/arm/csb336/console/uart.c

    From d9c4799c16abb6ff38a10cf6ced37b7ad3ba9049 Mon Sep 17 00:00:00 2001
    From: Kevin Kirspel <kevin-kirspel@idexx.com>
    Date: Thu, 2 Feb 2017 14:17:33 -0500
    Subject: [PATCH 1/4] Adding new files for inclusion of FREEBSD termios
     features. This will synchronize RTEMS with FREEBSD termios
    
    ---
     c/src/lib/libbsp/arm/csb336/console/uart.c         |  2 +-
     c/src/lib/libbsp/arm/lpc32xx/console/hsu.c         |  2 +-
     c/src/lib/libbsp/i386/shared/comm/tty_drv.c        |  2 +-
     .../libbsp/lm32/shared/milkymist_console/console.c |  2 +-
     c/src/lib/libbsp/m68k/av5282/console/console.c     |  6 ++---
     c/src/lib/libbsp/m68k/gen68340/console/console.c   | 18 ++++----------
     c/src/lib/libbsp/m68k/gen68360/console/console.c   |  2 +-
     c/src/lib/libbsp/m68k/genmcf548x/console/console.c |  2 +-
     c/src/lib/libbsp/m68k/mcf52235/console/console.c   |  8 ++++---
     c/src/lib/libbsp/m68k/mcf5225x/console/console.c   | 24 ++++++++++---------
     c/src/lib/libbsp/m68k/mcf5235/console/console.c    |  8 ++++---
     c/src/lib/libbsp/m68k/mcf5329/console/console.c    |  8 ++++---
     c/src/lib/libbsp/m68k/mrm332/console/sci.c         |  2 +-
     c/src/lib/libbsp/m68k/mvme167/console/console.c    |  8 +++----
     c/src/lib/libbsp/m68k/uC5282/console/console.c     |  4 ++--
     c/src/lib/libbsp/powerpc/acinclude.m4              |  4 ++--
     c/src/lib/libbsp/powerpc/gen5200/console/console.c |  2 +-
     c/src/lib/libbsp/powerpc/shared/console/console.c  |  2 +-
     c/src/lib/libbsp/powerpc/tqm8xx/console/console.c  |  2 +-
     c/src/lib/libbsp/shared/console.c                  |  4 ++--
     c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c  |  8 +++----
     c/src/lib/libcpu/arm/at91rm9200/usart/usart.c      |  2 +-
     c/src/lib/libcpu/bfin/serial/uart.c                |  4 ++--
     c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c       |  2 +-
     .../mpc5xx/console-generic/console-generic.c       |  2 +-
     .../mpc8260/console-generic/console-generic.c      |  4 ++--
     .../mpc8xx/console-generic/console-generic.c       |  4 ++--
     c/src/lib/libcpu/powerpc/ppc403/console/console.c  |  2 +-
     .../lib/libcpu/powerpc/ppc403/console/console405.c |  2 +-
     c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c  |  2 +-
     c/src/lib/libcpu/sh/sh7032/sci/sci.c               |  8 +++----
     c/src/lib/libcpu/sh/sh7045/sci/sci.c               |  6 ++---
     c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c       |  8 +++----
     c/src/libchip/serial/mc68681.c                     |  2 +-
     c/src/libchip/serial/mc68681_baud.c                | 28 ++++++++++++++++++----
     c/src/libchip/serial/z85c30.c                      |  2 +-
     36 files changed, 108 insertions(+), 90 deletions(-)
     mode change 100644 => 100755 c/src/lib/libbsp/arm/csb336/console/uart.c
     mode change 100644 => 100755 c/src/lib/libbsp/arm/lpc32xx/console/hsu.c
     mode change 100644 => 100755 c/src/lib/libbsp/i386/shared/comm/tty_drv.c
     mode change 100644 => 100755 c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/av5282/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/gen68340/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/gen68360/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/genmcf548x/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf52235/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5225x/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5235/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mcf5329/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mrm332/console/sci.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/mvme167/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/m68k/uC5282/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/powerpc/gen5200/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/powerpc/shared/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/shared/console.c
     mode change 100644 => 100755 c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
     mode change 100644 => 100755 c/src/lib/libcpu/arm/at91rm9200/usart/usart.c
     mode change 100644 => 100755 c/src/lib/libcpu/bfin/serial/uart.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/console/console.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/console/console405.c
     mode change 100644 => 100755 c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
     mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7032/sci/sci.c
     mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7045/sci/sci.c
     mode change 100644 => 100755 c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c
     mode change 100644 => 100755 c/src/libchip/serial/mc68681.c
     mode change 100644 => 100755 c/src/libchip/serial/mc68681_baud.c
     mode change 100644 => 100755 c/src/libchip/serial/z85c30.c
    
    diff --git a/c/src/lib/libbsp/arm/csb336/console/uart.c b/c/src/lib/libbsp/arm/csb336/console/uart.c
    old mode 100644
    new mode 100755
    index 1f3a4a1..e2e6bc2
    a b static int imx_uart_set_attrs(int minor, const struct termios *t) 
    322322{
    323323    int baud;
    324324
    325     baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     325    baud = rtems_termios_baud_to_number(t->c_ospeed);
    326326    imx_uart_set_baud(minor, baud);
    327327
    328328    return 0;
  • c/src/lib/libbsp/arm/lpc32xx/console/hsu.c

    diff --git a/c/src/lib/libbsp/arm/lpc32xx/console/hsu.c b/c/src/lib/libbsp/arm/lpc32xx/console/hsu.c
    old mode 100644
    new mode 100755
    index 8beeeef..b2044e0
    a b static bool lpc32xx_hsu_set_attributes( 
    178178{
    179179  lpc32xx_hsu_context *ctx = (lpc32xx_hsu_context *) base;
    180180  volatile lpc32xx_hsu *hsu = ctx->hsu;
    181   int baud_flags = term->c_cflag & CBAUD;
     181  int baud_flags = term->c_ospeed;
    182182
    183183  if (baud_flags != 0) {
    184184    int32_t baud = rtems_termios_baud_to_number(baud_flags);
  • c/src/lib/libbsp/i386/shared/comm/tty_drv.c

    diff --git a/c/src/lib/libbsp/i386/shared/comm/tty_drv.c b/c/src/lib/libbsp/i386/shared/comm/tty_drv.c
    old mode 100644
    new mode 100755
    index 2152dec..e15edbd
    a b conSetAttr(int port, int minor, const struct termios *t) 
    227227{
    228228  unsigned long baud, databits, parity, stopbits;
    229229
    230   baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     230  baud = rtems_termios_baud_to_number(t->c_ospeed);
    231231  if ( baud > 115200 )
    232232    rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
    233233
  • c/src/lib/libbsp/lm32/shared/milkymist_console/console.c

    diff --git a/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c b/c/src/lib/libbsp/lm32/shared/milkymist_console/console.c
    old mode 100644
    new mode 100755
    index 3558e33..de87233
    a b static int mmconsole_set_attributes(int minor, const struct termios *t) 
    4141{
    4242  int baud;
    4343
    44   switch (t->c_cflag & CBAUD) {
     44  switch (t->c_ospeed) {
    4545    case B0:
    4646      baud = 0;
    4747      break;
  • c/src/lib/libbsp/m68k/av5282/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/av5282/console/console.c b/c/src/lib/libbsp/m68k/av5282/console/console.c
    old mode 100644
    new mode 100755
    index 07a1569..f56305a
    a b static int IntUartSetAttributes( 
    179179  /* check to see if input is valid */
    180180  if ( t != (const struct termios *)0 ) {
    181181    /* determine baud rate index */
    182     baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     182    baud = rtems_termios_baud_to_number(t->c_ospeed);
    183183
    184184    /* determine data bits */
    185185    switch ( t->c_cflag & CSIZE ) {
    static int IntUartSetAttributes( 
    240240 * Description : This is the interrupt handler for the internal uart. It
    241241 * determines which channel caused the interrupt before queueing any received
    242242 * chars and dequeueing chars waiting for transmission.
    243  */ 
     243 */
    244244static rtems_isr IntUartInterruptHandler(rtems_vector_number v)
    245245{
    246246  unsigned int                chan = v - UART_INTC0_IRQ_VECTOR(0);
    static rtems_isr IntUartInterruptHandler(rtems_vector_number v) 
    303303 * Description : This initialises the internal uart hardware for all
    304304 * internal uarts. If the internal uart is to be interrupt driven then the
    305305 * interrupt vectors are hooked.
    306  */ 
     306 */
    307307static void IntUartInitialize(void)
    308308{
    309309  unsigned int              chan;
  • c/src/lib/libbsp/m68k/gen68340/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/gen68340/console/console.c b/c/src/lib/libbsp/m68k/gen68340/console/console.c
    old mode 100644
    new mode 100755
    index dd38559..5bf2c5b
    a b SetAttributes (int minor, const struct termios *t) 
    474474{
    475475 rtems_interrupt_level level;
    476476 float ispeed, ospeed;
    477  int isp, osp;
    478 
    479  /* output speed */
    480  if (t->c_cflag & CBAUDEX)
    481     osp = (t->c_cflag & CBAUD) + CBAUD + 1;
    482  else
    483     osp = t->c_cflag & CBAUD;
    484 
    485  /* input speed */
    486  isp = (t->c_cflag / (CIBAUD / CBAUD)) &  CBAUD;
    487477
    488478 /* convert it */
    489  ispeed = rtems_termios_baud_to_number(isp);
    490  ospeed = rtems_termios_baud_to_number(osp);
     479 ispeed = rtems_termios_baud_to_number(t->c_ispeed);
     480 ospeed = rtems_termios_baud_to_number(t->c_ospeed);
    491481
    492482 if (ispeed || ospeed) {
    493483       /* update config table */
    SetAttributes (int minor, const struct termios *t) 
    515505 }
    516506
    517507 /* if serial module configuration has been changed */
    518  if (t->c_cflag & (CBAUD | CIBAUD | CSIZE | PARENB)) {
     508 if (t->c_cflag & (CSIZE | PARENB)) {
    519509    rtems_interrupt_disable(level);
    520510    /* reinit the UART */
    521511    dbugInitialise();
    rtems_device_driver console_control( 
    693683{
    694684        rtems_libio_ioctl_args_t *args = arg;
    695685
    696         if (args->command == RTEMS_IO_SET_ATTRIBUTES)
     686        if (args->command == TIOCSETA)
    697687                SetAttributes (minor, (struct termios *)args->buffer);
    698688
    699689        return rtems_termios_ioctl (arg);
  • c/src/lib/libbsp/m68k/gen68360/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/gen68360/console/console.c b/c/src/lib/libbsp/m68k/gen68360/console/console.c
    old mode 100644
    new mode 100755
    index 1a8ed00..36d8470
    a b smc1SetAttributes (int minor, const struct termios *t) 
    8686{
    8787  int baud;
    8888
    89   baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     89  baud = rtems_termios_baud_to_number(t->c_ospeed);
    9090  if (baud > 0)
    9191    m360.brgc1 = smc1BRGC (baud);
    9292  return 0;
  • c/src/lib/libbsp/m68k/genmcf548x/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/genmcf548x/console/console.c b/c/src/lib/libbsp/m68k/genmcf548x/console/console.c
    old mode 100644
    new mode 100755
    index 6891e76..23186fc
    a b IntUartSetAttributes(int minor, const struct termios *t) 
    307307        if ( t != (const struct termios *)0 )
    308308        {
    309309                /* determine baud rate index */
    310                 baud = GetBaud( t->c_cflag & CBAUD );
     310    baud = GetBaud( t->c_ospeed );
    311311
    312312                /* determine data bits */
    313313                switch ( t->c_cflag & CSIZE )
  • c/src/lib/libbsp/m68k/mcf52235/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/mcf52235/console/console.c b/c/src/lib/libbsp/m68k/mcf52235/console/console.c
    old mode 100644
    new mode 100755
    index 50c642a..c2b6e36
    a b static int IntUartSetAttributes(int minor, const struct termios *t) 
    152152  /* check to see if input is valid */
    153153  if (t != (const struct termios *) 0) {
    154154    /* determine baud rate index */
    155     baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     155    baud = rtems_termios_baud_to_number(t->c_ospeed);
    156156
    157157    /* determine data bits */
    158158    switch (t->c_cflag & CSIZE) {
    rtems_device_driver console_open(rtems_device_major_number major, 
    598598    struct termios term;
    599599
    600600    if (tcgetattr(STDIN_FILENO, &term) >= 0) {
    601       term.c_cflag &= ~(CBAUD | CSIZE);
    602       term.c_cflag |= CS8 | B19200;
     601      term.c_cflag &= ~(CSIZE);
     602      term.c_cflag |= CS8;
     603      term.c_ispeed = B19200;
     604      term.c_ospeed = B19200;
    603605      tcsetattr(STDIN_FILENO, TCSANOW, &term);
    604606    }
    605607  }
  • c/src/lib/libbsp/m68k/mcf5225x/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/mcf5225x/console/console.c b/c/src/lib/libbsp/m68k/mcf5225x/console/console.c
    old mode 100644
    new mode 100755
    index 63bb644..9e36e39
    a b IntUartSet(int minor, int baud, int databits, int parity, int stopbits, 
    150150   Description : This provides the hardware-dependent portion of tcsetattr().
    151151   value and sets it. At the moment this just sets the baud rate.
    152152
    153    Note: The highest baudrate is 115200 as this stays within 
     153   Note: The highest baudrate is 115200 as this stays within
    154154   an error of +/- 5% at 25MHz processor clock
    155155 ***************************************************************************/
    156156static int IntUartSetAttributes(int minor, const struct termios *t)
    static int IntUartSetAttributes(int minor, const struct termios *t) 
    166166  /* check to see if input is valid */
    167167  if (t != (const struct termios *) 0) {
    168168    /* determine baud rate index */
    169     baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     169    baud = rtems_termios_baud_to_number(t->c_ospeed);
    170170
    171171    /* determine data bits */
    172172    switch (t->c_cflag & CSIZE) {
    static rtems_isr IntUartInterruptHandler(rtems_vector_number v) 
    243243                else
    244244                        MCF_GPIO_PORTTC |= MCF_GPIO_PORTTC_PORTTC0;
    245245#endif
    246                
     246
    247247    /* read data and put into the receive buffer */
    248248    while (MCF_UART_USR(chan) & MCF_UART_USR_RXRDY) {
    249249
    static void IntUartInitialize(void) 
    359359/***************************************************************************
    360360   Function : IntUartInterruptWrite
    361361
    362    Description : This writes a single character to the appropriate uart 
     362   Description : This writes a single character to the appropriate uart
    363363   channel. This is either called during an interrupt or in the user's task
    364    to initiate a transmit sequence. Calling this routine enables Tx 
     364   to initiate a transmit sequence. Calling this routine enables Tx
    365365   interrupts.
    366366 ***************************************************************************/
    367367static ssize_t IntUartInterruptWrite(int minor, const char *buf, size_t len)
    static int IntUartTaskRead(int minor) 
    476476/***************************************************************************
    477477   Function : IntUartPollRead
    478478
    479    Description : This reads a character from the internal uart. It returns 
     479   Description : This reads a character from the internal uart. It returns
    480480   to the caller without blocking if not character is waiting.
    481481 ***************************************************************************/
    482482static
    int IntUartPollRead(int minor) 
    491491/***************************************************************************
    492492   Function : IntUartPollWrite
    493493
    494    Description : This writes out each character in the buffer to the 
    495    appropriate internal uart channel waiting till each one is sucessfully 
     494   Description : This writes out each character in the buffer to the
     495   appropriate internal uart channel waiting till each one is sucessfully
    496496   transmitted.
    497497 ***************************************************************************/
    498498static ssize_t IntUartPollWrite(int minor, const char *buf, size_t len)
    rtems_device_driver console_initialize(rtems_device_major_number major, 
    562562/***************************************************************************
    563563   Function : console_open
    564564
    565    Description : This actually opens the device depending on the minor 
     565   Description : This actually opens the device depending on the minor
    566566   number set during initialisation. The device specific access routines are
    567567   passed to termios when the devices is opened depending on whether it is
    568568   polled or not.
    rtems_device_driver console_open(rtems_device_major_number major, 
    631631    struct termios term;
    632632
    633633    if (tcgetattr(STDIN_FILENO, &term) >= 0) {
    634       term.c_cflag &= ~(CBAUD | CSIZE);
    635       term.c_cflag |= CS8 | B115200;
     634      term.c_cflag &= ~(CSIZE);
     635      term.c_cflag |= CS8;
     636      term.c_ispeed = B115200;
     637      term.c_ospeed = B115200;
    636638      tcsetattr(STDIN_FILENO, TCSANOW, &term);
    637639    }
    638640  }
  • c/src/lib/libbsp/m68k/mcf5235/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/mcf5235/console/console.c b/c/src/lib/libbsp/m68k/mcf5235/console/console.c
    old mode 100644
    new mode 100755
    index 3f50b6a..6fd92aa
    a b IntUartSetAttributes(int minor, const struct termios *t) 
    174174        if ( t != (const struct termios *)0 )
    175175        {
    176176                /* determine baud rate index */
    177                 baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     177    baud = rtems_termios_baud_to_number(t->c_ospeed);
    178178
    179179                /* determine data bits */
    180180                switch ( t->c_cflag & CSIZE )
    rtems_device_driver console_open( 
    681681    struct termios term;
    682682    if (tcgetattr (STDIN_FILENO, &term) >= 0)
    683683    {
    684       term.c_cflag &= ~(CBAUD | CSIZE);
    685       term.c_cflag |= CS8 | B19200;
     684      term.c_cflag &= ~(CSIZE);
     685      term.c_cflag |= CS8;
     686      term.c_ispeed = B19200;
     687      term.c_ospeed = B19200;
    686688      tcsetattr (STDIN_FILENO, TCSANOW, &term);
    687689    }
    688690  }
  • c/src/lib/libbsp/m68k/mcf5329/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/mcf5329/console/console.c b/c/src/lib/libbsp/m68k/mcf5329/console/console.c
    old mode 100644
    new mode 100755
    index dfae857..ba4a7d9
    a b static int IntUartSetAttributes(int minor, const struct termios *t) 
    170170  /* check to see if input is valid */
    171171  if (t != (const struct termios *) 0) {
    172172    /* determine baud rate index */
    173     baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     173    baud = rtems_termios_baud_to_number(t->c_ospeed);
    174174
    175175    /* determine data bits */
    176176    switch (t->c_cflag & CSIZE) {
    rtems_device_driver console_open(rtems_device_major_number major, 
    613613    struct termios term;
    614614
    615615    if (tcgetattr(STDIN_FILENO, &term) >= 0) {
    616       term.c_cflag &= ~(CBAUD | CSIZE);
    617       term.c_cflag |= CS8 | B19200;
     616      term.c_cflag &= ~(CSIZE);
     617      term.c_cflag |= CS8;
     618      term.c_ispeed = B19200;
     619      term.c_ospeed = B19200;
    618620      tcsetattr(STDIN_FILENO, TCSANOW, &term);
    619621    }
    620622  }
  • c/src/lib/libbsp/m68k/mrm332/console/sci.c

    diff --git a/c/src/lib/libbsp/m68k/mrm332/console/sci.c b/c/src/lib/libbsp/m68k/mrm332/console/sci.c
    old mode 100644
    new mode 100755
    index a0f8cc0..4cd9f250
    a b int SciSetAttributes( 
    675675    /* if you look closely you will see this is the only thing we use */
    676676    /* set the baud rate */
    677677
    678     baud_requested = t->c_cflag & CBAUD;        /* baud rate */
     678    baud_requested = t->c_ospeed;        /* baud rate */
    679679
    680680    if (!baud_requested)
    681681    {
  • c/src/lib/libbsp/m68k/mvme167/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/mvme167/console/console.c b/c/src/lib/libbsp/m68k/mvme167/console/console.c
    old mode 100644
    new mode 100755
    index 9ac8f70..1e0935d
    a b int cd2401_firstOpen( 
    725725   * We could have made a tcgetattr() call if we had our fd.
    726726   */
    727727  newarg.iop = args->iop;
    728   newarg.command = RTEMS_IO_GET_ATTRIBUTES;
     728  newarg.command = TIOCGETA;
    729729  newarg.buffer = &termios;
    730730  sc = rtems_termios_ioctl (&newarg);
    731731  if (sc != RTEMS_SUCCESSFUL)
    int cd2401_firstOpen( 
    738738   *  on the ttyMutex that it already owns; this is safe in RTEMS.
    739739   */
    740740  termios.c_cflag |= CLOCAL;    /* Ignore modem status lines */
    741   newarg.command = RTEMS_IO_SET_ATTRIBUTES;
     741  newarg.command = TIOCSETA;
    742742  sc = rtems_termios_ioctl (&newarg);
    743743  if (sc != RTEMS_SUCCESSFUL)
    744744    rtems_fatal_error_occurred (sc);
    int cd2401_setAttributes( 
    844844  /* Determine what the line parameters should be */
    845845
    846846  /* baud rates */
    847   out_baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
    848   in_baud  = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     847  out_baud = rtems_termios_baud_to_number(t->c_ospeed);
     848  in_baud  = rtems_termios_baud_to_number(t->c_ispeed);
    849849
    850850  /* Number of bits per char */
    851851  csize = 0x07; /* to avoid a warning */
  • c/src/lib/libbsp/m68k/uC5282/console/console.c

    diff --git a/c/src/lib/libbsp/m68k/uC5282/console/console.c b/c/src/lib/libbsp/m68k/uC5282/console/console.c
    old mode 100644
    new mode 100755
    index 0f08cea..562e028
    a b IntUartSetAttributes(int minor, const struct termios *t) 
    190190        if ( t != (const struct termios *)0 )
    191191        {
    192192                /* determine baud rate index */
    193                 baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     193      baud = rtems_termios_baud_to_number(t->c_ospeed);
    194194
    195195                /* determine data bits */
    196196                switch ( t->c_cflag & CSIZE )
    IntUartInterruptOpen(int major, int minor, void *arg) 
    447447                MCF5282_GPIO_PUAPAR |= MCF5282_GPIO_PUAPAR_PUAPA3|MCF5282_GPIO_PUAPAR_PUAPA2;
    448448                break;
    449449        case 2:
    450                 MCF5282_GPIO_PASPAR = 
     450                MCF5282_GPIO_PASPAR =
    451451                  (MCF5282_GPIO_PASPAR
    452452                   & ~(MCF5282_GPIO_PASPAR_PASPA3(3)|MCF5282_GPIO_PASPAR_PASPA2(3)))
    453453                  |  (MCF5282_GPIO_PASPAR_PASPA3(2)|MCF5282_GPIO_PASPAR_PASPA2(2));
  • c/src/lib/libbsp/powerpc/acinclude.m4

    diff --git a/c/src/lib/libbsp/powerpc/acinclude.m4 b/c/src/lib/libbsp/powerpc/acinclude.m4
    index 4c83475..edc67b5 100644
    a b AC_DEFUN([RTEMS_CHECK_BSPDIR], 
    3232    AC_CONFIG_SUBDIRS([t32mppc]);;
    3333  tqm8xx )
    3434    AC_CONFIG_SUBDIRS([tqm8xx]);;
    35   virtex )
    36     AC_CONFIG_SUBDIRS([virtex]);;
    3735  virtex4 )
    3836    AC_CONFIG_SUBDIRS([virtex4]);;
    3937  virtex5 )
    4038    AC_CONFIG_SUBDIRS([virtex5]);;
     39  virtex )
     40    AC_CONFIG_SUBDIRS([virtex]);;
    4141  *)
    4242    AC_MSG_ERROR([Invalid BSP]);;
    4343  esac
  • c/src/lib/libbsp/powerpc/gen5200/console/console.c

    diff --git a/c/src/lib/libbsp/powerpc/gen5200/console/console.c b/c/src/lib/libbsp/powerpc/gen5200/console/console.c
    old mode 100644
    new mode 100755
    index 26f5558..754a527
    a b static int mpc5200_psc_setAttributes( 
    192192    (struct mpc5200_psc *)(&mpc5200.psc[psc_minor_to_regset[minor]]);
    193193
    194194  /* Baud rate */
    195   baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     195  baud = rtems_termios_baud_to_number(t->c_ospeed);
    196196  if (baud > 0) {
    197197   /*
    198198    * Calculate baud rate
  • c/src/lib/libbsp/powerpc/shared/console/console.c

    diff --git a/c/src/lib/libbsp/powerpc/shared/console/console.c b/c/src/lib/libbsp/powerpc/shared/console/console.c
    old mode 100644
    new mode 100755
    index 082cbd9..f275683
    a b static int conSetAttr( 
    304304{
    305305  rtems_termios_baud_t baud;
    306306
    307   baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
     307  baud = rtems_termios_baud_to_number(t->c_ospeed);
    308308  if ( baud > 115200 )
    309309    rtems_fatal_error_occurred (RTEMS_INTERNAL_ERROR);
    310310
  • c/src/lib/libbsp/powerpc/tqm8xx/console/console.c

    diff --git a/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c b/c/src/lib/libbsp/powerpc/tqm8xx/console/console.c
    old mode 100644
    new mode 100755
    index e0b4c70..e109303
    a b sccSetAttributes (int minor, const struct termios *t) 
    392392{
    393393  int baud;
    394394
    395   switch (t->c_cflag & CBAUD) {
     395  switch (t->c_ospeed) {
    396396  default:      baud = -1;      break;
    397397  case B50:     baud = 50;      break;
    398398  case B75:     baud = 75;      break;
  • c/src/lib/libbsp/shared/console.c

    diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
    old mode 100644
    new mode 100755
    index b4af1b3..b8a078f
    a b rtems_device_driver console_open( 
    244244       * If this is not the console we do not want ECHO and so forth
    245245       */
    246246      IoctlArgs.iop     = args->iop;
    247       IoctlArgs.command = RTEMS_IO_GET_ATTRIBUTES;
     247      IoctlArgs.command = TIOCGETA;
    248248      IoctlArgs.buffer  = &Termios;
    249249      rtems_termios_ioctl( &IoctlArgs );
    250250
    251251      Termios.c_lflag   = ICANON;
    252       IoctlArgs.command = RTEMS_IO_SET_ATTRIBUTES;
     252      IoctlArgs.command = TIOCSETA;
    253253      rtems_termios_ioctl( &IoctlArgs );
    254254    }
    255255  }
  • c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c

    diff --git a/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c b/c/src/lib/libbsp/sparc/shared/uart/apbuart_cons.c
    old mode 100644
    new mode 100755
    index 50805f1..aa69670
    a b  
    3939#ifdef DEBUG
    4040#define DBG(x...) printk(x)
    4141#else
    42 #define DBG(x...) 
     42#define DBG(x...)
    4343#endif
    4444
    4545/* LEON3 Low level transmit/receive functions provided by debug-uart code */
    static int apbuart_info( 
    8585#define APBUART_INFO_FUNC NULL
    8686#endif
    8787
    88 struct drvmgr_drv_ops apbuart_ops = 
     88struct drvmgr_drv_ops apbuart_ops =
    8989{
    9090        .init = {apbuart_init1, NULL, NULL, NULL},
    9191        .remove = NULL,
    int apbuart_set_attributes(int minor, const struct termios *t) 
    567567        uart->regs->ctrl = ctrl;
    568568
    569569        /* Baud rate */
    570         baud = apbuart_baud_num2baud(t->c_cflag & CBAUD);
     570  baud = apbuart_baud_num2baud(t->c_ospeed);
    571571        if (baud > 0){
    572572                /* Get APBUART core frequency */
    573573                drvmgr_freq_get(uart->dev, DEV_APB_SLV, &core_clk_hz);
    void apbuart_get_attributes(struct console_dev *condev, struct termios *t) 
    588588        unsigned int ctrl;
    589589        struct apbuart_baud *baud;
    590590
    591         t->c_cflag = t->c_cflag & ~(CSIZE|PARENB|PARODD|CLOCAL|CBAUD);
     591        t->c_cflag = t->c_cflag & ~(CSIZE|PARENB|PARODD|CLOCAL);
    592592
    593593        /* Hardware support only CS8 */
    594594        t->c_cflag |= CS8;
  • c/src/lib/libcpu/arm/at91rm9200/usart/usart.c

    diff --git a/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c b/c/src/lib/libcpu/arm/at91rm9200/usart/usart.c
    old mode 100644
    new mode 100755
    index c552899..23b877c
    a b static int usart_set_attributes(int minor, const struct termios *t) 
    240240   } else
    241241        mode |= US_MR_PAR_NONE;
    242242
    243   baud_requested = t->c_cflag & CBAUD;
     243  baud_requested = t->c_ospeed;
    244244
    245245  /* If not, set the dbgu console baud as USART baud default */
    246246  if (!baud_requested)
  • c/src/lib/libcpu/bfin/serial/uart.c

    diff --git a/c/src/lib/libcpu/bfin/serial/uart.c b/c/src/lib/libcpu/bfin/serial/uart.c
    old mode 100644
    new mode 100755
    index 79f0941..617c59d
    a b  
    99 *  found in the file LICENSE in this distribution or at
    1010 *  http://www.rtems.org/license/LICENSE.
    1111 */
    12  
     12
    1313#include <rtems.h>
    1414#include <rtems/libio.h>
    1515#include <rtems/termiostypes.h>
    static int setAttributes(int minor, const struct termios *termios) 
    159159  uint16_t lcr;
    160160
    161161  base = uartsConfig->channels[minor].uart_baseAddress;
    162   switch (termios->c_cflag & CBAUD) {
     162  switch (termios->c_ospeed) {
    163163    case B0:      baud = 0;      break;
    164164    case B50:     baud = 50;     break;
    165165    case B75:     baud = 75;     break;
  • c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c

    diff --git a/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c b/c/src/lib/libcpu/powerpc/mpc55xx/esci/esci.c
    old mode 100644
    new mode 100755
    index f8101d7..a500743b
    a b static int mpc55xx_esci_termios_set_attributes( int minor, const struct termios 
    362362        cr1.B.TE = 1;
    363363
    364364        /* Baud rate */
    365         switch (t->c_cflag & CBAUD) {
     365  switch (t->c_ospeed) {
    366366                case B50: br = 50; break;
    367367                case B75: br = 75; break;
    368368                case B110: br = 110; break;
  • c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c

    diff --git a/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc5xx/console-generic/console-generic.c
    old mode 100644
    new mode 100755
    index 22fee2d..c1de9c5
    a b m5xx_uart_setAttributes( 
    190190    return RTEMS_INVALID_NUMBER;
    191191
    192192  /* Baud rate */
    193   baud = rtems_termios_baud_to_number( t->c_cflag & CBAUD );
     193  baud = rtems_termios_baud_to_number( t->c_ospeed );
    194194  if (baud > 0) {
    195195    sccr0 &= ~QSMCM_SCI_BAUD(-1);
    196196    sccr0 |= QSMCM_SCI_BAUD((bsp_clock_speed + (16 * baud)) / (32 * baud));
  • c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c

    diff --git a/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8260/console-generic/console-generic.c
    old mode 100644
    new mode 100755
    index e325acc..4bfb640
    a b m8xx_smc_set_attributes (int minor, const struct termios *t) 
    108108  uint16_t   clen=0, cstopb, parenb, parodd, cread;
    109109
    110110  /* Baud rate */
    111   switch (t->c_cflag & CBAUD) {
     111  switch (t->c_ospeed) {
    112112  default:      baud = -1;      break;
    113113  case B50:     baud = 50;      break;
    114114  case B75:     baud = 75;      break;
    m8xx_scc_set_attributes (int minor, const struct termios *t) 
    221221  uint16_t   csize=0, cstopb, parenb, parodd;
    222222
    223223  /* Baud rate */
    224   switch (t->c_cflag & CBAUD) {
     224  switch (t->c_ospeed) {
    225225  default:      baud = -1;      break;
    226226  case B50:     baud = 50;      break;
    227227  case B75:     baud = 75;      break;
  • c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c

    diff --git a/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c b/c/src/lib/libcpu/powerpc/mpc8xx/console-generic/console-generic.c
    old mode 100644
    new mode 100755
    index d7fd8b4..e015a64
    a b m8xx_smc_set_attributes (int minor, const struct termios *t) 
    175175  uint16_t   clen=0, cstopb, parenb, parodd, cread;
    176176
    177177  /* Baud rate */
    178   switch (t->c_cflag & CBAUD) {
     178  switch (t->c_ospeed) {
    179179  default:      baud = -1;      break;
    180180  case B50:     baud = 50;      break;
    181181  case B75:     baud = 75;      break;
    m8xx_scc_set_attributes (int minor, const struct termios *t) 
    271271  uint16_t   csize=0, cstopb, parenb, parodd;
    272272
    273273  /* Baud rate */
    274   switch (t->c_cflag & CBAUD) {
     274  switch (t->c_ospeed) {
    275275  default:      baud = -1;      break;
    276276  case B50:     baud = 50;      break;
    277277  case B75:     baud = 75;      break;
  • c/src/lib/libcpu/powerpc/ppc403/console/console.c

    diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console.c b/c/src/lib/libcpu/powerpc/ppc403/console/console.c
    old mode 100644
    new mode 100755
    index 0e74879..0e0bbd7
    a b spiSetAttributes (int minor, const struct termios *t) 
    224224
    225225  /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */
    226226  /* FIXME: check and IMPLEMENT XON/XOFF                     */
    227   switch (t->c_cflag & CBAUD) {
     227  switch (t->c_ospeed) {
    228228  default:      baud = -1;      break;
    229229  case B50:     baud = 50;      break;
    230230  case B75:     baud = 75;      break;
  • c/src/lib/libcpu/powerpc/ppc403/console/console405.c

    diff --git a/c/src/lib/libcpu/powerpc/ppc403/console/console405.c b/c/src/lib/libcpu/powerpc/ppc403/console/console405.c
    old mode 100644
    new mode 100755
    index cf93658..96c3534
    a b spiSetAttributes (int minor, const struct termios *t) 
    216216
    217217  /* FIXME: check c_cflag & CRTSCTS for hardware flowcontrol */
    218218  /* FIXME: check and IMPLEMENT XON/XOFF                     */
    219   switch (t->c_cflag & CBAUD) {
     219  switch (t->c_ospeed) {
    220220  default:      baud = -1;      break;
    221221  case B50:     baud = 50;      break;
    222222  case B75:     baud = 75;      break;
  • c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c

    diff --git a/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c b/c/src/lib/libcpu/powerpc/ppc403/tty_drv/tty_drv.c
    old mode 100644
    new mode 100755
    index 1d7b013..3e79bbf
    a b tty0SetAttributes (int minor, const struct termios *t) 
    181181
    182182  /* FIXME: check c_cflag & CRTSCTS for hardware flow control */
    183183  /* FIXME: check and IMPLEMENT XON/XOFF                     */
    184   switch (t->c_cflag & CBAUD) {
     184  switch (t->c_ospeed) {
    185185  default:      baud = -1;      break;
    186186  case B50:     baud = 50;      break;
    187187  case B75:     baud = 75;      break;
  • c/src/lib/libcpu/sh/sh7032/sci/sci.c

    diff --git a/c/src/lib/libcpu/sh/sh7032/sci/sci.c b/c/src/lib/libcpu/sh/sh7032/sci/sci.c
    old mode 100644
    new mode 100755
    index c9db0fe..8a099cf
    a b struct scidev_t { 
    5454
    5555/*  imported from scitab.rel */
    5656extern int _sci_get_brparms(
    57   tcflag_t      cflag,
     57  speed_t       spd,
    5858  unsigned char *smr,
    5959  unsigned char *brr );
    6060
    6161/* Translate termios' tcflag_t into sci settings */
    6262static int _sci_set_cflags(
    6363  struct scidev_t      *sci_dev,
    64   tcflag_t      c_cflag )
     64  speed_t       spd )
    6565{
    6666  uint8_t       smr ;
    6767  uint8_t       brr ;
    6868
    69   if ( c_cflag & CBAUD )
     69  if ( spd )
    7070  {
    71     if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 )
     71    if ( _sci_get_brparms( spd, &smr, &brr ) != 0 )
    7272      return -1 ;
    7373  }
    7474
  • c/src/lib/libcpu/sh/sh7045/sci/sci.c

    diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci.c b/c/src/lib/libcpu/sh/sh7045/sci/sci.c
    old mode 100644
    new mode 100755
    index 690035a..882eb45
    a b static sci_setup_t sio_param[2]; 
    9696/* Translate termios' tcflag_t into sci settings */
    9797static int _sci_set_cflags(
    9898  struct scidev_t  *sci_dev,
    99   tcflag_t          c_cflag
     99  speed_t           spd
    100100)
    101101{
    102102  uint8_t  smr;
    103103  uint8_t  brr;
    104104
    105   if ( c_cflag & CBAUD )
     105  if ( spd )
    106106  {
    107     if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 )
     107    if ( _sci_get_brparms( spd, &smr, &brr ) != 0 )
    108108      return -1;
    109109  }
    110110
  • c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c

    diff --git a/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c b/c/src/lib/libcpu/sh/sh7045/sci/sci_termios.c
    old mode 100644
    new mode 100755
    index db9040e..645a433
    a b  
    5959 * Automatically generated function imported from scitab.rel
    6060 */
    6161extern int _sci_get_brparms(
    62   tcflag_t      cflag,
     62  speed_t       spd,
    6363  unsigned char *smr,
    6464  unsigned char *brr
    6565);
    int sh_sci_set_attributes( 
    7676    uint8_t     brr;
    7777    int a;
    7878
    79     tcflag_t c_cflag = t->c_cflag;
     79    speed_t spd = t->c_ospeed;
    8080
    81     if ( c_cflag & CBAUD ) {
    82         if ( _sci_get_brparms( c_cflag, &smr, &brr ) != 0 )
     81    if ( spd ) {
     82        if ( _sci_get_brparms( spd, &smr, &brr ) != 0 )
    8383            return -1 ;
    8484    }
    8585
  • c/src/libchip/serial/mc68681.c

    diff --git a/c/src/libchip/serial/mc68681.c b/c/src/libchip/serial/mc68681.c
    old mode 100644
    new mode 100755
    index afa850e..a9ca05d
    a b MC68681_STATIC int mc68681_baud_rate( 
    581581      break;
    582582  }
    583583
    584   baud_requested = baud & CBAUD;
     584  baud_requested = baud;
    585585  if (!baud_requested)
    586586    baud_requested = B9600;              /* default to 9600 baud */
    587587
  • c/src/libchip/serial/mc68681_baud.c

    diff --git a/c/src/libchip/serial/mc68681_baud.c b/c/src/libchip/serial/mc68681_baud.c
    old mode 100644
    new mode 100755
    index a27e6c9..0f8e87c
    a b mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { 
    3030    0x0B,                      /* B9600 */
    3131    MC68681_BAUD_NOT_VALID,    /* B19200 */
    3232    0x0C,                      /* B38400 */
     33    MC68681_BAUD_NOT_VALID,    /* B7200 */
     34    MC68681_BAUD_NOT_VALID,    /* B14400 */
     35    MC68681_BAUD_NOT_VALID,    /* B28800 */
    3336    MC68681_BAUD_NOT_VALID,    /* B57600 */
     37    MC68681_BAUD_NOT_VALID,    /* B76800 */
    3438    MC68681_BAUD_NOT_VALID,    /* B115200 */
    3539    MC68681_BAUD_NOT_VALID,    /* B230400 */
    36     MC68681_BAUD_NOT_VALID     /* B460800 */
     40    MC68681_BAUD_NOT_VALID,    /* B460800 */
     41    MC68681_BAUD_NOT_VALID     /* B921600 */
    3742  },
    3843  { /* ACR[7] = 1, X = 0 */
    3944    MC68681_BAUD_NOT_VALID,    /* B0 */
    mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { 
    5257    0x0B,                      /* B9600 */
    5358    0x0C,                      /* B19200 */
    5459    MC68681_BAUD_NOT_VALID,    /* B38400 */
     60    MC68681_BAUD_NOT_VALID,    /* B7200 */
     61    MC68681_BAUD_NOT_VALID,    /* B14400 */
     62    MC68681_BAUD_NOT_VALID,    /* B28800 */
    5563    MC68681_BAUD_NOT_VALID,    /* B57600 */
     64    MC68681_BAUD_NOT_VALID,    /* B76800 */
    5665    MC68681_BAUD_NOT_VALID,    /* B115200 */
    5766    MC68681_BAUD_NOT_VALID,    /* B230400 */
    58     MC68681_BAUD_NOT_VALID     /* B460800 */
     67    MC68681_BAUD_NOT_VALID,    /* B460800 */
     68    MC68681_BAUD_NOT_VALID     /* B921600 */
    5969  },
    6070  { /* ACR[7] = 0, X = 1 */
    6171    MC68681_BAUD_NOT_VALID,    /* B0 */
    mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { 
    7484    0x0B,                      /* B9600 */
    7585    0x0C,                      /* B19200 */
    7686    MC68681_BAUD_NOT_VALID,    /* B38400 */
     87    MC68681_BAUD_NOT_VALID,    /* B7200 */
     88    MC68681_BAUD_NOT_VALID,    /* B14400 */
     89    MC68681_BAUD_NOT_VALID,    /* B28800 */
    7790    0x07,                      /* B57600 */
     91    MC68681_BAUD_NOT_VALID,    /* B76800 */
    7892    0x08,                      /* B115200 */
    7993    MC68681_BAUD_NOT_VALID,    /* B230400 */
    80     MC68681_BAUD_NOT_VALID     /* B460800 */
     94    MC68681_BAUD_NOT_VALID,    /* B460800 */
     95    MC68681_BAUD_NOT_VALID     /* B921600 */
    8196  },
    8297  { /* ACR[7] = 1, X = 1 */
    8398    MC68681_BAUD_NOT_VALID,    /* B0 */
    mc68681_baud_t mc68681_baud_rate_table[4][RTEMS_TERMIOS_NUMBER_BAUD_RATES] = { 
    96111    0x0B,                      /* B9600 */
    97112    MC68681_BAUD_NOT_VALID,    /* B19200 */
    98113    0x0C,                      /* B38400 */
     114    MC68681_BAUD_NOT_VALID,    /* B7200 */
     115    MC68681_BAUD_NOT_VALID,    /* B14400 */
     116    MC68681_BAUD_NOT_VALID,    /* B28800 */
    99117    0x07,                      /* B57600 */
     118    MC68681_BAUD_NOT_VALID,    /* B76800 */
    100119    0x08,                      /* B115200 */
    101120    MC68681_BAUD_NOT_VALID,    /* B230400 */
    102     MC68681_BAUD_NOT_VALID     /* B460800 */
     121    MC68681_BAUD_NOT_VALID,    /* B460800 */
     122    MC68681_BAUD_NOT_VALID     /* B921600 */
    103123  },
    104124};
  • c/src/libchip/serial/z85c30.c

    diff --git a/c/src/libchip/serial/z85c30.c b/c/src/libchip/serial/z85c30.c
    old mode 100644
    new mode 100755
    index 7c55a51..55df9d3
    a b Z85C30_STATIC int z85c30_set_attributes( 
    449449   *  Assert ensures there is no division by 0.
    450450   */
    451451
    452   baud_requested = t->c_cflag & CBAUD;
     452  baud_requested = t->c_ospeed;
    453453  if (!baud_requested)
    454454    baud_requested = B9600;              /* default to 9600 baud */
    455455