Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:34

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  * @file termios_testdriver.h
0005  */
0006 
0007 /*
0008  *  COPYRIGHT (c) 1989-2009.
0009  *  On-Line Applications Research Corporation (OAR).
0010  *
0011  * Redistribution and use in source and binary forms, with or without
0012  * modification, are permitted provided that the following conditions
0013  * are met:
0014  * 1. Redistributions of source code must retain the above copyright
0015  *    notice, this list of conditions and the following disclaimer.
0016  * 2. Redistributions in binary form must reproduce the above copyright
0017  *    notice, this list of conditions and the following disclaimer in the
0018  *    documentation and/or other materials provided with the distribution.
0019  *
0020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0021  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0022  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0023  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0024  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0025  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0026  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0029  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0030  * POSSIBILITY OF SUCH DAMAGE.
0031  */
0032 
0033 #ifndef _TERMIOS_TESTDRIVER_H
0034 #define _TERMIOS_TESTDRIVER_H
0035 
0036 #ifdef __cplusplus
0037 extern "C" {
0038 #endif
0039 
0040 void termios_test_driver_set_rx(
0041   const void *p,
0042   size_t      len
0043 );
0044 
0045 void termios_test_driver_dump_tx(const char *c);
0046 
0047 /**
0048  *  This macro defines the standard name for the Termios Test device
0049  *  that is available to applications.
0050  */
0051 #define TERMIOS_TEST_DRIVER_DEVICE_NAME "/dev/test"
0052 
0053 /**
0054  *  This macro defines the standard device driver table entry for
0055  *  a Termios Test device driver.
0056  */
0057 #define TERMIOS_TEST_DRIVER_TABLE_ENTRY \
0058   { termios_test_driver_initialize, termios_test_driver_open, \
0059     termios_test_driver_close, termios_test_driver_read, \
0060     termios_test_driver_write, termios_test_driver_control }
0061 
0062 /**
0063  *  @brief Console Initialization Entry Point
0064  *
0065  *  This method initializes the Termios Test device driver.
0066  *
0067  *  @param[in] major is the device driver major number
0068  *  @param[in] minor is the device driver minor number
0069  *  @param[in] arg is the parameters to this call
0070  *
0071  *  @return This method returns RTEMS_SUCCESSFUL when
0072  *          the device driver is successfully initialized.
0073  */
0074 rtems_device_driver termios_test_driver_initialize(
0075   rtems_device_major_number  major,
0076   rtems_device_minor_number  minor,
0077   void                      *arg
0078 );
0079 
0080 /**
0081  *  @brief Console Open Entry Point
0082  *
0083  *  This method opens a specific device supported by the
0084  *  Termios Test device driver.
0085  *
0086  *  @param[in] major is the device driver major number
0087  *  @param[in] minor is the device driver minor number
0088  *  @param[in] arg is the parameters to this call
0089  *
0090  *  @return This method returns RTEMS_SUCCESSFUL when
0091  *          the device driver is successfully opened.
0092  */
0093 rtems_device_driver termios_test_driver_open(
0094   rtems_device_major_number  major,
0095   rtems_device_minor_number  minor,
0096   void                      *arg
0097 );
0098 
0099 /**
0100  *  @brief Console Close Entry Point
0101  *
0102  *  This method closes a specific device supported by the
0103  *  Termios Test device driver.
0104  *
0105  *  @param[in] major is the device driver major number
0106  *  @param[in] minor is the device driver minor number
0107  *  @param[in] arg is the parameters to this call
0108  *
0109  *  @return This method returns RTEMS_SUCCESSFUL when
0110  *          the device is successfully closed.
0111  */
0112 rtems_device_driver termios_test_driver_close(
0113   rtems_device_major_number  major,
0114   rtems_device_minor_number  minor,
0115   void                      *arg
0116 );
0117 
0118 /**
0119  *  @brief Console Read Entry Point
0120  *
0121  *  This method reads from a specific device supported by the
0122  *  Termios Test device driver.
0123  *
0124  *  @param[in] major is the device driver major number
0125  *  @param[in] minor is the device driver minor number
0126  *  @param[in] arg is the parameters to this call
0127  *
0128  *  @return This method returns RTEMS_SUCCESSFUL when
0129  *          the device is successfully read from.
0130  */
0131 rtems_device_driver termios_test_driver_read(
0132   rtems_device_major_number  major,
0133   rtems_device_minor_number  minor,
0134   void                      *arg
0135 );
0136 
0137 /**
0138  *  @brief Console Write Entry Point
0139  *
0140  *  This method writes to a specific device supported by the
0141  *  Termios Test device driver.
0142  *
0143  *  @param[in] major is the device driver major number
0144  *  @param[in] minor is the device driver minor number
0145  *  @param[in] arg is the parameters to this call
0146  *
0147  *  @return This method returns RTEMS_SUCCESSFUL when
0148  *          the device is successfully written.
0149  */
0150 rtems_device_driver termios_test_driver_write(
0151   rtems_device_major_number  major,
0152   rtems_device_minor_number  minor,
0153   void                      *arg
0154 );
0155 
0156 /**
0157  *  @brief Console IO Control Entry Point
0158  *
0159  *  This method performs an IO Control operation on a
0160  *  specific device supported by the Termios Test device driver.
0161  *
0162  *  @param[in] major is the device driver major number
0163  *  @param[in] minor is the device driver minor number
0164  *  @param[in] arg is the parameters to this call
0165  *
0166  *  @return This method returns RTEMS_SUCCESSFUL when
0167  *          the device driver IO control operation is
0168  *          successfully performed.
0169  */
0170 rtems_device_driver termios_test_driver_control(
0171   rtems_device_major_number  major,
0172   rtems_device_minor_number  minor,
0173   void                      *arg
0174 );
0175 
0176 #ifdef __cplusplus
0177 }
0178 #endif
0179 
0180 #endif
0181 /* end of include file */