ircomm_param.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:5k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*********************************************************************
  2.  *                
  3.  * Filename:      ircomm_param.h
  4.  * Version:       1.0
  5.  * Description:   Parameter handling for the IrCOMM protocol
  6.  * Status:        Experimental.
  7.  * Author:        Dag Brattli <dagb@cs.uit.no>
  8.  * Created at:    Mon Jun  7 08:47:28 1999
  9.  * Modified at:   Wed Aug 25 13:46:33 1999
  10.  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  11.  * 
  12.  *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
  13.  *     
  14.  *     This program is free software; you can redistribute it and/or 
  15.  *     modify it under the terms of the GNU General Public License as 
  16.  *     published by the Free Software Foundation; either version 2 of 
  17.  *     the License, or (at your option) any later version.
  18.  * 
  19.  *     This program is distributed in the hope that it will be useful,
  20.  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22.  *     GNU General Public License for more details.
  23.  * 
  24.  *     You should have received a copy of the GNU General Public License 
  25.  *     along with this program; if not, write to the Free Software 
  26.  *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
  27.  *     MA 02111-1307 USA
  28.  *     
  29.  ********************************************************************/
  30. #ifndef IRCOMM_PARAMS_H
  31. #define IRCOMM_PARAMS_H
  32. #include <net/irda/parameters.h>
  33. /* Parameters common to all service types */
  34. #define IRCOMM_SERVICE_TYPE     0x00
  35. #define IRCOMM_PORT_TYPE        0x01 /* Only used in LM-IAS */
  36. #define IRCOMM_PORT_NAME        0x02 /* Only used in LM-IAS */
  37. /* Parameters for both 3 wire and 9 wire */
  38. #define IRCOMM_DATA_RATE        0x10
  39. #define IRCOMM_DATA_FORMAT      0x11
  40. #define IRCOMM_FLOW_CONTROL     0x12
  41. #define IRCOMM_XON_XOFF         0x13
  42. #define IRCOMM_ENQ_ACK          0x14
  43. #define IRCOMM_LINE_STATUS      0x15
  44. #define IRCOMM_BREAK            0x16
  45. /* Parameters for 9 wire */
  46. #define IRCOMM_DTE              0x20
  47. #define IRCOMM_DCE              0x21
  48. #define IRCOMM_POLL             0x22
  49. /* Service type (details) */
  50. #define IRCOMM_3_WIRE_RAW       0x01
  51. #define IRCOMM_3_WIRE           0x02
  52. #define IRCOMM_9_WIRE           0x04
  53. #define IRCOMM_CENTRONICS       0x08
  54. /* Port type (details) */
  55. #define IRCOMM_SERIAL           0x00
  56. #define IRCOMM_PARALLEL         0x01
  57. /* Data format (details) */
  58. #define IRCOMM_WSIZE_5          0x00
  59. #define IRCOMM_WSIZE_6          0x01
  60. #define IRCOMM_WSIZE_7          0x02
  61. #define IRCOMM_WSIZE_8          0x03
  62. #define IRCOMM_1_STOP_BIT       0x00
  63. #define IRCOMM_2_STOP_BIT       0x04 /* 1.5 if char len 5 */
  64. #define IRCOMM_PARITY_DISABLE   0x00
  65. #define IRCOMM_PARITY_ENABLE    0x08
  66. #define IRCOMM_PARITY_ODD       0x00
  67. #define IRCOMM_PARITY_EVEN      0x10
  68. #define IRCOMM_PARITY_MARK      0x20
  69. #define IRCOMM_PARITY_SPACE     0x30
  70. /* Flow control */
  71. #define IRCOMM_XON_XOFF_IN      0x01
  72. #define IRCOMM_XON_XOFF_OUT     0x02
  73. #define IRCOMM_RTS_CTS_IN       0x04
  74. #define IRCOMM_RTS_CTS_OUT      0x08
  75. #define IRCOMM_DSR_DTR_IN       0x10
  76. #define IRCOMM_DSR_DTR_OUT      0x20
  77. #define IRCOMM_ENQ_ACK_IN       0x40
  78. #define IRCOMM_ENQ_ACK_OUT      0x80
  79. /* Line status */
  80. #define IRCOMM_OVERRUN_ERROR    0x02
  81. #define IRCOMM_PARITY_ERROR     0x04
  82. #define IRCOMM_FRAMING_ERROR    0x08
  83. /* DTE (Data terminal equipment) line settings */
  84. #define IRCOMM_DELTA_DTR        0x01
  85. #define IRCOMM_DELTA_RTS        0x02
  86. #define IRCOMM_DTR              0x04
  87. #define IRCOMM_RTS              0x08
  88. /* DCE (Data communications equipment) line settings */
  89. #define IRCOMM_DELTA_CTS        0x01  /* Clear to send has changed */
  90. #define IRCOMM_DELTA_DSR        0x02  /* Data set ready has changed */
  91. #define IRCOMM_DELTA_RI         0x04  /* Ring indicator has changed */
  92. #define IRCOMM_DELTA_CD         0x08  /* Carrier detect has changed */
  93. #define IRCOMM_CTS              0x10  /* Clear to send is high */
  94. #define IRCOMM_DSR              0x20  /* Data set ready is high */
  95. #define IRCOMM_RI               0x40  /* Ring indicator is high */
  96. #define IRCOMM_CD               0x80  /* Carrier detect is high */
  97. #define IRCOMM_DCE_DELTA_ANY    0x0f
  98. /*
  99.  * Parameter state
  100.  */
  101. struct ircomm_params {
  102. /* General control params */
  103. __u8  service_type;
  104. __u8  port_type;
  105. char  port_name[32];
  106. /* Control params for 3- and 9-wire service type */
  107. __u32 data_rate;         /* Data rate in bps */
  108. __u8  data_format;
  109. __u8  flow_control;
  110. char  xonxoff[2];
  111. char  enqack[2];
  112. __u8  line_status;
  113. __u8  _break;
  114. __u8  null_modem;
  115. /* Control params for 9-wire service type */
  116. __u8 dte;
  117. __u8 dce;
  118. __u8 poll;
  119. /* Control params for Centronics service type */
  120. };
  121. struct ircomm_tty_cb; /* Forward decl. */
  122. int ircomm_param_flush(struct ircomm_tty_cb *self);
  123. int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush);
  124. extern pi_param_info_t ircomm_param_info;
  125. #endif /* IRCOMM_PARAMS_H */