From 2d357c5912709485aac36a3bf3800cf282477d34 Mon Sep 17 00:00:00 2001 From: Chaoqiong Xiao Date: Wed, 8 Mar 2023 08:32:02 +0000 Subject: [PATCH] Release 6.2.1 on 08 Mar 2023. Expand to see details. e180182e Update owners a6785db8 Update for release. bc77918b Improve host audio sampling set and check (fixed a memory issue). 97d66e5d Add optimization options to ux_user.h eea2c732 USBX device printer error checking support. 1760cc8c USBX device audio error checking support a39f2f26 Fixed a macro name issue in device audio 1.0 83278dd8 Supported multiple report IDs in host HID. c548fe33 Fixed host CDC-ACM capability get. b64f8cdb Fix vendor request handling. --- common/core/inc/ux_api.h | 17 +++- common/core/inc/ux_user_sample.h | 50 +++++++++- .../ux_device_stack_control_request_process.c | 8 +- .../inc/ux_device_class_audio.h | 91 ++++++++++++++++++- .../inc/ux_device_class_audio10.h | 27 +++++- .../inc/ux_device_class_audio20.h | 24 ++++- .../inc/ux_device_class_ccid.h | 6 +- .../inc/ux_device_class_printer.h | 29 +++++- .../ux_device_class_audio10_control_process.c | 64 ++++++++++++- .../ux_device_class_audio20_control_process.c | 63 ++++++++++++- .../src/ux_device_class_audio_entry.c | 10 +- .../src/ux_device_class_audio_feedback_get.c | 52 +++++++++++ .../src/ux_device_class_audio_feedback_set.c | 52 +++++++++++ .../src/ux_device_class_audio_frame_write.c | 57 +++++++++++- .../src/ux_device_class_audio_initialize.c | 64 +++++++++++++ .../ux_device_class_audio_interrupt_send.c | 55 +++++++++++ .../src/ux_device_class_audio_ioctl.c | 65 +++++++++++-- .../ux_device_class_audio_read_frame_free.c | 57 +++++++++++- .../ux_device_class_audio_read_frame_get.c | 60 +++++++++++- .../ux_device_class_audio_reception_start.c | 57 +++++++++++- .../src/ux_device_class_audio_sample_read16.c | 58 +++++++++++- .../src/ux_device_class_audio_sample_read24.c | 58 +++++++++++- .../src/ux_device_class_audio_sample_read32.c | 58 +++++++++++- .../src/ux_device_class_audio_sample_read8.c | 57 +++++++++++- .../src/ux_device_class_audio_stream_get.c | 70 ++++++++++++-- ...ux_device_class_audio_transmission_start.c | 57 +++++++++++- ...ux_device_class_audio_write_frame_commit.c | 58 +++++++++++- .../ux_device_class_audio_write_frame_get.c | 60 +++++++++++- .../src/ux_device_class_ccid_activate.c | 6 +- .../src/ux_device_class_ccid_auto_seq_done.c | 6 +- .../src/ux_device_class_ccid_auto_seq_start.c | 6 +- .../src/ux_device_class_ccid_control_abort.c | 6 +- .../src/ux_device_class_ccid_hardware_error.c | 6 +- .../src/ux_device_class_ccid_icc_insert.c | 6 +- .../src/ux_device_class_ccid_icc_remove.c | 6 +- .../src/ux_device_class_ccid_initialize.c | 6 +- .../ux_device_class_ccid_notify_task_run.c | 4 +- ...ux_device_class_ccid_notify_thread_entry.c | 6 +- .../src/ux_device_class_ccid_response.c | 6 +- .../ux_device_class_ccid_runner_task_run.c | 4 +- ...ux_device_class_ccid_runner_thread_entry.c | 6 +- .../src/ux_device_class_ccid_tasks_run.c | 4 +- .../src/ux_device_class_ccid_thread_entry.c | 6 +- .../src/ux_device_class_printer_entry.c | 9 +- .../src/ux_device_class_printer_initialize.c | 58 ++++++++++++ .../src/ux_device_class_printer_ioctl.c | 59 +++++++++++- .../src/ux_device_class_printer_read.c | 56 ++++++++++++ .../src/ux_device_class_printer_write.c | 56 ++++++++++++ ..._host_class_audio_streaming_sampling_set.c | 35 ++++--- .../ux_host_class_cdc_acm_capabilities_get.c | 14 ++- ...ost_class_hid_transfer_request_completed.c | 45 +++++++-- .../src/ux_host_class_hub_tasks_run.c | 6 +- .../src/ux_host_class_storage_check_run.c | 6 +- .../src/ux_host_class_storage_lock.c | 6 +- .../src/ux_host_class_storage_media_read.c | 6 +- .../src/ux_host_class_storage_media_write.c | 6 +- .../ux_host_class_storage_read_write_run.c | 6 +- common/usbx_network/src/ux_network_driver.c | 6 +- 58 files changed, 1694 insertions(+), 148 deletions(-) diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index cb83675c..ec661a74 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -26,7 +26,7 @@ /* APPLICATION INTERFACE DEFINITION RELEASE */ /* */ /* ux_api.h PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -128,6 +128,11 @@ /* added interface instance */ /* creation strategy control, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* accepted UX_MAX_CLASSES as */ +/* max class driver configure, */ +/* added a new error code, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -255,6 +260,13 @@ typedef signed char SCHAR; #define UX_MAX_SLAVE_INTERFACES 16 #endif +/* Define USBX max number of classes (1 ~ n). */ +#ifndef UX_MAX_CLASSES +#define UX_MAX_CLASSES 2 +#endif +#ifndef UX_MAX_CLASS_DRIVER +#define UX_MAX_CLASS_DRIVER UX_MAX_CLASSES +#endif /* Define USBX max number of devices (1 ~ n). */ #ifndef UX_MAX_DEVICES @@ -295,7 +307,7 @@ typedef signed char SCHAR; #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 #define USBX_MINOR_VERSION 2 -#define USBX_PATCH_VERSION 0 +#define USBX_PATCH_VERSION 1 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ @@ -1417,6 +1429,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_INVALID_PARAMETER 0xfa #define UX_ABORTED 0xf9 #define UX_MATH_OVERFLOW 0xf8 +#define UX_INVALID_BUILD_OPTION 0xf7 #define UX_TOO_MANY_DEVICES 0x11 #define UX_MEMORY_INSUFFICIENT 0x12 diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index 72a7e5e8..f974505a 100644 --- a/common/core/inc/ux_user_sample.h +++ b/common/core/inc/ux_user_sample.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_user.h PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* */ /* AUTHOR */ /* */ @@ -89,6 +89,16 @@ /* added host stack instance */ /* creation strategy control, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added option to disable dev */ +/* alternate setting support, */ +/* added option to disable dev */ +/* framework initialize scan, */ +/* added option to reference */ +/* names by pointer to chars, */ +/* added option to enable */ +/* basic USBX error checking, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -409,6 +419,30 @@ /* #define UX_DEVICE_BIDIRECTIONAL_ENDPOINT_SUPPORT */ +/* Defined, this macro disables interface alternate setting support. + Device stalls + */ +/* UX_DEVICE_ALTERNATE_SETTING_SUPPORT_DISABLE */ + + +/* Defined, this macro disables device framework scan, where max number of endpoints (except EP0) + and max number of interfaces are calculated at runtime, as a base to allocate memory for + interfaces and endpoints structures and their buffers. + Undefined, the following two macros must be defined to initialize memory structures. + */ +/* #define UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE */ + +/* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined. + This value represents max number of endpoints (except EP0) activated at the same time. + */ +/* #define UX_MAX_DEVICE_ENDPOINTS 2 */ + +/* Works if UX_DEVICE_INITIALIZE_FRAMEWORK_SCAN_DISABLE is defined. + This value represents max number of interfaces activated at the same time. + */ +/* #define UX_MAX_DEVICE_INTERFACES 1 */ + + /* Defined, this macro enables device/host PIMA MTP support. */ /* #define UX_PIMA_WITH_MTP_SUPPORT */ @@ -421,6 +455,7 @@ /* #define UX_HOST_DEVICE_CLASS_CODE_VALIDATION_ENABLE */ + /* Defined, host HID interrupt OUT transfer is supported. */ /* #define UX_HOST_CLASS_HID_INTERRUPT_OUT_SUPPORT */ @@ -448,6 +483,12 @@ */ /* #define UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_CONTROL UX_HOST_STACK_CONFIGURATION_INSTANCE_CREATE_OWNED */ +/* Defined, the _name in structs are referenced by pointer instead of by contents. + By default the _name is an array of string that saves characters, the contents are compared to confirm match. + If referenced by pointer the address pointer to const string is saved, the pointers are compared to confirm match. + */ +/* #define UX_NAME_REFERENCED_BY_POINTER */ + /* Defined, this value will only enable the host side of usbx. */ /* #define UX_HOST_SIDE_ONLY */ @@ -522,6 +563,13 @@ /* #define UX_ASSERT_FAIL for (;;) {tx_thread_sleep(UX_WAIT_FOREVER); } */ +/* Defined, this option enables the basic USBX error checking. This define is typically used + when the application is debugging and removed after the application is fully debugged. */ +/* +#define UX_ENABLE_ERROR_CHECKING +*/ + + /* DEBUG includes and macros for a specific platform go here. */ #ifdef UX_INCLUDE_USER_DEFINE_BSP #include "usb_bsp.h" diff --git a/common/core/src/ux_device_stack_control_request_process.c b/common/core/src/ux_device_stack_control_request_process.c index 82729c2b..91e1ca0e 100644 --- a/common/core/src/ux_device_stack_control_request_process.c +++ b/common/core/src/ux_device_stack_control_request_process.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_control_request_process PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -91,6 +91,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed vendor request issue, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_stack_control_request_process(UX_SLAVE_TRANSFER *transfer_request) @@ -144,7 +147,8 @@ ULONG application_data_length; { /* Check the request demanded and compare it to the application registered one. */ - if (request == _ux_system_slave -> ux_system_slave_device_vendor_request) + if (_ux_system_slave -> ux_system_slave_device_vendor_request_function != UX_NULL && + request == _ux_system_slave -> ux_system_slave_device_vendor_request) { /* This is a Microsoft extended function. It happens before the device is configured. diff --git a/common/usbx_device_classes/inc/ux_device_class_audio.h b/common/usbx_device_classes/inc/ux_device_class_audio.h index 4cc5be3a..63ce8c34 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio.h PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -62,6 +62,9 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -85,6 +88,13 @@ extern "C" { /* Compile option: if defined, audio interrupt endpoint is supported. */ /* #define UX_DEVICE_CLASS_AUDIO_INTERRUPT_SUPPORT */ +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING +#endif + + /* Define Audio Class OS related constants. */ #define UX_DEVICE_CLASS_AUDIO_FEEDBACK_THREAD_STACK_SIZE UX_THREAD_STACK_SIZE @@ -514,12 +524,85 @@ VOID _ux_device_class_audio_interrupt_thread_entry(ULONG audio_inst); UINT _ux_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio); UINT _ux_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data); -#if defined(UX_DEVICE_STANDALONE) UINT _ux_device_class_audio_tasks_run(VOID *instance); -#endif + + +UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command); + +UINT _uxe_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function, + VOID *parameter); + +UINT _uxe_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio, ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream); + +VOID _uxe_device_class_audio_write_thread_entry(ULONG audio_stream); +VOID _uxe_device_class_audio_read_thread_entry(ULONG audio_stream); +UINT _uxe_device_class_audio_write_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream); +UINT _uxe_device_class_audio_read_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream); +UINT _uxe_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *audio); +UINT _uxe_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *sample); +UINT _uxe_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *audio, USHORT *sample); +UINT _uxe_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG *sample); +UINT _uxe_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG *sample); + +UINT _uxe_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR **frame_data, ULONG *frame_length); +UINT _uxe_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *audio); + +UINT _uxe_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *audio); +UINT _uxe_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *frame, ULONG length); + +UINT _uxe_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR **buffer, ULONG *max_length); +UINT _uxe_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *audio, ULONG length); + +UINT _uxe_device_class_audio_feedback_set(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *encoded_feedback); +UINT _uxe_device_class_audio_feedback_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio, UCHAR *encoded_feedback); +ULONG _uxe_device_class_audio_speed_get(UX_DEVICE_CLASS_AUDIO_STREAM *audio); + +VOID _uxe_device_class_audio_interrupt_thread_entry(ULONG audio_inst); +UINT _uxe_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio); +UINT _uxe_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data); + /* Define Device Class Audio API prototypes. */ +#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) + +#define ux_device_class_audio_entry _ux_device_class_audio_entry + +#define ux_device_class_audio_read_thread_entry _ux_device_class_audio_read_thread_entry +#define ux_device_class_audio_write_thread_entry _ux_device_class_audio_write_thread_entry + +#define ux_device_class_audio_read_task_function _ux_device_class_audio_read_task_function +#define ux_device_class_audio_write_task_function _ux_device_class_audio_write_task_function + +#define ux_device_class_audio_stream_get _uxe_device_class_audio_stream_get + +#define ux_device_class_audio_reception_start _uxe_device_class_audio_reception_start +#define ux_device_class_audio_sample_read8 _uxe_device_class_audio_sample_read8 +#define ux_device_class_audio_sample_read16 _uxe_device_class_audio_sample_read16 +#define ux_device_class_audio_sample_read24 _uxe_device_class_audio_sample_read24 +#define ux_device_class_audio_sample_read32 _uxe_device_class_audio_sample_read32 + +#define ux_device_class_audio_read_frame_get _uxe_device_class_audio_read_frame_get +#define ux_device_class_audio_read_frame_free _uxe_device_class_audio_read_frame_free + +#define ux_device_class_audio_transmission_start _uxe_device_class_audio_transmission_start +#define ux_device_class_audio_frame_write _uxe_device_class_audio_frame_write + +#define ux_device_class_audio_write_frame_get _uxe_device_class_audio_write_frame_get +#define ux_device_class_audio_write_frame_commit _uxe_device_class_audio_write_frame_commit + +#define ux_device_class_audio_ioctl _uxe_device_class_audio_ioctl + +#define ux_device_class_audio_speed_get _ux_device_class_audio_speed_get +#define ux_device_class_audio_feedback_thread_entry _ux_device_class_audio_feedback_thread_entry +#define ux_device_class_audio_feedback_task_function _ux_device_class_audio_feedback_task_function +#define ux_device_class_audio_feedback_get _uxe_device_class_audio_feedback_get +#define ux_device_class_audio_feedback_set _uxe_device_class_audio_feedback_set + +#define ux_device_class_audio_interrupt_send _uxe_device_class_audio_interrupt_send + +#else + #define ux_device_class_audio_entry _ux_device_class_audio_entry #define ux_device_class_audio_read_thread_entry _ux_device_class_audio_read_thread_entry @@ -555,6 +638,8 @@ UINT _ux_device_class_audio_tasks_run(VOID *instance); #define ux_device_class_audio_interrupt_send _ux_device_class_audio_interrupt_send +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_device_classes/inc/ux_device_class_audio10.h b/common/usbx_device_classes/inc/ux_device_class_audio10.h index d366ef2e..355821dc 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio10.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio10.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio10.h PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,6 +53,10 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added sampling control, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* fixed a macro name, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -70,6 +74,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING +#endif + + /* Define Audio Class specific AC interface descriptor subclasses. */ #define UX_DEVICE_CLASS_AUDIO10_AC_UNDEFINED 0x00 @@ -377,7 +388,7 @@ typedef struct UX_DEVICE_CLASS_AUDIO10_CONTROL_STRUCT #define UX_DEVICE_CLASS_AUDIO10_CONTROL_MUTE_CHANGED 1u #define UX_DEVICE_CLASS_AUDIO10_CONTROL_VOLUME_CHANGED 2u -#define UX_DEVICE_CLASS_AUDIO20_CONTROL_FREQUENCY_CHANGED 4u +#define UX_DEVICE_CLASS_AUDIO10_CONTROL_FREQUENCY_CHANGED 4u typedef struct UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP_STRUCT { @@ -389,8 +400,20 @@ UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, UX_SLAVE_TRANSFER *transfer_request, UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group); +UINT _uxe_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, + UX_SLAVE_TRANSFER *transfer_request, + UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group); + +#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) + +#define ux_device_class_audio10_control_process _uxe_device_class_audio10_control_process + +#else + #define ux_device_class_audio10_control_process _ux_device_class_audio10_control_process +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_device_classes/inc/ux_device_class_audio20.h b/common/usbx_device_classes/inc/ux_device_class_audio20.h index aa7cc4f8..7c2da211 100644 --- a/common/usbx_device_classes/inc/ux_device_class_audio20.h +++ b/common/usbx_device_classes/inc/ux_device_class_audio20.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_audio20.h PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,6 +55,9 @@ /* sampling frequencies, */ /* added clock multiplier DEFs,*/ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -72,6 +75,13 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING +#endif + + /* Define Audio Class function category codes. */ #define UX_DEVICE_CLASS_AUDIO20_CATEGORY_UNDEFINED 0x00 @@ -449,8 +459,20 @@ UINT _ux_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, UX_SLAVE_TRANSFER *transfer, UX_DEVICE_CLASS_AUDIO20_CONTROL_GROUP *group); +UINT _uxe_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, + UX_SLAVE_TRANSFER *transfer, + UX_DEVICE_CLASS_AUDIO20_CONTROL_GROUP *group); + +#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) + +#define ux_device_class_audio20_control_process _uxe_device_class_audio20_control_process + +#else + #define ux_device_class_audio20_control_process _ux_device_class_audio20_control_process +#endif + /* Determine if a C++ compiler is being used. If so, complete the standard C conditional started above. */ #ifdef __cplusplus diff --git a/common/usbx_device_classes/inc/ux_device_class_ccid.h b/common/usbx_device_classes/inc/ux_device_class_ccid.h index a35a76ad..4cf51bd0 100644 --- a/common/usbx_device_classes/inc/ux_device_class_ccid.h +++ b/common/usbx_device_classes/inc/ux_device_class_ccid.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_ccid.h PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -39,9 +39,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_printer.h b/common/usbx_device_classes/inc/ux_device_class_printer.h index 52ae8ce5..80d79dcc 100644 --- a/common/usbx_device_classes/inc/ux_device_class_printer.h +++ b/common/usbx_device_classes/inc/ux_device_class_printer.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_printer.h PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,6 +47,9 @@ /* 10-31-2022 Yajun xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Yajun xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ @@ -63,6 +66,12 @@ extern "C" { #endif +/* Internal option: enable the basic USBX error checking. This define is typically used + while debugging application. */ +#if defined(UX_ENABLE_ERROR_CHECKING) && !defined(UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING) +#define UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING +#endif + /* Defined, _write is pending ZLP automatically (complete transfer) after buffer is sent. */ /* #define UX_DEVICE_CLASS_PRINTER_WRITE_AUTO_ZLP */ @@ -174,13 +183,31 @@ UINT _ux_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR ULONG requested_length, ULONG *actual_length); #endif +UINT _uxe_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command); +UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length); +UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function, + VOID *parameter); + /* Define Device Printer Class API prototypes. */ +#if defined(UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING) + +#define ux_device_class_printer_entry _ux_device_class_printer_entry +#define ux_device_class_printer_read _uxe_device_class_printer_read +#define ux_device_class_printer_write _uxe_device_class_printer_write +#define ux_device_class_printer_ioctl _uxe_device_class_printer_ioctl + +#else #define ux_device_class_printer_entry _ux_device_class_printer_entry #define ux_device_class_printer_read _ux_device_class_printer_read #define ux_device_class_printer_write _ux_device_class_printer_write #define ux_device_class_printer_ioctl _ux_device_class_printer_ioctl +#endif + #if defined(UX_DEVICE_STANDALONE) #define ux_device_class_printer_read_run _ux_device_class_printer_read_run #define ux_device_class_printer_write_run _ux_device_class_printer_write_run diff --git a/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c b/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c index f38e9ccd..ecd0075a 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c +++ b/common/usbx_device_classes/src/ux_device_class_audio10_control_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio10_control_process PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,7 +66,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -84,6 +84,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added sampling control, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed a macro name, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, @@ -180,7 +183,7 @@ ULONG i; if (sam > max) sam = max; control -> ux_device_class_audio10_control_sam_freq = sam; - control -> ux_device_class_audio10_control_changed = UX_DEVICE_CLASS_AUDIO20_CONTROL_FREQUENCY_CHANGED; + control -> ux_device_class_audio10_control_changed = UX_DEVICE_CLASS_AUDIO10_CONTROL_FREQUENCY_CHANGED; return(UX_SUCCESS); case UX_DEVICE_CLASS_AUDIO10_GET_CUR: @@ -335,3 +338,58 @@ ULONG i; /* Done error. */ return(UX_ERROR); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio10_control_process PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in control processing function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Address of audio class */ +/* instance */ +/* transfer Address of transfer request */ +/* instance */ +/* group Request process data */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio10_control_process */ +/* Process control requests */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio10_control_process(UX_DEVICE_CLASS_AUDIO *audio, + UX_SLAVE_TRANSFER *transfer, UX_DEVICE_CLASS_AUDIO10_CONTROL_GROUP *group) +{ + + /* Sanity checks. */ + if (audio == UX_NULL || transfer == UX_NULL || group == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Process control request. */ + return(_ux_device_class_audio10_control_process(audio, transfer, group)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c b/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c index c98e5fa8..270e3bdf 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c +++ b/common/usbx_device_classes/src/ux_device_class_audio20_control_process.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio20_control_process PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,7 +69,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -89,6 +89,8 @@ /* added support of multiple */ /* sampling frequencies, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, @@ -394,3 +396,60 @@ ULONG n_sub, pos, min, max, res, freq; _ux_device_stack_endpoint_stall(endpoint); return(UX_ERROR); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio20_control_process PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in control request processing function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* audio Address of audio class */ +/* instance */ +/* transfer Address of transfer request */ +/* instance */ +/* group Request process data */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio20_control_process */ +/* Process control requests */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio20_control_process(UX_DEVICE_CLASS_AUDIO *audio, + UX_SLAVE_TRANSFER *transfer, + UX_DEVICE_CLASS_AUDIO20_CONTROL_GROUP *group) +{ + + /* Sanity checks. */ + if (audio == UX_NULL || transfer == UX_NULL || group == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Process control requests. */ + return(_ux_device_class_audio20_control_process(audio, transfer, group)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_entry.c index cc2e1643..e4adb2a1 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_entry PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* returned request status, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -93,7 +96,11 @@ UINT status; case UX_SLAVE_CLASS_COMMAND_INITIALIZE: /* Call the init function of the Audio class. */ +#if defined(UX_DEVICE_CLASS_AUDIO_ENABLE_ERROR_CHECKING) + status = _uxe_device_class_audio_initialize(command); +#else status = _ux_device_class_audio_initialize(command); +#endif /* Return the completion status. */ return(status); @@ -157,4 +164,3 @@ UINT status; return(UX_FUNCTION_NOT_SUPPORTED); } } - diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c index eede8543..7c8539c6 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_get.c @@ -115,3 +115,55 @@ UCHAR *buffer; return(UX_SUCCESS); #endif } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_feedback_get PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in encoded feedback getting function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* encoded_feedback Feedback data (3 or 4 bytes) */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_feedback_get Get encoded feedback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_feedback_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + UCHAR *encoded_feedback) +{ + + /* Sanity check on input parameters. */ + if (stream == UX_NULL || encoded_feedback == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Get feedback. */ + return(_ux_device_class_audio_feedback_get(stream, encoded_feedback)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c b/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c index 898eeea5..000cb4fd 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_feedback_set.c @@ -115,3 +115,55 @@ UCHAR *buffer; return(UX_SUCCESS); #endif } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_feedback_set PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in encoded feedback setting function */ +/* call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* encoded_feedback Feedback data (3 or 4 bytes) */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_feedback_set Set encoded feedback */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_feedback_set(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + UCHAR *encoded_feedback) +{ + + /* Sanity check on input parameters. */ + if (stream == UX_NULL || encoded_feedback == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Get feedback. */ + return(_ux_device_class_audio_feedback_set(stream, encoded_feedback)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c b/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c index 20538c60..fd7c9ecc 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_frame_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_frame_write PORTABLE C */ -/* 6.1.10 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,7 +61,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -75,6 +75,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed frame length check, */ /* resulting in version 6.1.10 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR *frame, ULONG length) @@ -132,3 +134,54 @@ ULONG frame_buffer_size; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_frame_write PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in writing frame function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* frame Pointer to buffer to save */ +/* frame data */ +/* length Frame length in bytes */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_frame_write Write frame to buffer to send */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_frame_write(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR *frame, ULONG length) +{ + + /* Sanity checks. */ + if (stream == UX_NULL || frame == UX_NULL || length == 0) + return(UX_INVALID_PARAMETER); + + /* Write to frame. */ + return(_ux_device_class_audio_frame_write(stream, frame, length)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_initialize.c b/common/usbx_device_classes/src/ux_device_class_audio_initialize.c index 4ba297a3..d2e74b55 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_initialize.c @@ -446,3 +446,67 @@ ULONG i; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_initialize PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in audio initialization function call. */ +/* */ +/* INPUT */ +/* */ +/* command Pointer to audio command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_initialize Initialize audio instance */ +/* */ +/* CALLED BY */ +/* */ +/* Device Audio Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ + +UX_DEVICE_CLASS_AUDIO_PARAMETER *audio_parameter; + + /* Get the pointer to the application parameters for the audio class. */ + audio_parameter = (UX_DEVICE_CLASS_AUDIO_PARAMETER *)command -> ux_slave_class_command_parameter; + + /* Sanity checks. */ + + /* There must be at least one stream. */ + if (audio_parameter -> ux_device_class_audio_parameter_streams == UX_NULL || + audio_parameter -> ux_device_class_audio_parameter_streams_nb < 1) + return(UX_INVALID_PARAMETER); + +#if defined(UX_DEVICE_CLASS_AUDIO_INTERRUPT_SUPPORT) + + /* There must be status setting for event queue. */ + if (audio_parameter -> ux_device_class_audio_parameter_status_queue_size == 0 || + audio_parameter -> ux_device_class_audio_parameter_status_size == 0) + return(UX_INVALID_PARAMETER); +#endif + + /* Do initialize. */ + return(_ux_device_class_audio_initialize(command)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c index eb5d4387..3cc4569b 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_send.c @@ -168,3 +168,58 @@ ULONG i; return(UX_SUCCESS); #endif } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_interrupt_send PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in queuing audio interrupt data */ +/* function call. */ +/* */ +/* Note the interrupt data size is predefined and not checked: */ +/* - for Audio 1.0 interrupt status word is 2 bytes */ +/* - for Audio 2.0 interrupt data message is 6 bytes */ +/* */ +/* INPUT */ +/* */ +/* audio Address of audio instance */ +/* int_data Interrupt data (2 or 6 bytes) */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_interrupt_send Queue interrupt data to send */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_interrupt_send(UX_DEVICE_CLASS_AUDIO *audio, UCHAR *int_data) +{ + + /* Sanity check. */ + if (audio == UX_NULL || int_data == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Send interrupt data. */ + return(_ux_device_class_audio_interrupt_send(audio, int_data)); +} \ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c b/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c index d8bee50a..a6eb89dd 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_ioctl PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -45,10 +45,10 @@ /* */ /* INPUT */ /* */ -/* audio Address of audio class */ -/* instance */ -/* ioctl_function IOCTL function code */ -/* parameter Parameter for function */ +/* audio Address of audio class */ +/* instance */ +/* ioctl_function IOCTL function code */ +/* parameter Parameter for function */ /* */ /* OUTPUT */ /* */ @@ -59,7 +59,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function, @@ -106,3 +108,54 @@ VOID **pptr_parameter; } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_ioctl PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in ioctl function call. */ +/* */ +/* INPUT */ +/* */ +/* audio Address of audio class */ +/* instance */ +/* ioctl_function IOCTL function code */ +/* parameter Parameter for function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_ioctl Perform IOCTL function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_ioctl(UX_DEVICE_CLASS_AUDIO *audio, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity check. */ + if (audio == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Dispatch IOCTL commands. */ + return(_ux_device_class_audio_ioctl(audio, ioctl_function, parameter)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c index b2430b56..31ba753b 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_frame_free PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,7 +57,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -66,6 +66,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *stream) @@ -124,3 +126,54 @@ UCHAR *next_frame; return(UX_SUCCESS); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_read_frame_free PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in freeing access buffer function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_read_frame_free */ +/* Free an item in FIFO */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_read_frame_free(UX_DEVICE_CLASS_AUDIO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Free frame buffer. */ + return(_ux_device_class_audio_read_frame_free(stream)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c index 3cfd71a6..fa644e5c 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_frame_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_frame_get PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,7 +61,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -70,6 +70,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, @@ -112,3 +114,57 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_read_frame_get PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in frame buffer getting function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* frame_data Pointer to buffer to save */ +/* pointer to frame data */ +/* frame_length Pointer to buffer to save */ +/* pointer to frame length */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_read_frame_get Get buffer from 1st FIFO item */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_read_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + UCHAR **frame_data, ULONG *frame_length) +{ + + /* Sanity checks. */ + if (stream == UX_NULL || frame_data == UX_NULL || frame_length == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Get frame access buffer. */ + return(_ux_device_class_audio_read_frame_get(stream, frame_data, frame_length)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c b/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c index 078ce81e..f756213d 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_reception_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_reception_start PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,7 +58,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -73,6 +73,8 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) @@ -118,3 +120,54 @@ UX_SLAVE_DEVICE *device; #endif return(UX_SUCCESS); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_reception_start PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in stream reception start function. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_reception_start */ +/* Audio stream reception start */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_reception_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Start reception. */ + return(_ux_device_class_audio_reception_start(stream)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c index 04dbd269..2c9f98dc 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read16.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read16 PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -59,7 +59,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *stream, @@ -141,3 +143,55 @@ ULONG next_frame_sample; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_sample_read16 PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in reading 16-bit sample function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* sample data */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_sample_read16 Read 16-bit sample */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_sample_read16(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + USHORT *buffer) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Read 16-bit sample. */ + return(_ux_device_class_audio_sample_read16(stream, buffer)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c index cd53dd90..973b4e23 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read24.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read24 PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -59,7 +59,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *stream, @@ -141,3 +143,55 @@ ULONG next_frame_sample; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_sample_read24 PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in reading 24-bit sample function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* sample data */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_sample_read24 Read 24-bit sample */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_sample_read24(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + ULONG *buffer) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Read 24-bit sample. */ + return(_ux_device_class_audio_sample_read24(stream, buffer)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c index 0e53daaa..e98a40b8 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read32.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read32 PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -59,7 +59,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG *buffer) @@ -143,3 +145,55 @@ ULONG next_frame_sample; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_sample_read32 PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in reading 32-bit sample function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* sample data */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_sample_read32 Read 32-bit sample */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_sample_read32(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + ULONG *buffer) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Read 32-bit sample. */ + return(_ux_device_class_audio_sample_read32(stream, buffer)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c b/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c index 2eab8e35..b00e1ed3 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_sample_read8.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_sample_read8 PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -59,7 +59,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -68,6 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *stream, @@ -141,3 +143,54 @@ ULONG next_frame_sample; return(UX_SUCCESS); } +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_sample_read8 PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in reading 8-bit sample function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* sample data */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_sample_read8 Read 8-bit sample */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_sample_read8(UX_DEVICE_CLASS_AUDIO_STREAM *stream, + UCHAR *buffer) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Read 8-bit sample. */ + return(_ux_device_class_audio_sample_read8(stream, buffer)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c b/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c index 1abb5afc..71739d4f 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_stream_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_stream_get PORTABLE C */ -/* 6.1.10 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,7 +60,7 @@ /* */ /* CALLED BY */ /* */ -/* Audio Class */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -71,25 +71,79 @@ /* resulting in version 6.1 */ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1.10 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio, ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream) { + /* Store the stream instance found. */ + *stream = audio -> ux_device_class_audio_streams + stream_index; + + /* Return completion status. */ + return(UX_SUCCESS); +} + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_stream_get PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in stream instance getting function. */ +/* */ +/* INPUT */ +/* */ +/* audio Address of audio class */ +/* instance */ +/* stream_index Stream instance index 0 based */ +/* stream Pointer to buffer to fill */ +/* pointer to stream instance */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_stream_get Get stream instance */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_stream_get(UX_DEVICE_CLASS_AUDIO *audio, + ULONG stream_index, UX_DEVICE_CLASS_AUDIO_STREAM **stream) +{ /* Sanity check. */ if (audio == UX_NULL) - return(UX_ERROR); + return(UX_INVALID_PARAMETER); /* Index validation. */ if (stream_index >= audio -> ux_device_class_audio_streams_nb) - return(UX_ERROR); + return(UX_INVALID_PARAMETER); /* Store the stream instance found. */ - if (stream) - *stream = audio -> ux_device_class_audio_streams + stream_index; + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); - /* Return completion status. */ - return(UX_SUCCESS); + /* Get audio stream instance. */ + return(_ux_device_class_audio_stream_get(audio, stream_index, stream)); } diff --git a/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c b/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c index 69b58c50..7304637f 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_transmission_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_transmission_start PORTABLE C */ -/* 6.2.0 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,7 +58,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -73,6 +73,8 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) @@ -118,3 +120,54 @@ UX_SLAVE_DEVICE *device; #endif return(UX_SUCCESS); } + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_transmission_start PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in starting sending function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_transmission_start */ +/* Start transmission */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_transmission_start(UX_DEVICE_CLASS_AUDIO_STREAM *stream) +{ + + /* Sanity check. */ + if (stream == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Start transmission. */ + return(_ux_device_class_audio_transmission_start(stream)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c index f772e0f0..b040d0a7 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_commit.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_write_frame_commit PORTABLE C */ -/* 6.1.11 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,7 +60,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -72,6 +72,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed frame length check, */ /* resulting in version 6.1.10 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG length) @@ -129,3 +131,55 @@ UCHAR *next_pos; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_write_frame_commit PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in setting frame buffer function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* frame data */ +/* length Frame length in bytes */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_write_frame_commit */ +/* Append a frame to FIFO */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_write_frame_commit(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG length) +{ + + /* Sanity checks. */ + if (stream == UX_NULL || length < 1) + return(UX_INVALID_PARAMETER); + + return(_ux_device_class_audio_write_frame_commit(stream, length)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c index ca952365..eec501fc 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_frame_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_write_frame_get PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -61,7 +61,7 @@ /* */ /* CALLED BY */ /* */ -/* ThreadX */ +/* Application */ /* */ /* RELEASE HISTORY */ /* */ @@ -70,6 +70,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR **frame, ULONG *length) @@ -113,3 +115,57 @@ UX_SLAVE_DEVICE *device; return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_audio_write_frame_get PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Chaoqiong Xiao, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in getting frame buffer function call. */ +/* */ +/* INPUT */ +/* */ +/* stream Address of audio stream */ +/* instance */ +/* frame Pointer to buffer to save */ +/* frame buffer pointer */ +/* length Pointer to save frame */ +/* buffer length in bytes */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_audio_write_frame_get */ +/* Get frame buffer */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_audio_write_frame_get(UX_DEVICE_CLASS_AUDIO_STREAM *stream, UCHAR **frame, ULONG *length) +{ + + /* Sanity checks. */ + if (stream == UX_NULL || frame == UX_NULL || length == UX_NULL) + return(UX_INVALID_PARAMETER); + + /* Get frame buffer and length. */ + return(_ux_device_class_audio_write_frame_get(stream, frame, length)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_activate.c b/common/usbx_device_classes/src/ux_device_class_ccid_activate.c index ed842dab..990f584c 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_activate PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,9 +67,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c index b3dbf492..5a485ebe 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_done.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_auto_seq_done PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,9 +67,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c index a2353e9d..e3352ee4 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_auto_seq_start.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_auto_seq_start PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_auto_seq_start(UX_DEVICE_CLASS_CCID *ccid, ULONG slot) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c b/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c index f2e7ae5e..ab94067a 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_control_abort.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_control_abort PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_control_abort(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c index 794a58eb..d13a0760 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_hardware_error PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c index 5eb59994..6af43283 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_insert.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_icc_insert PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,9 +67,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c index 9c887227..ffefc793 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_icc_remove.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_icc_remove PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -63,9 +63,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c b/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c index 50504d06..5e20857c 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_initialize PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c index 11ac29d3..732e93c9 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_notify_task_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_notify_task_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,7 +70,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_notify_task_run(UX_DEVICE_CLASS_CCID *ccid) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c index 91350dfa..b42638d4 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_notify_thread_entry.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_notify_thread_entry PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,9 +68,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_ccid_notify_thread_entry(ULONG ccid_inst) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_response.c b/common/usbx_device_classes/src/ux_device_class_ccid_response.c index 3d172887..33c24eea 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_response.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_response.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_response PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_response(UX_DEVICE_CLASS_CCID *ccid, UCHAR *buffer, ULONG length) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c index 0ee07d90..4ba38b93 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_runner_task_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_runner_task_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,7 +70,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_runner_task_run(UX_DEVICE_CLASS_CCID *ccid) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c index 747d08b4..c997889b 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_runner_thread_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_runner_thread_entry PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,9 +66,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_ccid_runner_thread_entry(ULONG ccid_runner) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c index cc562975..936c0c10 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_tasks_run.c @@ -40,7 +40,7 @@ static inline UINT _ux_device_class_ccid_rsp_task(UX_DEVICE_CLASS_CCID *ccid); /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_tasks_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,7 +75,7 @@ static inline UINT _ux_device_class_ccid_rsp_task(UX_DEVICE_CLASS_CCID *ccid); /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_tasks_run(VOID *instance) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c index d9836729..2fb99bcc 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_thread_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_thread_entry PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,9 +68,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ VOID _ux_device_class_ccid_thread_entry(ULONG ccid_inst) diff --git a/common/usbx_device_classes/src/ux_device_class_printer_entry.c b/common/usbx_device_classes/src/ux_device_class_printer_entry.c index b4d00a2c..c1eea7d6 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_entry PORTABLE C */ -/* 6.1.10 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ +/* 03-08-2023 Yajun Xia Modified comment(s), */ +/* added error checks support, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_entry(UX_SLAVE_CLASS_COMMAND *command) @@ -88,7 +91,11 @@ UINT status; case UX_SLAVE_CLASS_COMMAND_INITIALIZE: /* Call the init function of the Printer class. */ +#if defined(UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING) + status = _uxe_device_class_printer_initialize(command); +#else status = _ux_device_class_printer_initialize(command); +#endif /* Return the completion status. */ return(status); diff --git a/common/usbx_device_classes/src/ux_device_class_printer_initialize.c b/common/usbx_device_classes/src/ux_device_class_printer_initialize.c index f07e4462..49722b9f 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_initialize.c @@ -148,3 +148,61 @@ UINT status; /* Return completion status. */ return(UX_SUCCESS); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_initialize PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer initialization function call.*/ +/* */ +/* INPUT */ +/* */ +/* command Pointer to printer command */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_initialize Initialize printer instance */ +/* */ +/* CALLED BY */ +/* */ +/* Device Stack */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command) +{ +UX_DEVICE_CLASS_PRINTER_PARAMETER *printer_parameter; +ULONG length; + + /* Get the pointer to the application parameters for the printer class. */ + printer_parameter = command -> ux_slave_class_command_parameter; + + /* Sanity checks. */ + + /* Length of data (first two bytes in big endian). */ + length = _ux_utility_short_get_big_endian(printer_parameter -> ux_device_class_printer_device_id); + + if (length > UX_SLAVE_REQUEST_CONTROL_MAX_LENGTH) + { + return(UX_INVALID_PARAMETER); + } + + return (_ux_device_class_printer_initialize(command)); +} diff --git a/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c b/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c index c8599304..2979b194 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_ioctl PORTABLE C */ -/* 6.1.10 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -47,6 +47,8 @@ /* */ /* printer Address of printer class */ /* instance */ +/* ioctl_function Ioctl function */ +/* Parameter Parameter of ioctl function */ /* */ /* OUTPUT */ /* */ @@ -65,6 +67,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ +/* 03-08-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function, @@ -124,3 +128,56 @@ UX_SLAVE_TRANSFER *transfer; return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_ioctl PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer class ioctl function */ +/* */ +/* INPUT */ +/* */ +/* printer Address of printer class */ +/* instance */ +/* ioctl_function Ioctl function */ +/* Parameter Parameter of ioctl function */ +/* */ +/* OUTPUT */ +/* */ +/* Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_ioctl Printer class ioctl function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_ioctl(UX_DEVICE_CLASS_PRINTER *printer, ULONG ioctl_function, + VOID *parameter) +{ + + /* Sanity checks. */ + if (printer == UX_NULL) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_printer_ioctl(printer, ioctl_function, parameter)); +} \ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read.c b/common/usbx_device_classes/src/ux_device_class_printer_read.c index a1e506bd..72297bd7 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_read.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_read.c @@ -201,3 +201,59 @@ ULONG local_requested_length; /* Simply return the last transaction result. */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_read PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer class read function */ +/* */ +/* INPUT */ +/* */ +/* printer Address of printer class */ +/* instance */ +/* buffer Pointer to buffer to save */ +/* received data */ +/* requested_length Length of bytes to read */ +/* actual_length Pointer to save number of */ +/* bytes read */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_read Printer class read function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((printer == UX_NULL) || (buffer == UX_NULL) || (actual_length == UX_NULL)) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_printer_read(printer, buffer, requested_length, actual_length)); +} \ No newline at end of file diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write.c b/common/usbx_device_classes/src/ux_device_class_printer_write.c index 2c109583..b04266e9 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_write.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_write.c @@ -225,3 +225,59 @@ UINT status = 0; /* Simply return the last transaction result. */ return(status); } + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _uxe_device_class_printer_write PORTABLE C */ +/* 6.2.1 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function checks errors in printer class write function */ +/* */ +/* INPUT */ +/* */ +/* printer Address of printer class */ +/* instance */ +/* buffer Pointer to data to write */ +/* requested_length Length of bytes to write, */ +/* set to 0 to issue ZLP */ +/* actual_length Pointer to save number of */ +/* bytes written */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_device_class_printer_write Printer class write function */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ +/* */ +/**************************************************************************/ +UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, + ULONG requested_length, ULONG *actual_length) +{ + + /* Sanity checks. */ + if ((printer == UX_NULL) || (buffer == UX_NULL) || (actual_length == UX_NULL)) + { + return (UX_INVALID_PARAMETER); + } + + return (_ux_device_class_printer_write(printer, buffer, requested_length, actual_length)); +} \ No newline at end of file diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c index 244451cd..7a97642e 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_streaming_sampling_set PORTABLE C */ -/* 6.1.12 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -96,6 +96,9 @@ /* fixed error return code, */ /* used endpoints get API, */ /* resulting in version 6.1.12 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved frequency check, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling) @@ -305,10 +308,10 @@ ULONG res_bytes; transfer -> ux_transfer_request_value = UX_CLASS_AUDIO10_EP_SAMPLING_FREQ_CONTROL << 8; transfer -> ux_transfer_request_index = audio -> ux_host_class_audio_isochronous_endpoint -> ux_endpoint_descriptor.bEndpointAddress; status = _ux_host_stack_transfer_request(transfer); - } - /* Free buffer. */ - _ux_utility_memory_free(control_buffer); + /* Clear 4th byte in case it's changed occasionally. */ + control_buffer[3] = 0; + } /* Check frequency. */ if (status == UX_SUCCESS) @@ -317,18 +320,24 @@ ULONG res_bytes; if (audio_sampling -> ux_host_class_audio_sampling_frequency != frequency) status = UX_HOST_CLASS_AUDIO_WRONG_FREQUENCY; } + + /* Free buffer. */ + _ux_utility_memory_free(control_buffer); } /* Update packet processing parameters. */ - audio -> ux_host_class_audio_packet_freq = - (device -> ux_device_speed == UX_HIGH_SPEED_DEVICE) ? - 8000 : 1000; - audio -> ux_host_class_audio_packet_freq <<= - audio -> ux_host_class_audio_isochronous_endpoint -> - ux_endpoint_descriptor.bInterval - 1; /* Max 8000 << 15, no overflow. */ - res_bytes = audio_sampling -> ux_host_class_audio_sampling_resolution; - if (UX_OVERFLOW_CHECK_ADD_ULONG(res_bytes, 7)) - status = UX_MATH_OVERFLOW; + if (status == UX_SUCCESS) + { + audio -> ux_host_class_audio_packet_freq = + (device -> ux_device_speed == UX_HIGH_SPEED_DEVICE) ? + 8000 : 1000; + audio -> ux_host_class_audio_packet_freq <<= + audio -> ux_host_class_audio_isochronous_endpoint -> + ux_endpoint_descriptor.bInterval - 1; /* Max 8000 << 15, no overflow. */ + res_bytes = audio_sampling -> ux_host_class_audio_sampling_resolution; + if (UX_OVERFLOW_CHECK_ADD_ULONG(res_bytes, 7)) + status = UX_MATH_OVERFLOW; + } if (status == UX_SUCCESS) { res_bytes += 7; diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c index 2a1c8630..e67367ef 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_capabilities_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_capabilities_get PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed capabilities get from */ +/* multiple CDC-ACM functions, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_capabilities_get(UX_HOST_CLASS_CDC_ACM *cdc_acm) @@ -190,10 +194,10 @@ ULONG interface_found; _ux_utility_descriptor_parse(descriptor, _ux_system_interface_descriptor_structure, UX_INTERFACE_DESCRIPTOR_ENTRIES, (UCHAR *) &interface_descriptor); - /* Ensure we have the correct interface for Audio streaming. */ - if ((interface_descriptor.bInterfaceClass == UX_HOST_CLASS_CDC_CONTROL_CLASS) && - ((interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_CDC_ACM_SUBCLASS) || - (interface_descriptor.bInterfaceSubClass == UX_HOST_CLASS_CDC_DLC_SUBCLASS))) + /* Ensure we have the correct interface for CDC control (current interface). */ + if (interface_descriptor.bInterfaceNumber == + cdc_acm -> ux_host_class_cdc_acm_interface -> + ux_interface_descriptor.bInterfaceNumber) { /* Mark we have found it. */ diff --git a/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c b/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c index b4f8bb47..7014b26d 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_transfer_request_completed.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_transfer_request_completed PORTABLE C */ -/* 6.1 */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ +/* supported report IDs, */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ VOID _ux_host_class_hid_transfer_request_completed(UX_TRANSFER *transfer_request) @@ -128,16 +131,44 @@ ULONG field_report_count; /* We know this incoming report is for the Input report. */ hid_report = hid -> ux_host_class_hid_parser.ux_host_class_hid_parser_input_report; - /* initialize some of the callback structure which are generic to any - reporting method. */ - callback.ux_host_class_hid_report_callback_client = hid_client; - callback.ux_host_class_hid_report_callback_id = hid_report -> ux_host_class_hid_report_id; - + /* If there are multiple HID reports, report ID must be checked. */ + if (hid_report -> ux_host_class_hid_report_next_report != UX_NULL) + { + + /* Scan the reports to find the report expected. */ + while(1) + { + + /* Check report ID at buffer start. */ + if (*(UCHAR*)report_buffer == hid_report -> ux_host_class_hid_report_id) + break; + + /* If there is no more report, it's done. */ + if (hid_report -> ux_host_class_hid_report_next_report == UX_NULL) + break; + + /* There is more reports, next. */ + hid_report = hid_report -> ux_host_class_hid_report_next_report; + } + + /* Check if the report is what we expected. */ + if (*(UCHAR*)report_buffer != hid_report -> ux_host_class_hid_report_id) + + /* Report not found. */ + hid_report = UX_NULL; + } + /* For this report to be used, the HID client must have registered the report. We check the call back function. */ - if (hid_report -> ux_host_class_hid_report_callback_function != UX_NULL) + if ((hid_report != UX_NULL) && + (hid_report -> ux_host_class_hid_report_callback_function != UX_NULL)) { + /* initialize some of the callback structure which are generic to any + reporting method. */ + callback.ux_host_class_hid_report_callback_client = hid_client; + callback.ux_host_class_hid_report_callback_id = hid_report -> ux_host_class_hid_report_id; + /* The report is now in memory in a raw format the application may desire to handle it that way! */ if (hid_report -> ux_host_class_hid_report_callback_flags & UX_HOST_CLASS_HID_REPORT_RAW) { diff --git a/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c b/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c index d702e95c..ef4d3994 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_tasks_run.c @@ -40,7 +40,7 @@ static inline VOID _ux_host_class_hub_inst_tasks_run(UX_HOST_CLASS_HUB *hub); /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_tasks_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -90,10 +90,10 @@ static inline VOID _ux_host_class_hub_inst_tasks_run(UX_HOST_CLASS_HUB *hub); /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed reset speed handling, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile issue if only */ /* one device is supported, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_tasks_run(UX_HOST_CLASS *hub_class) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_check_run.c b/common/usbx_host_classes/src/ux_host_class_storage_check_run.c index 6c8eb86c..3063cee4 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_check_run.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_check_run.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_check_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,9 +79,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* checked device state, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_check_run(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_lock.c b/common/usbx_host_classes/src/ux_host_class_storage_lock.c index a2a0616d..045b1b28 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_lock.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_lock.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_lock PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,9 +71,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* checked device state, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_lock(UX_HOST_CLASS_STORAGE *storage, ULONG wait) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_read.c b/common/usbx_host_classes/src/ux_host_class_storage_media_read.c index 61cdcf76..6134a694 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_read.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_read.c @@ -82,7 +82,7 @@ ULONG command_length; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_read PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -123,9 +123,9 @@ ULONG command_length; /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* checked device removal, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_read(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_write.c b/common/usbx_host_classes/src/ux_host_class_storage_media_write.c index 4ad2d17d..fb891831 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_write.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_write.c @@ -81,7 +81,7 @@ ULONG command_length; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_write PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -122,9 +122,9 @@ ULONG command_length; /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* checked device removal, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c b/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c index 6077eb9a..79c3b13b 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_read_write_run.c @@ -43,7 +43,7 @@ extern VOID _ux_host_class_storage_write_initialize(UX_HOST_CLASS_STORAGE *stora /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_read_write_run PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -93,9 +93,9 @@ extern VOID _ux_host_class_storage_write_initialize(UX_HOST_CLASS_STORAGE *stora /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* checked device state, */ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_read_write_run(UX_HOST_CLASS_STORAGE *storage, diff --git a/common/usbx_network/src/ux_network_driver.c b/common/usbx_network/src/ux_network_driver.c index c9ae9fda..e1be41f9 100644 --- a/common/usbx_network/src/ux_network_driver.c +++ b/common/usbx_network/src/ux_network_driver.c @@ -398,7 +398,7 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_entry PORTABLE C */ -/* 6.x */ +/* 6.2.1 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -438,9 +438,9 @@ USB_NETWORK_DEVICE_TYPE *usb_network_device; /* 07-29-2022 Yajun Xia Modified comment(s), */ /* fixed ipv6 support issue, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 03-08-2023 Yajun Xia Modified comment(s), */ /* fixed build issue with NETX,*/ -/* resulting in version 6.x */ +/* resulting in version 6.2.1 */ /* */ /**************************************************************************/