Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

324 lines
8.5 KiB

  1. /****************************************************************************
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. USBCOMM.H
  5. Abstract:
  6. USB Communication Class Header File
  7. Environment:
  8. Kernel mode & user mode
  9. Notes:
  10. THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  11. KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  12. IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  13. PURPOSE.
  14. Copyright (c) 1998 Microsoft Corporation. All Rights Reserved.
  15. Revision History:
  16. 12/23/97 : created
  17. Author:
  18. Tom Green
  19. ****************************************************************************/
  20. #ifndef __USBCOMM_H__
  21. #define __USBCOMM_H__
  22. #include <pshpack1.h>
  23. // USB Communication Class Code
  24. #define USB_COMM_COMMUNICATION_CLASS_CODE 0x0002
  25. // USB Communication Class Code
  26. #define USB_COMM_DATA_CLASS_CODE 0x000A
  27. // USB Communication Class SubClass Codes
  28. #define USB_COMM_SUBCLASS_RESERVED 0x0000
  29. #define USB_COMM_SUBCLASS_DIRECT_LINE_CONTROL 0x0001
  30. #define USB_COMM_SUBCLASS_ABSTRACT_CONTROL 0x0002
  31. #define USB_COMM_SUBCLASS_TELEPHONE_CONTROL 0x0003
  32. // USB Communication Class Control Protocol Codes
  33. #define USB_COMM_PROTOCOL_RESERVED 0x0000
  34. #define USB_COMM_PROTOCOL_V25TER 0x0001
  35. // Direct Line Control Model defines
  36. #define USB_COMM_SET_AUX_LINE_STATE 0x0010
  37. #define USB_COMM_SET_HOOK_STATE 0x0011
  38. #define USB_COMM_PULSE_SETUP 0x0012
  39. #define USB_COMM_SEND_PULSE 0x0013
  40. #define USB_COMM_SET_PULSE_TIME 0x0014
  41. #define USB_COMM_RING_AUX_JACK 0x0015
  42. // Direct Line Control Model Notification defines
  43. #define USB_COMM_AUX_JACK_HOOK_STATE 0x0008
  44. #define USB_COMM_RING_DETECT 0x0009
  45. // Abstract Control Model defines
  46. #define USB_COMM_SEND_ENCAPSULATED_COMMAND 0x0000
  47. #define USB_COMM_GET_ENCAPSULATED_RESPONSE 0x0001
  48. #define USB_COMM_SET_COMM_FEATURE 0x0002
  49. #define USB_COMM_GET_COMM_FEATURE 0x0003
  50. #define USB_COMM_CLEAR_COMM_FEATURE 0x0004
  51. #define USB_COMM_SET_LINE_CODING 0x0020
  52. #define USB_COMM_GET_LINE_CODING 0x0021
  53. #define USB_COMM_SET_CONTROL_LINE_STATE 0x0022
  54. #define USB_COMM_SEND_BREAK 0x0023
  55. // Abstract Control Model Notification defines
  56. #define USB_COMM_NETWORK_CONNECTION 0x0000
  57. #define USB_COMM_RESPONSE_AVAILABLE 0x0001
  58. #define USB_COMM_SERIAL_STATE 0x0020
  59. // Telephone Control Model defines
  60. #define USB_COMM_SET_RINGER_PARMS 0x0030
  61. #define USB_COMM_GET_RINGER_PARMS 0x0031
  62. #define USB_COMM_SET_OPERATION_PARMS 0x0032
  63. #define USB_COMM_GET_OPERATION_PARMS 0x0033
  64. #define USB_COMM_SET_LINE_PARMS 0x0034
  65. #define USB_COMM_GET_LINE_PARMS 0x0035
  66. #define USB_COMM_DIAL_DIGITS 0x0036
  67. // Telephone Control Model Notification defines
  68. #define USB_COMM_CALL_STATE_CHANGE 0x0028
  69. #define USB_COMM_LINE_STATE_CHANGE 0x0029
  70. // Descriptor type for Functional Descriptors
  71. #define USB_COMM_CS_INTERFACE 0x0024
  72. #define USB_COMM_CS_ENDPOINT 0x0025
  73. // Communication Feature Selector Codes
  74. #define USB_COMM_ABSTRACT_STATE 0x0001
  75. #define USB_COMM_COUNTRY_SETTING 0x0002
  76. // POTS Relay Configuration Values
  77. #define USB_COMM_ON_HOOK 0x0000
  78. #define USB_COMM_OFF_HOOK 0x0001
  79. #define USB_COMM_SNOOPING 0x0002
  80. // Operation Mode Values
  81. #define USB_COMM_SIMPLE_MODE 0x0000
  82. #define USB_COMM_STANDALONE_MODE 0x0001
  83. #define USB_COMM_COMPUTER_CENTRIC_MODE 0x0002
  84. // Line State Change Values for SET_LINE_PARMS
  85. #define USB_COMM_DROP_ACTIVE_CALL 0x0000
  86. #define USB_COMM_START_NEW_CALL 0x0001
  87. #define USB_COMM_APPLY_RINGING 0x0002
  88. #define USB_COMM_REMOVE_RINGING 0x0003
  89. #define USB_COMM_SWITCH_TO_SPECIFIC_CALL 0x0004
  90. // Call State Values for GET_LINE_PARMS
  91. #define USB_COMM_CALL_IDLE 0x0000
  92. #define USB_COMM_TYPICAL_DIAL_TONE 0x0001
  93. #define USB_COMM_INTERRUPTED_DIAL_TONE 0x0002
  94. #define USB_COMM_DIALING_IN_PROGRESS 0x0003
  95. #define USB_COMM_RINGBACK 0x0004
  96. #define USB_COMM_CONNECTED 0x0005
  97. #define USB_COMM_INCOMING_CALL 0x0006
  98. // Call State Change values for CALL_STATE_CHANGE
  99. #define USB_COMM_CALL_RESERVED 0x0000
  100. #define USB_COMM_CALL_CALL_HAS_BECOME_IDLE 0x0001
  101. #define USB_COMM_CALL_DIALING 0x0002
  102. #define USB_COMM_CALL_RINGBACK 0x0003
  103. #define USB_COMM_CALL_CONNECTED 0x0004
  104. #define USB_COMM_CALL_INCOMING_CALL 0x0005
  105. // Line State Change Values for LINE_STATE_CHANGE
  106. #define USB_COMM_LINE_LINE_HAS_BECOME_IDLE 0x0000
  107. #define USB_COMM_LINE_LINE_HOLD_POSITION 0x0001
  108. #define USB_COMM_LINE_HOOK_SWITCH_OFF 0x0002
  109. #define USB_COMM_LINE_HOOK_SWITCH_ON 0x0003
  110. // Line Coding Stop Bits
  111. #define USB_COMM_STOPBITS_10 0x0000
  112. #define USB_COMM_STOPBITS_15 0x0001
  113. #define USB_COMM_STOPBITS_20 0x0002
  114. // Line Coding Parity Type
  115. #define USB_COMM_PARITY_NONE 0x0000
  116. #define USB_COMM_PARITY_ODD 0x0001
  117. #define USB_COMM_PARITY_EVEN 0x0002
  118. #define USB_COMM_PARITY_MARK 0x0003
  119. #define USB_COMM_PARITY_SPACE 0x0004
  120. // Control Line State
  121. #define USB_COMM_DTR 0x0001
  122. #define USB_COMM_RTS 0x0002
  123. // Serial State Notification bits
  124. #define USB_COMM_DCD 0x0001
  125. #define USB_COMM_DSR 0x0002
  126. #define USB_COMM_BREAK 0x0004
  127. #define USB_COMM_RING 0x0008
  128. #define USB_COMM_FRAMING_ERROR 0x0010
  129. #define USB_COMM_PARITY_ERROR 0x0020
  130. #define USB_COMM_OVERRUN 0x0040
  131. // Call Management Functional Descriptor
  132. typedef struct _USB_COMM_CALL_MANAGEMENT_FUNC_DESCR
  133. {
  134. UCHAR FunctionLength;
  135. UCHAR DescriptorType;
  136. UCHAR DescriptorSubType;
  137. UCHAR Capabilities;
  138. UCHAR DataInterface;
  139. } USB_COMM_CALL_MANAGEMENT_FUNC_DESCR, *PUSB_COMM_CALL_MANAGEMENT_FUNC_DESCR;
  140. // Abstract Control Management Functional Descriptor
  141. typedef struct _USB_COMM_ABSTRACT_CONTROL_MANAGEMENT_FUNC_DESCR
  142. {
  143. UCHAR FunctionLength;
  144. UCHAR DescriptorType;
  145. UCHAR DescriptorSubType;
  146. UCHAR Capabilities;
  147. } USB_COMM_ABSTRACT_CONTROL_MANAGEMENT_FUNC_DESCR, *PUSB_COMM_ABSTRACT_CONTROL_MANAGEMENT_FUNC_DESCR;
  148. // Direct Line Management Functional Descriptor
  149. typedef struct _USB_COMM_DIRECT_LINE_MANAGEMENT_FUNC_DESCR
  150. {
  151. UCHAR FunctionLength;
  152. UCHAR DescriptorType;
  153. UCHAR DescriptorSubType;
  154. UCHAR Capabilities;
  155. } USB_COMM_DIRECT_LINE_MANAGEMENT_FUNC_DESCR, *PUSB_COMM_DIRECT_LINE_MANAGEMENT_FUNC_DESCR;
  156. // Telephone Ringer Functional Descriptor
  157. typedef struct _USB_COMM_TELEPHONE_RINGER_FUNC_DESCR
  158. {
  159. UCHAR FunctionLength;
  160. UCHAR DescriptorType;
  161. UCHAR DescriptorSubType;
  162. UCHAR RingerVolSteps;
  163. UCHAR NumRingerPatterns;
  164. } USB_COMM_TELEPHONE_RINGER_FUNC_DESCR, *PUSB_COMM_TELEPHONE_RINGER_FUNC_DESCR;
  165. // Telephone Operational Modes Functional Descriptor
  166. typedef struct _USB_COMM_TELEPHONE_OPERATIONAL_MODES_FUNC_DESCR
  167. {
  168. UCHAR FunctionLength;
  169. UCHAR DescriptorType;
  170. UCHAR DescriptorSubType;
  171. UCHAR Capabilities;
  172. } USB_COMM_TELEPHONE_OPERATIONAL_MODES_FUNC_DESCR, *PUSB_COMM_TELEPHONE_OPERATIONAL_MODES_FUNC_DESCR;
  173. // Telephone Call and Line State Reporting Capabilities Descriptor
  174. typedef struct _USB_COMM_TELEPHONE_CALL_LINE_STATE_DESCR
  175. {
  176. UCHAR FunctionLength;
  177. UCHAR DescriptorType;
  178. UCHAR DescriptorSubType;
  179. UCHAR Capabilities;
  180. } USB_COMM_TELEPHONE_CALL_LINE_STATE_DESCR, *PUSB_COMM_TELEPHONE_CALL_LINE_STATE_DESCR;
  181. // Union Functional Descriptor
  182. typedef struct _USB_COMM_UNION_FUNC_DESCR
  183. {
  184. UCHAR FunctionLength;
  185. UCHAR DescriptorType;
  186. UCHAR DescriptorSubType;
  187. UCHAR MasterInterface;
  188. UCHAR SlaveInterface;
  189. } USB_COMM_UNION_FUNC_DESCR, *PUSB_COMM_UNION_FUNC_DESCR;
  190. // Country Selection Functional Descriptor
  191. typedef struct _USB_COMM_COUNTRY_SELECTION_FUNC_DESCR
  192. {
  193. UCHAR FunctionLength;
  194. UCHAR DescriptorType;
  195. UCHAR DescriptorSubType;
  196. UCHAR CountryCodeRelDate;
  197. UCHAR CountryCode;
  198. } USB_COMM_COUNTRY_SELECTION_FUNC_DESCR, *PUSB_COMM_COUNTRY_SELECTION_FUNC_DESCR;
  199. // Class Specific Interface Descriptor
  200. typedef struct _USB_COMM_CLASS_SPECIFIC_INTERFACE_DESCR
  201. {
  202. UCHAR FunctionLength;
  203. UCHAR DescriptorType;
  204. UCHAR DescriptorSubType;
  205. UCHAR CDC;
  206. } USB_COMM_CLASS_SPECIFIC_INTERFACE_DESCR, *PUSB_COMM_CLASS_SPECIFIC_INTERFACE_DESCR;
  207. // Line Coding for GET_LINE_CODING and SET_LINE_CODING
  208. typedef struct _USB_COMM_LINE_CODING
  209. {
  210. ULONG DTERate;
  211. UCHAR CharFormat;
  212. UCHAR ParityType;
  213. UCHAR DataBits;
  214. } USB_COMM_LINE_CODING, *PUSB_COMM_LINE_CODING;
  215. // Line Status Information for GET_LINE_PARMS
  216. typedef struct _USB_COMM_LINE_STATUS
  217. {
  218. USHORT Length;
  219. ULONG RingerBitmap;
  220. ULONG LineState;
  221. ULONG CallState;
  222. } USB_COMM_LINE_STATUS, *PUSB_COMM_LINE_STATUS;
  223. // Serial Status Notification
  224. typedef struct _USB_COMM_SERIAL_STATUS
  225. {
  226. UCHAR RequestType;
  227. UCHAR Notification;
  228. USHORT Value;
  229. USHORT Index;
  230. USHORT Length;
  231. USHORT SerialState;
  232. } USB_COMM_SERIAL_STATUS, *PUSB_COMM_SERIAL_STATUS;
  233. #include <poppack.h>
  234. #endif /* __USBCOMM_H__ */
  235.