ircomm_param.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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, see <http://www.gnu.org/licenses/>.
  26. *
  27. ********************************************************************/
  28. #ifndef IRCOMM_PARAMS_H
  29. #define IRCOMM_PARAMS_H
  30. #include <net/irda/parameters.h>
  31. /* Parameters common to all service types */
  32. #define IRCOMM_SERVICE_TYPE 0x00
  33. #define IRCOMM_PORT_TYPE 0x01 /* Only used in LM-IAS */
  34. #define IRCOMM_PORT_NAME 0x02 /* Only used in LM-IAS */
  35. /* Parameters for both 3 wire and 9 wire */
  36. #define IRCOMM_DATA_RATE 0x10
  37. #define IRCOMM_DATA_FORMAT 0x11
  38. #define IRCOMM_FLOW_CONTROL 0x12
  39. #define IRCOMM_XON_XOFF 0x13
  40. #define IRCOMM_ENQ_ACK 0x14
  41. #define IRCOMM_LINE_STATUS 0x15
  42. #define IRCOMM_BREAK 0x16
  43. /* Parameters for 9 wire */
  44. #define IRCOMM_DTE 0x20
  45. #define IRCOMM_DCE 0x21
  46. #define IRCOMM_POLL 0x22
  47. /* Service type (details) */
  48. #define IRCOMM_3_WIRE_RAW 0x01
  49. #define IRCOMM_3_WIRE 0x02
  50. #define IRCOMM_9_WIRE 0x04
  51. #define IRCOMM_CENTRONICS 0x08
  52. /* Port type (details) */
  53. #define IRCOMM_SERIAL 0x00
  54. #define IRCOMM_PARALLEL 0x01
  55. /* Data format (details) */
  56. #define IRCOMM_WSIZE_5 0x00
  57. #define IRCOMM_WSIZE_6 0x01
  58. #define IRCOMM_WSIZE_7 0x02
  59. #define IRCOMM_WSIZE_8 0x03
  60. #define IRCOMM_1_STOP_BIT 0x00
  61. #define IRCOMM_2_STOP_BIT 0x04 /* 1.5 if char len 5 */
  62. #define IRCOMM_PARITY_DISABLE 0x00
  63. #define IRCOMM_PARITY_ENABLE 0x08
  64. #define IRCOMM_PARITY_ODD 0x00
  65. #define IRCOMM_PARITY_EVEN 0x10
  66. #define IRCOMM_PARITY_MARK 0x20
  67. #define IRCOMM_PARITY_SPACE 0x30
  68. /* Flow control */
  69. #define IRCOMM_XON_XOFF_IN 0x01
  70. #define IRCOMM_XON_XOFF_OUT 0x02
  71. #define IRCOMM_RTS_CTS_IN 0x04
  72. #define IRCOMM_RTS_CTS_OUT 0x08
  73. #define IRCOMM_DSR_DTR_IN 0x10
  74. #define IRCOMM_DSR_DTR_OUT 0x20
  75. #define IRCOMM_ENQ_ACK_IN 0x40
  76. #define IRCOMM_ENQ_ACK_OUT 0x80
  77. /* Line status */
  78. #define IRCOMM_OVERRUN_ERROR 0x02
  79. #define IRCOMM_PARITY_ERROR 0x04
  80. #define IRCOMM_FRAMING_ERROR 0x08
  81. /* DTE (Data terminal equipment) line settings */
  82. #define IRCOMM_DELTA_DTR 0x01
  83. #define IRCOMM_DELTA_RTS 0x02
  84. #define IRCOMM_DTR 0x04
  85. #define IRCOMM_RTS 0x08
  86. /* DCE (Data communications equipment) line settings */
  87. #define IRCOMM_DELTA_CTS 0x01 /* Clear to send has changed */
  88. #define IRCOMM_DELTA_DSR 0x02 /* Data set ready has changed */
  89. #define IRCOMM_DELTA_RI 0x04 /* Ring indicator has changed */
  90. #define IRCOMM_DELTA_CD 0x08 /* Carrier detect has changed */
  91. #define IRCOMM_CTS 0x10 /* Clear to send is high */
  92. #define IRCOMM_DSR 0x20 /* Data set ready is high */
  93. #define IRCOMM_RI 0x40 /* Ring indicator is high */
  94. #define IRCOMM_CD 0x80 /* Carrier detect is high */
  95. #define IRCOMM_DCE_DELTA_ANY 0x0f
  96. /*
  97. * Parameter state
  98. */
  99. struct ircomm_params {
  100. /* General control params */
  101. __u8 service_type;
  102. __u8 port_type;
  103. char port_name[32];
  104. /* Control params for 3- and 9-wire service type */
  105. __u32 data_rate; /* Data rate in bps */
  106. __u8 data_format;
  107. __u8 flow_control;
  108. char xonxoff[2];
  109. char enqack[2];
  110. __u8 line_status;
  111. __u8 _break;
  112. __u8 null_modem;
  113. /* Control params for 9-wire service type */
  114. __u8 dte;
  115. __u8 dce;
  116. __u8 poll;
  117. /* Control params for Centronics service type */
  118. };
  119. struct ircomm_tty_cb; /* Forward decl. */
  120. int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush);
  121. extern pi_param_info_t ircomm_param_info;
  122. #endif /* IRCOMM_PARAMS_H */