1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** USBX Component                                                        */
17 /**                                                                       */
18 /**   Audio Class                                                         */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  COMPONENT DEFINITION                                   RELEASE        */
27 /*                                                                        */
28 /*    ux_class_audio20.h                                  PORTABLE C      */
29 /*                                                           6.1.12       */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Chaoqiong Xiao, Microsoft Corporation                               */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file contains all the header and structures used by the        */
37 /*    USBX Audio Class (UAC) 2.0.                                         */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  07-29-2022     Chaoqiong Xiao           Initial Version 6.1.12        */
44 /*                                                                        */
45 /**************************************************************************/
46 
47 #ifndef UX_CLASS_AUDIO20_H
48 #define UX_CLASS_AUDIO20_H
49 
50 /* Define Audio Class Codes.  */
51 
52 #define UX_CLASS_AUDIO20_IP_VERSION_02_00                  0x20
53 
54 #define UX_CLASS_AUDIO20_CLASS                             0x01
55 #define UX_CLASS_AUDIO20_SUBCLASS_UNDEFINED                0x00
56 #define UX_CLASS_AUDIO20_SUBCLASS_AUDIOCONTROL             0x01
57 #define UX_CLASS_AUDIO20_SUBCLASS_AUDIOSTREAMING           0x02
58 #define UX_CLASS_AUDIO20_SUBCLASS_MIDISTREAMING            0x03
59 #define UX_CLASS_AUDIO20_PROTOCOL_UNDEFINED                0x00
60 #define UX_CLASS_AUDIO20_PROTOCOL_02_00                    UX_CLASS_AUDIO20_IP_VERSION_02_00
61 
62 
63 /* Define Audio Function (AF) code.  */
64 
65 #define UX_CLASS_AUDIO20_AF_VERSION_02_00                  UX_CLASS_AUDIO20_IP_VERSION_02_00
66 
67 
68 /* Define Audio Class function category codes.  */
69 
70 #define UX_CLASS_AUDIO20_CATEGORY_UNDEFINED                0x00
71 #define UX_CLASS_AUDIO20_CATEGORY_DESKTOP_SPEAKER          0x01
72 #define UX_CLASS_AUDIO20_CATEGORY_HOME_THEATER             0x02
73 #define UX_CLASS_AUDIO20_CATEGORY_MICROPHONE               0x03
74 #define UX_CLASS_AUDIO20_CATEGORY_HEADSET                  0x04
75 #define UX_CLASS_AUDIO20_CATEGORY_TELEPHONE                0x05
76 #define UX_CLASS_AUDIO20_CATEGORY_CONVERTER                0x06
77 #define UX_CLASS_AUDIO20_CATEGORY_VOICE_SOUND_RECORDER     0x07
78 #define UX_CLASS_AUDIO20_CATEGORY_I_O_BOX                  0x08
79 #define UX_CLASS_AUDIO20_CATEGORY_MUSICAL_INSTRUMENT       0x09
80 #define UX_CLASS_AUDIO20_CATEGORY_PRO_AUDIO                0x0A
81 #define UX_CLASS_AUDIO20_CATEGORY_AUDIO_VIDEO              0x0B
82 #define UX_CLASS_AUDIO20_CATEGORY_CONTROL_PANEL            0x0C
83 #define UX_CLASS_AUDIO20_CATEGORY_OTHER                    0xFF
84 
85 
86 /* Define Audio Class desctiptor types.  */
87 #define UX_CLASS_AUDIO20_CS_UNDEFINED                      0x20
88 #define UX_CLASS_AUDIO20_CS_DEVICE                         0x21
89 #define UX_CLASS_AUDIO20_CS_CONFIGURATION                  0x22
90 #define UX_CLASS_AUDIO20_CS_STRING                         0x23
91 #define UX_CLASS_AUDIO20_CS_INTERFACE                      0x24
92 #define UX_CLASS_AUDIO20_CS_ENDPOINT                       0x25
93 
94 
95 /* Define Audio Class AC interface descriptor subclasses.  */
96 
97 #define UX_CLASS_AUDIO20_AC_UNDEFINED                      0x00
98 #define UX_CLASS_AUDIO20_AC_HEADER                         0x01
99 #define UX_CLASS_AUDIO20_AC_INPUT_TERMINAL                 0x02
100 #define UX_CLASS_AUDIO20_AC_OUTPUT_TERMINAL                0x03
101 #define UX_CLASS_AUDIO20_AC_MIXER_UNIT                     0x04
102 #define UX_CLASS_AUDIO20_AC_SELECTOR_UNIT                  0x05
103 #define UX_CLASS_AUDIO20_AC_FEATURE_UNIT                   0x06
104 #define UX_CLASS_AUDIO20_AC_EFFECT_UNIT                    0x07
105 #define UX_CLASS_AUDIO20_AC_PROCESSING_UNIT                0x08
106 #define UX_CLASS_AUDIO20_AC_EXTENSION_UNIT                 0x09
107 #define UX_CLASS_AUDIO20_AC_CLOCK_SOURCE                   0x0A
108 #define UX_CLASS_AUDIO20_AC_CLOCK_SELECTOR                 0x0B
109 #define UX_CLASS_AUDIO20_AC_CLOCK_MULTIPLIER               0x0C
110 #define UX_CLASS_AUDIO20_AC_SAMPLE_RATE_CONVERTER          0x0D
111 
112 /* Define Audio Class Effect Unit (EU) Effect Types (ET).  */
113 
114 #define UX_CLASS_AUDIO20_EFFECT_UNDEFINED                  0x00
115 #define UX_CLASS_AUDIO20_EFFECT_PARAM_EQ_SECTION           0x01
116 #define UX_CLASS_AUDIO20_EFFECT_REVERBERATION              0x02
117 #define UX_CLASS_AUDIO20_EFFECT_MOD_DELAY                  0x03
118 #define UX_CLASS_AUDIO20_EFFECT_DYN_RANGE_COMP             0x04
119 
120 /* Define Audio Class Processing Unit (PU) Process Types (PT).  */
121 
122 #define UX_CLASS_AUDIO20_PROCESS_UNDEFINED                 0x00
123 #define UX_CLASS_AUDIO20_PROCESS_UP_DOWN_MIX               0x01
124 #define UX_CLASS_AUDIO20_PROCESS_DOLBY_PROLOGIC            0x02
125 #define UX_CLASS_AUDIO20_PROCESS_STEREO_EXTENDER           0x03
126 
127 
128 /* Define Audio Class AS interface descriptor subclasses.  */
129 
130 #define UX_CLASS_AUDIO20_AS_UNDEFINED                      0x00
131 #define UX_CLASS_AUDIO20_AS_GENERAL                        0x01
132 #define UX_CLASS_AUDIO20_AS_FORMAT_TYPE                    0x02
133 #define UX_CLASS_AUDIO20_AS_ENCODER                        0x03
134 #define UX_CLASS_AUDIO20_AS_DECODER                        0x04
135 
136 
137 /* Define Audio Class endpoint descriptor subtypes.  */
138 
139 #define UX_CLASS_AUDIO20_EP_UNDEFINED                      0x00
140 #define UX_CLASS_AUDIO20_EP_GENERAL                        0x01
141 
142 
143 /* Define Audio Class Encoder Type codes.  */
144 
145 #define UX_CLASS_AUDIO20_ENCODER_UNDEFINED                 0x00
146 #define UX_CLASS_AUDIO20_ENCODER_OTHER                     0x01
147 #define UX_CLASS_AUDIO20_ENCODER_MPEG                      0x02
148 #define UX_CLASS_AUDIO20_ENCODER_AC3                       0x03
149 #define UX_CLASS_AUDIO20_ENCODER_WMA                       0x04
150 #define UX_CLASS_AUDIO20_ENCODER_DTS                       0x05
151 
152 /* Define Audio Class Decoder Type codes.  */
153 
154 #define UX_CLASS_AUDIO20_DECODER_UNDEFINED                 0x00
155 #define UX_CLASS_AUDIO20_DECODER_OTHER                     0x01
156 #define UX_CLASS_AUDIO20_DECODER_MPEG                      0x02
157 #define UX_CLASS_AUDIO20_DECODER_AC3                       0x03
158 #define UX_CLASS_AUDIO20_DECODER_WMA                       0x04
159 #define UX_CLASS_AUDIO20_DECODER_DTS                       0x05
160 
161 
162 /* Define Audio Class request codes.  */
163 
164 #define UX_CLASS_AUDIO20_REQUEST_CODE_UNDEFINED            0x00
165 #define UX_CLASS_AUDIO20_CUR                               0x01
166 #define UX_CLASS_AUDIO20_RANGE                             0x02
167 #define UX_CLASS_AUDIO20_MEM                               0x03
168 
169 
170 /* Define Audio Class clock source control selectors.  */
171 
172 #define UX_CLASS_AUDIO20_CS_CONTROL_UNDEFINED              0x00
173 #define UX_CLASS_AUDIO20_CS_SAM_FREQ_CONTROL               0x01
174 #define UX_CLASS_AUDIO20_CS_CLOCK_VALID_CONTROL            0x02
175 
176 /* Define Audio Class clock selector control selectors.  */
177 
178 #define UX_CLASS_AUDIO20_CX_CONTROL_UNDEFINED              0x00
179 #define UX_CLASS_AUDIO20_CX_CLOCK_SELECTOR_CONTROL         0x01
180 
181 /* Define Audio Class clock multiplier control selectors.  */
182 
183 #define UX_CLASS_AUDIO20_CM_CONTROL_UNDEFINED              0x00
184 #define UX_CLASS_AUDIO20_CM_NUMERATOR_CONTROL              0x01
185 #define UX_CLASS_AUDIO20_CM_DENOMINATOR_CONTROL            0x02
186 
187 /* Define Audio Class terminal control selectors.  */
188 
189 #define UX_CLASS_AUDIO20_TE_CONTROL_UNDEFINED              0x00
190 #define UX_CLASS_AUDIO20_TE_COPY_PROTECT_CONTROL           0x01
191 #define UX_CLASS_AUDIO20_TE_CONNECTOR_CONTROL              0x02
192 #define UX_CLASS_AUDIO20_TE_OVERLOAD_CONTROL               0x03
193 #define UX_CLASS_AUDIO20_TE_CLUSTER_CONTROL                0x04
194 #define UX_CLASS_AUDIO20_TE_UNDERFLOW_CONTROL              0x05
195 #define UX_CLASS_AUDIO20_TE_OVERFLOW_CONTROL               0x06
196 #define UX_CLASS_AUDIO20_TE_LATENCY_CONTROL                0x07
197 
198 /* Define Audio Class mixer control selectors.  */
199 
200 #define UX_CLASS_AUDIO20_MU_CONTROL_UNDEFINED              0x00
201 #define UX_CLASS_AUDIO20_MU_MIXER_CONTROL                  0x01
202 #define UX_CLASS_AUDIO20_MU_CLUSTER_CONTROL                0x02
203 #define UX_CLASS_AUDIO20_MU_UNDERFLOW_CONTROL              0x03
204 #define UX_CLASS_AUDIO20_MU_OVERFLOW_CONTROL               0x04
205 #define UX_CLASS_AUDIO20_MU_LATENCY_CONTROL                0x05
206 
207 /* Define Audio Class selector control selectors.  */
208 
209 #define UX_CLASS_AUDIO20_SU_CONTROL_UNDEFINED              0x00
210 #define UX_CLASS_AUDIO20_SU_SELECTOR_CONTROL               0x01
211 #define UX_CLASS_AUDIO20_SU_LATENCY_CONTROL                0x02
212 
213 /* Define Audio Class feature unit control selectors.  */
214 
215 #define UX_CLASS_AUDIO20_FU_CONTROL_UNDEFINED              0x00
216 #define UX_CLASS_AUDIO20_FU_MUTE_CONTROL                   0x01
217 #define UX_CLASS_AUDIO20_FU_VOLUME_CONTROL                 0x02
218 #define UX_CLASS_AUDIO20_FU_BASS_CONTROL                   0x03
219 #define UX_CLASS_AUDIO20_FU_MID_CONTROL                    0x04
220 #define UX_CLASS_AUDIO20_FU_TREBLE_CONTROL                 0x05
221 #define UX_CLASS_AUDIO20_FU_GRAPHIC_EQUALIZER_CONTROL      0x06
222 #define UX_CLASS_AUDIO20_FU_AUTOMATIC_GAIN_CONTROL         0x07
223 #define UX_CLASS_AUDIO20_FU_DELAY_CONTROL                  0x08
224 #define UX_CLASS_AUDIO20_FU_BASS_BOOST_CONTROL             0x09
225 #define UX_CLASS_AUDIO20_FU_LOUNDNESS_CONTROL              0x0A
226 #define UX_CLASS_AUDIO20_FU_INPUT_GAIN_CONTROL             0x0B
227 #define UX_CLASS_AUDIO20_FU_INPUT_GAIN_PAD_CONTROL         0x0C
228 #define UX_CLASS_AUDIO20_FU_PHASE_INVERTER_CONTROL         0x0D
229 #define UX_CLASS_AUDIO20_FU_UNDERFLOW_CONTROL              0x0E
230 #define UX_CLASS_AUDIO20_FU_OVERFLOW_CONTROL               0x0F
231 #define UX_CLASS_AUDIO20_FU_LATENCY_CONTROL                0x10
232 
233 /* Define Audio Class effect unit control selectors.  */
234 
235 /* Define Audio Class parametric equalizer (PE) section effect unit control selectors.  */
236 #define UX_CLASS_AUDIO20_PE_CONTROL_UNDEFINED              0x00
237 #define UX_CLASS_AUDIO20_PE_ENABLE_CONTROL                 0x01
238 #define UX_CLASS_AUDIO20_PE_CENTERFREQ_CONTROL             0x02
239 #define UX_CLASS_AUDIO20_PE_QFACTOR_CONTROL                0x03
240 #define UX_CLASS_AUDIO20_PE_GAIN_CONTROL                   0x04
241 #define UX_CLASS_AUDIO20_PE_UNDERFLOW_CONTROL              0x05
242 #define UX_CLASS_AUDIO20_PE_OVERFLOW_CONTROL               0x06
243 #define UX_CLASS_AUDIO20_PE_LATENCY_CONTROL                0x07
244 
245 /* Define Audio Class reverberation (RV) section effect unit control selectors.  */
246 #define UX_CLASS_AUDIO20_RV_CONTROL_UNDEFINED              0x00
247 #define UX_CLASS_AUDIO20_RV_ENABLE_CONTROL                 0x01
248 #define UX_CLASS_AUDIO20_RV_TYPE_CONTROL                   0x02
249 #define UX_CLASS_AUDIO20_RV_LEVEL_CONTROL                  0x03
250 #define UX_CLASS_AUDIO20_RV_TIME_CONTROL                   0x04
251 #define UX_CLASS_AUDIO20_RV_FEEDBACK_CONTROL               0x05
252 #define UX_CLASS_AUDIO20_RV_PREDELAY_CONTROL               0x06
253 #define UX_CLASS_AUDIO20_RV_DENSITY_CONTROL                0x07
254 #define UX_CLASS_AUDIO20_RV_HIFREQ_ROLLOFF_CONTROL         0x08
255 #define UX_CLASS_AUDIO20_RV_UNDERFLOW_CONTROL              0x09
256 #define UX_CLASS_AUDIO20_RV_OVERFLOW_CONTROL               0x0A
257 #define UX_CLASS_AUDIO20_RV_LATENCY_CONTROL                0x0B
258 
259 /* Define Audio Class modulation delay (MD) effect unit control selectors.  */
260 
261 #define UX_CLASS_AUDIO20_MD_CONTROL_UNDEFINED              0x00
262 #define UX_CLASS_AUDIO20_MD_ENABLE_CONTROL                 0x01
263 #define UX_CLASS_AUDIO20_MD_BALANCE_CONTROL                0x02
264 #define UX_CLASS_AUDIO20_MD_RATE_CONTROL                   0x03
265 #define UX_CLASS_AUDIO20_MD_DEPTH_CONTROL                  0x04
266 #define UX_CLASS_AUDIO20_MD_TIME_CONTROL                   0x05
267 #define UX_CLASS_AUDIO20_MD_FEEDBACK_CONTROL               0x06
268 #define UX_CLASS_AUDIO20_MD_UNDERFLOW_CONTROL              0x07
269 #define UX_CLASS_AUDIO20_MD_OVERFLOW_CONTROL               0x08
270 #define UX_CLASS_AUDIO20_MD_LATENCY_CONTROL                0x09
271 
272 /* Define Audio Class dynamic range (DR) compressor effect unit control selectors.  */
273 
274 #define UX_CLASS_AUDIO20_DR_CONTROL_UNDEFINED              0x00
275 #define UX_CLASS_AUDIO20_DR_ENABLE_CONTROL                 0x01
276 #define UX_CLASS_AUDIO20_DR_COMPRESSION_RATE_CONTROL       0x02
277 #define UX_CLASS_AUDIO20_DR_MAXAMPL_CONTROL                0x03
278 #define UX_CLASS_AUDIO20_DR_THRESHOLD_CONTROL              0x04
279 #define UX_CLASS_AUDIO20_DR_ATTACK_TIME_CONTROL            0x05
280 #define UX_CLASS_AUDIO20_DR_RELEASE_TIME_CONTROL           0x06
281 #define UX_CLASS_AUDIO20_DR_UNDERFLOW_CONTROL              0x07
282 #define UX_CLASS_AUDIO20_DR_OVERFLOW_CONTROL               0x08
283 #define UX_CLASS_AUDIO20_DR_LATENCY_CONTROL                0x09
284 
285 /* Define Audio Class processing unit control selectors.  */
286 
287 /* Define Audio Class up/down-mix (UD) processing unit control selectors.  */
288 
289 #define UX_CLASS_AUDIO20_UD_CONTROL_UNDEFINED              0x00
290 #define UX_CLASS_AUDIO20_UD_ENABLE_CONTROL                 0x01
291 #define UX_CLASS_AUDIO20_UD_MODE_SELECT_CONTROL            0x02
292 #define UX_CLASS_AUDIO20_UD_CLUSTER_CONTROL                0x03
293 #define UX_CLASS_AUDIO20_UD_UNDERFLOW_CONTROL              0x04
294 #define UX_CLASS_AUDIO20_UD_OVERFLOW_CONTROL               0x05
295 #define UX_CLASS_AUDIO20_UD_LATENCY_CONTROL                0x06
296 
297 /* Define Audio Class dolby prologic (DP) processing unit control selectors.  */
298 
299 #define UX_CLASS_AUDIO20_DP_CONTROL_UNDEFINED              0x00
300 #define UX_CLASS_AUDIO20_DP_ENABLE_CONTROL                 0x01
301 #define UX_CLASS_AUDIO20_DP_MODE_SELECT_CONTROL            0x02
302 #define UX_CLASS_AUDIO20_DP_CLUSTER_CONTROL                0x03
303 #define UX_CLASS_AUDIO20_DP_UNDERFLOW_CONTROL              0x04
304 #define UX_CLASS_AUDIO20_DP_OVERFLOW_CONTROL               0x05
305 #define UX_CLASS_AUDIO20_DP_LATENCY_CONTROL                0x06
306 
307 /* Define Audio Class stereo extender (ST_EXT) processing unit control selectors.  */
308 
309 #define UX_CLASS_AUDIO20_ST_EXT_CONTROL_UNDEFINED          0x00
310 #define UX_CLASS_AUDIO20_ST_EXT_ENABLE_CONTROL             0x01
311 #define UX_CLASS_AUDIO20_ST_EXT_WIDTH_CONTROL              0x02
312 #define UX_CLASS_AUDIO20_ST_EXT_UNDERFLOW_CONTROL          0x03
313 #define UX_CLASS_AUDIO20_ST_EXT_OVERFLOW_CONTROL           0x04
314 #define UX_CLASS_AUDIO20_ST_EXT_LATENCY_CONTROL            0x05
315 
316 /* Define Audio Class extension unit (XU) control selectors.  */
317 
318 #define UX_CLASS_AUDIO20_XU_CONTROL_UNDEFINED              0x00
319 #define UX_CLASS_AUDIO20_XU_ENABLE_CONTROL                 0x01
320 #define UX_CLASS_AUDIO20_XU_CLUSTER_CONTROL                0x02
321 #define UX_CLASS_AUDIO20_XU_UNDERFLOW_CONTROL              0x03
322 #define UX_CLASS_AUDIO20_XU_OVERFLOW_CONTROL               0x04
323 #define UX_CLASS_AUDIO20_XU_LATENCY_CONTROL                0x05
324 
325 
326 /* Define Audio Class AudioStreaming interface control selectors.  */
327 
328 #define UX_CLASS_AUDIO20_AS_CONTROL_UNDEFINED              0x00
329 #define UX_CLASS_AUDIO20_AS_ACT_ALT_SETTING_CONTROL        0x01
330 #define UX_CLASS_AUDIO20_AS_VAL_ALT_SETTINGS_CONTROL       0x02
331 #define UX_CLASS_AUDIO20_AS_AUDIO_DATA_FORMAT_CONTROL      0x03
332 
333 /* Define Audio Class encoder (EN) control selectors.  */
334 
335 #define UX_CLASS_AUDIO20_EN_CONTROL_UNDEFINED              0x00
336 #define UX_CLASS_AUDIO20_EN_BIT_RATE_CONTROL               0x01
337 #define UX_CLASS_AUDIO20_EN_QUALITY_CONTROL                0x02
338 #define UX_CLASS_AUDIO20_EN_VBR_CONTROL                    0x03
339 #define UX_CLASS_AUDIO20_EN_TYPE_CONTROL                   0x04
340 #define UX_CLASS_AUDIO20_EN_UNDERFLOW_CONTROL              0x05
341 #define UX_CLASS_AUDIO20_EN_OVERFLOW_CONTROL               0x06
342 #define UX_CLASS_AUDIO20_EN_ENCODER_ERROR_CONTROL          0x07
343 #define UX_CLASS_AUDIO20_EN_PARAM1_CONTROL                 0x08
344 #define UX_CLASS_AUDIO20_EN_PARAM2_CONTROL                 0x09
345 #define UX_CLASS_AUDIO20_EN_PARAM3_CONTROL                 0x0A
346 #define UX_CLASS_AUDIO20_EN_PARAM4_CONTROL                 0x0B
347 #define UX_CLASS_AUDIO20_EN_PARAM5_CONTROL                 0x0C
348 #define UX_CLASS_AUDIO20_EN_PARAM6_CONTROL                 0x0D
349 #define UX_CLASS_AUDIO20_EN_PARAM7_CONTROL                 0x0E
350 #define UX_CLASS_AUDIO20_EN_PARAM8_CONTROL                 0x0F
351 
352 /* Define Audio Class decoder control selectors.  */
353 
354 /* Define Audio Class MPEG decoder (MD) control selectors.  */
355 
356 #define UX_CLASS_AUDIO20_MD_CONTROL_UNDEFINED              0x00
357 #define UX_CLASS_AUDIO20_MD_DUAL_CHANNEL_CONTROL           0x01
358 #define UX_CLASS_AUDIO20_MD_SECOND_STEREO_CONTROL          0x02
359 #define UX_CLASS_AUDIO20_MD_MULTILINGUAL_CONTROL           0x03
360 #define UX_CLASS_AUDIO20_MD_DYN_RANGE_CONTROL              0x04
361 #define UX_CLASS_AUDIO20_MD_SCALING_CONTROL                0x05
362 #define UX_CLASS_AUDIO20_MD_HILO_SCALING_CONTROL           0x06
363 #define UX_CLASS_AUDIO20_MD_UNDERFLOW_CONTROL              0x07
364 #define UX_CLASS_AUDIO20_MD_OVERFLOW_CONTROL               0x08
365 #define UX_CLASS_AUDIO20_MD_DECODER_ERROR_CONTROL          0x09
366 
367 /* Define Audio Class AC-3 decoder (AD) control selectors.  */
368 
369 #define UX_CLASS_AUDIO20_AD_CONTROL_UNDEFINED              0x00
370 #define UX_CLASS_AUDIO20_AD_MODE_CONTROL                   0x01
371 #define UX_CLASS_AUDIO20_AD_DYN_RANGE_CONTROL              0x02
372 #define UX_CLASS_AUDIO20_AD_SCALING_CONTROL                0x03
373 #define UX_CLASS_AUDIO20_AD_HILO_SCALING_CONTROL           0x04
374 #define UX_CLASS_AUDIO20_AD_UNDERFLOW_CONTROL              0x05
375 #define UX_CLASS_AUDIO20_AD_OVERFLOW_CONTROL               0x06
376 #define UX_CLASS_AUDIO20_AD_DECODER_ERROR_CONTROL          0x07
377 
378 /* Define Audio Class WMA decoder (WD) control selectors.  */
379 
380 #define UX_CLASS_AUDIO20_WD_CONTROL_UNDEFINED              0x00
381 #define UX_CLASS_AUDIO20_WD_UNDERFLOW_CONTROL              0x01
382 #define UX_CLASS_AUDIO20_WD_OVERFLOW_CONTROL               0x02
383 #define UX_CLASS_AUDIO20_WD_DECODER_ERROR_CONTROL          0x03
384 
385 /* Define Audio Class DTS decoder (DD) control selectors.  */
386 
387 #define UX_CLASS_AUDIO20_DD_CONTROL_UNDEFINED              0x00
388 #define UX_CLASS_AUDIO20_DD_UNDERFLOW_CONTROL              0x01
389 #define UX_CLASS_AUDIO20_DD_OVERFLOW_CONTROL               0x02
390 #define UX_CLASS_AUDIO20_DD_DECODER_ERROR_CONTROL          0x03
391 
392 
393 /* Define Audio Class endpoint control selectors.  */
394 
395 #define UX_CLASS_AUDIO20_EP_CONTROL_UNDEFINED              0x00
396 #define UX_CLASS_AUDIO20_EP_PITCH_CONTROL                  0x01
397 #define UX_CLASS_AUDIO20_EP_DATA_OVERRUN_CONTROL           0x02
398 #define UX_CLASS_AUDIO20_EP_DATA_UNDERRUN_CONTROL          0x03
399 
400 
401 /* Define Audio Class format type codes.  */
402 
403 #define UX_CLASS_AUDIO20_FORMAT_TYPE_UNDEFINED             0x00
404 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I                     0x01
405 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II                    0x02
406 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III                   0x03
407 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV                    0x04
408 #define UX_CLASS_AUDIO20_EXT_FORMAT_TYPE_I                 0x81
409 #define UX_CLASS_AUDIO20_EXT_FORMAT_TYPE_II                0x82
410 #define UX_CLASS_AUDIO20_EXT_FORMAT_TYPE_III               0x83
411 
412 
413 /* Define Audio Class encoding format type I bit allocations.  */
414 
415 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_PCM                          (1u << 0)
416 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_PCM8                         (1u << 1)
417 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_IEEE_FLOAT                   (1u << 2)
418 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_ALAW                         (1u << 3)
419 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_MULAW                        (1u << 4)
420 #define UX_CLASS_AUDIO20_FORMAT_TYPE_I_RAW                          (1u << 31)
421 
422 /* Define Audio Class encoding format type II bit allocations.  */
423 
424 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II_MPEG                        (1u << 0)
425 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II_AC3                         (1u << 1)
426 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II_WMA                         (1u << 2)
427 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II_DTS                         (1u << 3)
428 #define UX_CLASS_AUDIO20_FORMAT_TYPE_II_RAW_DATA                    (1u << 31)
429 
430 /* Define Audio Class encoding format type III bit allocations.  */
431 
432 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_AC3               (1u << 0)
433 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG1_LAYER1      (1u << 1)
434 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG1_LAYER2_3    (1u << 2)
435 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG2_NOEXT       (1u << 2)
436 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG2_EXT         (1u << 3)
437 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG2_AAC_ADTS    (1u << 4)
438 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG2_LAYER1_LS   (1u << 5)
439 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_MPEG2_LAYER2_3_LS (1u << 6)
440 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_DTS_I             (1u << 7)
441 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_DTS_II            (1u << 8)
442 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_DTS_III           (1u << 9)
443 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_ATRAC             (1u << 10)
444 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_IEC61937_ATRAC2_3          (1u << 11)
445 #define UX_CLASS_AUDIO20_FORMAT_TYPE_III_WMA                        (1u << 12)
446 
447 /* Define Audio Class encoding format type IV bit allocations.  */
448 
449 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_PCM                         (1u << 0)
450 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_PCM8                        (1u << 1)
451 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEEE_FLOAT                  (1u << 2)
452 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_ALAW                        (1u << 3)
453 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_MULAW                       (1u << 4)
454 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_MPEG                        (1u << 5)
455 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_AC3                         (1u << 6)
456 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_WMA                         (1u << 7)
457 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_AC3                (1u << 8)
458 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG1_LAYER1       (1u << 9)
459 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG1_LAYER2_3     (1u << 10)
460 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG2_NOEXT        (1u << 10)
461 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG2_EXT          (1u << 11)
462 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG2_AAC_ADTS     (1u << 12)
463 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG2_LAYER1_LS    (1u << 13)
464 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_MPEG2_LAYER2_3_LS  (1u << 14)
465 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_DTS_I              (1u << 15)
466 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_DTS_II             (1u << 16)
467 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_DTS_III            (1u << 17)
468 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_ATRAC              (1u << 18)
469 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC61937_ATRAC2_3           (1u << 19)
470 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_TYPE_III_WMA                (1u << 20)
471 #define UX_CLASS_AUDIO20_FORMAT_TYPE_IV_IEC60958_PCM                (1u << 21)
472 
473 /* Define Audio Class side band protocol codes.  */
474 
475 #define UX_CLASS_AUDIO20_SIDE_BAND_PROTOCOL_UNDEFINED               0x00
476 #define UX_CLASS_AUDIO20_SIDE_BAND_PRES_TIMESTAMP_PROTOCOL          0x01
477 
478 
479 /* Define Audio Class bmControls bit pair.  */
480 
481 #define UX_CLASS_AUDIO20_CONTROL_MASK                               0x3u
482 #define UX_CLASS_AUDIO20_CONTROL_NOT_PRESENT                        0x0u
483 #define UX_CLASS_AUDIO20_CONTROL_READ_ONLY                          0x1u
484 #define UX_CLASS_AUDIO20_CONTROL_PROGRAMMABLE                       0x3u
485 
486 /* Control position from control selector (CS).  */
487 #define UX_CLASS_AUDIO20_CONTROL_POS(cs)                            (((cs)-1) << 1)
488 
489 
490 
491 /* Class descriptor structures (packed).
492  * Typedefs to be used:
493  * - for byte               : UCHAR/CHAR
494  * - for word               : USHORT/SHORT
495  * - for double word (dword): ULONG/LONG
496  * - for 64-bit-width word  : ULONG64
497  * Field offset considerations inside descriptor:
498  * - Minimum fields alignment: byte (8-bit)
499  * - Field is not byte and not aligned : field declared as bytes array (UCHAR[])
500  * - Field is word and word aligned    : field declared as USHORT/SHORT
501  * - Field is dword and dword aligned  : field declared as ULONG/LONG
502  */
503 
504 /* Audio Class Audio Channel Cluster Descriptor.  */
505 
506 typedef struct UX_CLASS_AUDIO20_CHANNEL_CLUSTER_DESCRIPTOR_STRUCT
507 {
508     UCHAR           bNrChannels;
509     UCHAR           bmChannelConfig[4];
510     UCHAR           iChannelNames;
511 } UX_CLASS_AUDIO20_CHANNEL_CLUSTER_DESCRIPTOR;
512 
513 /* bmChannelConfig channel bits (F-Front,L-Left,R-Right,C-Center,B-Back,S-Side,T-Top).  */
514 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_FL                 (1u << 0)
515 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_FR                 (1u << 1)
516 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_FC                 (1u << 2)
517 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_LFE                (1u << 3) /* Low Frequency Effects  */
518 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BL                 (1u << 4)
519 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BR                 (1u << 5)
520 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_FLC                (1u << 6)
521 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_FRC                (1u << 7)
522 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BC                 (1u << 8)
523 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_SL                 (1u << 9)
524 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_SR                 (1u << 10)
525 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TC                 (1u << 11)
526 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TFL                (1u << 12)
527 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TFC                (1u << 13)
528 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TFR                (1u << 14)
529 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TBL                (1u << 15)
530 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TBC                (1u << 16)
531 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TBR                (1u << 17)
532 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TFLC               (1u << 18)
533 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TFRC               (1u << 19)
534 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_LLFE               (1u << 20)
535 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_RLFE               (1u << 21)
536 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TSL                (1u << 22)
537 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_TSR                (1u << 23)
538 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BottomC            (1u << 24) /* Bottom Center  */
539 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BLC                (1u << 25)
540 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_BRC                (1u << 26)
541 #define UX_CLASS_AUDIO20_CHANNEL_CLUSTER_CHANNEL_RD                 (1u << 31) /* Raw Data  */
542 
543 /* Audio Class AC interface header descriptors.  */
544 
545 typedef struct UX_CLASS_AUDIO20_AC_HEADER_DESCRIPTOR_STRUCT
546 {
547     UCHAR           bLength;
548     UCHAR           bDescriptorType;
549     UCHAR           bDescriptorSubtype;
550     UCHAR           bcdADC[2];
551     UCHAR           bCategory;
552     USHORT          wTotalLength;
553     UCHAR           bmControls;
554 } UX_CLASS_AUDIO20_AC_HEADER_DESCRIPTOR;
555 
556 /* Define Audio Class clock source descriptor (CSD).  */
557 
558 typedef struct UX_CLASS_AUDIO20_AC_CLOCK_SOURCE_DESCRIPTOR_STRUCT
559 {
560     UCHAR           bLength;
561     UCHAR           bDescriptorType;
562     UCHAR           bDescriptorSubType;
563     UCHAR           bClockID;
564     UCHAR           bmAttributes;
565     UCHAR           bmControls;
566     UCHAR           bAssocTerminal;
567     UCHAR           iClockSource;
568 } UX_CLASS_AUDIO20_AC_CLOCK_SOURCE_DESCRIPTOR, UX_CLASS_AUDIO20_AC_CSD;
569 
570 /* CSD::bmAttributes.  */
571 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_TYPE_MASK                       (0x3u)
572 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_TYPE_EXTERNAL                   (0x0u)
573 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_TYPE_INTERNAL_FIXED             (0x1u)
574 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_TYPE_INTERNAL_VARIABLE          (0x2u)
575 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_TYPE_INTERNAL_PROGRAMMABLE      (0x3u)
576 #define UX_CLASS_AUDIO20_CSD_ATTR_CLOCK_SYNCH_TO_SOF                    (0x1u << 2)
577 
578 /* CSD::bmControls.  */
579 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_FREQ_POS                     (0)
580 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_FREQ_MASK                    (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_FREQ_POS)
581 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_FREQ(v)                      ((v) << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_FREQ_POS)
582 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_VALIDITY_POS                 (2)
583 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_VALIDITY_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_VALIDITY_POS)
584 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_VALIDITY(v)                  ((v) << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_VALIDITY_POS)
585 
586 /* Define Audio Class clock selector descriptor (CXD, bNrInPins=1).  */
587 
588 typedef struct UX_CLASS_AUDIO20_AC_CLOCK_SELECTOR_DESCRIPTOR_STRUCT
589 {
590     UCHAR           bLength;
591     UCHAR           bDescriptorType;
592     UCHAR           bDescriptorSubType;
593     UCHAR           bClockID;
594     UCHAR           bNrInPins;
595     UCHAR           baCSourceID[1];
596     UCHAR           bmControls;
597     UCHAR           iClockSelector;
598 } UX_CLASS_AUDIO20_AC_CLOCK_SELECTOR_DESCRIPTOR, UX_CLASS_AUDIO20_AC_CXD;
599 
600 /* CXD::bmControls.  */
601 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_SELECTOR_POS                 (0)
602 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_SELECTOR_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_SELECTOR_POS)
603 #define UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_SELECTOR(v)                  ((v) << UX_CLASS_AUDIO20_CSD_CONTROL_CLOCK_SELECTOR_POS)
604 
605 /* Define Audio Class clock multiplier descriptor (CMD).  */
606 
607 typedef struct UX_CLASS_AUDIO20_AC_CLOCK_MULTIPLIER_DESCRIPTOR_STRUCT
608 {
609     UCHAR           bLength;
610     UCHAR           bDescriptorType;
611     UCHAR           bDescriptorSubType;
612     UCHAR           bClockID;
613     UCHAR           bCSourceID;
614     UCHAR           bmControls;
615     UCHAR           iClockMultiplier;
616 } UX_CLASS_AUDIO20_AC_CLOCK_MULTIPLIER_DESCRIPTOR, UX_CLASS_AUDIO20_AC_CMD;
617 
618 /* CMD::bmControls.  */
619 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_NUMERATOR_POS                (0)
620 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_NUMERATOR_MASK               (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_NUMERATOR_POS)
621 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_NUMERATOR(v)                 ((v) << UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_NUMERATOR_POS)
622 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_DENOMINATOR_POS              (2)
623 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_DENOMINATOR_MASK             (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_DENOMINATOR_POS)
624 #define UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_DENOMINATOR(v)               ((v) << UX_CLASS_AUDIO20_CMD_CONTROL_CLOCK_DENOMINATOR_POS)
625 
626 /* Define Audio Class input terminal descriptor (ITD).  */
627 
628 typedef struct UX_CLASS_AUDIO20_AC_INPUT_TERMINAL_DESCRIPTOR_STRUCT
629 {
630     UCHAR           bLength;
631     UCHAR           bDescriptorType;
632     UCHAR           bDescriptorSubType;
633     UCHAR           bTerminalID;
634     USHORT          wTerminalType;
635     UCHAR           bAssocTerminal;
636     UCHAR           bCSourceID;
637     UCHAR           bNrChannels;
638     UCHAR           bmChannelConfig[4];
639     UCHAR           iChannelNames;
640     USHORT          bmControls;
641     UCHAR           iTerminal;
642 } UX_CLASS_AUDIO20_AC_INPUT_TERMINAL_DESCRIPTOR, UX_CLASS_AUDIO20_AC_ITD;
643 
644 /* ITD::bmControls.  */
645 #define UX_CLASS_AUDIO20_ITD_CONTROL_COPY_PROTECT_POS                   (0)
646 #define UX_CLASS_AUDIO20_ITD_CONTROL_COPY_PROTECT_MASK                  (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_COPY_PROTECT_POS)
647 #define UX_CLASS_AUDIO20_ITD_CONTROL_COPY_PROTECT(v)                    ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_COPY_PROTECT_POS)
648 #define UX_CLASS_AUDIO20_ITD_CONTROL_CONNECTOR_POS                      (2)
649 #define UX_CLASS_AUDIO20_ITD_CONTROL_CONNECTOR_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_CONNECTOR_POS)
650 #define UX_CLASS_AUDIO20_ITD_CONTROL_CONNECTOR(v)                       ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_CONNECTOR_POS)
651 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERLOAD_POS                       (4)
652 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERLOAD_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_OVERLOAD_POS)
653 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERLOAD(v)                        ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_OVERLOAD_POS)
654 #define UX_CLASS_AUDIO20_ITD_CONTROL_CLUSTER_POS                        (6)
655 #define UX_CLASS_AUDIO20_ITD_CONTROL_CLUSTER_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_CLUSTER_POS)
656 #define UX_CLASS_AUDIO20_ITD_CONTROL_CLUSTER(v)                         ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_CLUSTER_POS)
657 #define UX_CLASS_AUDIO20_ITD_CONTROL_UNDERFLOW_POS                      (8)
658 #define UX_CLASS_AUDIO20_ITD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_UNDERFLOW_POS)
659 #define UX_CLASS_AUDIO20_ITD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_UNDERFLOW_POS)
660 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERFLOW_POS                       (10)
661 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ITD_CONTROL_OVERFLOW_POS)
662 #define UX_CLASS_AUDIO20_ITD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_ITD_CONTROL_OVERFLOW_POS)
663 
664 /* Define Audio Class output terminal descriptor (OTD).  */
665 
666 typedef struct UX_CLASS_AUDIO20_AC_OUTPUT_TERMINAL_DESCRIPTOR_STRUCT
667 {
668     UCHAR           bLength;
669     UCHAR           bDescriptorType;
670     UCHAR           bDescriptorSubType;
671     UCHAR           bTerminalID;
672     USHORT          wTerminalType;
673     UCHAR           bAssocTerminal;
674     UCHAR           bSourceID;
675     UCHAR           bCSourceID;
676     UCHAR           bmControls[2];
677     UCHAR           iTerminal;
678 } UX_CLASS_AUDIO20_AC_OUTPUT_TERMINAL_DESCRIPTOR, UX_CLASS_AUDIO20_AC_OTD;
679 
680 /* OTD::bmControls.  */
681 #define UX_CLASS_AUDIO20_OTD_CONTROL_COPY_PROTECT_POS                   (0)
682 #define UX_CLASS_AUDIO20_OTD_CONTROL_COPY_PROTECT_MASK                  (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_OTD_CONTROL_COPY_PROTECT_POS)
683 #define UX_CLASS_AUDIO20_OTD_CONTROL_COPY_PROTECT(v)                    ((v) << UX_CLASS_AUDIO20_OTD_CONTROL_COPY_PROTECT_POS)
684 #define UX_CLASS_AUDIO20_OTD_CONTROL_CONNECTOR_POS                      (2)
685 #define UX_CLASS_AUDIO20_OTD_CONTROL_CONNECTOR_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_OTD_CONTROL_CONNECTOR_POS)
686 #define UX_CLASS_AUDIO20_OTD_CONTROL_CONNECTOR(v)                       ((v) << UX_CLASS_AUDIO20_OTD_CONTROL_CONNECTOR_POS)
687 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERLOAD_POS                       (4)
688 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERLOAD_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_OTD_CONTROL_OVERLOAD_POS)
689 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERLOAD(v)                        ((v) << UX_CLASS_AUDIO20_OTD_CONTROL_OVERLOAD_POS)
690 #define UX_CLASS_AUDIO20_OTD_CONTROL_UNDERFLOW_POS                      (6)
691 #define UX_CLASS_AUDIO20_OTD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_OTD_CONTROL_UNDERFLOW_POS)
692 #define UX_CLASS_AUDIO20_OTD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_OTD_CONTROL_UNDERFLOW_POS)
693 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERFLOW_POS                       (8)
694 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_OTD_CONTROL_OVERFLOW_POS)
695 #define UX_CLASS_AUDIO20_OTD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_OTD_CONTROL_OVERFLOW_POS)
696 
697 /* Define Audio Class mixer unit descriptor (MUD, bNrInPins=1, bmMixerControls N=1).  */
698 
699 typedef struct UX_CLASS_AUDIO20_AC_MIXER_UNIT_DESCRIPTOR_STRUCT
700 {
701     UCHAR           bLength;
702     UCHAR           bDescriptorType;
703     UCHAR           bDescriptorSubType;
704     UCHAR           bUnitID;
705     UCHAR           bNrInPins;
706     UCHAR           baSourceID[1];
707     UCHAR           bNrChannels;
708     UCHAR           bmChannelConfig[4];
709     UCHAR           iChannelNames;
710     UCHAR           bmMixerControls[1];
711     UCHAR           bmControls;
712     UCHAR           iMixer;
713 } UX_CLASS_AUDIO20_AC_MIXER_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_MUD;
714 
715 /* MUD::bmControls.  */
716 #define UX_CLASS_AUDIO20_MUD_CONTROL_CLUSTER_POS                        (0)
717 #define UX_CLASS_AUDIO20_MUD_CONTROL_CLUSTER_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MUD_CONTROL_CLUSTER_POS)
718 #define UX_CLASS_AUDIO20_MUD_CONTROL_CLUSTER(v)                         ((v) << UX_CLASS_AUDIO20_MUD_CONTROL_CLUSTER_POS)
719 #define UX_CLASS_AUDIO20_MUD_CONTROL_UNDERFLOW_POS                      (2)
720 #define UX_CLASS_AUDIO20_MUD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MUD_CONTROL_UNDERFLOW_POS)
721 #define UX_CLASS_AUDIO20_MUD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_MUD_CONTROL_UNDERFLOW_POS)
722 #define UX_CLASS_AUDIO20_MUD_CONTROL_OVERFLOW_POS                       (4)
723 #define UX_CLASS_AUDIO20_MUD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MUD_CONTROL_OVERFLOW_POS)
724 #define UX_CLASS_AUDIO20_MUD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_MUD_CONTROL_OVERFLOW_POS)
725 
726 /* Define Audio Class selector unit descriptor (SUD, bNrInPins=1).  */
727 
728 typedef struct UX_CLASS_AUDIO20_AC_SELECTOR_UNIT_DESCRIPTOR_STRUCT
729 {
730     UCHAR           bLength;
731     UCHAR           bDescriptorType;
732     UCHAR           bDescriptorSubType;
733     UCHAR           bUnitID;
734     UCHAR           bNrInPins;
735     UCHAR           baSourceID[1];
736     UCHAR           bmControls;
737     UCHAR           iSelector;
738 } UX_CLASS_AUDIO20_AC_SELECTOR_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_SUD;
739 
740 /* SUD::bmControls.  */
741 #define UX_CLASS_AUDIO20_SUD_CONTROL_SELECTOR_POS                       (0)
742 #define UX_CLASS_AUDIO20_SUD_CONTROL_SELECTOR_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_SUD_CONTROL_SELECTOR_POS)
743 #define UX_CLASS_AUDIO20_SUD_CONTROL_SELECTOR(v)                        ((v) << UX_CLASS_AUDIO20_SUD_CONTROL_SELECTOR_POS)
744 
745 /* Define Audio Class feature unit descriptor (FUD, ch=1).  */
746 
747 typedef struct UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_STRUCT
748 {
749     UCHAR           bLength;
750     UCHAR           bDescriptorType;
751     UCHAR           bDescriptorSubType;
752     UCHAR           bUnitID;
753     UCHAR           bSourceID;
754     UCHAR           bmaControls[4 * 2];
755     UCHAR           iFeature;
756 } UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_FUD;
757 
758 /* FUD::bmControls.  */
759 #define UX_CLASS_AUDIO20_FUD_CONTROL_MUTE_POS                           (0)
760 #define UX_CLASS_AUDIO20_FUD_CONTROL_MUTE_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_MUTE_POS)
761 #define UX_CLASS_AUDIO20_FUD_CONTROL_MUTE(v)                            ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_MUTE_POS)
762 #define UX_CLASS_AUDIO20_FUD_CONTROL_VOLUME_POS                         (2)
763 #define UX_CLASS_AUDIO20_FUD_CONTROL_VOLUME_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_VOLUME_POS)
764 #define UX_CLASS_AUDIO20_FUD_CONTROL_VOLUME(v)                          ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_VOLUME_POS)
765 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS_POS                           (4)
766 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_BASS_POS)
767 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS(v)                            ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_BASS_POS)
768 #define UX_CLASS_AUDIO20_FUD_CONTROL_MID_POS                            (6)
769 #define UX_CLASS_AUDIO20_FUD_CONTROL_MID_MASK                           (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_MID_POS)
770 #define UX_CLASS_AUDIO20_FUD_CONTROL_MID(v)                             ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_MID_POS)
771 #define UX_CLASS_AUDIO20_FUD_CONTROL_TREBLE_POS                         (8)
772 #define UX_CLASS_AUDIO20_FUD_CONTROL_TREBLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_TREBLE_POS)
773 #define UX_CLASS_AUDIO20_FUD_CONTROL_TREBLE(v)                          ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_TREBLE_POS)
774 #define UX_CLASS_AUDIO20_FUD_CONTROL_GRAPHIC_EQ_POS                     (10)
775 #define UX_CLASS_AUDIO20_FUD_CONTROL_GRAPHIC_EQ_MASK                    (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_GRAPHIC_EQ_POS)
776 #define UX_CLASS_AUDIO20_FUD_CONTROL_GRAPHIC_EQ(v)                      ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_GRAPHIC_EQ_POS)
777 #define UX_CLASS_AUDIO20_FUD_CONTROL_AUTO_GAIN_POS                      (12)
778 #define UX_CLASS_AUDIO20_FUD_CONTROL_AUTO_GAIN_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_AUTO_GAIN_POS)
779 #define UX_CLASS_AUDIO20_FUD_CONTROL_AUTO_GAIN(v)                       ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_AUTO_GAIN_POS)
780 #define UX_CLASS_AUDIO20_FUD_CONTROL_DELAY_POS                          (14)
781 #define UX_CLASS_AUDIO20_FUD_CONTROL_DELAY_MASK                         (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_DELAY_POS)
782 #define UX_CLASS_AUDIO20_FUD_CONTROL_DELAY(v)                           ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_DELAY_POS)
783 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS_BOOST_POS                     (16)
784 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS_BOOST_MASK                    (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_BASS_BOOST_POS)
785 #define UX_CLASS_AUDIO20_FUD_CONTROL_BASS_BOOST(v)                      ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_BASS_BOOST_POS)
786 #define UX_CLASS_AUDIO20_FUD_CONTROL_LOUDNESS_POS                       (18)
787 #define UX_CLASS_AUDIO20_FUD_CONTROL_LOUDNESS_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_LOUDNESS_POS)
788 #define UX_CLASS_AUDIO20_FUD_CONTROL_LOUDNESS(v)                        ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_LOUDNESS_POS)
789 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_POS                     (20)
790 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_MASK                    (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_POS)
791 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN(v)                      ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_POS)
792 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_PAD_POS                 (22)
793 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_PAD_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_PAD_POS)
794 #define UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_PAD(v)                  ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_INPUT_GAIN_PAD_POS)
795 #define UX_CLASS_AUDIO20_FUD_CONTROL_PHASE_INVERTER_POS                 (24)
796 #define UX_CLASS_AUDIO20_FUD_CONTROL_PHASE_INVERTER_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_PHASE_INVERTER_POS)
797 #define UX_CLASS_AUDIO20_FUD_CONTROL_PHASE_INVERTER(v)                  ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_PHASE_INVERTER_POS)
798 #define UX_CLASS_AUDIO20_FUD_CONTROL_UNDERFLOW_POS                      (26)
799 #define UX_CLASS_AUDIO20_FUD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_UNDERFLOW_POS)
800 #define UX_CLASS_AUDIO20_FUD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_UNDERFLOW_POS)
801 #define UX_CLASS_AUDIO20_FUD_CONTROL_OVERFLOW_POS                       (28)
802 #define UX_CLASS_AUDIO20_FUD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_FUD_CONTROL_OVERFLOW_POS)
803 #define UX_CLASS_AUDIO20_FUD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_FUD_CONTROL_OVERFLOW_POS)
804 
805 typedef struct UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_1_STRUCT
806 {
807     UCHAR           bLength;
808     UCHAR           bDescriptorType;
809     UCHAR           bDescriptorSubType;
810     UCHAR           bUnitID;
811     UCHAR           bSourceID;
812     UCHAR           bmaControl0[4];
813     UCHAR           bmaControl1[4];
814     UCHAR           iFeature;
815 } UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_1, UX_CLASS_AUDIO20_AC_FUD_1;
816 
817 typedef struct UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_2_STRUCT
818 {
819     UCHAR           bLength;
820     UCHAR           bDescriptorType;
821     UCHAR           bDescriptorSubType;
822     UCHAR           bUnitID;
823     UCHAR           bSourceID;
824     UCHAR           bmaControl0[4];
825     UCHAR           bmaControl1[4];
826     UCHAR           bmaControl2[4];
827     UCHAR           iFeature;
828 } UX_CLASS_AUDIO20_AC_FEATURE_UNIT_DESCRIPTOR_2, UX_CLASS_AUDIO20_AC_FUD_2;
829 
830 /* Define Audio Class sampling rate converter descriptor (RDU).  */
831 
832 typedef struct UX_CLASS_AUDIO20_AC_SAMPLING_RATE_CONVERTER_DESCRIPTOR_STRUCT
833 {
834     UCHAR           bLength;
835     UCHAR           bDescriptorType;
836     UCHAR           bDescriptorSubType;
837     UCHAR           bUnitID;
838     UCHAR           bSourceID;
839     UCHAR           bSourceInID;
840     UCHAR           bSourceOutID;
841     UCHAR           iSRC;
842 } UX_CLASS_AUDIO20_AC_SAMPLING_RATE_CONVERTER_DESCRIPTOR, UX_CLASS_AUDIO20_AC_RUD;
843 
844 /* Define Audio Class effect unit descriptor (EUD, ch=1).  */
845 
846 typedef struct UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR_STRUCT
847 {
848     UCHAR           bLength;
849     UCHAR           bDescriptorType;
850     UCHAR           bDescriptorSubType;
851     UCHAR           bUnitID;
852     USHORT          wEffectType;
853     UCHAR           bSourceID;
854     UCHAR           bmaControls[4 * 2];
855     UCHAR           iEffects;
856 } UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_EUD;
857 
858 typedef struct UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR_1_STRUCT
859 {
860     UCHAR           bLength;
861     UCHAR           bDescriptorType;
862     UCHAR           bDescriptorSubType;
863     UCHAR           bUnitID;
864     USHORT          wEffectType;
865     UCHAR           bSourceID;
866     UCHAR           bmaControl0[4];
867     UCHAR           bmaControl1[4];
868     UCHAR           iEffects;
869 } UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR_1, UX_CLASS_AUDIO20_AC_EUD_1;
870 
871 typedef struct UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR_2_STRUCT
872 {
873     UCHAR           bLength;
874     UCHAR           bDescriptorType;
875     UCHAR           bDescriptorSubType;
876     UCHAR           bUnitID;
877     USHORT          wEffectType;
878     UCHAR           bSourceID;
879     UCHAR           bmaControl0[4];
880     UCHAR           bmaControl1[4];
881     UCHAR           bmaControl2[4];
882     UCHAR           iEffects;
883 } UX_CLASS_AUDIO20_AC_EFFECT_UNIT_DESCRIPTOR_2, UX_CLASS_AUDIO20_AC_EUD_2;
884 
885 /* Parametric Equalizer Section (PEQS) EUD(PED)::bmaControls.  */
886 #define UX_CLASS_AUDIO20_PED_CONTROL_ENABLE_POS                         (0)
887 #define UX_CLASS_AUDIO20_PED_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_ENABLE_POS)
888 #define UX_CLASS_AUDIO20_PED_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_PED_CONTROL_ENABLE_POS)
889 #define UX_CLASS_AUDIO20_PED_CONTROL_CENTER_FREQ_POS                    (2)
890 #define UX_CLASS_AUDIO20_PED_CONTROL_CENTER_FREQ_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_CENTER_FREQ_POS)
891 #define UX_CLASS_AUDIO20_PED_CONTROL_CENTER_FREQ(v)                     ((v) << UX_CLASS_AUDIO20_PED_CONTROL_CENTER_FREQ_POS)
892 #define UX_CLASS_AUDIO20_PED_CONTROL_Q_FACTOR_POS                       (4)
893 #define UX_CLASS_AUDIO20_PED_CONTROL_Q_FACTOR_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_Q_FACTOR_POS)
894 #define UX_CLASS_AUDIO20_PED_CONTROL_Q_FACTOR(v)                        ((v) << UX_CLASS_AUDIO20_PED_CONTROL_Q_FACTOR_POS)
895 #define UX_CLASS_AUDIO20_PED_CONTROL_GAIN_POS                           (6)
896 #define UX_CLASS_AUDIO20_PED_CONTROL_GAIN_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_GAIN_POS)
897 #define UX_CLASS_AUDIO20_PED_CONTROL_GAIN(v)                            ((v) << UX_CLASS_AUDIO20_PED_CONTROL_GAIN_POS)
898 #define UX_CLASS_AUDIO20_PED_CONTROL_UNDERFLOW_POS                      (8)
899 #define UX_CLASS_AUDIO20_PED_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_UNDERFLOW_POS)
900 #define UX_CLASS_AUDIO20_PED_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_PED_CONTROL_UNDERFLOW_POS)
901 #define UX_CLASS_AUDIO20_PED_CONTROL_OVERFLOW_POS                       (10)
902 #define UX_CLASS_AUDIO20_PED_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PED_CONTROL_OVERFLOW_POS)
903 #define UX_CLASS_AUDIO20_PED_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_PED_CONTROL_OVERFLOW_POS)
904 
905 /* Reverberation EUD(RVD)::bmaControls.  */
906 #define UX_CLASS_AUDIO20_RVD_CONTROL_ENABLE_POS                         (0)
907 #define UX_CLASS_AUDIO20_RVD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_ENABLE_POS)
908 #define UX_CLASS_AUDIO20_RVD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_ENABLE_POS)
909 #define UX_CLASS_AUDIO20_RVD_CONTROL_TYPE_POS                           (2)
910 #define UX_CLASS_AUDIO20_RVD_CONTROL_TYPE_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_TYPE_POS)
911 #define UX_CLASS_AUDIO20_RVD_CONTROL_TYPE(v)                            ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_TYPE_POS)
912 #define UX_CLASS_AUDIO20_RVD_CONTROL_LEVEL_POS                          (4)
913 #define UX_CLASS_AUDIO20_RVD_CONTROL_LEVEL_MASK                         (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_LEVEL_POS)
914 #define UX_CLASS_AUDIO20_RVD_CONTROL_LEVEL(v)                           ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_LEVEL_POS)
915 #define UX_CLASS_AUDIO20_RVD_CONTROL_TIME_POS                           (6)
916 #define UX_CLASS_AUDIO20_RVD_CONTROL_TIME_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_TIME_POS)
917 #define UX_CLASS_AUDIO20_RVD_CONTROL_TIME(v)                            ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_TIME_POS)
918 #define UX_CLASS_AUDIO20_RVD_CONTROL_DELAY_FEEDBACK_POS                 (8)
919 #define UX_CLASS_AUDIO20_RVD_CONTROL_DELAY_FEEDBACK_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_DELAY_FEEDBACK_POS)
920 #define UX_CLASS_AUDIO20_RVD_CONTROL_DELAY_FEEDBACK(v)                  ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_DELAY_FEEDBACK_POS)
921 #define UX_CLASS_AUDIO20_RVD_CONTROL_PRE_DELAY_POS                      (10)
922 #define UX_CLASS_AUDIO20_RVD_CONTROL_PRE_DELAY_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_PRE_DELAY_POS)
923 #define UX_CLASS_AUDIO20_RVD_CONTROL_PRE_DELAY(v)                       ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_PRE_DELAY_POS)
924 #define UX_CLASS_AUDIO20_RVD_CONTROL_DENSITY_POS                        (12)
925 #define UX_CLASS_AUDIO20_RVD_CONTROL_DENSITY_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_DENSITY_POS)
926 #define UX_CLASS_AUDIO20_RVD_CONTROL_DENSITY(v)                         ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_DENSITY_POS)
927 #define UX_CLASS_AUDIO20_RVD_CONTROL_HI_FREQ_ROLL_OFF_POS               (14)
928 #define UX_CLASS_AUDIO20_RVD_CONTROL_HI_FREQ_ROLL_OFF_MASK              (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_HI_FREQ_ROLL_OFF_POS)
929 #define UX_CLASS_AUDIO20_RVD_CONTROL_HI_FREQ_ROLL_OFF(v)                ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_HI_FREQ_ROLL_OFF_POS)
930 #define UX_CLASS_AUDIO20_RVD_CONTROL_UNDERFLOW_POS                      (16)
931 #define UX_CLASS_AUDIO20_RVD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_UNDERFLOW_POS)
932 #define UX_CLASS_AUDIO20_RVD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_UNDERFLOW_POS)
933 #define UX_CLASS_AUDIO20_RVD_CONTROL_OVERFLOW_POS                       (18)
934 #define UX_CLASS_AUDIO20_RVD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_RVD_CONTROL_OVERFLOW_POS)
935 #define UX_CLASS_AUDIO20_RVD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_RVD_CONTROL_OVERFLOW_POS)
936 
937 /* Modulation Delay EUD(MDD)::bmaControls.  */
938 #define UX_CLASS_AUDIO20_MDD_CONTROL_ENABLE_POS                         (0)
939 #define UX_CLASS_AUDIO20_MDD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_ENABLE_POS)
940 #define UX_CLASS_AUDIO20_MDD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_ENABLE_POS)
941 #define UX_CLASS_AUDIO20_MDD_CONTROL_BALANCE_POS                        (2)
942 #define UX_CLASS_AUDIO20_MDD_CONTROL_BALANCE_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_BALANCE_POS)
943 #define UX_CLASS_AUDIO20_MDD_CONTROL_BALANCE(v)                         ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_BALANCE_POS)
944 #define UX_CLASS_AUDIO20_MDD_CONTROL_RATE_POS                           (4)
945 #define UX_CLASS_AUDIO20_MDD_CONTROL_RATE_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_RATE_POS)
946 #define UX_CLASS_AUDIO20_MDD_CONTROL_RATE(v)                            ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_RATE_POS)
947 #define UX_CLASS_AUDIO20_MDD_CONTROL_DEPTH_POS                          (6)
948 #define UX_CLASS_AUDIO20_MDD_CONTROL_DEPTH_MASK                         (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_DEPTH_POS)
949 #define UX_CLASS_AUDIO20_MDD_CONTROL_DEPTH(v)                           ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_DEPTH_POS)
950 #define UX_CLASS_AUDIO20_MDD_CONTROL_TIME_POS                           (8)
951 #define UX_CLASS_AUDIO20_MDD_CONTROL_TIME_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_TIME_POS)
952 #define UX_CLASS_AUDIO20_MDD_CONTROL_TIME(v)                            ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_TIME_POS)
953 #define UX_CLASS_AUDIO20_MDD_CONTROL_FEEDBACK_LEVEL_POS                 (10)
954 #define UX_CLASS_AUDIO20_MDD_CONTROL_FEEDBACK_LEVEL_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_FEEDBACK_LEVEL_POS)
955 #define UX_CLASS_AUDIO20_MDD_CONTROL_FEEDBACK_LEVEL(v)                  ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_FEEDBACK_LEVEL_POS)
956 #define UX_CLASS_AUDIO20_MDD_CONTROL_UNDERFLOW_POS                      (12)
957 #define UX_CLASS_AUDIO20_MDD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_UNDERFLOW_POS)
958 #define UX_CLASS_AUDIO20_MDD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_UNDERFLOW_POS)
959 #define UX_CLASS_AUDIO20_MDD_CONTROL_OVERFLOW_POS                       (14)
960 #define UX_CLASS_AUDIO20_MDD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MDD_CONTROL_OVERFLOW_POS)
961 #define UX_CLASS_AUDIO20_MDD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_MDD_CONTROL_OVERFLOW_POS)
962 
963 /* Dynamic Range Compressor EUD(DRD)::bmaControls.  */
964 #define UX_CLASS_AUDIO20_DRD_CONTROL_ENABLE_POS                         (0)
965 #define UX_CLASS_AUDIO20_DRD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_ENABLE_POS)
966 #define UX_CLASS_AUDIO20_DRD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_ENABLE_POS)
967 #define UX_CLASS_AUDIO20_DRD_CONTROL_COMPRESS_RATIO_POS                 (2)
968 #define UX_CLASS_AUDIO20_DRD_CONTROL_COMPRESS_RATIO_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_COMPRESS_RATIO_POS)
969 #define UX_CLASS_AUDIO20_DRD_CONTROL_COMPRESS_RATIO(v)                  ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_COMPRESS_RATIO_POS)
970 #define UX_CLASS_AUDIO20_DRD_CONTROL_MAX_AMPL_POS                       (4)
971 #define UX_CLASS_AUDIO20_DRD_CONTROL_MAX_AMPL_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_MAX_AMPL_POS)
972 #define UX_CLASS_AUDIO20_DRD_CONTROL_MAX_AMPL(v)                        ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_MAX_AMPL_POS)
973 #define UX_CLASS_AUDIO20_DRD_CONTROL_THRESHOLD_POS                      (6)
974 #define UX_CLASS_AUDIO20_DRD_CONTROL_THRESHOLD_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_THRESHOLD_POS)
975 #define UX_CLASS_AUDIO20_DRD_CONTROL_THRESHOLD(v)                       ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_THRESHOLD_POS)
976 #define UX_CLASS_AUDIO20_DRD_CONTROL_ATTACK_TIME_POS                    (8)
977 #define UX_CLASS_AUDIO20_DRD_CONTROL_ATTACK_TIME_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_ATTACK_TIME_POS)
978 #define UX_CLASS_AUDIO20_DRD_CONTROL_ATTACK_TIME(v)                     ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_ATTACK_TIME_POS)
979 #define UX_CLASS_AUDIO20_DRD_CONTROL_RELEASE_TIME_POS                   (10)
980 #define UX_CLASS_AUDIO20_DRD_CONTROL_RELEASE_TIME_MASK                  (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_RELEASE_TIME_POS)
981 #define UX_CLASS_AUDIO20_DRD_CONTROL_RELEASE_TIME(v)                    ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_RELEASE_TIME_POS)
982 #define UX_CLASS_AUDIO20_DRD_CONTROL_UNDERFLOW_POS                      (12)
983 #define UX_CLASS_AUDIO20_DRD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_UNDERFLOW_POS)
984 #define UX_CLASS_AUDIO20_DRD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_UNDERFLOW_POS)
985 #define UX_CLASS_AUDIO20_DRD_CONTROL_OVERFLOW_POS                       (14)
986 #define UX_CLASS_AUDIO20_DRD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DRD_CONTROL_OVERFLOW_POS)
987 #define UX_CLASS_AUDIO20_DRD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_DRD_CONTROL_OVERFLOW_POS)
988 
989 /* Define Audio Class processing unit descriptor (PUD, bNrInPins=1).  */
990 
991 typedef struct UX_CLASS_AUDIO20_AC_PROCESSING_UNIT_DESCRIPTOR_STRUCT
992 {
993     UCHAR           bLength;
994     UCHAR           bDescriptorType;
995     UCHAR           bDescriptorSubType;
996     UCHAR           bUnitID;
997     USHORT          wProcessType;
998     UCHAR           bNrInPins;
999     UCHAR           baSourceID[1];
1000     UCHAR           bNrChannels;
1001     UCHAR           bmChannelConfig[4];
1002     UCHAR           iChannelNames;
1003     USHORT          bmControls;
1004     UCHAR           iProcessing;
1005 } UX_CLASS_AUDIO20_AC_PROCESSING_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_PUD;
1006 
1007 /* PDU::bmaControls.  */
1008 #define UX_CLASS_AUDIO20_PDU_CONTROL_ENABLE_POS                         (0)
1009 #define UX_CLASS_AUDIO20_PDU_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_PDU_CONTROL_ENABLE_POS)
1010 #define UX_CLASS_AUDIO20_PDU_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_PDU_CONTROL_ENABLE_POS)
1011 
1012 /* Define Audio Class up/down processing unit descriptor (PUD, bNrInPins=1, bNrModes=1).  */
1013 
1014 typedef struct UX_CLASS_AUDIO20_AC_UP_DOWN_PROCESSING_UNIT_DESCRIPTOR_STRUCT
1015 {
1016     UCHAR           bLength;
1017     UCHAR           bDescriptorType;
1018     UCHAR           bDescriptorSubType;
1019     UCHAR           bUnitID;
1020     USHORT          wProcessType;
1021     UCHAR           bNrInPins;
1022     UCHAR           baSourceID[1];
1023     UCHAR           bNrChannels;
1024     UCHAR           bmChannelConfig[4];
1025     UCHAR           iChannelNames;
1026     USHORT          bmControls;
1027     UCHAR           iProcessing;
1028     UCHAR           bNrModes;
1029     UCHAR           daModes[4 * 1];
1030 } UX_CLASS_AUDIO20_AC_UP_DOWN_PROCESSING_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_UDD;
1031 
1032 /* UDD::bmaControls.  */
1033 #define UX_CLASS_AUDIO20_UDD_CONTROL_ENABLE_POS                         (0)
1034 #define UX_CLASS_AUDIO20_UDD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_UDD_CONTROL_ENABLE_POS)
1035 #define UX_CLASS_AUDIO20_UDD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_UDD_CONTROL_ENABLE_POS)
1036 #define UX_CLASS_AUDIO20_UDD_CONTROL_MODE_SELECT_POS                    (2)
1037 #define UX_CLASS_AUDIO20_UDD_CONTROL_MODE_SELECT_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_UDD_CONTROL_MODE_SELECT_POS)
1038 #define UX_CLASS_AUDIO20_UDD_CONTROL_MODE_SELECT(v)                     ((v) << UX_CLASS_AUDIO20_UDD_CONTROL_MODE_SELECT_POS)
1039 #define UX_CLASS_AUDIO20_UDD_CONTROL_CLUSTER_POS                        (4)
1040 #define UX_CLASS_AUDIO20_UDD_CONTROL_CLUSTER_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_UDD_CONTROL_CLUSTER_POS)
1041 #define UX_CLASS_AUDIO20_UDD_CONTROL_CLUSTER(v)                         ((v) << UX_CLASS_AUDIO20_UDD_CONTROL_CLUSTER_POS)
1042 #define UX_CLASS_AUDIO20_UDD_CONTROL_UNDERFLOW_POS                      (6)
1043 #define UX_CLASS_AUDIO20_UDD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_UDD_CONTROL_UNDERFLOW_POS)
1044 #define UX_CLASS_AUDIO20_UDD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_UDD_CONTROL_UNDERFLOW_POS)
1045 #define UX_CLASS_AUDIO20_UDD_CONTROL_OVERFLOW_POS                       (8)
1046 #define UX_CLASS_AUDIO20_UDD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_UDD_CONTROL_OVERFLOW_POS)
1047 #define UX_CLASS_AUDIO20_UDD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_UDD_CONTROL_OVERFLOW_POS)
1048 
1049 /* Define Audio Class dolby prologic processing unit descriptor (DPD, bNrInPins=1, bNrModes=1).  */
1050 
1051 typedef struct UX_CLASS_AUDIO20_AC_DOLBY_PROCESSING_UNIT_DESCRIPTOR_STRUCT
1052 {
1053     UCHAR           bLength;
1054     UCHAR           bDescriptorType;
1055     UCHAR           bDescriptorSubType;
1056     UCHAR           bUnitID;
1057     USHORT          wProcessType;
1058     UCHAR           bNrInPins;
1059     UCHAR           baSourceID[1];
1060     UCHAR           bNrChannels;
1061     UCHAR           bmChannelConfig[4];
1062     UCHAR           iChannelNames;
1063     USHORT          bmControls;
1064     UCHAR           iProcessing;
1065     UCHAR           bNrModes;
1066     UCHAR           daModes[4 * 1];
1067 } UX_CLASS_AUDIO20_AC_DOLBY_PROCESSING_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_DPD;
1068 
1069 /* DPD::bmaControls.  */
1070 #define UX_CLASS_AUDIO20_DPD_CONTROL_ENABLE_POS                         (0)
1071 #define UX_CLASS_AUDIO20_DPD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DPD_CONTROL_ENABLE_POS)
1072 #define UX_CLASS_AUDIO20_DPD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_DPD_CONTROL_ENABLE_POS)
1073 #define UX_CLASS_AUDIO20_DPD_CONTROL_MODE_SELECT_POS                    (2)
1074 #define UX_CLASS_AUDIO20_DPD_CONTROL_MODE_SELECT_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DPD_CONTROL_MODE_SELECT_POS)
1075 #define UX_CLASS_AUDIO20_DPD_CONTROL_MODE_SELECT(v)                     ((v) << UX_CLASS_AUDIO20_DPD_CONTROL_MODE_SELECT_POS)
1076 #define UX_CLASS_AUDIO20_DPD_CONTROL_CLUSTER_POS                        (4)
1077 #define UX_CLASS_AUDIO20_DPD_CONTROL_CLUSTER_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DPD_CONTROL_CLUSTER_POS)
1078 #define UX_CLASS_AUDIO20_DPD_CONTROL_CLUSTER(v)                         ((v) << UX_CLASS_AUDIO20_DPD_CONTROL_CLUSTER_POS)
1079 #define UX_CLASS_AUDIO20_DPD_CONTROL_UNDERFLOW_POS                      (6)
1080 #define UX_CLASS_AUDIO20_DPD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DPD_CONTROL_UNDERFLOW_POS)
1081 #define UX_CLASS_AUDIO20_DPD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_DPD_CONTROL_UNDERFLOW_POS)
1082 #define UX_CLASS_AUDIO20_DPD_CONTROL_OVERFLOW_POS                       (8)
1083 #define UX_CLASS_AUDIO20_DPD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DPD_CONTROL_OVERFLOW_POS)
1084 #define UX_CLASS_AUDIO20_DPD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_DPD_CONTROL_OVERFLOW_POS)
1085 
1086 /* Define Audio Class Stereo Extender (ST_EXT) Processing Unit Descriptor.  */
1087 typedef UX_CLASS_AUDIO20_AC_PUD UX_CLASS_AUDIO20_AC_STEREO_EXT_PROCESSING_UNIT_DESCRIPTOR;
1088 typedef UX_CLASS_AUDIO20_AC_PUD UX_CLASS_AUDIO20_AC_ST_EXTD;
1089 
1090 /* ST_EXTD::bmaControls.  */
1091 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_ENABLE_POS                         (0)
1092 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_ENABLE_MASK                        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_ENABLE_POS)
1093 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_ENABLE(v)                          ((v) << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_ENABLE_POS)
1094 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_MODE_SELECT_POS                    (2)
1095 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_MODE_SELECT_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_MODE_SELECT_POS)
1096 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_MODE_SELECT(v)                     ((v) << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_MODE_SELECT_POS)
1097 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_CLUSTER_POS                        (4)
1098 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_CLUSTER_MASK                       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_CLUSTER_POS)
1099 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_CLUSTER(v)                         ((v) << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_CLUSTER_POS)
1100 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_UNDERFLOW_POS                      (6)
1101 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_UNDERFLOW_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_UNDERFLOW_POS)
1102 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_UNDERFLOW(v)                       ((v) << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_UNDERFLOW_POS)
1103 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_OVERFLOW_POS                       (8)
1104 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_OVERFLOW_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_OVERFLOW_POS)
1105 #define UX_CLASS_AUDIO20_ST_EXTD_CONTROL_OVERFLOW(v)                        ((v) << UX_CLASS_AUDIO20_ST_EXTD_CONTROL_OVERFLOW_POS)
1106 
1107 /* Define Audio Class extension unit descriptor (XUD, bNrInPins=1).  */
1108 
1109 typedef struct UX_CLASS_AUDIO20_AC_EXTENSION_UNIT_DESCRIPTOR_STRUCT
1110 {
1111     UCHAR           bLength;
1112     UCHAR           bDescriptorType;
1113     UCHAR           bDescriptorSubType;
1114     UCHAR           bUnitID;
1115     USHORT          wExtensionCode;
1116     UCHAR           bNrInPins;
1117     UCHAR           baSourceID[1];
1118     UCHAR           bNrChannels;
1119     UCHAR           bmChannelConfig[4];
1120     UCHAR           iChannelNames;
1121     USHORT          bmControls;
1122     UCHAR           iExtension;
1123 } UX_CLASS_AUDIO20_AC_EXTENSION_UNIT_DESCRIPTOR, UX_CLASS_AUDIO20_AC_XUD;
1124 
1125 /* XUD::bmaControls.  */
1126 #define UX_CLASS_AUDIO20_XUD_CONTROL_ENABLE_POS                             (0)
1127 #define UX_CLASS_AUDIO20_XUD_CONTROL_ENABLE_MASK                            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_XUD_CONTROL_ENABLE_POS)
1128 #define UX_CLASS_AUDIO20_XUD_CONTROL_ENABLE(v)                              ((v) << UX_CLASS_AUDIO20_XUD_CONTROL_ENABLE_POS)
1129 #define UX_CLASS_AUDIO20_XUD_CONTROL_CLUSTER_POS                            (2)
1130 #define UX_CLASS_AUDIO20_XUD_CONTROL_CLUSTER_MASK                           (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_XUD_CONTROL_CLUSTER_POS)
1131 #define UX_CLASS_AUDIO20_XUD_CONTROL_CLUSTER(v)                             ((v) << UX_CLASS_AUDIO20_XUD_CONTROL_CLUSTER_POS)
1132 #define UX_CLASS_AUDIO20_XUD_CONTROL_UNDERFLOW_POS                          (4)
1133 #define UX_CLASS_AUDIO20_XUD_CONTROL_UNDERFLOW_MASK                         (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_XUD_CONTROL_UNDERFLOW_POS)
1134 #define UX_CLASS_AUDIO20_XUD_CONTROL_UNDERFLOW(v)                           ((v) << UX_CLASS_AUDIO20_XUD_CONTROL_UNDERFLOW_POS)
1135 #define UX_CLASS_AUDIO20_XUD_CONTROL_OVERFLOW_POS                           (6)
1136 #define UX_CLASS_AUDIO20_XUD_CONTROL_OVERFLOW_MASK                          (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_XUD_CONTROL_OVERFLOW_POS)
1137 #define UX_CLASS_AUDIO20_XUD_CONTROL_OVERFLOW(v)                            ((v) << UX_CLASS_AUDIO20_XUD_CONTROL_OVERFLOW_POS)
1138 
1139 /* Audio class-specific AS interface descriptor.  */
1140 
1141 typedef struct UX_CLASS_AUDIO20_AS_INTERFACE_DESCRIPTOR_STRUCT
1142 {
1143     UCHAR           bLength;
1144     UCHAR           bDescriptorType;
1145     UCHAR           bDescriptorSubType;
1146     UCHAR           bTerminalLink;
1147     UCHAR           bmControls;
1148     UCHAR           bFormatType;
1149     UCHAR           bmFormats[4];
1150     UCHAR           bNrChannels;
1151     UCHAR           bmChannelConfig[4];
1152     UCHAR           iChannelNames;
1153 } UX_CLASS_AUDIO20_AS_INTERFACE_DESCRIPTOR, UX_CLASS_AUDIO20_AS_IFACED;
1154 
1155 /* AS interface (AS_INTERFACE)::bmaControls.  */
1156 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_ACTIVE_ALT_POS               (0)
1157 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_ACTIVE_ALT_MASK              (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_AS_IFACED_CONTROL_ACTIVE_ALT_POS)
1158 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_ACTIVE_ALT(v)                ((v) << UX_CLASS_AUDIO20_AS_IFACED_CONTROL_ACTIVE_ALT_POS)
1159 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_VALID_ALT_POS                (2)
1160 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_VALID_ALT_MASK               (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_AS_IFACED_CONTROL_VALID_ALT_POS)
1161 #define UX_CLASS_AUDIO20_AS_IFACED_CONTROL_VALID_ALT(v)                 ((v) << UX_CLASS_AUDIO20_AS_IFACED_CONTROL_VALID_ALT_POS)
1162 
1163 
1164 /* Audio class-specific AS encoder descriptor.  */
1165 
1166 typedef struct UX_CLASS_AUDIO20_AS_ENCODER_DESCRIPTOR_STRUCT
1167 {
1168     UCHAR           bLength;
1169     UCHAR           bDescriptorType;
1170     UCHAR           bDescriptorSubType;
1171     UCHAR           bEncoderID;
1172     UCHAR           bEncoder;
1173     UCHAR           unknown[3]; /* These 3 bytes are not described in spec (UAC 2.0, May 31, 2006)?  */
1174     ULONG           bmControls;
1175     UCHAR           iParam1;
1176     UCHAR           iParam2;
1177     UCHAR           iParam3;
1178     UCHAR           iParam4;
1179     UCHAR           iParam5;
1180     UCHAR           iParam6;
1181     UCHAR           iParam7;
1182     UCHAR           iParam8;
1183     UCHAR           iEncoder;
1184 } UX_CLASS_AUDIO20_AS_ENCODER_DESCRIPTOR, UX_CLASS_AUDIO20_AS_ENCD;
1185 
1186 /* AS ENCODER::bmaControls.  */
1187 #define UX_CLASS_AUDIO20_ENCD_CONTROL_BIT_RATE_POS                  (0)
1188 #define UX_CLASS_AUDIO20_ENCD_CONTROL_BIT_RATE_MASK                 (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_BIT_RATE_POS)
1189 #define UX_CLASS_AUDIO20_ENCD_CONTROL_BIT_RATE(v)                   ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_BIT_RATE_POS)
1190 #define UX_CLASS_AUDIO20_ENCD_CONTROL_QUALITY_POS                   (2)
1191 #define UX_CLASS_AUDIO20_ENCD_CONTROL_QUALITY_MASK                  (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_QUALITY_POS)
1192 #define UX_CLASS_AUDIO20_ENCD_CONTROL_QUALITY(v)                    ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_QUALITY_POS)
1193 #define UX_CLASS_AUDIO20_ENCD_CONTROL_VBR_POS                       (4)
1194 #define UX_CLASS_AUDIO20_ENCD_CONTROL_VBR_MASK                      (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_VBR_POS)
1195 #define UX_CLASS_AUDIO20_ENCD_CONTROL_VBR(v)                        ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_VBR_POS)
1196 #define UX_CLASS_AUDIO20_ENCD_CONTROL_TYPE_POS                      (6)
1197 #define UX_CLASS_AUDIO20_ENCD_CONTROL_TYPE_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_TYPE_POS)
1198 #define UX_CLASS_AUDIO20_ENCD_CONTROL_TYPE(v)                       ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_TYPE_POS)
1199 #define UX_CLASS_AUDIO20_ENCD_CONTROL_UNDERFLOW_POS                 (8)
1200 #define UX_CLASS_AUDIO20_ENCD_CONTROL_UNDERFLOW_MASK                (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_UNDERFLOW_POS)
1201 #define UX_CLASS_AUDIO20_ENCD_CONTROL_UNDERFLOW(v)                  ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_UNDERFLOW_POS)
1202 #define UX_CLASS_AUDIO20_ENCD_CONTROL_OVERFLOW_POS                  (10)
1203 #define UX_CLASS_AUDIO20_ENCD_CONTROL_OVERFLOW_MASK                 (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_OVERFLOW_POS)
1204 #define UX_CLASS_AUDIO20_ENCD_CONTROL_OVERFLOW(v)                   ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_OVERFLOW_POS)
1205 #define UX_CLASS_AUDIO20_ENCD_CONTROL_ENCODER_ERROR_POS             (12)
1206 #define UX_CLASS_AUDIO20_ENCD_CONTROL_ENCODER_ERROR_MASK            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_ENCODER_ERROR_POS)
1207 #define UX_CLASS_AUDIO20_ENCD_CONTROL_ENCODER_ERROR(v)              ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_ENCODER_ERROR_POS)
1208 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM1_POS                    (14)
1209 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM1_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM1_POS)
1210 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM1(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM1_POS)
1211 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM2_POS                    (16)
1212 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM2_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM2_POS)
1213 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM2(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM2_POS)
1214 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM3_POS                    (18)
1215 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM3_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM3_POS)
1216 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM3(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM3_POS)
1217 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM4_POS                    (20)
1218 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM4_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM4_POS)
1219 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM4(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM4_POS)
1220 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM5_POS                    (22)
1221 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM5_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM5_POS)
1222 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM5(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM5_POS)
1223 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM6_POS                    (24)
1224 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM6_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM6_POS)
1225 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM6(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM6_POS)
1226 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM7_POS                    (26)
1227 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM7_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM7_POS)
1228 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM7(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM7_POS)
1229 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM8_POS                    (28)
1230 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM8_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM8_POS)
1231 #define UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM8(v)                     ((v) << UX_CLASS_AUDIO20_ENCD_CONTROL_PARAM8_POS)
1232 
1233 
1234 /* Audio class-specific AS decoder descriptor.  */
1235 
1236 /* Audio class-specific AS MPEG decoder descriptor.  */
1237 
1238 typedef struct UX_CLASS_AUDIO20_AS_MPEG_DECODER_DESCRIPTOR_STRUCT
1239 {
1240     UCHAR           bLength;
1241     UCHAR           bDescriptorType;
1242     UCHAR           bDescriptorSubType;
1243     UCHAR           bDecoderID;
1244     UCHAR           bDecoder;
1245     UCHAR           bmMPEGCapabilities[2];
1246     UCHAR           bmMPEGFeatures;
1247     UCHAR           bmControls;
1248     UCHAR           iDecoder;
1249 } UX_CLASS_AUDIO20_AS_MPEG_DECODER_DESCRIPTOR, UX_CLASS_AUDIO20_AS_MPEG_DECD;
1250 
1251 /* MPEG DECODER::bmMPEGCapabilities.  */
1252 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_LAYER_MASK                   (0x7u << 0)
1253 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_LAYER_I                      (0x1u << 0)
1254 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_LAYER_II                     (0x1u << 1)
1255 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_LAYER_III                    (0x1u << 2)
1256 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG1_ONLY                   (0x1u << 3)
1257 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG1_DUAL_CH                (0x1u << 4)
1258 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_STEREO                 (0x1u << 5)
1259 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_7_1_CH                 (0x1u << 6)
1260 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_ADAPTIVE_MULTI_CH_PREDICT    (0x1u << 7)
1261 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_MULTILINGUAL_MASK      (0x3u << 8)
1262 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_MULTI_NOT_SUPPORT      (0x0u << 8)
1263 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_MULTI_FS               (0x1u << 8)
1264 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_MPEG2_MULTI_FS_HALF_FS       (0x3u << 8)
1265 #define UX_CLASS_AUDIO20_MPEG_DECD_CAP_SUPPORT_HALF_FS              (0x1u << 10)
1266 
1267 /* MPEG DECODER::bmMPEGFeatures.  */
1268 #define UX_CLASS_AUDIO20_MPEG_DECD_FEAT_IDYN_RNG_CTRL_MASK          (0x3u << 4) /* Internal Dynamic Range Control  */
1269 #define UX_CLASS_AUDIO20_MPEG_DECD_FEAT_IDYN_RNG_CTRL_NOT_SUP       (0x0u << 4) /* Not support  */
1270 #define UX_CLASS_AUDIO20_MPEG_DECD_FEAT_IDYN_RNG_CTRL_NOT_SCAL      (0x1u << 4) /* Not scalable  */
1271 #define UX_CLASS_AUDIO20_MPEG_DECD_FEAT_IDYN_RNG_CTRL_SCAL_COMMON   (0x2u << 4) /* Common boost and cut scaling value  */
1272 #define UX_CLASS_AUDIO20_MPEG_DECD_FEAT_IDYN_RNG_CTRL_SCAL_SEPARA   (0x3u << 4) /* Separate boost and cut scaling value  */
1273 
1274 /* MPEG DECODER::bmControls.  */
1275 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_UNDERFLOW_POS            (0)
1276 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_UNDERFLOW_MASK           (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_UNDERFLOW_POS)
1277 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_UNDERFLOW(v)             ((v) << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_UNDERFLOW_POS)
1278 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_OVERFLOW_POS             (2)
1279 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_OVERFLOW_MASK            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_OVERFLOW_POS)
1280 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_OVERFLOW(v)              ((v) << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_OVERFLOW_POS)
1281 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_DECODER_ERROR_POS        (4)
1282 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_DECODER_ERROR_MASK       (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_DECODER_ERROR_POS)
1283 #define UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_DECODER_ERROR(v)         ((v) << UX_CLASS_AUDIO20_MPEG_DECD_CONTROL_DECODER_ERROR_POS)
1284 
1285 /* Audio class-specific AS AC-3 decoder descriptor.  */
1286 
1287 typedef struct UX_CLASS_AUDIO20_AS_AC3_DECODER_DESCRIPTOR_STRUCT
1288 {
1289     UCHAR           bLength;
1290     UCHAR           bDescriptorType;
1291     UCHAR           bDescriptorSubType;
1292     UCHAR           bDecoderID;
1293     UCHAR           bDecoder;
1294     UCHAR           bmBSID[4];
1295     UCHAR           bmAC3Features;
1296     UCHAR           bmControls;
1297     UCHAR           iDecoder;
1298 } UX_CLASS_AUDIO20_AS_AC3_DECODER_DESCRIPTOR, UX_CLASS_AUDIO20_AS_AC3_DECD;
1299 
1300 /* AC3 DECODER::bmAC3Features.  */
1301 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_RF_MODE                      (0x1u << 0)
1302 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_LINE_MODE                    (0x1u << 1)
1303 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_CUSTOM0_MODE                 (0x1u << 2)
1304 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_CUSTOM1_MODE                 (0x1u << 3)
1305 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_IDYN_RNG_CTRL_MASK           (0x3u << 4) /* Internal Dynamic Range Control  */
1306 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_IDYN_RNG_CTRL_NOT_SUP        (0x0u << 4) /* Not support  */
1307 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_IDYN_RNG_CTRL_NOT_SCAL       (0x3u << 4) /* Not scalable  */
1308 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_IDYN_RNG_CTRL_SCAL_COMMON    (0x3u << 4) /* Common boost and cut scaling value  */
1309 #define UX_CLASS_AUDIO20_AC3_DECD_FEAT_IDYN_RNG_CTRL_SCAL_SEPARATE  (0x3u << 4) /* Separate boost and cut scaling value  */
1310 
1311 /* AC3 DECODER::bmControls.  */
1312 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_UNDERFLOW_POS             (0)
1313 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_UNDERFLOW_MASK            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_UNDERFLOW_POS)
1314 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_UNDERFLOW(v)              ((v) << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_UNDERFLOW_POS)
1315 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_OVERFLOW_POS              (2)
1316 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_OVERFLOW_MASK             (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_OVERFLOW_POS)
1317 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_OVERFLOW(v)               ((v) << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_OVERFLOW_POS)
1318 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_DECODER_ERROR_POS         (4)
1319 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_DECODER_ERROR_MASK        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_DECODER_ERROR_POS)
1320 #define UX_CLASS_AUDIO20_AC3_DECD_CONTROL_DECODER_ERROR(v)          ((v) << UX_CLASS_AUDIO20_AC3_DECD_CONTROL_DECODER_ERROR_POS)
1321 
1322 /* Audio class-specific AS WMA decoder descriptor.  */
1323 
1324 typedef struct UX_CLASS_AUDIO20_AS_WMA_DECODER_DESCRIPTOR_STRUCT
1325 {
1326     UCHAR           bLength;
1327     UCHAR           bDescriptorType;
1328     UCHAR           bDescriptorSubType;
1329     UCHAR           bDecoderID;
1330     UCHAR           bDecoder;
1331     UCHAR           bmWMAProfile[2];
1332     UCHAR           bmControls;
1333     UCHAR           iDecoder;
1334 } UX_CLASS_AUDIO20_AS_WMA_DECODER_DESCRIPTOR, UX_CLASS_AUDIO20_AS_WMA_DECD;
1335 
1336 /* WMA DECODER::bmWMAProfile.  */
1337 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_1_L1                      (1u << 0)
1338 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_2_L2                      (1u << 1)
1339 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_3_L3                      (1u << 2)
1340 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_OTHER_L                   (1u << 3)
1341 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_SPEECH_1_S1               (1u << 4)
1342 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_SPEECH_2_S2               (1u << 5)
1343 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_PRO_1_M1                  (1u << 6)
1344 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_PRO_2_M2                  (1u << 7)
1345 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_PRO_3_M3                  (1u << 8)
1346 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_PRO_OTHER_M               (1u << 9)
1347 #define UX_CLASS_AUDIO20_WMA_DECD_PROFILE_LOSSLESS_SUPPORT          (1u << 10)
1348 
1349 /* WMA DECODER::bmControls.  */
1350 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_UNDERFLOW_POS             (0)
1351 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_UNDERFLOW_MASK            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_UNDERFLOW_POS)
1352 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_UNDERFLOW(v)              ((v) << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_UNDERFLOW_POS)
1353 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_OVERFLOW_POS              (2)
1354 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_OVERFLOW_MASK             (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_OVERFLOW_POS)
1355 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_OVERFLOW(v)               ((v) << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_OVERFLOW_POS)
1356 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_DECODER_ERROR_POS         (4)
1357 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_DECODER_ERROR_MASK        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_DECODER_ERROR_POS)
1358 #define UX_CLASS_AUDIO20_WMA_DECD_CONTROL_DECODER_ERROR(v)          ((v) << UX_CLASS_AUDIO20_WMA_DECD_CONTROL_DECODER_ERROR_POS)
1359 
1360 /* Audio class-specific AS DTS decoder descriptor.  */
1361 
1362 typedef struct UX_CLASS_AUDIO20_AS_DTS_DECODER_DESCRIPTOR_STRUCT
1363 {
1364     UCHAR           bLength;
1365     UCHAR           bDescriptorType;
1366     UCHAR           bDescriptorSubType;
1367     UCHAR           bDecoderID;
1368     UCHAR           bDecoder;
1369     UCHAR           bmCapabilities;
1370     UCHAR           bmControls;
1371     UCHAR           iDecoder;
1372 } UX_CLASS_AUDIO20_AS_DTS_DECODER_DESCRIPTOR, UX_CLASS_AUDIO20_AS_DTS_DECD;
1373 
1374 /* DTS DECODER::bmCapabilities.  */
1375 #define UX_CLASS_AUDIO20_DTS_DECD_CAP_CORE                          (0x1u << 0)
1376 #define UX_CLASS_AUDIO20_DTS_DECD_CAP_LOSSLESS                      (0x1u << 1)
1377 #define UX_CLASS_AUDIO20_DTS_DECD_CAP_LBR                           (0x1u << 2)
1378 #define UX_CLASS_AUDIO20_DTS_DECD_CAP_MULTI_STREAM_MIX              (0x1u << 3)
1379 #define UX_CLASS_AUDIO20_DTS_DECD_CAP_DUAL_DECODE                   (0x1u << 4)
1380 
1381 /* DTS DECODER::bmControls.  */
1382 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_UNDERFLOW_POS             (2)
1383 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_UNDERFLOW_MASK            (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_UNDERFLOW_POS)
1384 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_UNDERFLOW(v)              ((v) << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_UNDERFLOW_POS)
1385 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_OVERFLOW_POS              (4)
1386 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_OVERFLOW_MASK             (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_OVERFLOW_POS)
1387 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_OVERFLOW(v)               ((v) << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_OVERFLOW_POS)
1388 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_DECODER_ERROR_POS         (6)
1389 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_DECODER_ERROR_MASK        (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_DECODER_ERROR_POS)
1390 #define UX_CLASS_AUDIO20_DTS_DECD_CONTROL_DECODER_ERROR(v)          ((v) << UX_CLASS_AUDIO20_DTS_DECD_CONTROL_DECODER_ERROR_POS)
1391 
1392 
1393 /* Audio class-specific isochronous audio data endpoint descriptor (EPD).  */
1394 typedef struct UX_CLASS_AUDIO20_ENDPOINT_DESCRIPTOR_STRUCT
1395 {
1396     UCHAR           bLength;
1397     UCHAR           bDescriptorType;
1398     UCHAR           bDescriptorSubType;
1399     UCHAR           bmAttributes;
1400     UCHAR           bmControls;
1401     UCHAR           bLockDelayUnits;
1402     USHORT          wLockDelay;
1403 } UX_CLASS_AUDIO20_ENDPOINT_DESCRIPTOR, UX_CLASS_AUDIO20_EPD;
1404 
1405 /* EPD::bmAttributes.  */
1406 #define UX_CLASS_AUDIO20_EPD_ATTR_MAX_PACKET_SIZE_ONLY              (0x1u << 7)
1407 
1408 /* EPD::bmControls.  */
1409 #define UX_CLASS_AUDIO20_EPD_CONTROL_PITCH_POS                      (0)
1410 #define UX_CLASS_AUDIO20_EPD_CONTROL_PITCH_MASK                     (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_EPD_CONTROL_PITCH_POS)
1411 #define UX_CLASS_AUDIO20_EPD_CONTROL_PITCH(v)                       ((v) << UX_CLASS_AUDIO20_EPD_CONTROL_PITCH_POS)
1412 #define UX_CLASS_AUDIO20_EPD_CONTROL_OVERRUN_POS                    (2)
1413 #define UX_CLASS_AUDIO20_EPD_CONTROL_OVERRUN_MASK                   (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_EPD_CONTROL_OVERRUN_POS)
1414 #define UX_CLASS_AUDIO20_EPD_CONTROL_OVERRUN(v)                     ((v) << UX_CLASS_AUDIO20_EPD_CONTROL_OVERRUN_POS)
1415 #define UX_CLASS_AUDIO20_EPD_CONTROL_UNDERRUN_POS                   (4)
1416 #define UX_CLASS_AUDIO20_EPD_CONTROL_UNDERRUN_MASK                  (UX_CLASS_AUDIO20_CONTROL_MASK << UX_CLASS_AUDIO20_EPD_CONTROL_UNDERRUN_POS)
1417 #define UX_CLASS_AUDIO20_EPD_CONTROL_UNDERRUN(v)                    ((v) << UX_CLASS_AUDIO20_EPD_CONTROL_UNDERRUN_POS)
1418 
1419 /* EPD::bLockDelayUnits.  */
1420 #define UX_CLASS_AUDIO20_EPD_LOCK_DELAY_UNITS_UNDEFINED             0
1421 #define UX_CLASS_AUDIO20_EPD_LOCK_DELAY_UNITS_MS                    1
1422 #define UX_CLASS_AUDIO20_EPD_LOCK_DELAY_UNITS_DEC_PCM_SAMPLES       2
1423 
1424 
1425 /* Audio class control request layout.  */
1426 
1427 typedef struct UX_CLASS_AUDIO20_REQUEST_VALUE_CS_CN_STRUCT {
1428     UCHAR   channel_num;        /* Channel Number       (CN)   */
1429     UCHAR   control_sel;        /* Control Selector     (CS)   */
1430 } UX_CLASS_AUDIO20_REQUEST_VALUE_CS_CN;
1431 
1432 typedef struct UX_CLASS_AUDIO20_REQUEST_VALUE_MIXER_STRUCT {
1433     UCHAR   mixer_ctrl_num;     /* Mixer Control Number (MCN)  */
1434     UCHAR   control_sel;        /* Control Selector     (CS)   */
1435 } UX_CLASS_AUDIO20_REQUEST_VALUE_MIXER, UX_CLASS_AUDIO20_REQUEST_VALUE_CS_MCN;
1436 
1437 typedef struct UX_CLASS_AUDIO20_REQUEST_VALUE_CONTROL_STRUCT {
1438     UCHAR   cn_mcn;             /* CN/MCN   */
1439     UCHAR   cs;                 /* CS       */
1440 } UX_CLASS_AUDIO20_REQUEST_VALUE_CONTROL;
1441 
1442 typedef struct UX_CLASS_AUDIO20_REQUEST_INDEX_EP_STRUCT {
1443     UCHAR   ep_addr;            /* Endpoint Address  */
1444     UCHAR   reserved_zero;
1445 } UX_CLASS_AUDIO20_REQUEST_INDEX_EP;
1446 
1447 typedef struct UX_CLASS_AUDIO20_REQUEST_INDEX_INTERFACE_STRUCT {
1448     UCHAR   iface_num;          /* Interface number  */
1449     UCHAR   entity_id;
1450 } UX_CLASS_AUDIO20_REQUEST_INDEX_INTERFACE;
1451 
1452 typedef struct UX_CLASS_AUDIO20_REQUEST_INDEX_CONTROL_STRUCT {
1453     UCHAR   ep_iface;           /* Endpoint Address/Interface Number  */
1454     UCHAR   entity_id_zero;     /* Entity ID/Zero  */
1455 } UX_CLASS_AUDIO20_REQUEST_INDEX_CONTROL;
1456 
1457 typedef struct UX_CLASS_AUDIO20_REQUEST_STRUCT
1458 {
1459     UCHAR           bmRequestType;
1460     UCHAR           bRequest;
1461     union UX_CLASS_AUDIO20_REQUEST_VALUE_UNION {
1462         USHORT      value;
1463         UX_CLASS_AUDIO20_REQUEST_VALUE_CS_CN
1464                     control_cs_cn;
1465         UX_CLASS_AUDIO20_REQUEST_VALUE_MIXER
1466                     control_mixer;
1467         UX_CLASS_AUDIO20_REQUEST_VALUE_CONTROL
1468                     control;
1469         USHORT      mem_offset;
1470     }               wValue;
1471     union UX_CLASS_AUDIO20_REQUEST_INDEX_UNION {
1472         USHORT      value;
1473         UX_CLASS_AUDIO20_REQUEST_INDEX_EP
1474                     ep;
1475         UX_CLASS_AUDIO20_REQUEST_INDEX_INTERFACE
1476                     iface;
1477         UX_CLASS_AUDIO20_REQUEST_INDEX_CONTROL
1478                     control;
1479     }               wIndex;
1480     USHORT          wLength;
1481 } UX_CLASS_AUDIO20_REQUEST;
1482 
1483 typedef struct UX_CLASS_AUDIO20_RANGE_1B_STRUCT
1484 {
1485     UCHAR           bMIN;
1486     UCHAR           bMAX;
1487     UCHAR           bRES;
1488 } UX_CLASS_AUDIO20_RANGE_1B;
1489 
1490 typedef struct UX_CLASS_AUDIO20_RANGE_1B_BLOCK_STRUCT
1491 {
1492     USHORT          wNumSubRanges;
1493     UX_CLASS_AUDIO20_RANGE_1B
1494                     aSubRange[1];
1495 } UX_CLASS_AUDIO20_RANGE_1B_BLOCK;
1496 
1497 typedef struct UX_CLASS_AUDIO20_RANGE_2B_STRUCT
1498 {
1499     USHORT          wMIN;
1500     USHORT          wMAX;
1501     USHORT          wRES;
1502 } UX_CLASS_AUDIO20_RANGE_2B;
1503 
1504 typedef struct UX_CLASS_AUDIO20_RANGE_2B_BLOCK_STRUCT
1505 {
1506     USHORT          wNumSubRanges;
1507     UX_CLASS_AUDIO20_RANGE_2B
1508                     aSubRange[1];
1509 } UX_CLASS_AUDIO20_RANGE_2B_BLOCK;
1510 
1511 typedef struct UX_CLASS_AUDIO20_RANGE_4B_STRUCT
1512 {
1513     ULONG           dMIN;
1514     ULONG           dMAX;
1515     ULONG           dRES;
1516 } UX_CLASS_AUDIO20_RANGE_4B;
1517 
1518 typedef struct UX_CLASS_AUDIO20_RANGE_4B_BLOCK_STRUCT
1519 {
1520     USHORT          wNumSubRanges;
1521     struct UX_CLASS_AUDIO20_RANGE_4B_UNALIGNED_STRUCT {
1522         UCHAR       dMIN[4];
1523         UCHAR       dMAX[4];
1524         UCHAR       dRES[4];
1525     }               aSubRange[1];   /* Not 4-byte aligned.  */
1526 } UX_CLASS_AUDIO20_RANGE_4B_BLOCK;
1527 
1528 
1529 /* Audio Class 2.0 connector control CUR parameter block.  */
1530 
1531 typedef struct UX_CLASS_AUDIO20_CONNECTOR_CONTROL_CUR_PARAM_BLOCK_STRUCT
1532 {
1533     UCHAR           bNrChannels;
1534     UCHAR           bmChannelConfig[4];
1535     UCHAR           iChannelNames;
1536 } UX_CLASS_AUDIO20_CONNECTOR_CONTROL_CUR_PARAM_BLOCK;
1537 
1538 /* Audio Class 2.0 Graphic Equalizer Control CUR parameter block (NrBits=4).  */
1539 
1540 typedef struct UX_CLASS_AUDIO20_GEQ_CONTROL_CUR_PARAM_BLOCK_STRUCT
1541 {
1542     ULONG           bmBandsPresent;
1543     UCHAR           bCUR[4];
1544 } UX_CLASS_AUDIO20_GEQ_CONTROL_CUR_PARAM_BLOCK;
1545 
1546 /* Audio Class 2.0 Graphic Equalizer Control RANGE parameter block (NrBits=1).  */
1547 
1548 typedef struct UX_CLASS_AUDIO20_GEQ_CONTROL_RANGE_PARAM_BLOCK_STRUCT
1549 {
1550     ULONG           bmBandsPresent;
1551     UX_CLASS_AUDIO20_RANGE_1B
1552                     aRNG[1];
1553 } UX_CLASS_AUDIO20_GEQ_CONTROL_RANGE_PARAM_BLOCK;
1554 
1555 /* Audio Class 2.0 Valid Alternate Settings Control CUR parameter block (bControlSize=1).  */
1556 
1557 typedef struct UX_CLASS_AUDIO20_VALID_ALT_SETT_CONTROL_CUR_PARAM_BLOCK_STRUCT
1558 {
1559     UCHAR           bControlSize;           /* Number of bytes.  */
1560     UCHAR           bmValidAltSettings[1];  /* bControlSize bytes.  */
1561 } UX_CLASS_AUDIO20_VALID_ALT_SETT_CONTROL_CUR_PARAM_BLOCK;
1562 
1563 /* Audio Class 2.0 High/Low Scaling Control CUR parameter block.  */
1564 
1565 typedef struct UX_CLASS_AUDIO20_HI_LO_SCALING_CONTROL_CUR_PARAM_BLOCK_STRUCT
1566 {
1567     UCHAR           bCUR_Lo;
1568     UCHAR           bCUR_Hi;
1569 } UX_CLASS_AUDIO20_HI_LO_SCALING_CONTROL_CUR_PARAM_BLOCK;
1570 
1571 /* Audio Class 2.0 High/Low Scaling Control RANGE parameter block (wNumSubRanges=1).  */
1572 
1573 typedef struct UX_CLASS_AUDIO20_HI_LO_SCALING_CONTROL_RANGE_PARAM_BLOCK_STRUCT
1574 {
1575     USHORT          wNumSubRanges;
1576     UX_CLASS_AUDIO20_RANGE_1B
1577                     aRNG[1];
1578 } UX_CLASS_AUDIO20_HI_LO_SCALING_CONTROL_RANGE_PARAM_BLOCK;
1579 
1580 
1581 /* Audio Class 2.0 Interrupt Data Message Format.  */
1582 
1583 typedef struct UX_CLASS_AUDIO20_INT_MESSAGE_STRUCT
1584 {
1585     UCHAR           bInfo;
1586     UCHAR           bAttribute;
1587     union UX_CLASS_AUDIO20_INT_MESSAGE_VALUE {
1588         USHORT      value;
1589         UX_CLASS_AUDIO20_REQUEST_VALUE_CONTROL
1590                     control;
1591     }               wValue;
1592     union UX_CLASS_AUDIO20_INT_MESSAGE_INDEX {
1593         USHORT      value;
1594         UX_CLASS_AUDIO20_REQUEST_INDEX_CONTROL
1595                     control;
1596     }               wIndex;
1597 } UX_CLASS_AUDIO20_INT_MESSAGE;
1598 
1599 
1600 /* Audio Class 2.0 Type I Format Type Descriptor.  */
1601 
1602 typedef struct UX_CLASS_AUDIO20_TYPE_I_FORMAT_TYPE_DESCRIPTOR
1603 {
1604     UCHAR           bLength;
1605     UCHAR           bDescriptorType;
1606     UCHAR           bDescriptorSubType;
1607     UCHAR           bFormatType;
1608     UCHAR           bSubslotSize;
1609     UCHAR           bBitResolution;
1610 } UX_CLASS_AUDIO20_TYPE_I_FORMAT_TYPE;
1611 
1612 /* Audio Class 2.0 Type II Format Type Descriptor.  */
1613 
1614 typedef struct UX_CLASS_AUDIO20_TYPE_II_FORMAT_TYPE_DESCRIPTOR
1615 {
1616     UCHAR           bLength;
1617     UCHAR           bDescriptorType;
1618     UCHAR           bDescriptorSubType;
1619     UCHAR           bFormatType;
1620     USHORT          wMaxBitRate;
1621     USHORT          wSlotsPerFrame;
1622 } UX_CLASS_AUDIO20_TYPE_II_FORMAT_TYPE;
1623 
1624 /* Audio Class 2.0 Type III Format Type Descriptor.  */
1625 
1626 typedef struct UX_CLASS_AUDIO20_TYPE_III_FORMAT_TYPE_DESCRIPTOR
1627 {
1628     UCHAR           bLength;
1629     UCHAR           bDescriptorType;
1630     UCHAR           bDescriptorSubType;
1631     UCHAR           bFormatType;
1632     UCHAR           bSubslotSize;
1633     UCHAR           bBitResolution;
1634 } UX_CLASS_AUDIO20_TYPE_III_FORMAT_TYPE;
1635 
1636 /* Audio Class 2.0 Type IV Format Type Descriptor.  */
1637 
1638 typedef struct UX_CLASS_AUDIO20_TYPE_IV_FORMAT_TYPE_DESCRIPTOR
1639 {
1640     UCHAR           bLength;
1641     UCHAR           bDescriptorType;
1642     UCHAR           bDescriptorSubType;
1643     UCHAR           bFormatType;
1644 } UX_CLASS_AUDIO20_TYPE_IV_FORMAT_TYPE;
1645 
1646 /* Audio Class 2.0 Extended Type I Format Type Descriptor.  */
1647 
1648 typedef struct UX_CLASS_AUDIO20_EXT_TYPE_I_FORMAT_TYPE_DESCRIPTOR
1649 {
1650     UCHAR           bLength;
1651     UCHAR           bDescriptorType;
1652     UCHAR           bDescriptorSubType;
1653     UCHAR           bFormatType;
1654     UCHAR           bSubslotSize;
1655     UCHAR           bBitResolution;
1656     UCHAR           bHeaderLength;
1657     UCHAR           bControlSize;
1658     UCHAR           bSideBandProtocol;
1659 } UX_CLASS_AUDIO20_EXT_TYPE_I_FORMAT_TYPE;
1660 
1661 /* Audio Class 2.0 Extended Type II Format Type Descriptor.  */
1662 
1663 typedef struct UX_CLASS_AUDIO20_EXT_TYPE_II_FORMAT_TYPE_DESCRIPTOR
1664 {
1665     UCHAR           bLength;
1666     UCHAR           bDescriptorType;
1667     UCHAR           bDescriptorSubType;
1668     UCHAR           bFormatType;
1669     USHORT          wMaxBitRate;
1670     USHORT          wSamplesPerFrame;
1671     UCHAR           bHeaderLength;
1672     UCHAR           bSideBandProtocol;
1673 } UX_CLASS_AUDIO20_EXT_TYPE_II_FORMAT_TYPE;
1674 
1675 /* Audio Class 2.0 Extended Type III Format Type Descriptor.  */
1676 
1677 typedef struct UX_CLASS_AUDIO20_EXT_TYPE_III_FORMAT_TYPE_DESCRIPTOR
1678 {
1679     UCHAR           bLength;
1680     UCHAR           bDescriptorType;
1681     UCHAR           bDescriptorSubType;
1682     UCHAR           bFormatType;
1683     UCHAR           bSubslotSize;
1684     UCHAR           bBitResolution;
1685     UCHAR           bHeaderLength;
1686     UCHAR           bSideBandProtocol;
1687 } UX_CLASS_AUDIO20_EXT_TYPE_III_FORMAT_TYPE;
1688 
1689 /* Audio Class 2.0 Hi-Res Presentation TimeStamp Layout.  */
1690 
1691 typedef struct UX_CLASS_AUDIO20_HI_RES_PRESENTATION_TIMESTAMP_STRUCT
1692 {
1693     UCHAR           bmFlags;
1694     UCHAR           qNanoSeconds[8];
1695 } UX_CLASS_AUDIO20_HI_RES_PRESENTATION_TIMESTAMP;
1696 
1697 #define UX_CLASS_AUDIO20_HI_RES_PRESENTATION_TIMESTAMP_FLAG_VALID   (1u << 31)
1698 
1699 #endif
1700