Contiki-NG
cdc.h
1 #ifndef CDC_H_K1Q26ESJOC__
2 #define CDC_H_K1Q26ESJOC__
3 #include <usb.h>
4 /* Communication Class */
5 /* Class code */
6 #define CDC 0x02
7 
8 /* Interface subclass codes */
9 #define CDC_RESERVED 0x00
10 #define DIRECT_LINE_CONTROL_MODEL 0x01
11 #define ABSTRACT_CONTROL_MODEL 0x02
12 #define TELEPHONE_CONTROL_MODEL 0x03
13 #define MULTI_CHANNEL_CONTROL_MODEL 0x04
14 #define CAPI_CONTROL_MODEL 0x05
15 #define ETHERNET_NETWORKING_CONTROL_MODEL 0x06
16 #define ATM_NETWORKING_CONTROL_MODEL 0x07
17 
18 /* Protocols */
19 #define V_25TER_PROTOCOL 0x01
20 
21 /* Requests */
22 #define SEND_ENCAPSULATED_COMMAND 0x00
23 #define GET_ENCAPSULATED_RESPONSE 0x01
24 #define SET_COMM_FEATURE 0x02
25 #define GET_COMM_FEATURE 0x03
26 #define CLEAR_COMM_FEATURE 0x04
27 
28 #define SET_AUX_LINE_STATE 0x10
29 #define SET_HOOK_STATE 0x11
30 #define PULSE_SETUP 0x12
31 #define SEND_PULSE 0x13
32 #define SET_PULSE_TIME 0x14
33 #define RING_AUX_JACK 0x15
34 
35 #define SET_LINE_CODING 0x20
36 #define GET_LINE_CODING 0x21
37 #define SET_CONTROL_LINE_STATE 0x22
38 #define SEND_BREAK 0x23
39 
40 #define SET_RINGER_PARMS 0x30
41 #define GET_RINGER_PARMS 0x31
42 #define SET_OPERATION_PARMS 0x32
43 #define GET_OPERATION_PARMS 0x33
44 #define SET_LINE_PARMS 0x34
45 #define GET_LINE_PARMS 0x35
46 #define DIAL_DIGITS 0x36
47 
48 #define SET_UNIT_PARAMETER 0x37
49 #define GET_UNIT_PARAMETER 0x38
50 #define CLEAR_UNIT_PARAMETER 0x39
51 
52 #define GET_PROFILE 0x3a
53 
54 #define SET_ETHERNET_MULTICAST_FILTERS 0x40
55 #define GET_ETHERNET_MULTICAST_FILTERS 0x41
56 #define GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x42
57 #define SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER 0x43
58 #define GET_ETHERNET_STATISTIC 0x44
59 
60 #define SET_ATM_D ATA_FORMAT 0x50
61 #define GET_ATM_DEVICE_STATISTICS 0x51
62 #define SET_ATM_DEFAULT_VC 0x52
63 #define GET_ATM_VC_STATISTICS 0x53
64 
65 
66 /* Notifications */
67 #define NETWORK_CONNECTION 0x00
68 #define RESPONSE_AVAILABLE 0x01
69 
70 #define AUX_JACK_HOOK_STATE 0x08
71 #define RING_DETECT 0x09
72 
73 #define SERIAL_STATE 0x20
74 
75 #define CALL_STATE_CHANGE 0x28
76 #define LINE_STATE_CHANGE 0x29
77 #define CONNECTION_SPEED_CHANGE 0x2a
78 
79 /* Data interface */
80 
81 /* Class code */
82 #define CDC_DATA 0x0a
83 
84 /* Protocols */
85 #define I_430_PROTOCOL 0x30
86 #define ISO_IEC_3_1993_PROTOCOL 0x31
87 #define TRANSPARENT_PROTOCOL 0x32
88 #define Q_921M_PROTOCOL 0x50
89 #define Q_921_PROTOCOL 0x51
90 #define Q_921TM_PROTOCOL 0x52
91 #define V_42BIS_PROTOCOL 0x90
92 #define Q_931_PROTOCOL 0x91
93 #define V_120_PROTOCOL 0x93
94 #define CDC_PROTOCOL 0xfe
95 
96 /* Descriptor subtypes */
97 
98 #define CDC_FUNC_DESCR_HEADER 0x00
99 #define CDC_FUNC_DESCR_CALL_MGMNT 0x01
100 #define CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT 0x02
101 #define CDC_FUNC_DESCR_DIRECT_LINE_MGMNT 0x03
102 #define CDC_FUNC_DESCR_RINGER_MGMNT 0x04
103 #define CDC_FUNC_DESCR_TEL_STATE 0x05
104 #define CDC_FUNC_DESCR_UNION 0x06
105 #define CDC_FUNC_DESCR_COUNTRY 0x07
106 #define CDC_FUNC_DESCR_TEL_MODE 0x08
107 #define CDC_FUNC_DESCR_USB_TERM 0x09
108 #define CDC_FUNC_DESCR_NET_TERM 0x0a
109 #define CDC_FUNC_DESCR_PROTOCOL_UNIT 0x0b
110 #define CDC_FUNC_DESCR_EXTENSION_UNIT 0x0c
111 #define CDC_FUNC_DESCR_MULTICH_MGMNT 0x0d
112 #define CDC_FUNC_DESCR_CAPI_MGMNT 0x0e
113 #define CDC_FUNC_DESCR_ETHERNET 0x0f
114 #define CDC_FUNC_DESCR_ATM 0x10
115 
116 
117 
118 struct usb_cdc_header_func_descriptor
119 {
120  Uchar bLength; /* Size of this descriptor in bytes */
121  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
122  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_HEADER subtype */
123  Uint16 bcdCDC; /* Revision of class specification */
124 } BYTE_ALIGNED;
125 
126 struct usb_cdc_call_mgmnt_func_descriptor
127 {
128  Uchar bLength; /* Size of this descriptor in bytes */
129  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
130  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_CALL_MGMNT subtype */
131  Uchar bmCapabilities; /* Capabilities */
132  Uchar bDataInterface; /* Management data interface */
133 } BYTE_ALIGNED;
134 
135 struct usb_cdc_abstract_ctrl_mgmnt_func_descriptor
136 {
137  Uchar bLength; /* Size of this descriptor in bytes */
138  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
139  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_ABSTRACT_CTRL_MGMNT subtype*/
140  Uchar bmCapabilities; /* Capabilities */
141 } BYTE_ALIGNED;
142 
143 struct usb_cdc_direct_line_mgmnt_func_descriptor
144 {
145  Uchar bLength; /* Size of this descriptor in bytes */
146  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
147  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_DIRECT_LINE_MGMNT subtype*/
148  Uchar bmCapabilities; /* Capabilities */
149 } BYTE_ALIGNED;
150 
151 struct usb_cdc_ringer_mgmnt_func_descriptor
152 {
153  Uchar bLength; /* Size of this descriptor in bytes */
154  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
155  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_RINGER_MGMNT subtype*/
156  Uchar bRingerVolSteps; /* Ringer volume steps */
157  Uchar bNumRingerPatterns; /* Number of ringer patterns supported */
158 } BYTE_ALIGNED;
159 
160 struct usb_cdc_tel_mode_func_descriptor
161 {
162  Uchar bLength; /* Size of this descriptor in bytes */
163  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
164  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_TEL_MODE subtype*/
165  Uchar bmCapabilities; /* Capabilities */
166 } BYTE_ALIGNED;
167 
168 struct usb_cdc_tel_state_func_descriptor
169 {
170  Uchar bLength; /* Size of this descriptor in bytes */
171  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
172  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_TEL_STATE subtype*/
173  Uchar bmCapabilities; /* Capabilities */
174 } BYTE_ALIGNED;
175 
176 struct usb_cdc_union_func_descriptor
177 {
178  Uchar bLength; /* Size of this descriptor in bytes */
179  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
180  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_UNION subtype*/
181  Uchar bMasterInterface; /* Master interface for union */
182  Uchar bSlaveInterface[1]; /* Slave interfaces in union */
183 } BYTE_ALIGNED;
184 
185 struct usb_cdc_country_func_descriptor
186 {
187  Uchar bLength; /* Size of this descriptor in bytes */
188  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
189  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_COUNTRY subtype*/
190  Uchar iCountryCodeRelDate; /* Release date for country codes */
191  Uint16 wCountryCode[1]; /* Country codes */
192 } BYTE_ALIGNED;
193 
194 struct usb_cdc_ethernet_func_descriptor
195 {
196  Uchar bLength; /* Size of this descriptor in bytes */
197  Uchar bDescriptorType; /* CS_INTERFACE descriptor type */
198  Uchar bDescriptorSubtype; /* CDC_FUNC_DESCR_ETHERNET subtype*/
199  Uchar iMACAddress; /* MAC address string descriptor */
200  Uint32 bmEthernetStatistics; /* Supported statistics */
201  Uint16 wMaxSegmentSize;
202  Uint16 wNumberMCFilters; /* Number of multicast filters */
203  Uchar bNumberPowerFilters; /* Number of wake-up pattern filters */;
204 } BYTE_ALIGNED;
205 
206 struct usb_cdc_line_coding
207 {
208  Uint32 dwDTERate;
209  Uchar bCharFormat;
210  Uchar bParityType;
211  Uchar bDataBits;
212 } BYTE_ALIGNED;
213 
214 #endif /* CDC_H_K1Q26ESJOC__ */