1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 /**************************************************************************/
12 /**************************************************************************/
13 /**                                                                       */
14 /** USBX Component                                                        */
15 /**                                                                       */
16 /**   CDC Class                                                           */
17 /**                                                                       */
18 /**************************************************************************/
19 /**************************************************************************/
20 
21 /**************************************************************************/
22 /*                                                                        */
23 /*  COMPONENT DEFINITION                                   RELEASE        */
24 /*                                                                        */
25 /*    ux_device_class_cdc_acm.h                           PORTABLE C      */
26 /*                                                           6.3.0        */
27 /*  AUTHOR                                                                */
28 /*                                                                        */
29 /*    Chaoqiong Xiao, Microsoft Corporation                               */
30 /*                                                                        */
31 /*  DESCRIPTION                                                           */
32 /*                                                                        */
33 /*    This file defines the equivalences for the USBX Device Class CDC    */
34 /*    ACM component.                                                      */
35 /*                                                                        */
36 /*  RELEASE HISTORY                                                       */
37 /*                                                                        */
38 /*    DATE              NAME                      DESCRIPTION             */
39 /*                                                                        */
40 /*  05-19-2020     Chaoqiong Xiao           Initial Version 6.0           */
41 /*  09-30-2020     Chaoqiong Xiao           Modified comment(s),          */
42 /*                                            used UX prefix to refer to  */
43 /*                                            TX symbols instead of using */
44 /*                                            them directly,              */
45 /*                                            resulting in version 6.1    */
46 /*  04-02-2021     Chaoqiong Xiao           Modified comment(s),          */
47 /*                                            added macro to disable      */
48 /*                                            transmission support,       */
49 /*                                            resulting in version 6.1.6  */
50 /*  08-02-2021     Chaoqiong Xiao           Modified comment(s),          */
51 /*                                            added extern "C" keyword    */
52 /*                                            for compatibility with C++, */
53 /*                                            resulting in version 6.1.8  */
54 /*  01-31-2022     Chaoqiong Xiao           Modified comment(s),          */
55 /*                                            added standalone support,   */
56 /*                                            resulting in version 6.1.10 */
57 /*  07-29-2022     Chaoqiong Xiao           Modified comment(s),          */
58 /*                                            added write auto ZLP,       */
59 /*                                            resulting in version 6.1.12 */
60 /*  10-31-2023     Yajun xia, CQ Xiao       Modified comment(s),          */
61 /*                                            added zero copy support,    */
62 /*                                            added a new mode to manage  */
63 /*                                            endpoint buffer in classes, */
64 /*                                            added error checks support, */
65 /*                                            resulting in version 6.3.0  */
66 /*                                                                        */
67 /**************************************************************************/
68 
69 #ifndef UX_DEVICE_CLASS_CDC_ACM_H
70 #define UX_DEVICE_CLASS_CDC_ACM_H
71 
72 /* Determine if a C++ compiler is being used.  If so, ensure that standard
73    C is used to process the API information.  */
74 
75 #ifdef   __cplusplus
76 
77 /* Yes, C++ compiler is present.  Use standard C.  */
78 extern   "C" {
79 
80 #endif
81 
82 /* Internal option: enable the basic USBX error checking. This define is typically used
83    while debugging application.  */
84 #if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING)
85 #define UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING
86 #endif
87 
88 /* Defined, _write is pending ZLP automatically (complete transfer) after buffer is sent.  */
89 
90 /* #define UX_DEVICE_CLASS_CDC_ACM_WRITE_AUTO_ZLP  */
91 
92 /* Option: bulk out endpoint / read buffer size, must be larger than max packet size in framework, and aligned in 4-bytes.  */
93 #ifndef UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE
94 #define UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE                        512
95 #endif
96 
97 /* Option: bulk in endpoint / write buffer size, must be larger than max packet size in framework, and aligned in 4-bytes.  */
98 #ifndef UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE
99 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE                       UX_SLAVE_REQUEST_DATA_MAX_LENGTH
100 #endif
101 
102 /* Option: zero copy enable.
103     Works if UX_DEVICE_ENDPOINT_BUFFER_OWNER is 1 (endpoint buffer managed by class).
104     Defined, it enables zero copy for bulk in/out endpoints (write/read). In this case, the endpoint
105     buffer is not allocated in class, application must provide the buffer for read/write, and the
106     buffer must meet device controller driver (DCD) buffer requirements (e.g., aligned and cache safe).
107  */
108 /* #define UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY  */
109 
110 /* Internal: check if class own endpoint buffer  */
111 #if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) &&                                   \
112     (!defined(UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY) ||                             \
113      !defined(UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE))
114 #define UX_DEVICE_CLASS_CDC_ACM_OWN_ENDPOINT_BUFFER
115 #endif
116 
117 
118 /* Define CDC Class USB Class constants.  */
119 #define UX_SLAVE_CLASS_CDC_ACM_CLASS                                    10
120 
121 /* Device CDC Requests */
122 #define UX_SLAVE_CLASS_CDC_ACM_SEND_ENCAPSULATED_COMMAND                0x00
123 #define UX_SLAVE_CLASS_CDC_ACM_GET_ENCAPSULATED_RESPONSE                0x01
124 #define UX_SLAVE_CLASS_CDC_ACM_SET_COMM_FEATURE                         0x02
125 #define UX_SLAVE_CLASS_CDC_ACM_GET_COMM_FEATURE                         0x03
126 #define UX_SLAVE_CLASS_CDC_ACM_CLEAR_COMM_FEATURE                       0x04
127 #define UX_SLAVE_CLASS_CDC_ACM_SET_AUX_LINE_STATE                       0x10
128 #define UX_SLAVE_CLASS_CDC_ACM_SET_HOOK_STATE                           0x11
129 #define UX_SLAVE_CLASS_CDC_ACM_PULSE_SETUP                              0x12
130 #define UX_SLAVE_CLASS_CDC_ACM_SEND_PULSE                               0x13
131 #define UX_SLAVE_CLASS_CDC_ACM_SET_PULSE_TIME                           0x14
132 #define UX_SLAVE_CLASS_CDC_ACM_RING_AUX_JACK                            0x15
133 #define UX_SLAVE_CLASS_CDC_ACM_SET_LINE_CODING                          0x20
134 #define UX_SLAVE_CLASS_CDC_ACM_GET_LINE_CODING                          0x21
135 #define UX_SLAVE_CLASS_CDC_ACM_SET_CONTROL_LINE_STATE                   0x22
136 #define UX_SLAVE_CLASS_CDC_ACM_SEND_BREAK                               0x23
137 #define UX_SLAVE_CLASS_CDC_ACM_SET_RINGER_PARMS                         0x30
138 #define UX_SLAVE_CLASS_CDC_ACM_GET_RINGER_PARMS                         0x31
139 #define UX_SLAVE_CLASS_CDC_ACM_SET_OPERATION_PARMS                      0x32
140 #define UX_SLAVE_CLASS_CDC_ACM_GET_OPERATION_PARMS                      0x33
141 #define UX_SLAVE_CLASS_CDC_ACM_SET_LINE_PARMS                           0x34
142 #define UX_SLAVE_CLASS_CDC_ACM_GET_LINE_PARMS                           0x35
143 #define UX_SLAVE_CLASS_CDC_ACM_DIAL_DIGITS                              0x36
144 #define UX_SLAVE_CLASS_CDC_ACM_SET_UNIT_PARAMETER                       0x37
145 #define UX_SLAVE_CLASS_CDC_ACM_GET_UNIT_PARAMETER                       0x38
146 #define UX_SLAVE_CLASS_CDC_ACM_CLEAR_UNIT_PARAMETER                     0x39
147 #define UX_SLAVE_CLASS_CDC_ACM_GET_PROFILE                              0x3A
148 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_MULTICAST_FILTERS           0x40
149 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_POWER_MANAGEMENT_PATTERN    0x41
150 #define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_POWER_MANAGEMENT_PATTERN    0x42
151 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_PACKET_FILTER               0x43
152 #define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_STATISTIC                   0x44
153 #define UX_SLAVE_CLASS_CDC_ACM_SET_ATM_DATA_FORMAT                      0x50
154 #define UX_SLAVE_CLASS_CDC_ACM_GET_ATM_DEVICE_STATISTICS                0x51
155 #define UX_SLAVE_CLASS_CDC_ACM_SET_ATM_DEFAULT_VC                       0x52
156 #define UX_SLAVE_CLASS_CDC_ACM_GET_ATM_VC_STATISTICS                    0x53
157 
158 /* Default line coding values.  */
159 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_BAUDRATE                     115200
160 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_STOP_BIT                     1
161 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARITY                       0
162 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_DATA_BIT                     8
163 
164 /* Define line coding structure.  */
165 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_BAUDRATE_STRUCT              0
166 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_STOP_BIT_STRUCT              4
167 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARITY_STRUCT                5
168 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_DATA_BIT_STRUCT              6
169 #define UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_RESPONSE_SIZE                7
170 
171 /* Define line state bits.  */
172 #define UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_DTR                           1
173 #define UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_RTS                           2
174 
175 /* Define Transfer direction bits.  */
176 #define UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_XMIT                            1
177 #define UX_SLAVE_CLASS_CDC_ACM_ENDPOINT_RCV                             2
178 
179 /* Define IOCTL functions.  */
180 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING                    1
181 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING                    2
182 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_GET_LINE_STATE                     3
183 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_ABORT_PIPE                         4
184 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE                     5
185 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_START                 6
186 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_TRANSMISSION_STOP                  7
187 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_READ_TIMEOUT                   8
188 #define UX_SLAVE_CLASS_CDC_ACM_IOCTL_SET_WRITE_TIMEOUT                  9
189 
190 /* Define event group flag.  */
191 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_EVENT                             1
192 
193 
194 /* CDC ACM read state machine states.  */
195 #define UX_DEVICE_CLASS_CDC_ACM_READ_START      (UX_STATE_STEP + 1)
196 #define UX_DEVICE_CLASS_CDC_ACM_READ_WAIT       (UX_STATE_STEP + 2)
197 
198 /* CDC ACM write state machine states.  */
199 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_START     (UX_STATE_STEP + 1)
200 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_WAIT      (UX_STATE_STEP + 2)
201 
202 
203 /* Define Slave CDC Class Calling Parameter structure */
204 
205 typedef struct UX_SLAVE_CLASS_CDC_ACM_PARAMETER_STRUCT
206 {
207     VOID                    (*ux_slave_class_cdc_acm_instance_activate)(VOID *);
208     VOID                    (*ux_slave_class_cdc_acm_instance_deactivate)(VOID *);
209     VOID                    (*ux_slave_class_cdc_acm_parameter_change)(VOID *);
210 
211 } UX_SLAVE_CLASS_CDC_ACM_PARAMETER;
212 
213 /* Define CDC Class structure.  */
214 
215 typedef struct UX_SLAVE_CLASS_CDC_ACM_STRUCT
216 {
217     UX_SLAVE_INTERFACE                  *ux_slave_class_cdc_acm_interface;
218     UX_SLAVE_CLASS_CDC_ACM_PARAMETER    ux_slave_class_cdc_acm_parameter;
219 
220 #if defined(UX_DEVICE_CLASS_CDC_ACM_OWN_ENDPOINT_BUFFER)
221     UCHAR                               *ux_device_class_cdc_acm_endpoint_buffer;
222 #endif
223 
224 #if !defined(UX_DEVICE_STANDALONE)
225     UX_MUTEX                            ux_slave_class_cdc_acm_endpoint_in_mutex;
226     UX_MUTEX                            ux_slave_class_cdc_acm_endpoint_out_mutex;
227 #else
228 #if (UX_DEVICE_ENDPOINT_BUFFER_OWNER != 1) || !defined(UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY)
229     UCHAR                               *ux_device_class_cdc_acm_read_buffer;
230     ULONG                               ux_device_class_cdc_acm_read_requested_length;
231     ULONG                               ux_device_class_cdc_acm_read_transfer_length;
232     ULONG                               ux_device_class_cdc_acm_read_actual_length;
233 #endif
234     UINT                                ux_device_class_cdc_acm_read_state;
235     UINT                                ux_device_class_cdc_acm_read_status;
236 
237 #if (UX_DEVICE_ENDPOINT_BUFFER_OWNER != 1) || !defined(UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY)
238     ULONG                               ux_device_class_cdc_acm_write_transfer_length;
239     ULONG                               ux_device_class_cdc_acm_write_host_length;
240     ULONG                               ux_device_class_cdc_acm_write_actual_length;
241 #endif
242     UCHAR                               *ux_device_class_cdc_acm_write_buffer;
243     ULONG                               ux_device_class_cdc_acm_write_requested_length;
244     UINT                                ux_device_class_cdc_acm_write_status;
245     UINT                                ux_device_class_cdc_acm_write_state;
246 #endif
247 
248     ULONG                               ux_slave_class_cdc_acm_baudrate;
249     UCHAR                               ux_slave_class_cdc_acm_stop_bit;
250     UCHAR                               ux_slave_class_cdc_acm_parity;
251     UCHAR                               ux_slave_class_cdc_acm_data_bit;
252     UCHAR                               ux_slave_class_cdc_acm_data_dtr_state;
253     UCHAR                               ux_slave_class_cdc_acm_data_rts_state;
254     UCHAR                               reserved[3];
255 
256 #ifndef UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE
257 #if !defined(UX_DEVICE_STANDALONE)
258     UX_THREAD                           ux_slave_class_cdc_acm_bulkin_thread;
259     UX_THREAD                           ux_slave_class_cdc_acm_bulkout_thread;
260     UX_EVENT_FLAGS_GROUP                ux_slave_class_cdc_acm_event_flags_group;
261     UCHAR                               *ux_slave_class_cdc_acm_bulkin_thread_stack;
262     UCHAR                               *ux_slave_class_cdc_acm_bulkout_thread_stack;
263 #endif
264     UINT                                (*ux_device_class_cdc_acm_write_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, ULONG length);
265     UINT                                (*ux_device_class_cdc_acm_read_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, UCHAR *data_pointer, ULONG length);
266     ULONG                               ux_slave_class_cdc_acm_transmission_status;
267     ULONG                               ux_slave_class_cdc_acm_scheduled_write;
268 #if !defined(UX_DEVICE_STANDALONE)
269     ULONG                               ux_slave_class_cdc_acm_callback_total_length;
270     UCHAR                               *ux_slave_class_cdc_acm_callback_data_pointer;
271     UCHAR                               *ux_slave_class_cdc_acm_callback_current_data_pointer;
272 #endif
273 #endif
274 } UX_SLAVE_CLASS_CDC_ACM;
275 
276 #if defined(UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY) && !defined(UX_DEVICE_CLASS_CDC_ACM_TRANSMISSION_DISABLE)
277 #define UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW  (UX_FALSE)
278 #define UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE    (UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE)
279 #define UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER(acm)        ((acm) -> ux_device_class_cdc_acm_endpoint_buffer)
280 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER(acm)       (UX_NULL)
281 #else
282 #define UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW              \
283         (UX_OVERFLOW_CHECK_ADD_ULONG(UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE, UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE))
284 #define UX_DEVICE_CLASS_CDC_ACM_ENDPOINT_BUFFER_SIZE    (UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE + UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER_SIZE)
285 #define UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER(acm)        ((acm) -> ux_device_class_cdc_acm_endpoint_buffer)
286 #define UX_DEVICE_CLASS_CDC_ACM_WRITE_BUFFER(acm)       (UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER(acm) + UX_DEVICE_CLASS_CDC_ACM_READ_BUFFER_SIZE)
287 #endif
288 
289 
290 /* Define some CDC Class structures */
291 
292 typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER_STRUCT
293 {
294     ULONG                               ux_slave_class_cdc_acm_parameter_baudrate;
295     UCHAR                               ux_slave_class_cdc_acm_parameter_stop_bit;
296     UCHAR                               ux_slave_class_cdc_acm_parameter_parity;
297     UCHAR                               ux_slave_class_cdc_acm_parameter_data_bit;
298 
299 } UX_SLAVE_CLASS_CDC_ACM_LINE_CODING_PARAMETER;
300 
301 typedef struct UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER_STRUCT
302 {
303     UCHAR                               ux_slave_class_cdc_acm_parameter_rts;
304     UCHAR                               ux_slave_class_cdc_acm_parameter_dtr;
305 
306 } UX_SLAVE_CLASS_CDC_ACM_LINE_STATE_PARAMETER;
307 
308 typedef struct UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER_STRUCT
309 {
310     UINT                                (*ux_device_class_cdc_acm_parameter_write_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, ULONG length);
311     UINT                                (*ux_device_class_cdc_acm_parameter_read_callback)(struct UX_SLAVE_CLASS_CDC_ACM_STRUCT *cdc_acm, UINT status, UCHAR *data_pointer, ULONG length);
312 
313 } UX_SLAVE_CLASS_CDC_ACM_CALLBACK_PARAMETER;
314 
315 
316 
317 /* Requests - Ethernet Networking Control Model */
318 
319 #define UX_SLAVE_CLASS_CDC_ACM_SEND_ENCAPSULATED_COMMAND                        0x00
320                                         /* Issues a command in the format of the supported control
321                                            protocol. The intent of this mechanism is to support
322                                            networking devices (e.g., host-based cable modems)
323                                            that require an additional vendor-defined interface for
324                                            media specific hardware configuration and
325                                            management.  */
326 #define UX_SLAVE_CLASS_CDC_ACM_GET_ENCAPSULATED_RESPONSE                        0x01
327                                         /* Requests a response in the format of the supported
328                                            control protocol.  */
329 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_MULTICAST_FILTERS                   0x40
330                                         /* As applications are loaded and unloaded on the host,
331                                            the networking transport will instruct the device's MAC
332                                            driver to change settings of the Networking device's
333                                            multicast filters.  */
334 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER     0x41
335                                         /* Some hosts are able to conserve energy and stay quiet
336                                            in a 'sleeping' state while not being used. USB
337                                            Networking devices may provide special pattern filtering
338                                            hardware that enables it to wake up the attached host
339                                            on demand when something is attempting to contact the
340                                            host (e.g., an incoming web browser connection).
341                                            Primitives are needed in management plane to negotiate
342                                            the setting of these special filters  */
343 #define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER     0x42
344                                         /* Retrieves the status of the above power management
345                                            pattern filter setting  */
346 #define UX_SLAVE_CLASS_CDC_ACM_SET_ETHERNET_PACKET_FILTER                       0x43
347                                         /* Sets device filter for running a network analyzer
348                                            application on the host machine  */
349 #define UX_SLAVE_CLASS_CDC_ACM_GET_ETHERNET_STATISTIC                           0x44
350                                         /* Retrieves Ethernet device statistics such as frames
351                                            transmitted, frames received, and bad frames received.  */
352 
353 /* Define buffer length for IN/OUT pipes.  */
354 
355 #define UX_SLAVE_CLASS_CDC_ACM_BUFFER_SIZE                  4096
356 
357 
358 /* Define Device CDC Class prototypes.  */
359 
360 UINT  _ux_device_class_cdc_acm_activate(UX_SLAVE_CLASS_COMMAND *command);
361 UINT  _ux_device_class_cdc_acm_control_request(UX_SLAVE_CLASS_COMMAND *command);
362 UINT  _ux_device_class_cdc_acm_deactivate(UX_SLAVE_CLASS_COMMAND *command);
363 UINT  _ux_device_class_cdc_acm_entry(UX_SLAVE_CLASS_COMMAND *command);
364 UINT  _ux_device_class_cdc_acm_initialize(UX_SLAVE_CLASS_COMMAND *command);
365 UINT  _ux_device_class_cdc_acm_uninitialize(UX_SLAVE_CLASS_COMMAND *command);
366 UINT  _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
367                                 ULONG requested_length, ULONG *actual_length);
368 UINT  _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
369                                 ULONG requested_length, ULONG *actual_length);
370 UINT  _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
371                                     VOID *parameter);
372 VOID  _ux_device_class_cdc_acm_bulkin_thread(ULONG class_pointer);
373 VOID  _ux_device_class_cdc_acm_bulkout_thread(ULONG class_pointer);
374 UINT  _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
375                                 ULONG requested_length);
376 
377 UINT  _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
378                                 ULONG requested_length, ULONG *actual_length);
379 UINT  _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
380                                 ULONG requested_length, ULONG *actual_length);
381 
382 UINT  _ux_device_class_cdc_acm_tasks_run(VOID *instance);
383 
384 UINT  _uxe_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
385                                     ULONG requested_length, ULONG *actual_length);
386 UINT  _uxe_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
387                                     ULONG requested_length, ULONG *actual_length);
388 UINT  _uxe_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function,
389                                     VOID *parameter);
390 UINT  _uxe_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
391                                     ULONG requested_length);
392 UINT  _uxe_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
393                                 ULONG requested_length, ULONG *actual_length);
394 UINT  _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer,
395                                 ULONG requested_length, ULONG *actual_length);
396 
397 /* Define Device CDC Class API prototypes.  */
398 #define ux_device_class_cdc_acm_entry               _ux_device_class_cdc_acm_entry
399 
400 #if defined(UX_DEVICE_CLASS_CDC_ACM_ENABLE_ERROR_CHECKING)
401 
402 #define ux_device_class_cdc_acm_read                _uxe_device_class_cdc_acm_read
403 #define ux_device_class_cdc_acm_write               _uxe_device_class_cdc_acm_write
404 #define ux_device_class_cdc_acm_ioctl               _uxe_device_class_cdc_acm_ioctl
405 #define ux_device_class_cdc_acm_write_with_callback _uxe_device_class_cdc_acm_write_with_callback
406 
407 #define ux_device_class_cdc_acm_read_run            _uxe_device_class_cdc_acm_read_run
408 #define ux_device_class_cdc_acm_write_run           _uxe_device_class_cdc_acm_write_run
409 
410 #else
411 
412 #define ux_device_class_cdc_acm_read                _ux_device_class_cdc_acm_read
413 #define ux_device_class_cdc_acm_write               _ux_device_class_cdc_acm_write
414 #define ux_device_class_cdc_acm_ioctl               _ux_device_class_cdc_acm_ioctl
415 #define ux_device_class_cdc_acm_write_with_callback _ux_device_class_cdc_acm_write_with_callback
416 
417 #define ux_device_class_cdc_acm_read_run            _ux_device_class_cdc_acm_read_run
418 #define ux_device_class_cdc_acm_write_run           _ux_device_class_cdc_acm_write_run
419 
420 #endif
421 
422 /* Determine if a C++ compiler is being used.  If so, complete the standard
423    C conditional started above.  */
424 #ifdef __cplusplus
425 }
426 #endif
427 
428 #endif /* UX_DEVICE_CLASS_CDC_ACM_H */
429