From a830cb864d4cd1b4d386844a53da4f5eef81d3c0 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 7 Oct 2014 16:27:51 +0200 Subject: termios: Separate flow control from normal handler --- cpukit/libcsupport/include/rtems/termiostypes.h | 35 ++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'cpukit/libcsupport/include/rtems/termiostypes.h') diff --git a/cpukit/libcsupport/include/rtems/termiostypes.h b/cpukit/libcsupport/include/rtems/termiostypes.h index 6339456b20..045a91f4c2 100644 --- a/cpukit/libcsupport/include/rtems/termiostypes.h +++ b/cpukit/libcsupport/include/rtems/termiostypes.h @@ -143,6 +143,18 @@ typedef struct { const struct termios *term ); + /** + * @brief Termios device mode. + */ + rtems_termios_device_mode mode; +} rtems_termios_device_handler; + +/** + * @brief Termios device flow control handler. + * + * @see rtems_termios_device_install(). + */ +typedef struct { /** * @brief Indicate to stop remote transmitter. * @@ -160,12 +172,7 @@ typedef struct { * @see rtems_termios_get_device_context(). */ void (*start_remote_tx)(struct rtems_termios_tty *tty); - - /** - * @brief Termios device mode. - */ - rtems_termios_device_mode mode; -} rtems_termios_device_handler; +} rtems_termios_device_flow; /** * @brief Termios device node for installed devices. @@ -177,6 +184,7 @@ typedef struct rtems_termios_device_node { rtems_device_major_number major; rtems_device_minor_number minor; const rtems_termios_device_handler *handler; + const rtems_termios_device_flow *flow; void *context; struct rtems_termios_tty *tty; } rtems_termios_device_node; @@ -254,6 +262,11 @@ typedef struct rtems_termios_tty { */ rtems_termios_device_handler handler; + /** + * @brief The device flow control handler. + */ + rtems_termios_device_flow flow; + volatile unsigned int flow_ctrl; unsigned int lowwater,highwater; @@ -295,11 +308,14 @@ typedef struct rtems_termios_tty { * @brief Installs a Termios device. * * @param[in] device_file If not @c NULL, then a device file for the specified - * major and minor number will be created. + * major and minor number will be created. * @param[in] major The device major number of the corresponding device driver. * @param[in] minor The device minor number of the corresponding device driver. * @param[in] handler The device handler. It must be persistent throughout the * installed time of the device. + * @param[in] flow The device flow control handler. The device flow control + * handler are optional and may be @c NULL. If present must be persistent + * throughout the installed time of the device. * @param[in] context The device context. It must be persistent throughout the * installed time of the device. * @@ -307,17 +323,18 @@ typedef struct rtems_termios_tty { * @retval RTEMS_NO_MEMORY Not enough memory to create a device node. * @retval RTEMS_UNSATISFIED Creation of the device file failed. * @retval RTEMS_RESOURCE_IN_USE There exists a device node for this major and - * minor number pair. + * minor number pair. * @retval RTEMS_INCORRECT_STATE Termios is not initialized. * * @see rtems_termios_device_remove(), rtems_termios_device_open(), - * rtems_termios_device_close() and rtems_termios_get_device_context(). + * rtems_termios_device_close() and rtems_termios_get_device_context(). */ rtems_status_code rtems_termios_device_install( const char *device_file, rtems_device_major_number major, rtems_device_minor_number minor, const rtems_termios_device_handler *handler, + const rtems_termios_device_flow *flow, void *context ); -- cgit v1.2.3