From 8074342c9b0c315bc8e69cc0391e01972fe2ff95 Mon Sep 17 00:00:00 2001 From: Christian Mauderer Date: Thu, 3 Jul 2014 12:55:42 +0200 Subject: termios: Add rtems_termios_get_termios() --- cpukit/libcsupport/include/rtems/termiostypes.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/cpukit/libcsupport/include/rtems/termiostypes.h b/cpukit/libcsupport/include/rtems/termiostypes.h index 80912b662e..df3ec0c2d7 100644 --- a/cpukit/libcsupport/include/rtems/termiostypes.h +++ b/cpukit/libcsupport/include/rtems/termiostypes.h @@ -78,7 +78,7 @@ typedef struct { * @retval true Successful operation. * @retval false Cannot open device. * - * @see rtems_termios_get_device_context(). + * @see rtems_termios_get_device_context() and rtems_termios_get_termios(). */ bool (*first_open)( struct rtems_termios_tty *tty, @@ -372,6 +372,19 @@ RTEMS_INLINE_ROUTINE void *rtems_termios_get_device_context( return tty->device_context; } +/** + * @brief Returns the Termios structure. + * + * It can be used for example in the first open handler to adjust or obtain the + * initial attributes. + */ +RTEMS_INLINE_ROUTINE struct termios *rtems_termios_get_termios( + const rtems_termios_tty *tty +) +{ + return &tty->termios; +} + struct rtems_termios_linesw { int (*l_open) (struct rtems_termios_tty *tp); int (*l_close)(struct rtems_termios_tty *tp); -- cgit v1.2.3