Changeset 29e214e in rtems


Ignore:
Timestamp:
Sep 26, 2003, 5:33:59 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
2e9d1ef5
Parents:
174bf23
Message:

2003-09-26 Cedric Aubert <cedric_aubert@…>

PR 501/rtems_misc

  • console.c: console_open disables ICANON on non-console port, which should be ok for the first open but not for subsequent ones. If you open one serial port, you will configure it, when you reopen it you will lost the ICANON parameters if you had put it. Should be done by console only at first open.
Location:
c/src/lib/libbsp/shared
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/shared/ChangeLog

    r174bf23 r29e214e  
     12003-09-26      Cedric Aubert <cedric_aubert@yahoo.fr>
     2
     3        PR 501/rtems_misc
     4        * console.c: console_open disables ICANON on non-console port, which
     5        should be ok for the first open but not for subsequent ones. If you
     6        open one serial port, you will configure it, when you reopen it you
     7        will lost the ICANON parameters if you had put it. Should be done by
     8        console only at first open.
     9
    1102003-09-04      Joel Sherrill <joel@OARcorp.com>
    211
  • c/src/lib/libbsp/shared/console.c

    r174bf23 r29e214e  
    2121#include <termios.h>
    2222
     23#include <rtems/termiostypes.h>
    2324#include <libchip/serial.h>
    2425
     
    5152  rtems_termios_callbacks        Callbacks;
    5253  console_tbl                   *cptr;
     54  struct rtems_termios_tty      *current_tty;
    5355
    5456  /*
     
    8082  status = rtems_termios_open ( major, minor, arg, &Callbacks );
    8183  Console_Port_Data[minor].termios_data = args->iop->data1;
    82 
    83   if (minor!=Console_Port_Minor) {
    84     /*
    85      * If this is not the console we do not want ECHO and
    86      * so forth
    87      */
    88     IoctlArgs.iop=args->iop;
    89     IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
    90     IoctlArgs.buffer=&Termios;
    91     rtems_termios_ioctl(&IoctlArgs);
    92     Termios.c_lflag=ICANON;
    93     IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
    94     rtems_termios_ioctl(&IoctlArgs);
     84 
     85  /* Get tty pointeur from the Console_Port_Data */
     86  current_tty = Console_Port_Data[minor].termios_data;
     87 
     88  if ( (current_tty->refcount == 1) ) {
     89  /*
     90   * If it's the first open, modified, if need, the port parameters
     91   */
     92        if (minor!=Console_Port_Minor) {
     93                /*
     94                 * If this is not the console we do not want ECHO and
     95                 * so forth
     96                 */
     97                IoctlArgs.iop=args->iop;
     98                IoctlArgs.command=RTEMS_IO_GET_ATTRIBUTES;
     99                IoctlArgs.buffer=&Termios;
     100                rtems_termios_ioctl(&IoctlArgs);
     101                Termios.c_lflag=ICANON;
     102                IoctlArgs.command=RTEMS_IO_SET_ATTRIBUTES;
     103                rtems_termios_ioctl(&IoctlArgs);
     104        }
    95105  }
    96106
Note: See TracChangeset for help on using the changeset viewer.