diff --git a/common/core/CMakeLists.txt b/common/core/CMakeLists.txt index 1cbb4d56..0e795d81 100644 --- a/common/core/CMakeLists.txt +++ b/common/core/CMakeLists.txt @@ -185,6 +185,8 @@ target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_copy.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_free.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_free_block_best_get.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_byte_pool_create.c + ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_byte_pool_search.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_memory_set.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_mutex_create.c ${CMAKE_CURRENT_LIST_DIR}/src/ux_utility_mutex_delete.c diff --git a/common/core/inc/ux_api.h b/common/core/inc/ux_api.h index 006fa589..bb9c1b83 100644 --- a/common/core/inc/ux_api.h +++ b/common/core/inc/ux_api.h @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Application Interface (API) */ /** */ @@ -21,28 +21,28 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* APPLICATION INTERFACE DEFINITION RELEASE */ -/* */ -/* ux_api.h PORTABLE C */ -/* 6.x */ +/**************************************************************************/ +/* */ +/* APPLICATION INTERFACE DEFINITION RELEASE */ +/* */ +/* ux_api.h PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This file defines the basic Application Interface (API) to the */ -/* high-performance USBX real-time USB stack. All service prototypes */ -/* and data structure definitions are defined in this file. */ -/* Please note that basic data type definitions and other architecture-*/ -/* specific information is contained in the file ux_port.h. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* This file defines the basic Application Interface (API) to the */ +/* high-performance USBX real-time USB stack. All service prototypes */ +/* and data structure definitions are defined in this file. */ +/* Please note that basic data type definitions and other architecture-*/ +/* specific information is contained in the file ux_port.h. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* added query usage of device */ @@ -133,16 +133,17 @@ /* max class driver configure, */ /* added a new error code, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* refined memory management, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* optimized USB descriptors, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ -#ifndef UX_API_H +#ifndef UX_API_H #define UX_API_H /* Determine if a C++ compiler is being used. If so, ensure that standard @@ -161,7 +162,7 @@ extern "C" { /* Process compile options: * - * - UX_HOST_SIDE_ONLY/UX_HOST_STANDALONE: + * - UX_HOST_SIDE_ONLY/UX_HOST_STANDALONE: * Must not be defined at the same time, * When defined, only host/device side APIs are available. * @@ -289,7 +290,7 @@ typedef signed char SCHAR; /* Define USBX device max bInterfaceNumber of interfaces (0 ~ n), it must be larger than max bInterfaceNumber in USB framework descriptors. */ -#ifndef UX_MAX_SLAVE_INTERFACES +#ifndef UX_MAX_SLAVE_INTERFACES #define UX_MAX_SLAVE_INTERFACES 16 #endif @@ -339,8 +340,8 @@ typedef signed char SCHAR; /* Define basic constants for the USBX Stack. */ #define AZURE_RTOS_USBX #define USBX_MAJOR_VERSION 6 -#define USBX_MINOR_VERSION 2 -#define USBX_PATCH_VERSION 1 +#define USBX_MINOR_VERSION 3 +#define USBX_PATCH_VERSION 0 /* Macros for concatenating tokens, where UX_CONCATn concatenates n tokens. */ @@ -428,7 +429,7 @@ typedef signed char SCHAR; #ifndef UX_DEBUG_LOG_SIZE #define UX_DEBUG_LOG_SIZE (1024 * 32) #endif - + /* Map the error log macros to internal USBX function. */ #define UX_DEBUG_LOG(debug_location, debug_message, debug_code, debug_parameter_1, debug_parameter_2) _ux_utility_debug_log((UCHAR *) debug_location, (UCHAR *) debug_message, (ULONG) debug_code, (ULONG) debug_parameter_1, (ULONG) debug_parameter_2); @@ -444,8 +445,8 @@ VOID _ux_utility_debug_log(UCHAR *debug_location, UCHAR *debug_message, ULONG de /* If Log is not defined, map it to nothing so that debug messages can stay in the code. */ #define UX_DEBUG_LOG(debug_location, debug_message, debug_code, debug_parameter_1, debug_parameter_2) -#endif - +#endif + /* Determine if tracing is enabled. */ #if defined(TX_ENABLE_EVENT_TRACE) && !defined(UX_STANDALONE) @@ -482,7 +483,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_HOST_OBJECT_TYPE_INTERFACE (UX_TRACE_OBJECT_TYPE_BASE + 2) #define UX_TRACE_HOST_OBJECT_TYPE_ENDPOINT (UX_TRACE_OBJECT_TYPE_BASE + 3) #define UX_TRACE_HOST_OBJECT_TYPE_CLASS_INSTANCE (UX_TRACE_OBJECT_TYPE_BASE + 4) - + #define UX_TRACE_DEVICE_OBJECT_TYPE_DEVICE (UX_TRACE_OBJECT_TYPE_BASE + 5) #define UX_TRACE_DEVICE_OBJECT_TYPE_INTERFACE (UX_TRACE_OBJECT_TYPE_BASE + 6) #define UX_TRACE_DEVICE_OBJECT_TYPE_ENDPOINT (UX_TRACE_OBJECT_TYPE_BASE + 7) @@ -491,13 +492,13 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL /* Define event filters that can be used to selectively disable certain events or groups of events. */ #define UX_TRACE_ALL_EVENTS 0x7F000000 /* All USBX events */ -#define UX_TRACE_ERRORS 0x01000000 /* USBX Errors events */ -#define UX_TRACE_HOST_STACK_EVENTS 0x02000000 /* USBX Host Class Events */ -#define UX_TRACE_DEVICE_STACK_EVENTS 0x04000000 /* USBX Device Class Events */ -#define UX_TRACE_HOST_CONTROLLER_EVENTS 0x08000000 /* USBX Host Controller Events */ -#define UX_TRACE_DEVICE_CONTROLLER_EVENTS 0x10000000 /* USBX Device Controllers Events */ -#define UX_TRACE_HOST_CLASS_EVENTS 0x20000000 /* USBX Host Class Events */ -#define UX_TRACE_DEVICE_CLASS_EVENTS 0x40000000 /* USBX Device Class Events */ +#define UX_TRACE_ERRORS 0x01000000 /* USBX Errors events */ +#define UX_TRACE_HOST_STACK_EVENTS 0x02000000 /* USBX Host Class Events */ +#define UX_TRACE_DEVICE_STACK_EVENTS 0x04000000 /* USBX Device Class Events */ +#define UX_TRACE_HOST_CONTROLLER_EVENTS 0x08000000 /* USBX Host Controller Events */ +#define UX_TRACE_DEVICE_CONTROLLER_EVENTS 0x10000000 /* USBX Device Controllers Events */ +#define UX_TRACE_HOST_CLASS_EVENTS 0x20000000 /* USBX Host Class Events */ +#define UX_TRACE_DEVICE_CLASS_EVENTS 0x40000000 /* USBX Device Class Events */ /* Define the trace events in USBX, if not defined. */ @@ -505,219 +506,219 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL /* Define the USBX host stack events. */ #define UX_TRACE_HOST_STACK_EVENTS_BASE 600 -#define UX_TRACE_HOST_STACK_CLASS_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 1) /* I1 = class , I2 = class instance */ -#define UX_TRACE_HOST_STACK_CLASS_INSTANCE_DESTROY (UX_TRACE_HOST_STACK_EVENTS_BASE + 2) /* I1 = class , I2 = class instance */ -#define UX_TRACE_HOST_STACK_CONFIGURATION_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 3) /* I1 = configuration */ -#define UX_TRACE_HOST_STACK_CONFIGURATION_ENUMERATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 4) /* I1 = device */ -#define UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 5) /* I1 = configuration */ -#define UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 6) /* I1 = configuration */ -#define UX_TRACE_HOST_STACK_CONFIGURATION_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 7) /* I1 = configuration */ -#define UX_TRACE_HOST_STACK_DEVICE_ADDRESS_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 8) /* I1 = device , I2 = device address */ -#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 9) /* I1 = device , I2 = configuration */ -#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_SELECT (UX_TRACE_HOST_STACK_EVENTS_BASE + 10) /* I1 = device , I2 = configuration */ -#define UX_TRACE_HOST_STACK_DEVICE_DESCRIPTOR_READ (UX_TRACE_HOST_STACK_EVENTS_BASE + 11) /* I1 = device */ -#define UX_TRACE_HOST_STACK_DEVICE_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 12) /* I1 = device index */ -#define UX_TRACE_HOST_STACK_DEVICE_REMOVE (UX_TRACE_HOST_STACK_EVENTS_BASE + 13) /* I1 = hcd , I2 = parent , I3 = port index , I4 = device */ -#define UX_TRACE_HOST_STACK_DEVICE_RESOURCE_FREE (UX_TRACE_HOST_STACK_EVENTS_BASE + 14) /* I1 = device */ -#define UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 15) /* I1 = device , I2 = endpoint */ -#define UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 16) /* I1 = device , I2 = endpoint */ -#define UX_TRACE_HOST_STACK_ENDPOINT_RESET (UX_TRACE_HOST_STACK_EVENTS_BASE + 17) /* I1 = device , I2 = endpoint */ -#define UX_TRACE_HOST_STACK_ENDPOINT_TRANSFER_ABORT (UX_TRACE_HOST_STACK_EVENTS_BASE + 18) /* I1 = endpoint */ -#define UX_TRACE_HOST_STACK_HCD_REGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 19) /* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */ -#define UX_TRACE_HOST_STACK_INITIALIZE (UX_TRACE_HOST_STACK_EVENTS_BASE + 20) /* */ -#define UX_TRACE_HOST_STACK_INTERFACE_ENDPOINT_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 21) /* I1 = interface , I2 = endpoint index */ -#define UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 22) /* I1 = interface */ -#define UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 23) /* I1 = interface */ -#define UX_TRACE_HOST_STACK_INTERFACE_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 24) /* I1 = interface */ -#define UX_TRACE_HOST_STACK_INTERFACE_SETTING_SELECT (UX_TRACE_HOST_STACK_EVENTS_BASE + 25) /* I1 = interface */ -#define UX_TRACE_HOST_STACK_NEW_CONFIGURATION_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 26) /* I1 = device , I2 = configuration */ -#define UX_TRACE_HOST_STACK_NEW_DEVICE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 27) /* I1 = hcd , I2 = device owner , I3 = port index , I4 = device */ -#define UX_TRACE_HOST_STACK_NEW_ENDPOINT_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 28) /* I1 = interface , I2 = endpoint */ -#define UX_TRACE_HOST_STACK_RH_CHANGE_PROCESS (UX_TRACE_HOST_STACK_EVENTS_BASE + 29) /* I1 = port index */ -#define UX_TRACE_HOST_STACK_RH_DEVICE_EXTRACTION (UX_TRACE_HOST_STACK_EVENTS_BASE + 30) /* I1 = hcd , I2 = port index */ -#define UX_TRACE_HOST_STACK_RH_DEVICE_INSERTION (UX_TRACE_HOST_STACK_EVENTS_BASE + 31) /* I1 = hcd , I2 = port index */ -#define UX_TRACE_HOST_STACK_TRANSFER_REQUEST (UX_TRACE_HOST_STACK_EVENTS_BASE + 32) /* I1 = device , I2 = endpoint , I3 = transfer request */ -#define UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT (UX_TRACE_HOST_STACK_EVENTS_BASE + 33) /* I1 = device , I2 = endpoint , I3 = transfer request */ -#define UX_TRACE_HOST_STACK_UNINITIALIZE (UX_TRACE_HOST_STACK_EVENTS_BASE + 34) /* */ -#define UX_TRACE_HOST_STACK_HCD_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 35) /* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */ -#define UX_TRACE_HOST_STACK_CLASS_REGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 36) /* I1 = class name , I2 = entry function */ -#define UX_TRACE_HOST_STACK_CLASS_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 37) /* I1 = class entry */ -#define UX_TRACE_HOST_STACK_DEVICE_STRING_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 38) /* I1 = device , I2 = buffer , I3 = length , I4 = (langID<<16) | index */ -#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 39) /* I1 = device , I2 = configuration */ -#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 40) /* I1 = device , I2 = configuration */ - -/* Define the USBX host class events. */ - -#define UX_TRACE_HOST_CLASS_EVENTS_BASE 650 -#define UX_TRACE_HOST_CLASS_ASIX_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 1) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_ASIX_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 2) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_ASIX_INTERRUPT_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 3) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_ASIX_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 4) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_ASIX_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 5) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -#define UX_TRACE_HOST_CLASS_AUDIO_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 10) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 11) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 12) /* I1 = class instance , I2 = audio control */ -#define UX_TRACE_HOST_CLASS_AUDIO_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 13) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_AUDIO_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 14) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 15) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 16) /* I1 = class instance , I2 = audio sampling */ -#define UX_TRACE_HOST_CLASS_AUDIO_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 17) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -#define UX_TRACE_HOST_CLASS_CDC_ACM_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 20) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 21) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 22) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 23) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 24) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 25) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 26) /* I1 = class instance , I2 = endpoint */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 27) /* I1 = class instance , I2 = endpointr */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_NOTIFICATION_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 28) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 29) /* I1 = class instance , I2 = device status */ +#define UX_TRACE_HOST_STACK_CLASS_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 1) /* I1 = class , I2 = class instance */ +#define UX_TRACE_HOST_STACK_CLASS_INSTANCE_DESTROY (UX_TRACE_HOST_STACK_EVENTS_BASE + 2) /* I1 = class , I2 = class instance */ +#define UX_TRACE_HOST_STACK_CONFIGURATION_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 3) /* I1 = configuration */ +#define UX_TRACE_HOST_STACK_CONFIGURATION_ENUMERATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 4) /* I1 = device */ +#define UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 5) /* I1 = configuration */ +#define UX_TRACE_HOST_STACK_CONFIGURATION_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 6) /* I1 = configuration */ +#define UX_TRACE_HOST_STACK_CONFIGURATION_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 7) /* I1 = configuration */ +#define UX_TRACE_HOST_STACK_DEVICE_ADDRESS_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 8) /* I1 = device , I2 = device address */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 9) /* I1 = device , I2 = configuration */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_SELECT (UX_TRACE_HOST_STACK_EVENTS_BASE + 10) /* I1 = device , I2 = configuration */ +#define UX_TRACE_HOST_STACK_DEVICE_DESCRIPTOR_READ (UX_TRACE_HOST_STACK_EVENTS_BASE + 11) /* I1 = device */ +#define UX_TRACE_HOST_STACK_DEVICE_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 12) /* I1 = device index */ +#define UX_TRACE_HOST_STACK_DEVICE_REMOVE (UX_TRACE_HOST_STACK_EVENTS_BASE + 13) /* I1 = hcd , I2 = parent , I3 = port index , I4 = device */ +#define UX_TRACE_HOST_STACK_DEVICE_RESOURCE_FREE (UX_TRACE_HOST_STACK_EVENTS_BASE + 14) /* I1 = device */ +#define UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 15) /* I1 = device , I2 = endpoint */ +#define UX_TRACE_HOST_STACK_ENDPOINT_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 16) /* I1 = device , I2 = endpoint */ +#define UX_TRACE_HOST_STACK_ENDPOINT_RESET (UX_TRACE_HOST_STACK_EVENTS_BASE + 17) /* I1 = device , I2 = endpoint */ +#define UX_TRACE_HOST_STACK_ENDPOINT_TRANSFER_ABORT (UX_TRACE_HOST_STACK_EVENTS_BASE + 18) /* I1 = endpoint */ +#define UX_TRACE_HOST_STACK_HCD_REGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 19) /* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */ +#define UX_TRACE_HOST_STACK_INITIALIZE (UX_TRACE_HOST_STACK_EVENTS_BASE + 20) /* */ +#define UX_TRACE_HOST_STACK_INTERFACE_ENDPOINT_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 21) /* I1 = interface , I2 = endpoint index */ +#define UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 22) /* I1 = interface */ +#define UX_TRACE_HOST_STACK_INTERFACE_INSTANCE_DELETE (UX_TRACE_HOST_STACK_EVENTS_BASE + 23) /* I1 = interface */ +#define UX_TRACE_HOST_STACK_INTERFACE_SET (UX_TRACE_HOST_STACK_EVENTS_BASE + 24) /* I1 = interface */ +#define UX_TRACE_HOST_STACK_INTERFACE_SETTING_SELECT (UX_TRACE_HOST_STACK_EVENTS_BASE + 25) /* I1 = interface */ +#define UX_TRACE_HOST_STACK_NEW_CONFIGURATION_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 26) /* I1 = device , I2 = configuration */ +#define UX_TRACE_HOST_STACK_NEW_DEVICE_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 27) /* I1 = hcd , I2 = device owner , I3 = port index , I4 = device */ +#define UX_TRACE_HOST_STACK_NEW_ENDPOINT_CREATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 28) /* I1 = interface , I2 = endpoint */ +#define UX_TRACE_HOST_STACK_RH_CHANGE_PROCESS (UX_TRACE_HOST_STACK_EVENTS_BASE + 29) /* I1 = port index */ +#define UX_TRACE_HOST_STACK_RH_DEVICE_EXTRACTION (UX_TRACE_HOST_STACK_EVENTS_BASE + 30) /* I1 = hcd , I2 = port index */ +#define UX_TRACE_HOST_STACK_RH_DEVICE_INSERTION (UX_TRACE_HOST_STACK_EVENTS_BASE + 31) /* I1 = hcd , I2 = port index */ +#define UX_TRACE_HOST_STACK_TRANSFER_REQUEST (UX_TRACE_HOST_STACK_EVENTS_BASE + 32) /* I1 = device , I2 = endpoint , I3 = transfer request */ +#define UX_TRACE_HOST_STACK_TRANSFER_REQUEST_ABORT (UX_TRACE_HOST_STACK_EVENTS_BASE + 33) /* I1 = device , I2 = endpoint , I3 = transfer request */ +#define UX_TRACE_HOST_STACK_UNINITIALIZE (UX_TRACE_HOST_STACK_EVENTS_BASE + 34) /* */ +#define UX_TRACE_HOST_STACK_HCD_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 35) /* I1 = hcd name , I2 = parameter 1 , I3 = parameter 2 */ +#define UX_TRACE_HOST_STACK_CLASS_REGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 36) /* I1 = class name , I2 = entry function */ +#define UX_TRACE_HOST_STACK_CLASS_UNREGISTER (UX_TRACE_HOST_STACK_EVENTS_BASE + 37) /* I1 = class entry */ +#define UX_TRACE_HOST_STACK_DEVICE_STRING_GET (UX_TRACE_HOST_STACK_EVENTS_BASE + 38) /* I1 = device , I2 = buffer , I3 = length , I4 = (langID<<16) | index */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_ACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 39) /* I1 = device , I2 = configuration */ +#define UX_TRACE_HOST_STACK_DEVICE_CONFIGURATION_DEACTIVATE (UX_TRACE_HOST_STACK_EVENTS_BASE + 40) /* I1 = device , I2 = configuration */ + +/* Define the USBX host class events. */ + +#define UX_TRACE_HOST_CLASS_EVENTS_BASE 650 +#define UX_TRACE_HOST_CLASS_ASIX_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 1) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_ASIX_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 2) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_ASIX_INTERRUPT_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 3) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_ASIX_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 4) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_ASIX_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 5) /* I1 = class instance , I2 = data pointer , I3 = requested length */ + +#define UX_TRACE_HOST_CLASS_AUDIO_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 10) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 11) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_AUDIO_CONTROL_VALUE_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 12) /* I1 = class instance , I2 = audio control */ +#define UX_TRACE_HOST_CLASS_AUDIO_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 13) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_AUDIO_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 14) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 15) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_AUDIO_STREAMING_SAMPLING_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 16) /* I1 = class instance , I2 = audio sampling */ +#define UX_TRACE_HOST_CLASS_AUDIO_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 17) /* I1 = class instance , I2 = data pointer , I3 = requested length */ + +#define UX_TRACE_HOST_CLASS_CDC_ACM_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 20) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 21) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 22) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 23) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 24) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 25) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 26) /* I1 = class instance , I2 = endpoint */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 27) /* I1 = class instance , I2 = endpointr */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_NOTIFICATION_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 28) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 29) /* I1 = class instance , I2 = device status */ #define UX_TRACE_HOST_CLASS_CDC_ACM_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 30) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 31) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 32) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 31) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ACM_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 32) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_CDC_ACM_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 33) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -#define UX_TRACE_HOST_CLASS_CDC_ECM_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 35) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_CDC_ECM_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 36) /* I1 = class instance */ + +#define UX_TRACE_HOST_CLASS_CDC_ECM_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 35) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ECM_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 36) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_CDC_ECM_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 37) /* I1 = class instance , I2 = data pointer , I3 = requested length */ #define UX_TRACE_HOST_CLASS_CDC_ECM_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 38) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_CDC_ECM_INTERRUPT_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 39) /* I1 = class instance */ - -#define UX_TRACE_HOST_CLASS_HID_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 40) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_HID_CLIENT_REGISTER (UX_TRACE_HOST_CLASS_EVENTS_BASE + 41) /* I1 = hid client name */ -#define UX_TRACE_HOST_CLASS_HID_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 42) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_HID_IDLE_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 43) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_HID_IDLE_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 44) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_HID_KEYBOARD_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 45) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_KEYBOARD_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 46) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_MOUSE_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 47) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_MOUSE_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 48) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 49) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 50) /* I1 = class instance , I2 = hid client instance */ -#define UX_TRACE_HOST_CLASS_HID_REPORT_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 51) /* I1 = class instance , I2 = client report */ -#define UX_TRACE_HOST_CLASS_HID_REPORT_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 52) /* I1 = class instance , I2 = client report */ -#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 53) /* I1 = client instance , I2 = remote control instance */ - -#define UX_TRACE_HOST_CLASS_HUB_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 60) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_HUB_CHANGE_DETECT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 62) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_CDC_ECM_INTERRUPT_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 39) /* I1 = class instance */ + +#define UX_TRACE_HOST_CLASS_HID_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 40) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_HID_CLIENT_REGISTER (UX_TRACE_HOST_CLASS_EVENTS_BASE + 41) /* I1 = hid client name */ +#define UX_TRACE_HOST_CLASS_HID_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 42) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_HID_IDLE_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 43) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_HID_IDLE_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 44) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_HID_KEYBOARD_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 45) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_KEYBOARD_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 46) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_MOUSE_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 47) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_MOUSE_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 48) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 49) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 50) /* I1 = class instance , I2 = hid client instance */ +#define UX_TRACE_HOST_CLASS_HID_REPORT_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 51) /* I1 = class instance , I2 = client report */ +#define UX_TRACE_HOST_CLASS_HID_REPORT_SET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 52) /* I1 = class instance , I2 = client report */ +#define UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 53) /* I1 = client instance , I2 = remote control instance */ + +#define UX_TRACE_HOST_CLASS_HUB_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 60) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_HUB_CHANGE_DETECT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 62) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_CONNECTION_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 63) /* I1 = class instance , I2 = port , I3 = port status */ -#define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_ENABLE_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 64) /* I1 = class instance , I2 = port , I3 = port status */ +#define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_ENABLE_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 64) /* I1 = class instance , I2 = port , I3 = port status */ #define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_OVER_CURRENT_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 65) /* I1 = class instance , I2 = port , I3 = port status */ #define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_RESET_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 66) /* I1 = class instance , I2 = port , I3 = port status */ #define UX_TRACE_HOST_CLASS_HUB_PORT_CHANGE_SUSPEND_PROCESS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 67) /* I1 = class instance , I2 = port , I3 = port status */ -#define UX_TRACE_HOST_CLASS_HUB_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 68) /* I1 = class instance */ - -#define UX_TRACE_HOST_CLASS_PIMA_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 70) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PIMA_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 71) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PIMA_DEVICE_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 72) /* I1 = class instance , I2 = pima device */ -#define UX_TRACE_HOST_CLASS_PIMA_DEVICE_RESET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 73) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PIMA_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 74) /* I1 = class instance , I2 = event code , I3 = transaction ID , I4 = parameter1 */ -#define UX_TRACE_HOST_CLASS_PIMA_NUM_OBJECTS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 75) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_CLOSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 76) /* I1 = class instance , I2 = object */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_COPY (UX_TRACE_HOST_CLASS_EVENTS_BASE + 77) /* I1 = class instance , I2 = object handle */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_DELETE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 78) /* I1 = class instance , I2 = object handle */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 79) /* I1 = class instance , I2 = object handle , I3 = object */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 80) /* I1 = class instance , I2 = object handle , I3 = object */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_SEND (UX_TRACE_HOST_CLASS_EVENTS_BASE + 81) /* I1 = class instance , I2 = object */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_MOVE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 82) /* I1 = class instance , I2 = object handle */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_SEND (UX_TRACE_HOST_CLASS_EVENTS_BASE + 83) /* I1 = class instance , I2 = object , I3 = object_buffer , I4 = object length */ -#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_TRANSFER_ABORT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 84) /* I1 = class instance , I2 = object handle , I3 = object */ -#define UX_TRACE_HOST_CLASS_PIMA_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 85) /* I1 = class instance , I2 = data pointer , I3 = data length */ +#define UX_TRACE_HOST_CLASS_HUB_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 68) /* I1 = class instance */ + +#define UX_TRACE_HOST_CLASS_PIMA_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 70) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PIMA_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 71) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PIMA_DEVICE_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 72) /* I1 = class instance , I2 = pima device */ +#define UX_TRACE_HOST_CLASS_PIMA_DEVICE_RESET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 73) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PIMA_NOTIFICATION (UX_TRACE_HOST_CLASS_EVENTS_BASE + 74) /* I1 = class instance , I2 = event code , I3 = transaction ID , I4 = parameter1 */ +#define UX_TRACE_HOST_CLASS_PIMA_NUM_OBJECTS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 75) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_CLOSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 76) /* I1 = class instance , I2 = object */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_COPY (UX_TRACE_HOST_CLASS_EVENTS_BASE + 77) /* I1 = class instance , I2 = object handle */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_DELETE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 78) /* I1 = class instance , I2 = object handle */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 79) /* I1 = class instance , I2 = object handle , I3 = object */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 80) /* I1 = class instance , I2 = object handle , I3 = object */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_INFO_SEND (UX_TRACE_HOST_CLASS_EVENTS_BASE + 81) /* I1 = class instance , I2 = object */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_MOVE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 82) /* I1 = class instance , I2 = object handle */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_SEND (UX_TRACE_HOST_CLASS_EVENTS_BASE + 83) /* I1 = class instance , I2 = object , I3 = object_buffer , I4 = object length */ +#define UX_TRACE_HOST_CLASS_PIMA_OBJECT_TRANSFER_ABORT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 84) /* I1 = class instance , I2 = object handle , I3 = object */ +#define UX_TRACE_HOST_CLASS_PIMA_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 85) /* I1 = class instance , I2 = data pointer , I3 = data length */ #define UX_TRACE_HOST_CLASS_PIMA_REQUEST_CANCEL (UX_TRACE_HOST_CLASS_EVENTS_BASE + 86) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PIMA_SESSION_CLOSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 87) /* I1 = class instance , I2 = pima session */ -#define UX_TRACE_HOST_CLASS_PIMA_SESSION_OPEN (UX_TRACE_HOST_CLASS_EVENTS_BASE + 88) /* I1 = class instance , I2 = pima session */ -#define UX_TRACE_HOST_CLASS_PIMA_STORAGE_IDS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 89) /* I1 = class instance , I2 = storage ID array, I3 = storage ID length */ -#define UX_TRACE_HOST_CLASS_PIMA_STORAGE_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 90) /* I1 = class instance , I2 = storage ID , I3 = storage */ -#define UX_TRACE_HOST_CLASS_PIMA_THUMB_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 91) /* I1 = class instance , I2 = object handle */ -#define UX_TRACE_HOST_CLASS_PIMA_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 92) /* I1 = class instance , I2 = data pointer , I3 = data length */ - -#define UX_TRACE_HOST_CLASS_PRINTER_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 100) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PRINTER_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 101) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PRINTER_NAME_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 102) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PRINTER_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 103) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_PRINTER_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 104) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_PRINTER_SOFT_RESET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 105) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PRINTER_STATUS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 106) /* I1 = class instance , I2 = printer status */ -#define UX_TRACE_HOST_CLASS_PRINTER_DEVICE_ID_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 107) /* I1 = class instance , I2 = printer , I3 = data pointer , I4 = buffer length */ - -#define UX_TRACE_HOST_CLASS_PROLIFIC_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 110) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 111) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 112) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 113) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 114) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_PURGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 115) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 116) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 117) /* I1 = class instance , I2 = endpoint */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 118) /* I1 = class instance , I2 = endpointr */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_REPORT_DEVICE_STATUS_CHANGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 119) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 120) /* I1 = class instance , I2 = device status */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 121) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 122) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 123) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_PROLIFIC_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 124) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -#define UX_TRACE_HOST_CLASS_STORAGE_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 130) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_STORAGE_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 131) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_CAPACITY_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 132) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_FORMAT_CAPACITY_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 133) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_MOUNT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 134) /* I1 = class instance , I2 = sector */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_OPEN (UX_TRACE_HOST_CLASS_EVENTS_BASE + 135) /* I1 = class instance , I2 = media */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 136) /* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */ -#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 137) /* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */ -#define UX_TRACE_HOST_CLASS_STORAGE_REQUEST_SENSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 138) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_STORAGE_START_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 139) /* I1 = class instance , I2 = start stop signal */ -#define UX_TRACE_HOST_CLASS_STORAGE_UNIT_READY_TEST (UX_TRACE_HOST_CLASS_EVENTS_BASE + 140) /* I1 = class instance */ - -#define UX_TRACE_HOST_CLASS_DPUMP_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 150) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_DPUMP_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 151) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_DPUMP_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 152) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_DPUMP_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 153) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -#define UX_TRACE_HOST_CLASS_SWAR_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 160) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_SWAR_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 161) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 162) /* I1 = class instance , I2 = endpoint */ -#define UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 163) /* I1 = class instance , I2 = endpointr */ +#define UX_TRACE_HOST_CLASS_PIMA_SESSION_CLOSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 87) /* I1 = class instance , I2 = pima session */ +#define UX_TRACE_HOST_CLASS_PIMA_SESSION_OPEN (UX_TRACE_HOST_CLASS_EVENTS_BASE + 88) /* I1 = class instance , I2 = pima session */ +#define UX_TRACE_HOST_CLASS_PIMA_STORAGE_IDS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 89) /* I1 = class instance , I2 = storage ID array, I3 = storage ID length */ +#define UX_TRACE_HOST_CLASS_PIMA_STORAGE_INFO_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 90) /* I1 = class instance , I2 = storage ID , I3 = storage */ +#define UX_TRACE_HOST_CLASS_PIMA_THUMB_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 91) /* I1 = class instance , I2 = object handle */ +#define UX_TRACE_HOST_CLASS_PIMA_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 92) /* I1 = class instance , I2 = data pointer , I3 = data length */ + +#define UX_TRACE_HOST_CLASS_PRINTER_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 100) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PRINTER_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 101) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PRINTER_NAME_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 102) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PRINTER_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 103) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_PRINTER_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 104) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_PRINTER_SOFT_RESET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 105) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PRINTER_STATUS_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 106) /* I1 = class instance , I2 = printer status */ +#define UX_TRACE_HOST_CLASS_PRINTER_DEVICE_ID_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 107) /* I1 = class instance , I2 = printer , I3 = data pointer , I4 = buffer length */ + +#define UX_TRACE_HOST_CLASS_PROLIFIC_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 110) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 111) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 112) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 113) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 114) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_PURGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 115) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 116) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 117) /* I1 = class instance , I2 = endpoint */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 118) /* I1 = class instance , I2 = endpointr */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_REPORT_DEVICE_STATUS_CHANGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 119) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 120) /* I1 = class instance , I2 = device status */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 121) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 122) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 123) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_PROLIFIC_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 124) /* I1 = class instance , I2 = data pointer , I3 = requested length */ + +#define UX_TRACE_HOST_CLASS_STORAGE_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 130) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_STORAGE_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 131) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_CAPACITY_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 132) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_FORMAT_CAPACITY_GET (UX_TRACE_HOST_CLASS_EVENTS_BASE + 133) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_MOUNT (UX_TRACE_HOST_CLASS_EVENTS_BASE + 134) /* I1 = class instance , I2 = sector */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_OPEN (UX_TRACE_HOST_CLASS_EVENTS_BASE + 135) /* I1 = class instance , I2 = media */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 136) /* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */ +#define UX_TRACE_HOST_CLASS_STORAGE_MEDIA_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 137) /* I1 = class instance , I2 = sector start , I3 = sector count , I4 = data pointer */ +#define UX_TRACE_HOST_CLASS_STORAGE_REQUEST_SENSE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 138) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_STORAGE_START_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 139) /* I1 = class instance , I2 = start stop signal */ +#define UX_TRACE_HOST_CLASS_STORAGE_UNIT_READY_TEST (UX_TRACE_HOST_CLASS_EVENTS_BASE + 140) /* I1 = class instance */ + +#define UX_TRACE_HOST_CLASS_DPUMP_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 150) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_DPUMP_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 151) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_DPUMP_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 152) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_DPUMP_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 153) /* I1 = class instance , I2 = data pointer , I3 = requested length */ + +#define UX_TRACE_HOST_CLASS_SWAR_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 160) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_SWAR_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 161) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 162) /* I1 = class instance , I2 = endpoint */ +#define UX_TRACE_HOST_CLASS_SWAR_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 163) /* I1 = class instance , I2 = endpointr */ #define UX_TRACE_HOST_CLASS_SWAR_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 164) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_SWAR_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 165) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_SWAR_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 166) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_SWAR_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 165) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_SWAR_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 166) /* I1 = class instance */ #define UX_TRACE_HOST_CLASS_SWAR_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 167) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_GSER_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 170) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_GSER_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 171) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 172) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 173) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 174) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_PURGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 175) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 176) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 177) /* I1 = class instance , I2 = endpoint */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 178) /* I1 = class instance , I2 = endpointr */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_REPORT_DEVICE_STATUS_CHANGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 179) /* I1 = class instance , I2 = parameter */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 180) /* I1 = class instance , I2 = device status */ -#define UX_TRACE_HOST_CLASS_GSER_IOCTL_NOTIFICATION_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 181) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_GSER_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 182) /* I1 = class instance , I2 = data pointer , I3 = requested length */ -#define UX_TRACE_HOST_CLASS_GSER_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 183) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_GSER_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 184) /* I1 = class instance */ -#define UX_TRACE_HOST_CLASS_GSER_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 185) /* I1 = class instance , I2 = data pointer , I3 = requested length */ - -/* Define the USBX device stack events. */ - -#define UX_TRACE_DEVICE_STACK_EVENTS_BASE 850 -#define UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_GET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 1) /* I1 = interface value */ -#define UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_SET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 2) /* I1 = interface value , I2 = alternate setting value */ +#define UX_TRACE_HOST_CLASS_GSER_ACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 170) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_GSER_DEACTIVATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 171) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 172) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_LINE_CODING (UX_TRACE_HOST_CLASS_EVENTS_BASE + 173) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SET_LINE_STATE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 174) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_PURGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 175) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_SEND_BREAK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 176) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_IN_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 177) /* I1 = class instance , I2 = endpoint */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_ABORT_OUT_PIPE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 178) /* I1 = class instance , I2 = endpointr */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_REPORT_DEVICE_STATUS_CHANGE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 179) /* I1 = class instance , I2 = parameter */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_GET_DEVICE_STATUS (UX_TRACE_HOST_CLASS_EVENTS_BASE + 180) /* I1 = class instance , I2 = device status */ +#define UX_TRACE_HOST_CLASS_GSER_IOCTL_NOTIFICATION_CALLBACK (UX_TRACE_HOST_CLASS_EVENTS_BASE + 181) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_GSER_READ (UX_TRACE_HOST_CLASS_EVENTS_BASE + 182) /* I1 = class instance , I2 = data pointer , I3 = requested length */ +#define UX_TRACE_HOST_CLASS_GSER_RECEPTION_START (UX_TRACE_HOST_CLASS_EVENTS_BASE + 183) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_GSER_RECEPTION_STOP (UX_TRACE_HOST_CLASS_EVENTS_BASE + 184) /* I1 = class instance */ +#define UX_TRACE_HOST_CLASS_GSER_WRITE (UX_TRACE_HOST_CLASS_EVENTS_BASE + 185) /* I1 = class instance , I2 = data pointer , I3 = requested length */ + +/* Define the USBX device stack events. */ + +#define UX_TRACE_DEVICE_STACK_EVENTS_BASE 850 +#define UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_GET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 1) /* I1 = interface value */ +#define UX_TRACE_DEVICE_STACK_ALTERNATE_SETTING_SET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 2) /* I1 = interface value , I2 = alternate setting value */ #define UX_TRACE_DEVICE_STACK_CLASS_REGISTER (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 3) /* I1 = class name , I2 = interface number, I3 = parameter */ #define UX_TRACE_DEVICE_STACK_CLEAR_FEATURE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 4) /* I1 = request type , I2 = request value , I3 = request index */ #define UX_TRACE_DEVICE_STACK_CONFIGURATION_GET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 5) /* I1 = configuration value */ #define UX_TRACE_DEVICE_STACK_CONFIGURATION_SET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 6) /* I1 = configuration value */ -#define UX_TRACE_DEVICE_STACK_CONNECT (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 7) /* */ -#define UX_TRACE_DEVICE_STACK_DESCRIPTOR_SEND (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 8) /* I1 = descriptor type , I2 = request index */ +#define UX_TRACE_DEVICE_STACK_CONNECT (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 7) /* */ +#define UX_TRACE_DEVICE_STACK_DESCRIPTOR_SEND (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 8) /* I1 = descriptor type , I2 = request index */ #define UX_TRACE_DEVICE_STACK_DISCONNECT (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 9) /* I1 = device */ #define UX_TRACE_DEVICE_STACK_ENDPOINT_STALL (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 10) /* I1 = endpoint */ -#define UX_TRACE_DEVICE_STACK_GET_STATUS (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 11) /* I1 = request type , I2 = request value , I3 = request index */ -#define UX_TRACE_DEVICE_STACK_HOST_WAKEUP (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 12) /* */ -#define UX_TRACE_DEVICE_STACK_INITIALIZE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 13) /* */ -#define UX_TRACE_DEVICE_STACK_INTERFACE_DELETE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 14) /* I1 = interface */ +#define UX_TRACE_DEVICE_STACK_GET_STATUS (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 11) /* I1 = request type , I2 = request value , I3 = request index */ +#define UX_TRACE_DEVICE_STACK_HOST_WAKEUP (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 12) /* */ +#define UX_TRACE_DEVICE_STACK_INITIALIZE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 13) /* */ +#define UX_TRACE_DEVICE_STACK_INTERFACE_DELETE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 14) /* I1 = interface */ #define UX_TRACE_DEVICE_STACK_INTERFACE_GET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 15) /* I1 = interface value */ #define UX_TRACE_DEVICE_STACK_INTERFACE_SET (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 16) /* I1 = alternate setting value */ #define UX_TRACE_DEVICE_STACK_SET_FEATURE (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 17) /* I1 = request value , I2 = request index */ @@ -726,23 +727,23 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_DEVICE_STACK_TRANSFER_REQUEST (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 20) /* I1 = transfer request */ #define UX_TRACE_DEVICE_STACK_MICROSOFT_EXTENSION_REGISTER (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 21) /* I1 = transfer request */ #define UX_TRACE_DEVICE_STACK_CLASS_UNREGISTER (UX_TRACE_DEVICE_STACK_EVENTS_BASE + 22) /* I1 = class name */ - -/* Define the USBX device stack events first. */ -#define UX_TRACE_DEVICE_CLASS_EVENTS_BASE 900 -#define UX_TRACE_DEVICE_CLASS_DPUMP_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 1) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_DPUMP_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 2) /* I1 = class instance */ +/* Define the USBX device stack events first. */ + +#define UX_TRACE_DEVICE_CLASS_EVENTS_BASE 900 +#define UX_TRACE_DEVICE_CLASS_DPUMP_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 1) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_DPUMP_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 2) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_DPUMP_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 3) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_DPUMP_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 4) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_DPUMP_CHANGE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 5) /* I1 = class instance , I2 = buffer , I3 = requested_length */ - -#define UX_TRACE_DEVICE_CLASS_CDC_ACM_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 10) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_CDC_ACM_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 11) /* I1 = class instance */ + +#define UX_TRACE_DEVICE_CLASS_CDC_ACM_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 10) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CDC_ACM_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 11) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_CDC_ACM_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 12) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_CDC_ACM_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 13) /* I1 = class instance , I2 = buffer , I3 = requested_length */ - -#define UX_TRACE_DEVICE_CLASS_HID_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 20) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_HID_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 21) /* I1 = class instance */ + +#define UX_TRACE_DEVICE_CLASS_HID_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 20) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_HID_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 21) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_HID_EVENT_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 22) /* I1 = class instance , I2 = hid event */ #define UX_TRACE_DEVICE_CLASS_HID_EVENT_SET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 23) /* I1 = class instance , I2 = hid event */ #define UX_TRACE_DEVICE_CLASS_HID_REPORT_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 24) /* I1 = class instance , I2 = descriptor type , I3 = request index */ @@ -751,13 +752,13 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_DEVICE_CLASS_HID_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 27) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_HID_RECEIVER_EVENT_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 28) /* I1 = class instance , I2 = receiver event , I3 = wait_option */ #define UX_TRACE_DEVICE_CLASS_HID_RECEIVER_EVENT_FREE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 29) /* I1 = class instance , I2 = receiver event */ - -#define UX_TRACE_DEVICE_CLASS_PIMA_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 30) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_PIMA_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 31) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_PIMA_DEVICE_INFO_SEND (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 32) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_PIMA_EVENT_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 33) /* I1 = class instance , I2 = pima event */ -#define UX_TRACE_DEVICE_CLASS_PIMA_EVENT_SET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 34) /* I1 = class instance , I2 = pima event */ -#define UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_ADD (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 35) /* I1 = class instance , I2 = object handle */ + +#define UX_TRACE_DEVICE_CLASS_PIMA_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 30) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_PIMA_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 31) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_PIMA_DEVICE_INFO_SEND (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 32) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_PIMA_EVENT_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 33) /* I1 = class instance , I2 = pima event */ +#define UX_TRACE_DEVICE_CLASS_PIMA_EVENT_SET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 34) /* I1 = class instance , I2 = pima event */ +#define UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_ADD (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 35) /* I1 = class instance , I2 = object handle */ #define UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DATA_GET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 36) /* I1 = class instance , I2 = object handle */ #define UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DATA_SEND (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 37) /* I1 = class instance , I2 = object handle */ #define UX_TRACE_DEVICE_CLASS_PIMA_OBJECT_DELETE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 38) /* I1 = class instance , I2 = object handle */ @@ -781,54 +782,54 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRACE_DEVICE_CLASS_PIMA_STORAGE_FORMAT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 56) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_PIMA_DEVICE_RESET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 57) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_PIMA_SET_OBJECT_PROP_VALUE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 58) /* I1 = class instance */ - -#define UX_TRACE_DEVICE_CLASS_RNDIS_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 60) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_RNDIS_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 61) /* I1 = class instance */ + +#define UX_TRACE_DEVICE_CLASS_RNDIS_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 60) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_RNDIS_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 61) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_RECEIVE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 62) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_TRANSMIT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 63) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_RNDIS_MSG_QUERY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 64) /* I1 = class instance , I2 = rndis OID */ #define UX_TRACE_DEVICE_CLASS_RNDIS_MSG_KEEP_ALIVE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 65) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_RNDIS_MSG_RESET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 66) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_RNDIS_MSG_SET (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 67) /* I1 = class instance , I2 = rndis OID */ - -#define UX_TRACE_DEVICE_CLASS_STORAGE_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 70) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 71) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_FORMAT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 72) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_INQUIRY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 73) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SELECT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 74) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SENSE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 75) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_PREVENT_ALLOW_MEDIA_REMOVAL (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 76) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 77) /* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 78) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_FORMAT_CAPACITY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 79) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_TOC (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 80) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_REQUEST_SENSE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 81) /* I1 = class instance , I2 = lun , I3 = sense key , I4 = code */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_TEST_READY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 82) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_START_STOP (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 83) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_VERIFY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 84) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 85) /* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 86) /* I1 = class instance , I2 = lun */ + +#define UX_TRACE_DEVICE_CLASS_STORAGE_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 70) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 71) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_FORMAT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 72) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_INQUIRY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 73) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SELECT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 74) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_MODE_SENSE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 75) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_PREVENT_ALLOW_MEDIA_REMOVAL (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 76) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 77) /* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_CAPACITY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 78) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_FORMAT_CAPACITY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 79) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_READ_TOC (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 80) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_REQUEST_SENSE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 81) /* I1 = class instance , I2 = lun , I3 = sense key , I4 = code */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_TEST_READY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 82) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_START_STOP (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 83) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_VERIFY (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 84) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 85) /* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_GET_CONFIGURATION (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 86) /* I1 = class instance , I2 = lun */ #define UX_TRACE_DEVICE_CLASS_STORAGE_SYNCHRONIZE_CACHE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 87) /* I1 = class instance , I2 = lun , I3 = sector , I4 = number sectors */ -#define UX_TRACE_DEVICE_CLASS_STORAGE_OTHER (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 88) /* I1 = class instance , I2 = lun */ +#define UX_TRACE_DEVICE_CLASS_STORAGE_OTHER (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 88) /* I1 = class instance , I2 = lun */ -#define UX_TRACE_DEVICE_CLASS_CDC_ECM_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 90) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_CDC_ECM_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 91) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_CDC_ECM_CHANGE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 92) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CDC_ECM_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 90) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CDC_ECM_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 91) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CDC_ECM_CHANGE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 92) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_CDC_ECM_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 93) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_CDC_ECM_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 94) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_TRANSMIT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 95) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_RECEIVE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 96) /* I1 = class instance , I2 = buffer , I3 = requested_length */ - -#define UX_TRACE_DEVICE_CLASS_DFU_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 97) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_DFU_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 98) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_PRINTER_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 100) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_PRINTER_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 101) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_DFU_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 97) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_DFU_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 98) /* I1 = class instance */ + +#define UX_TRACE_DEVICE_CLASS_PRINTER_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 100) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_PRINTER_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 101) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_PRINTER_READ (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 102) /* I1 = class instance , I2 = buffer , I3 = requested_length */ #define UX_TRACE_DEVICE_CLASS_PRINTER_WRITE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 103) /* I1 = class instance , I2 = buffer , I3 = requested_length */ -#define UX_TRACE_DEVICE_CLASS_CCID_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 110) /* I1 = class instance */ -#define UX_TRACE_DEVICE_CLASS_CCID_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 111) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CCID_ACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 110) /* I1 = class instance */ +#define UX_TRACE_DEVICE_CLASS_CCID_DEACTIVATE (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 111) /* I1 = class instance */ #define UX_TRACE_DEVICE_CLASS_CCID_REQ_ABORT (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 112) /* I1 = class instance , I2 = slot */ #define UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ICC_POWER_ON (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 113) /* I1 = class instance , I2 = slot */ #define UX_TRACE_DEVICE_CLASS_CCID_PC_TO_RDR_ICC_POWER_OFF (UX_TRACE_DEVICE_CLASS_EVENTS_BASE + 114) /* I1 = class instance , I2 = slot */ @@ -859,10 +860,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #else -#define UX_TRACE_OBJECT_REGISTER(t,p,n,a,b) -#define UX_TRACE_OBJECT_UNREGISTER(o) -#define UX_TRACE_IN_LINE_INSERT(i,a,b,c,d,f,g,h) -#define UX_TRACE_EVENT_UPDATE(e,t,i,a,b,c,d) +#define UX_TRACE_OBJECT_REGISTER(t,p,n,a,b) +#define UX_TRACE_OBJECT_UNREGISTER(o) +#define UX_TRACE_IN_LINE_INSERT(i,a,b,c,d,f,g,h) +#define UX_TRACE_EVENT_UPDATE(e,t,i,a,b,c,d) #endif @@ -883,7 +884,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_SYSTEM_CONTEXT_HOST_STACK 10 -/* Defines the number of ThreadX timer ticks per seconds. By default, the ThreadX timer tick is 10ms, +/* Defines the number of ThreadX timer ticks per seconds. By default, the ThreadX timer tick is 10ms, so the default value for this constant is 100. If TX_TIMER_TICKS_PER_SECOND is defined, this value is derived from TX_TIMER_TICKS_PER_SECOND. */ @@ -1115,13 +1116,13 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_SETUP_INDEX 4u #define UX_SETUP_LENGTH 6u #define UX_SETUP_SIZE 8u - - -/* Define USBX standard commands. */ - + + +/* Define USBX standard commands. */ + #define UX_GET_STATUS 0u #define UX_CLEAR_FEATURE 1u -#define UX_SET_FEATURE 3u +#define UX_SET_FEATURE 3u #define UX_SET_ADDRESS 5u #define UX_GET_DESCRIPTOR 6u #define UX_SET_DESCRIPTOR 7u @@ -1130,19 +1131,19 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_GET_INTERFACE 10u #define UX_SET_INTERFACE 11u #define UX_SYNCH_FRAME 12u - - -/* Define USBX command sub constants. */ - + + +/* Define USBX command sub constants. */ + #define UX_ENDPOINT_HALT 0u - + /* Define USBX feature selector constants. */ #define UX_REQUEST_FEATURE_ENDPOINT_HALT 0u #define UX_REQUEST_FEATURE_DEVICE_REMOTE_WAKEUP 1u #define UX_REQUEST_FEATURE_TEST_MODE 2u -/* Define Generic USBX constants. */ - +/* Define Generic USBX constants. */ + #define UX_UNUSED 0 #define UX_USED 1 @@ -1152,10 +1153,11 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_CACHE_SAFE_MEMORY 1 #define UX_NO_ALIGN 0u +#define UX_ALIGN_8 0x07u #define UX_ALIGN_16 0x0fu #define UX_ALIGN_32 0x1fu #define UX_ALIGN_64 0x3fu -#define UX_ALIGN_128 0x7fu +#define UX_ALIGN_128 0x7fu #define UX_ALIGN_256 0xffu #define UX_ALIGN_512 0x1ffu #define UX_ALIGN_1024 0x3ffu @@ -1164,28 +1166,28 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_SAFE_ALIGN 0xffffffffu #define UX_MAX_SCATTER_GATHER_ALIGNMENT 4096 #ifndef UX_ALIGN_MIN -#define UX_ALIGN_MIN UX_ALIGN_16 +#define UX_ALIGN_MIN UX_ALIGN_8 #endif - + #define UX_MAX_USB_DEVICES 127 - + #define UX_ENDPOINT_DIRECTION 0x80u #define UX_ENDPOINT_IN 0x80u #define UX_ENDPOINT_OUT 0x00u - + #define UX_MASK_ENDPOINT_TYPE 3u #define UX_CONTROL_ENDPOINT 0u #define UX_ISOCHRONOUS_ENDPOINT 1u #define UX_BULK_ENDPOINT 2u #define UX_INTERRUPT_ENDPOINT 3u - + #define UX_ISOCHRONOUS_ENDPOINT_IN 0x81u #define UX_ISOCHRONOUS_ENDPOINT_OUT 0x01u #define UX_BULK_ENDPOINT_IN 0x82u #define UX_BULK_ENDPOINT_OUT 0x02u #define UX_INTERRUPT_ENDPOINT_IN 0x83u #define UX_INTERRUPT_ENDPOINT_OUT 0x03u - + #define UX_MAX_PACKET_SIZE_MASK 0x7ffu #define UX_MAX_NUMBER_OF_TRANSACTIONS_MASK 0x1800u #define UX_MAX_NUMBER_OF_TRANSACTIONS_SHIFT 11 @@ -1196,18 +1198,18 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_REQUEST_DIRECTION 0x80u #define UX_REQUEST_IN 0x80u #define UX_REQUEST_OUT 0x00u - + #define UX_REQUEST_TYPE 0x60u #define UX_REQUEST_TYPE_STANDARD 0x00u #define UX_REQUEST_TYPE_CLASS 0x20u #define UX_REQUEST_TYPE_VENDOR 0x40u - + #define UX_REQUEST_TARGET 0x03u #define UX_REQUEST_TARGET_DEVICE 0x00u #define UX_REQUEST_TARGET_INTERFACE 0x01u #define UX_REQUEST_TARGET_ENDPOINT 0x02u #define UX_REQUEST_TARGET_OTHER 0x03u - + #define UX_DEVICE_RESET 0 #define UX_DEVICE_ATTACHED 1 #define UX_DEVICE_ADDRESSED 2 @@ -1220,11 +1222,11 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_DEVICE_BUS_RESET_COMPLETED 9 #define UX_DEVICE_REMOVED 10 #define UX_DEVICE_FORCE_DISCONNECT 11 - + #define UX_ENDPOINT_RESET 0 #define UX_ENDPOINT_RUNNING 1 #define UX_ENDPOINT_HALTED 2 - + #define UX_DEVICE_DESCRIPTOR_ITEM 1u #define UX_CONFIGURATION_DESCRIPTOR_ITEM 2u #define UX_STRING_DESCRIPTOR_ITEM 3u @@ -1238,7 +1240,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_DEVICE_CAPABILITY_DESCRIPTOR_ITEM 16u #define UX_DFU_FUNCTIONAL_DESCRIPTOR_ITEM 0x21u #define UX_HUB_DESCRIPTOR_ITEM 0x29u - + #define UX_CAPABILITY_WIRELESS_USB 0x01u #define UX_CAPABILITY_USB_2_0_EXTENSION 0x02u #define UX_CAPABILITY_SUPERSPEED_USB 0x03u @@ -1264,7 +1266,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #ifndef UX_NON_CONTROL_TRANSFER_TIMEOUT #define UX_NON_CONTROL_TRANSFER_TIMEOUT 50000 #endif -#define UX_PORT_ENABLE_WAIT 50 +#define UX_PORT_ENABLE_WAIT 50 #define UX_DEVICE_ADDRESS_SET_WAIT 50 #define UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT 200 #define UX_ENUMERATION_THREAD_WAIT 200 @@ -1281,35 +1283,35 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL /* USBX 5.8 BACKWARD COMPATIBILITY DEFINITIONS. THESE DEFINITIONS ARE NOW OBSOLETE BUT DEFINED HERE FOR COMPATIBILITY REASONS. */ - + #ifndef UX_CONTROL_TRANSFER_TIMEOUT_IN_MS #define UX_CONTROL_TRANSFER_TIMEOUT_IN_MS 10000 -#endif +#endif #ifndef UX_NON_CONTROL_TRANSFER_TIMEOUT_IN_MS #define UX_NON_CONTROL_TRANSFER_TIMEOUT_IN_MS 50000 -#endif +#endif -#ifndef UX_PORT_ENABLE_WAIT_IN_MS +#ifndef UX_PORT_ENABLE_WAIT_IN_MS #define UX_PORT_ENABLE_WAIT_IN_MS 500 #endif -#ifndef UX_DEVICE_ADDRESS_SET_WAIT_IN_MS +#ifndef UX_DEVICE_ADDRESS_SET_WAIT_IN_MS #define UX_DEVICE_ADDRESS_SET_WAIT_IN_MS 500 #endif -#ifndef UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT_IN_MS +#ifndef UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT_IN_MS #define UX_HIGH_SPEED_DETECTION_HANDSHAKE_SUSPEND_WAIT_IN_MS 2000 #endif /* END OF 5.8 BACKWARD COMPATIBILITY DEFINITIONS. */ - + #define UX_TRANSFER_PHASE_SETUP 1 #define UX_TRANSFER_PHASE_DATA_IN 2 #define UX_TRANSFER_PHASE_DATA_OUT 3 #define UX_TRANSFER_PHASE_STATUS_IN 4 #define UX_TRANSFER_PHASE_STATUS_OUT 5 - + /* Host change callback events : _callback(event, *class, *instance) */ @@ -1330,15 +1332,15 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_STANDALONE_WAIT_BACKGROUND_TASK 0x00u -/* Define USBX transfer request status constants. */ - +/* Define USBX transfer request status constants. */ + #define UX_TRANSFER_STATUS_NOT_PENDING 0 #define UX_TRANSFER_STATUS_PENDING 1 -#define UX_TRANSFER_STATUS_COMPLETED 2 +#define UX_TRANSFER_STATUS_COMPLETED 2 #define UX_TRANSFER_STATUS_ABORT 4 - -/* Define USBX device power constants. */ - + +/* Define USBX device power constants. */ + #define UX_DEVICE_BUS_POWERED 1u #define UX_DEVICE_SELF_POWERED 2u #define UX_MAX_SELF_POWER (500u/2) @@ -1354,49 +1356,49 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_OTG_HNP_SUPPORT 2u #define UX_HCD_OTG_CAPABLE 1u #define UX_DCD_OTG_CAPABLE 1u - -#define UX_OTG_FEATURE_B_HNP_ENABLE 3u -#define UX_OTG_FEATURE_A_HNP_SUPPORT 4u -#define UX_OTG_FEATURE_A_ALT_HNP_SUPPORT 5u + +#define UX_OTG_FEATURE_B_HNP_ENABLE 3u +#define UX_OTG_FEATURE_A_HNP_SUPPORT 4u +#define UX_OTG_FEATURE_A_ALT_HNP_SUPPORT 5u #define UX_OTG_STATUS_SELECTOR 0xF000u #define UX_OTG_HOST_REQUEST_FLAG 0x01u - + #define UX_OTG_IDLE 0u -#define UX_OTG_IDLE_TO_HOST 1u -#define UX_OTG_IDLE_TO_SLAVE 2u -#define UX_OTG_HOST_TO_IDLE 3u -#define UX_OTG_HOST_TO_SLAVE 4u -#define UX_OTG_SLAVE_TO_IDLE 5u -#define UX_OTG_SLAVE_TO_HOST 6u -#define UX_OTG_SLAVE_SRP 7u - -#define UX_OTG_MODE_IDLE 0u -#define UX_OTG_MODE_SLAVE 1u -#define UX_OTG_MODE_HOST 2u - -#define UX_OTG_DEVICE_IDLE 0u -#define UX_OTG_DEVICE_A 1u -#define UX_OTG_DEVICE_B 2u - -#define UX_OTG_VBUS_IDLE 0u -#define UX_OTG_VBUS_ON 1u -#define UX_OTG_VBUS_OFF 2u - - +#define UX_OTG_IDLE_TO_HOST 1u +#define UX_OTG_IDLE_TO_SLAVE 2u +#define UX_OTG_HOST_TO_IDLE 3u +#define UX_OTG_HOST_TO_SLAVE 4u +#define UX_OTG_SLAVE_TO_IDLE 5u +#define UX_OTG_SLAVE_TO_HOST 6u +#define UX_OTG_SLAVE_SRP 7u + +#define UX_OTG_MODE_IDLE 0u +#define UX_OTG_MODE_SLAVE 1u +#define UX_OTG_MODE_HOST 2u + +#define UX_OTG_DEVICE_IDLE 0u +#define UX_OTG_DEVICE_A 1u +#define UX_OTG_DEVICE_B 2u + +#define UX_OTG_VBUS_IDLE 0u +#define UX_OTG_VBUS_ON 1u +#define UX_OTG_VBUS_OFF 2u + + #define UX_OTG_HNP_THREAD_SLEEP_TIME (2 * UX_PERIODIC_RATE) -/* Define USBX device speed constants. */ - +/* Define USBX device speed constants. */ + #define UX_DEFAULT_HS_MPS 64 #define UX_DEFAULT_MPS 8 - + #define UX_LOW_SPEED_DEVICE 0 #define UX_FULL_SPEED_DEVICE 1 -#define UX_HIGH_SPEED_DEVICE 2 - - -/* Define USBX generic port status constants. */ - +#define UX_HIGH_SPEED_DEVICE 2 + + +/* Define USBX generic port status constants. */ + #define UX_PS_CCS 0x01u #define UX_PS_CPE 0x01u #define UX_PS_PES 0x02u @@ -1407,7 +1409,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_PS_DS_LS 0x00u #define UX_PS_DS_FS 0x40u #define UX_PS_DS_HS 0x80u - + #define UX_PS_DS 6u @@ -1434,23 +1436,23 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_STATE_IS_LOCKED(s) ((s) >= UX_STATE_LOCK) /* Locked but not pendint */ -/* Define USBX Error Code constants. The following format describes +/* Define USBX Error Code constants. The following format describes their meaning: - - 0x00 : Success - 0x0x : State machine return codes - 0x1x : Configuration errors - 0x2x : USB transport errors - 0x3x : USB controller errors - 0x4x : USB topology errors - 0x5x : USB API errors - 0x6x : USB Generic Class errors - 0x7x : USB HID Class errors - 0x8x : USB Audio Class errors - 0x9x : USB CDC-ECM Class errors + + 0x00 : Success + 0x0x : State machine return codes + 0x1x : Configuration errors + 0x2x : USB transport errors + 0x3x : USB controller errors + 0x4x : USB topology errors + 0x5x : USB API errors + 0x6x : USB Generic Class errors + 0x7x : USB HID Class errors + 0x8x : USB Audio Class errors + 0x9x : USB CDC-ECM Class errors ... 0xfx : General errors -*/ +*/ #define UX_SUCCESS 0 @@ -1476,7 +1478,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_MEMORY_ARRAY_FULL 0x1a #define UX_FATAL_ERROR 0x1b #define UX_ALREADY_ACTIVATED 0x1c - + #define UX_TRANSFER_STALLED 0x21 #define UX_TRANSFER_NO_ANSWER 0x22 #define UX_TRANSFER_ERROR 0x23 @@ -1486,17 +1488,17 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_TRANSFER_BUFFER_OVERFLOW 0x27 #define UX_TRANSFER_APPLICATION_RESET 0x28 #define UX_TRANSFER_DATA_LESS_THAN_EXPECTED 0x29 - + #define UX_PORT_RESET_FAILED 0x31 #define UX_CONTROLLER_INIT_FAILED 0x32 #define UX_CONTROLLER_DEAD 0x33 - + #define UX_NO_BANDWIDTH_AVAILABLE 0x41 #define UX_DESCRIPTOR_CORRUPTED 0x42 #define UX_OVER_CURRENT_CONDITION 0x43 #define UX_DEVICE_ENUMERATION_FAILURE 0x44 #define UX_TOO_MANY_HUB_PORTS 0x45 - + #define UX_DEVICE_HANDLE_UNKNOWN 0x50 #define UX_CONFIGURATION_HANDLE_UNKNOWN 0x51 #define UX_INTERFACE_HANDLE_UNKNOWN 0x52 @@ -1513,7 +1515,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_BUFFER_OVERFLOW 0x5d #define UX_NO_ALTERNATE_SETTING 0x5e #define UX_NO_DEVICE_CONNECTED 0x5f - + #define UX_HOST_CLASS_PROTOCOL_ERROR 0x60 #define UX_HOST_CLASS_MEMORY_ERROR 0x61 #define UX_HOST_CLASS_MEDIA_NOT_SUPPORTED 0x62 @@ -1531,7 +1533,7 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_HOST_CLASS_HID_REPORT_ERROR 0x79 #define UX_HOST_CLASS_HID_PERIODIC_REPORT_ERROR 0x7A #define UX_HOST_CLASS_HID_UNKNOWN 0x7B - + #define UX_HOST_CLASS_AUDIO_WRONG_TYPE 0x80 #define UX_HOST_CLASS_AUDIO_WRONG_INTERFACE 0x81 #define UX_HOST_CLASS_AUDIO_WRONG_FREQUENCY 0x82 @@ -1541,10 +1543,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_CLASS_ETH_PACKET_POOL_ERROR 0x91 #define UX_CLASS_ETH_PACKET_ERROR 0x92 #define UX_CLASS_ETH_SIZE_ERROR 0x93 - - -/* Define USBX HCD API function constants. */ - + + +/* Define USBX HCD API function constants. */ + #define UX_HCD_DISABLE_CONTROLLER 1 #define UX_HCD_GET_PORT_STATUS 2 #define UX_HCD_ENABLE_PORT 3 @@ -1565,9 +1567,9 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_HCD_PROCESS_DONE_QUEUE 17 #define UX_HCD_TASKS_RUN 17 #define UX_HCD_UNINITIALIZE 18 - -/* Define USBX DCD API function constants. */ - + +/* Define USBX DCD API function constants. */ + #define UX_DCD_DISABLE_CONTROLLER 1 #define UX_DCD_GET_PORT_STATUS 2 #define UX_DCD_ENABLE_PORT 3 @@ -1591,35 +1593,35 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_DCD_CHANGE_STATE 19 #define UX_DCD_STALL_ENDPOINT 20 #define UX_DCD_ENDPOINT_STATUS 21 - - -/* Define USBX generic host controller constants. */ - + + +/* Define USBX generic host controller constants. */ + #define UX_HCD_STATUS_UNUSED 0 #define UX_HCD_STATUS_HALTED 1 #define UX_HCD_STATUS_OPERATIONAL 2 #define UX_HCD_STATUS_DEAD 3 - -/* Define USBX generic SLAVE controller constants. */ - + +/* Define USBX generic SLAVE controller constants. */ + #define UX_DCD_STATUS_HALTED 0 #define UX_DCD_STATUS_OPERATIONAL 1 #define UX_DCD_STATUS_DEAD 2 - -/* Define USBX SLAVE controller VBUS constants. */ - + +/* Define USBX SLAVE controller VBUS constants. */ + #define UX_DCD_VBUS_RESET 0 #define UX_DCD_VBUS_SET 1 - -/* Define USBX class interface constants. */ - + +/* Define USBX class interface constants. */ + #define UX_HOST_CLASS_COMMAND_QUERY 1 #define UX_HOST_CLASS_COMMAND_ACTIVATE 2 #define UX_HOST_CLASS_COMMAND_DEACTIVATE 3 #define UX_HOST_CLASS_COMMAND_DESTROY 4 #define UX_HOST_CLASS_COMMAND_ACTIVATE_START UX_HOST_CLASS_COMMAND_ACTIVATE #define UX_HOST_CLASS_COMMAND_ACTIVATE_WAIT 5 - + #define UX_SLAVE_CLASS_COMMAND_QUERY 1 #define UX_SLAVE_CLASS_COMMAND_ACTIVATE 2 #define UX_SLAVE_CLASS_COMMAND_DEACTIVATE 3 @@ -1627,29 +1629,29 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_SLAVE_CLASS_COMMAND_INITIALIZE 5 #define UX_SLAVE_CLASS_COMMAND_CHANGE 6 #define UX_SLAVE_CLASS_COMMAND_UNINITIALIZE 7 - + #define UX_HOST_CLASS_COMMAND_USAGE_PIDVID 1 #define UX_HOST_CLASS_COMMAND_USAGE_CSP 2 #define UX_HOST_CLASS_COMMAND_USAGE_DCSP 3 - + #define UX_HOST_CLASS_INSTANCE_FREE 0 #define UX_HOST_CLASS_INSTANCE_LIVE 1 #define UX_HOST_CLASS_INSTANCE_SHUTDOWN 2 #define UX_HOST_CLASS_INSTANCE_MOUNTING 3 -/* Define USBX root HUB constants. */ - +/* Define USBX root HUB constants. */ + #define UX_RH_ENUMERATION_RETRY 3 #define UX_RH_ENUMERATION_RETRY_DELAY 100 - -/* Define USBX PCI driver constants. */ - + +/* Define USBX PCI driver constants. */ + #define UX_PCI_NB_FUNCTIONS 7 #define UX_PCI_NB_DEVICE 32 #define UX_PCI_NB_BUS 0xff - + #define UX_PCI_CMD_IO_ENABLE 0x0001u #define UX_PCI_CMD_MEM_ENABLE 0x0002u #define UX_PCI_CMD_MASTER_ENABLE 0x0004u @@ -1660,10 +1662,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_PCI_CMD_WAIT_CYCLE_CTRL_ENABLE 0x0080u #define UX_PCI_CMD_SERR_ENABLE 0x0100u #define UX_PCI_CMD_FBB_ENABLE 0x0200u - + #define UX_PCI_CFG_CTRL_ADDRESS 0x0cf8u #define UX_PCI_CFG_DATA_ADDRESS 0x0cfcu - + #define UX_PCI_CFG_VENDOR_ID 0x00 #define UX_PCI_CFG_DEVICE_ID 0x02 #define UX_PCI_CFG_COMMAND 0x04 @@ -1692,10 +1694,10 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_PCI_CFG_INT_PIN 0x3d #define UX_PCI_CFG_MIN_GNT 0x3e #define UX_PCI_CFG_MAX_LATENCY 0x3f - + #define UX_PCI_CFG_SBRN 0x60 #define UX_PCI_CFG_FLADJ 0x61 - + /* Define DFU constants. */ #define UX_SYSTEM_DFU_STATE_APP_IDLE 0 #define UX_SYSTEM_DFU_STATE_APP_DETACH 1 @@ -1703,14 +1705,14 @@ VOID _ux_trace_event_update(TX_TRACE_BUFFER_ENTRY *event, ULONG timestamp, UL #define UX_SYSTEM_DFU_STATE_DFU_DNLOAD_SYNC 3 #define UX_SYSTEM_DFU_STATE_DFU_DNBUSY 4 #define UX_SYSTEM_DFU_STATE_DFU_DNLOAD_IDLE 5 -#define UX_SYSTEM_DFU_STATE_DFU_MANIFEST_SYNC 6 +#define UX_SYSTEM_DFU_STATE_DFU_MANIFEST_SYNC 6 #define UX_SYSTEM_DFU_STATE_DFU_MANIFEST 7 -#define UX_SYSTEM_DFU_STATE_DFU_MANIFEST_WAIT_RESET 8 +#define UX_SYSTEM_DFU_STATE_DFU_MANIFEST_WAIT_RESET 8 #define UX_SYSTEM_DFU_STATE_DFU_UPLOAD_IDLE 9 #define UX_SYSTEM_DFU_STATE_DFU_ERROR 10 -/* Define basic class constants. */ - +/* Define basic class constants. */ + #define UX_HOST_CLASS_PRINTER_NAME_LENGTH 64 @@ -1741,8 +1743,8 @@ typedef struct UX_HOST_CLASS_COMMAND_STRUCT UINT ux_host_class_command_iad_class; UINT ux_host_class_command_iad_subclass; UINT ux_host_class_command_iad_protocol; - - struct UX_HOST_CLASS_STRUCT + + struct UX_HOST_CLASS_STRUCT *ux_host_class_command_class_ptr; } UX_HOST_CLASS_COMMAND; @@ -1778,7 +1780,7 @@ typedef struct UX_TRANSFER_STRUCT { ULONG ux_transfer_request_status; - struct UX_ENDPOINT_STRUCT + struct UX_ENDPOINT_STRUCT *ux_transfer_request_endpoint; UCHAR * ux_transfer_request_data_pointer; ULONG ux_transfer_request_requested_length; @@ -1793,7 +1795,7 @@ typedef struct UX_TRANSFER_STRUCT ULONG ux_transfer_request_timeout_value; UINT ux_transfer_request_completion_code; ULONG ux_transfer_request_packet_length; - struct UX_TRANSFER_STRUCT + struct UX_TRANSFER_STRUCT *ux_transfer_request_next_transfer_request; VOID *ux_transfer_request_user_specific; #if !defined(UX_HOST_STANDALONE) @@ -1846,16 +1848,16 @@ typedef struct UX_ENDPOINT_STRUCT ULONG ux_endpoint; ULONG ux_endpoint_state; - void *ux_endpoint_ed; - struct UX_ENDPOINT_DESCRIPTOR_STRUCT + void *ux_endpoint_ed; + struct UX_ENDPOINT_DESCRIPTOR_STRUCT ux_endpoint_descriptor; - struct UX_ENDPOINT_STRUCT + struct UX_ENDPOINT_STRUCT *ux_endpoint_next_endpoint; - struct UX_INTERFACE_STRUCT + struct UX_INTERFACE_STRUCT *ux_endpoint_interface; - struct UX_DEVICE_STRUCT + struct UX_DEVICE_STRUCT *ux_endpoint_device; - struct UX_TRANSFER_STRUCT + struct UX_TRANSFER_STRUCT ux_endpoint_transfer_request; } UX_ENDPOINT; @@ -1957,7 +1959,7 @@ typedef struct UX_INTERFACE_ASSOCIATION_DESCRIPTOR_STRUCT UCHAR bFunctionProtocol; UCHAR iFunction; } UX_INTERFACE_ASSOCIATION_DESCRIPTOR; - + #define UX_INTERFACE_ASSOCIATION_DESCRIPTOR_ENTRIES 8 #define UX_INTERFACE_ASSOCIATION_DESCRIPTOR_LENGTH 8 @@ -1980,25 +1982,25 @@ typedef struct UX_DEVICE_STRUCT #if !defined(UX_HOST_STANDALONE) UX_SEMAPHORE ux_device_protection_semaphore; #endif - struct UX_HOST_CLASS_STRUCT + struct UX_HOST_CLASS_STRUCT *ux_device_class; VOID *ux_device_class_instance; - struct UX_CONFIGURATION_STRUCT + struct UX_CONFIGURATION_STRUCT *ux_device_first_configuration; - struct UX_DEVICE_DESCRIPTOR_STRUCT + struct UX_DEVICE_DESCRIPTOR_STRUCT ux_device_descriptor; - struct UX_ENDPOINT_STRUCT + struct UX_ENDPOINT_STRUCT ux_device_control_endpoint; ULONG ux_device_port_location; #if UX_MAX_HCD > 1 - struct UX_HCD_STRUCT + struct UX_HCD_STRUCT *ux_device_hcd; #endif #if UX_MAX_DEVICES > 1 struct UX_DEVICE_STRUCT *ux_device_parent; ULONG ux_device_max_power; - struct UX_HUB_TT_STRUCT + struct UX_HUB_TT_STRUCT ux_device_hub_tt[UX_MAX_TT]; #endif @@ -2102,13 +2104,13 @@ typedef struct UX_CONFIGURATION_STRUCT ULONG ux_configuration_handle; ULONG ux_configuration_state; ULONG ux_configuration_otg_capabilities; - struct UX_CONFIGURATION_DESCRIPTOR_STRUCT + struct UX_CONFIGURATION_DESCRIPTOR_STRUCT ux_configuration_descriptor; - struct UX_INTERFACE_STRUCT + struct UX_INTERFACE_STRUCT *ux_configuration_first_interface; - struct UX_CONFIGURATION_STRUCT + struct UX_CONFIGURATION_STRUCT *ux_configuration_next_configuration; - struct UX_DEVICE_STRUCT + struct UX_DEVICE_STRUCT *ux_configuration_device; ULONG ux_configuration_iad_class; ULONG ux_configuration_iad_subclass; @@ -2138,7 +2140,7 @@ typedef struct UX_INTERFACE_DESCRIPTOR_STRUCT UCHAR iInterface; UCHAR _align_size[3]; } UX_INTERFACE_DESCRIPTOR; - + #define UX_INTERFACE_DESCRIPTOR_ENTRIES 9 #define UX_INTERFACE_DESCRIPTOR_LENGTH 9 @@ -2151,16 +2153,16 @@ typedef struct UX_INTERFACE_STRUCT ULONG ux_interface_handle; ULONG ux_interface_state; UINT ux_interface_current_alternate_setting; - struct UX_INTERFACE_DESCRIPTOR_STRUCT + struct UX_INTERFACE_DESCRIPTOR_STRUCT ux_interface_descriptor; - struct UX_HOST_CLASS_STRUCT + struct UX_HOST_CLASS_STRUCT *ux_interface_class; VOID *ux_interface_class_instance; - struct UX_ENDPOINT_STRUCT + struct UX_ENDPOINT_STRUCT *ux_interface_first_endpoint; - struct UX_INTERFACE_STRUCT + struct UX_INTERFACE_STRUCT *ux_interface_next_interface; - struct UX_CONFIGURATION_STRUCT + struct UX_CONFIGURATION_STRUCT *ux_interface_configuration; ULONG ux_interface_iad_class; ULONG ux_interface_iad_subclass; @@ -2242,7 +2244,7 @@ typedef struct UX_DFU_FUNCTIONAL_DESCRIPTOR_STRUCT USHORT bcdDFUVersion; UCHAR _align_size[2]; } UX_DFU_FUNCTIONAL_DESCRIPTOR; - + #define UX_DFU_FUNCTIONAL_DESCRIPTOR_ENTRIES 6 #define UX_DFU_FUNCTIONAL_DESCRIPTOR_LENGTH 9 @@ -2250,7 +2252,7 @@ typedef struct UX_DFU_FUNCTIONAL_DESCRIPTOR_STRUCT /* Define USBX Host Controller structure. */ typedef struct UX_HCD_STRUCT -{ +{ #if defined(UX_NAME_REFERENCED_BY_POINTER) const UCHAR *ux_hcd_name; @@ -2294,7 +2296,7 @@ typedef struct UX_SLAVE_TRANSFER_STRUCT ULONG ux_slave_transfer_request_status; ULONG ux_slave_transfer_request_type; - struct UX_SLAVE_ENDPOINT_STRUCT + struct UX_SLAVE_ENDPOINT_STRUCT *ux_slave_transfer_request_endpoint; UCHAR *ux_slave_transfer_request_data_pointer; UCHAR *ux_slave_transfer_request_current_data_pointer; @@ -2324,20 +2326,20 @@ typedef struct UX_SLAVE_TRANSFER_STRUCT /* Define USBX Device Controller Endpoint structure. */ typedef struct UX_SLAVE_ENDPOINT_STRUCT -{ +{ ULONG ux_slave_endpoint_status; ULONG ux_slave_endpoint_state; - void *ux_slave_endpoint_ed; - struct UX_ENDPOINT_DESCRIPTOR_STRUCT + void *ux_slave_endpoint_ed; + struct UX_ENDPOINT_DESCRIPTOR_STRUCT ux_slave_endpoint_descriptor; - struct UX_SLAVE_ENDPOINT_STRUCT + struct UX_SLAVE_ENDPOINT_STRUCT *ux_slave_endpoint_next_endpoint; - struct UX_SLAVE_INTERFACE_STRUCT + struct UX_SLAVE_INTERFACE_STRUCT *ux_slave_endpoint_interface; - struct UX_SLAVE_DEVICE_STRUCT + struct UX_SLAVE_DEVICE_STRUCT *ux_slave_endpoint_device; - struct UX_SLAVE_TRANSFER_STRUCT + struct UX_SLAVE_TRANSFER_STRUCT ux_slave_endpoint_transfer_request; } UX_SLAVE_ENDPOINT; @@ -2345,17 +2347,17 @@ typedef struct UX_SLAVE_ENDPOINT_STRUCT /* Define USBX Device Controller Interface structure. */ typedef struct UX_SLAVE_INTERFACE_STRUCT -{ +{ ULONG ux_slave_interface_status; - struct UX_SLAVE_CLASS_STRUCT + struct UX_SLAVE_CLASS_STRUCT *ux_slave_interface_class; VOID *ux_slave_interface_class_instance; - struct UX_INTERFACE_DESCRIPTOR_STRUCT + struct UX_INTERFACE_DESCRIPTOR_STRUCT ux_slave_interface_descriptor; - struct UX_SLAVE_INTERFACE_STRUCT + struct UX_SLAVE_INTERFACE_STRUCT *ux_slave_interface_next_interface; - struct UX_SLAVE_ENDPOINT_STRUCT + struct UX_SLAVE_ENDPOINT_STRUCT *ux_slave_interface_first_endpoint; } UX_SLAVE_INTERFACE; @@ -2363,33 +2365,33 @@ typedef struct UX_SLAVE_INTERFACE_STRUCT /* Define USBX Device Controller structure. */ typedef struct UX_SLAVE_DEVICE_STRUCT -{ +{ - ULONG ux_slave_device_state; - struct UX_DEVICE_DESCRIPTOR_STRUCT + ULONG ux_slave_device_state; + struct UX_DEVICE_DESCRIPTOR_STRUCT ux_slave_device_descriptor; - struct UX_SLAVE_ENDPOINT_STRUCT + struct UX_SLAVE_ENDPOINT_STRUCT ux_slave_device_control_endpoint; ULONG ux_slave_device_configuration_selected; - struct UX_CONFIGURATION_DESCRIPTOR_STRUCT + struct UX_CONFIGURATION_DESCRIPTOR_STRUCT ux_slave_device_configuration_descriptor; - struct UX_SLAVE_INTERFACE_STRUCT + struct UX_SLAVE_INTERFACE_STRUCT *ux_slave_device_first_interface; - struct UX_SLAVE_INTERFACE_STRUCT + struct UX_SLAVE_INTERFACE_STRUCT *ux_slave_device_interfaces_pool; ULONG ux_slave_device_interfaces_pool_number; - struct UX_SLAVE_ENDPOINT_STRUCT + struct UX_SLAVE_ENDPOINT_STRUCT *ux_slave_device_endpoints_pool; ULONG ux_slave_device_endpoints_pool_number; - ULONG ux_slave_device_power_state; - + ULONG ux_slave_device_power_state; + } UX_SLAVE_DEVICE; /* Define USBX Device Controller structure. */ typedef struct UX_SLAVE_DCD_STRUCT -{ +{ UINT ux_slave_dcd_status; UINT ux_slave_dcd_controller_type; @@ -2419,11 +2421,11 @@ typedef struct UX_SLAVE_CLASS_COMMAND_STRUCT UINT ux_slave_class_command_class; UINT ux_slave_class_command_subclass; UINT ux_slave_class_command_protocol; - struct UX_SLAVE_CLASS_STRUCT + struct UX_SLAVE_CLASS_STRUCT *ux_slave_class_command_class_ptr; VOID *ux_slave_class_command_parameter; VOID *ux_slave_class_command_interface_number; - + } UX_SLAVE_CLASS_COMMAND; @@ -2448,53 +2450,81 @@ typedef struct UX_SLAVE_CLASS_STRUCT #else UINT (*ux_slave_class_task_function)(VOID *class_instance); #endif - VOID *ux_slave_class_interface_parameter; - ULONG ux_slave_class_interface_number; - ULONG ux_slave_class_configuration_number; - struct UX_SLAVE_INTERFACE_STRUCT + VOID *ux_slave_class_interface_parameter; + ULONG ux_slave_class_interface_number; + ULONG ux_slave_class_configuration_number; + struct UX_SLAVE_INTERFACE_STRUCT *ux_slave_class_interface; } UX_SLAVE_CLASS; +#define UX_UCHAR_POINTER_ADD(a,b) (((UCHAR *) (a)) + ((UINT) (b))) +#define UX_UCHAR_POINTER_SUB(a,b) (((UCHAR *) (a)) - ((UINT) (b))) +#define UX_UCHAR_POINTER_DIF(a,b) ((ULONG)(((UCHAR *) (a)) - ((UCHAR *) (b)))) +#define UX_ULONG_POINTER_ADD(a,b) (((ULONG *) (a)) + ((UINT) (b))) +#define UX_ULONG_POINTER_SUB(a,b) (((ULONG *) (a)) - ((UINT) (b))) +#define UX_ULONG_POINTER_DIF(a,b) ((ULONG)(((ULONG *) (a)) - ((ULONG *) (b)))) +#define UX_POINTER_TO_ULONG_CONVERT(a) ((ULONG) ((VOID *) (a))) +#define UX_ULONG_TO_POINTER_CONVERT(a) ((VOID *) ((ULONG) (a))) +#define UX_POINTER_TO_ALIGN_TYPE_CONVERT(a) ((ALIGN_TYPE) ((VOID *) (a))) +#define UX_ALIGN_TYPE_TO_POINTER_CONVERT(a) ((VOID *) ((ALIGN_TYPE) (a))) +#define UX_LOOP_FOREVER ((UINT) 1) +#define UX_INDIRECT_VOID_TO_UCHAR_POINTER_CONVERT(a) ((UCHAR **) ((VOID *) (a))) +#define UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(a) ((UCHAR **) ((VOID *) (a))) +#define UX_VOID_TO_UCHAR_POINTER_CONVERT(a) ((UCHAR *) ((VOID *) (a))) +#define UX_VOID_TO_INDIRECT_UCHAR_POINTER_CONVERT(a) ((UCHAR **) ((VOID *) (a))) +#define UX_VOID_TO_BYTE_POOL_POINTER_CONVERT(a) ((UX_MEMORY_BYTE_POOL *) ((VOID *) (a))) +#define UX_BYTE_POOL_TO_UCHAR_POINTER_CONVERT(a) ((UCHAR *) ((VOID *) (a))) +#ifndef UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT +#define UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(a) ((ALIGN_TYPE *) ((VOID *) (a))) +#endif +#define UX_UCHAR_TO_INDIRECT_BYTE_POOL_POINTER(a) ((UX_MEMORY_BYTE_POOL **) ((VOID *) (a))) +#define UX_MEMORY_BLOCK_HEADER_SIZE (sizeof(UCHAR *) + sizeof(ALIGN_TYPE)) + +#ifndef UX_BYTE_BLOCK_FREE +#define UX_BYTE_BLOCK_FREE ((ULONG) 0xFFFFEEEEUL) +#endif + +#ifndef UX_BYTE_BLOCK_MIN +#define UX_BYTE_BLOCK_MIN ((ULONG) 20) +#endif + /* Define USBX Memory Management structure. */ -typedef struct UX_MEMORY_BLOCK_STRUCT +typedef struct UX_MEMORY_BYTE_POOL_STRUCT { - ULONG ux_memory_block_size; - ULONG ux_memory_block_status; - struct UX_MEMORY_BLOCK_STRUCT - *ux_memory_block_next; - struct UX_MEMORY_BLOCK_STRUCT - *ux_memory_block_previous; -} UX_MEMORY_BLOCK; + /* Define the number of available bytes in the pool. */ + ULONG ux_byte_pool_available; + /* Define the number of fragments in the pool. */ + UINT ux_byte_pool_fragments; + + /* Define the search pointer used for initial searching for memory in a byte pool. */ + UCHAR *ux_byte_pool_search; + + /* Save the start address of the byte pool's memory area. */ + UCHAR *ux_byte_pool_start; + + /* Save the byte pool's size in bytes. */ + ULONG ux_byte_pool_size; -typedef struct UX_SYSTEM_STRUCT -{ - - UX_MEMORY_BLOCK *ux_system_regular_memory_pool_start; - ULONG ux_system_regular_memory_pool_size; - ULONG ux_system_regular_memory_pool_free; - UX_MEMORY_BLOCK *ux_system_cache_safe_memory_pool_start; - ULONG ux_system_cache_safe_memory_pool_size; - ULONG ux_system_cache_safe_memory_pool_free; #ifdef UX_ENABLE_MEMORY_STATISTICS - UCHAR *ux_system_regular_memory_pool_base; - ALIGN_TYPE ux_system_regular_memory_pool_max_start_offset; - ALIGN_TYPE ux_system_regular_memory_pool_min_free; - UCHAR *ux_system_cache_safe_memory_pool_base; - ALIGN_TYPE ux_system_cache_safe_memory_pool_max_start_offset; - ALIGN_TYPE ux_system_cache_safe_memory_pool_min_free; - ULONG ux_system_regular_memory_pool_alloc_count; - ULONG ux_system_regular_memory_pool_alloc_total; - ULONG ux_system_regular_memory_pool_alloc_max_count; - ULONG ux_system_regular_memory_pool_alloc_max_total; - ULONG ux_system_cache_safe_memory_pool_alloc_count; - ULONG ux_system_cache_safe_memory_pool_alloc_total; - ULONG ux_system_cache_safe_memory_pool_alloc_max_count; - ULONG ux_system_cache_safe_memory_pool_alloc_max_total; + ALIGN_TYPE ux_byte_pool_min_free; + ULONG ux_byte_pool_alloc_count; + ULONG ux_byte_pool_alloc_total; + ULONG ux_byte_pool_alloc_max_count; + ULONG ux_byte_pool_alloc_max_total; #endif +} UX_MEMORY_BYTE_POOL; + +#define UX_MEMORY_BYTE_POOL_REGULAR 0 +#define UX_MEMORY_BYTE_POOL_CACHE_SAFE 1 +#define UX_MEMORY_BYTE_POOL_NUM 2 + +typedef struct UX_SYSTEM_STRUCT +{ + UX_MEMORY_BYTE_POOL *ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_NUM]; UINT ux_system_thread_lowest_priority; #if !defined(UX_STANDALONE) @@ -2522,7 +2552,7 @@ typedef struct UX_SYSTEM_STRUCT /* Define USBX System Host Data structure. */ typedef struct UX_SYSTEM_HOST_STRUCT -{ +{ #if UX_MAX_CLASS_DRIVER > 1 UINT ux_system_host_max_class; @@ -2607,7 +2637,7 @@ typedef struct UX_SYSTEM_HOST_STRUCT typedef struct UX_SYSTEM_SLAVE_STRUCT -{ +{ UX_SLAVE_DCD ux_system_slave_dcd; UX_SLAVE_DEVICE ux_system_slave_device; @@ -2652,7 +2682,7 @@ typedef struct UX_SYSTEM_SLAVE_STRUCT #endif typedef struct UX_SYSTEM_OTG_STRUCT -{ +{ #if !defined(UX_OTG_STANDALONE) UX_THREAD ux_system_otg_thread; @@ -2678,7 +2708,7 @@ typedef struct UX_SYSTEM_OTG_STRUCT typedef struct UX_HOST_CLASS_DPUMP_STRUCT { - struct UX_HOST_CLASS_DPUMP_STRUCT + struct UX_HOST_CLASS_DPUMP_STRUCT *ux_host_class_dpump_next_instance; UX_HOST_CLASS *ux_host_class_dpump_class; UX_DEVICE *ux_host_class_dpump_device; @@ -2695,8 +2725,8 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT } UX_HOST_CLASS_DPUMP; -/* Define the system API mappings based on the error checking - selected by the user. Note: this section is only applicable to +/* Define the system API mappings based on the error checking + selected by the user. Note: this section is only applicable to application source code, hence the conditional that turns off this stuff when the include file is processed by the ThreadX source. */ @@ -2814,19 +2844,19 @@ typedef struct UX_HOST_CLASS_DPUMP_STRUCT #define ux_hcd_sim_host_initialize _ux_hcd_sim_host_initialize #define ux_dcd_sim_slave_initialize _ux_dcd_sim_slave_initialize -#define ux_network_driver_init _ux_network_driver_init +#define ux_network_driver_init _ux_network_driver_init #endif /* Define USBX API prototypes. */ -UINT ux_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size, +UINT ux_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size, VOID *cached_memory_pool_start, ULONG cached_memory_size); UINT ux_system_uninitialize(VOID); UINT ux_system_tasks_run(VOID); -UINT uxe_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size, +UINT uxe_system_initialize(VOID *non_cached_memory_pool_start, ULONG non_cached_memory_size, VOID *cached_memory_pool_start, ULONG cached_memory_size); @@ -2873,7 +2903,7 @@ UINT ux_dcd_at91_initialize(ULONG dcd_io); UINT ux_dcd_isp1181_initialize(ULONG dcd_io, ULONG dcd_irq, ULONG dcd_vbus_address); UINT ux_dcd_ml6965_initialize(ULONG dcd_io, ULONG dcd_irq, ULONG dcd_vbus_address); UINT ux_dcd_sim_slave_initialize(VOID); - + UINT ux_device_class_storage_entry(UX_SLAVE_CLASS_COMMAND *command); VOID ux_device_class_storage_thread(ULONG); UINT ux_device_stack_alternate_setting_get(ULONG interface_value); diff --git a/common/core/inc/ux_device_class_dpump.h b/common/core/inc/ux_device_class_dpump.h index 76f55812..1f4bb4b5 100644 --- a/common/core/inc/ux_device_class_dpump.h +++ b/common/core/inc/ux_device_class_dpump.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_dpump.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,10 +50,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_device_stack.h b/common/core/inc/ux_device_stack.h index cafe5339..03bc9b9b 100644 --- a/common/core/inc/ux_device_stack.h +++ b/common/core/inc/ux_device_stack.h @@ -25,7 +25,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_stack.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,9 +53,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_host_stack.h b/common/core/inc/ux_host_stack.h index b4a6ac01..d174bc14 100644 --- a/common/core/inc/ux_host_stack.h +++ b/common/core/inc/ux_host_stack.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_stack.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,9 +65,9 @@ /* names conflict C++ keyword, */ /* added standalone HUB, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_system.h b/common/core/inc/ux_system.h index 9734f1d6..33f95eea 100644 --- a/common/core/inc/ux_system.h +++ b/common/core/inc/ux_system.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_system.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,9 +53,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* added device CCID name, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/core/inc/ux_user_sample.h b/common/core/inc/ux_user_sample.h index 28a09346..c86531ff 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.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -99,14 +99,15 @@ /* added option to enable */ /* basic USBX error checking, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Xiuwen Cai, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Xiuwen Cai, CQ Xiao Modified comment(s), */ +/* refined memory management, */ /* added zero copy support */ /* in many device classes, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* added option for get string */ /* requests with zero wIndex, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -141,8 +142,8 @@ also refer to ux_port.h for descriptions on each of these options. */ /* Defined, this value represents minimal allocated memory alignment in number of bytes. - The default is UX_ALIGN_16 (0x0f) to align allocated memory to 16 bytes. */ -/* #define UX_ALIGN_MIN UX_ALIGN_16 */ + The default is UX_ALIGN_8 (0x07) to align allocated memory to 8 bytes. */ +/* #define UX_ALIGN_MIN UX_ALIGN_8 */ /* Defined, this value represents how many ticks per seconds for a specific hardware platform. The default is 1000 indicating 1 tick per millisecond. */ @@ -239,7 +240,7 @@ */ /* #define UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY */ -/* Defined, it enables zero copy and flexible queue support (works if HID owns endpoint buffer). +/* Defined, it enables device HID zero copy and flexible queue support (works if HID owns endpoint buffer). Enabled, the internal queue buffer is directly used for transfer, the APIs are kept to keep backword compatibility, to AVOID KEEPING BUFFERS IN APPLICATION. Flexible queue introduces initialization parameter _event_max_number and _event_max_length, @@ -252,6 +253,27 @@ */ /* #define UX_DEVICE_CLASS_HID_ZERO_COPY */ +/* Defined, it enables device CDC_ECM zero copy support (works if CDC_ECM owns endpoint buffer). + Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max + size is larger than UX_DEVICE_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE (1536). + */ +/* #define UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY */ + +/* Defined, it enables device RNDIS zero copy support (works if RNDIS owns endpoint buffer). + Enabled, it requires that the NX IP default packet pool is in cache safe area, and buffer max + size is larger than UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE (1600). + */ +/* #define UX_DEVICE_CLASS_RNDIS_ZERO_COPY */ + +/* Defined, it enables zero copy support (works if PRINTER owns endpoint buffer). + Defined, it enables zero copy for bulk in/out endpoints (write/read). In this case, the endpoint + buffer is not allocated in class, application must provide the buffer for read/write, and the + buffer must meet device controller driver (DCD) buffer requirements (e.g., aligned and cache + safe if buffer is for DMA). + */ +/* #define UX_DEVICE_CLASS_PRINTER_ZERO_COPY */ + + /* Defined, this value represents the maximum number of bytes that can be received or transmitted on any endpoint. This value cannot be less than the maximum packet size of any endpoint. The default is 4096 bytes but can be reduced in memory constrained environments. For cd-rom support in the storage diff --git a/common/core/inc/ux_utility.h b/common/core/inc/ux_utility.h index 8b42fae9..aacabff1 100644 --- a/common/core/inc/ux_utility.h +++ b/common/core/inc/ux_utility.h @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Utility */ /** */ @@ -26,20 +26,20 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_utility.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ +/* */ /* This file contains all the header and extern functions used by the */ -/* USBX components that utilize utility functions. */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* USBX components that utilize utility functions. */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* added timer delete, used UX */ @@ -57,10 +57,11 @@ /* added macros for RTOS calls,*/ /* fixed OHCI PRSC issue, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* refined memory management, */ /* added new function to check */ /* parsed size of descriptor, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -86,9 +87,10 @@ VOID _ux_utility_memory_copy(VOID *memory_destination, VOID *memory_ VOID _ux_utility_memory_free(VOID *memory); ULONG _ux_utility_string_length_get(UCHAR *string); UINT _ux_utility_string_length_check(UCHAR *input_string, UINT *string_length_ptr, UINT max_string_length); -UX_MEMORY_BLOCK *_ux_utility_memory_free_block_best_get(ULONG memory_cache_flag, ULONG memory_size_requested); +UCHAR *_ux_utility_memory_byte_pool_search(UX_MEMORY_BYTE_POOL *pool_ptr, ULONG memory_size); +UINT _ux_utility_memory_byte_pool_create(UX_MEMORY_BYTE_POOL *pool_ptr, VOID *pool_start, ULONG pool_size); VOID _ux_utility_memory_set(VOID *destination, UCHAR value, ULONG length); -ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number, +ULONG _ux_utility_pci_class_scan(ULONG pci_class, ULONG bus_number, ULONG device_number, ULONG function_number, ULONG *current_bus_number, ULONG *current_device_number, ULONG *current_function_number); ULONG _ux_utility_pci_read(ULONG bus_number, ULONG device_number, ULONG function_number, @@ -116,9 +118,9 @@ UINT _ux_utility_semaphore_create(UX_SEMAPHORE *semaphore, CHAR *sem UINT _ux_utility_semaphore_delete(UX_SEMAPHORE *semaphore); UINT _ux_utility_semaphore_get(UX_SEMAPHORE *semaphore, ULONG semaphore_signal); UINT _ux_utility_semaphore_put(UX_SEMAPHORE *semaphore); -UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name, +UINT _ux_utility_thread_create(UX_THREAD *thread_ptr, CHAR *name, VOID (*entry_function)(ULONG), ULONG entry_input, - VOID *stack_start, ULONG stack_size, + VOID *stack_start, ULONG stack_size, UINT priority, UINT preempt_threshold, ULONG time_slice, UINT auto_start); UINT _ux_utility_thread_delete(UX_THREAD *thread_ptr); @@ -129,12 +131,12 @@ UINT _ux_utility_thread_sleep(ULONG ticks); UINT _ux_utility_thread_suspend(UX_THREAD *thread_ptr); UX_THREAD *_ux_utility_thread_identify(VOID); UINT _ux_utility_timer_create(UX_TIMER *timer, CHAR *timer_name, VOID (*expiration_function) (ULONG), - ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks, + ULONG expiration_input, ULONG initial_ticks, ULONG reschedule_ticks, UINT activation_flag); UINT _ux_utility_timer_delete(UX_TIMER *timer); UINT _ux_utility_event_flags_create(UX_EVENT_FLAGS_GROUP*group_ptr, CHAR *name); UINT _ux_utility_event_flags_delete(UX_EVENT_FLAGS_GROUP*group_ptr); -UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags, +UINT _ux_utility_event_flags_get(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG requested_flags, UINT get_option, ULONG *actual_flags_ptr, ULONG wait_option); UINT _ux_utility_event_flags_set(UX_EVENT_FLAGS_GROUP*group_ptr, ULONG flags_to_set, UINT set_option); @@ -399,7 +401,7 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL /* Define the system API mappings. - Note: this section is only applicable to + Note: this section is only applicable to application source code, hence the conditional that turns off this stuff when the include file is processed by the ThreadX source. */ @@ -450,8 +452,8 @@ VOID* _ux_utility_memory_allocate_add_safe(ULONG align,ULONG cache,UL #define ux_utility_event_flags_set _ux_utility_event_flags_set #define ux_utility_unicode_to_string _ux_utility_unicode_to_string #define ux_utility_string_to_unicode _ux_utility_string_to_unicode -#define ux_utility_delay_ms _ux_utility_delay_ms -#define ux_utility_error_callback_register _ux_utility_error_callback_register +#define ux_utility_delay_ms _ux_utility_delay_ms +#define ux_utility_error_callback_register _ux_utility_error_callback_register #define ux_system_error_handler _ux_system_error_handler #define ux_utility_time_get _ux_utility_time_get diff --git a/common/core/src/ux_device_class_dpump_activate.c b/common/core/src/ux_device_class_dpump_activate.c index ab6963b0..7c0f61eb 100644 --- a/common/core/src/ux_device_class_dpump_activate.c +++ b/common/core/src/ux_device_class_dpump_activate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,10 +73,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/core/src/ux_device_class_dpump_change.c b/common/core/src/ux_device_class_dpump_change.c index 24f52aed..ef22087c 100644 --- a/common/core/src/ux_device_class_dpump_change.c +++ b/common/core/src/ux_device_class_dpump_change.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_change PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,10 +76,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_change(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/core/src/ux_device_class_dpump_initialize.c b/common/core/src/ux_device_class_dpump_initialize.c index 853b4f8b..bcd36411 100644 --- a/common/core/src/ux_device_class_dpump_initialize.c +++ b/common/core/src/ux_device_class_dpump_initialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/core/src/ux_device_class_dpump_read.c b/common/core/src/ux_device_class_dpump_read.c index c93df013..c70b4e6b 100644 --- a/common/core/src/ux_device_class_dpump_read.c +++ b/common/core/src/ux_device_class_dpump_read.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_read(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, diff --git a/common/core/src/ux_device_class_dpump_read_run.c b/common/core/src/ux_device_class_dpump_read_run.c index 0bd3da40..16fd2f4c 100644 --- a/common/core/src/ux_device_class_dpump_read_run.c +++ b/common/core/src/ux_device_class_dpump_read_run.c @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,10 +78,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_read_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, diff --git a/common/core/src/ux_device_class_dpump_write.c b/common/core/src/ux_device_class_dpump_write.c index 2e950aae..b739dff5 100644 --- a/common/core/src/ux_device_class_dpump_write.c +++ b/common/core/src/ux_device_class_dpump_write.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_write(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, diff --git a/common/core/src/ux_device_class_dpump_write_run.c b/common/core/src/ux_device_class_dpump_write_run.c index b08e49bd..9a4bce16 100644 --- a/common/core/src/ux_device_class_dpump_write_run.c +++ b/common/core/src/ux_device_class_dpump_write_run.c @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dpump_write_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,10 +78,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dpump_write_run(UX_SLAVE_CLASS_DPUMP *dpump, UCHAR *buffer, diff --git a/common/core/src/ux_device_stack_class_register.c b/common/core/src/ux_device_stack_class_register.c index ad61647b..aa799d65 100644 --- a/common/core/src/ux_device_stack_class_register.c +++ b/common/core/src/ux_device_stack_class_register.c @@ -172,7 +172,7 @@ ULONG class_index; /* FUNCTION RELEASE */ /* */ /* _uxe_device_stack_class_register PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -206,7 +206,7 @@ ULONG class_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_stack_class_register(UCHAR *class_name, diff --git a/common/core/src/ux_device_stack_class_unregister.c b/common/core/src/ux_device_stack_class_unregister.c index 8d1bde05..0e8fe589 100644 --- a/common/core/src/ux_device_stack_class_unregister.c +++ b/common/core/src/ux_device_stack_class_unregister.c @@ -156,7 +156,7 @@ ULONG class_index; /* FUNCTION RELEASE */ /* */ /* _uxe_device_stack_class_unregister PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -187,7 +187,7 @@ ULONG class_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_stack_class_unregister(UCHAR *class_name, 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 826097a6..e8a2a98f 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.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -94,10 +94,10 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed vendor request issue, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* improved interface request */ /* process with print class, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_stack_control_request_process(UX_SLAVE_TRANSFER *transfer_request) diff --git a/common/core/src/ux_device_stack_descriptor_send.c b/common/core/src/ux_device_stack_descriptor_send.c index 4ce10a8d..b7b5a574 100644 --- a/common/core/src/ux_device_stack_descriptor_send.c +++ b/common/core/src/ux_device_stack_descriptor_send.c @@ -41,7 +41,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_descriptor_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,11 +89,11 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* moved compile option check, */ /* added support for get string*/ /* requests with zero wIndex, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_stack_descriptor_send(ULONG descriptor_type, ULONG request_index, ULONG host_length) diff --git a/common/core/src/ux_device_stack_initialize.c b/common/core/src/ux_device_stack_initialize.c index 5b7a9b1f..d6b628ed 100644 --- a/common/core/src/ux_device_stack_initialize.c +++ b/common/core/src/ux_device_stack_initialize.c @@ -54,7 +54,7 @@ UX_SYSTEM_SLAVE *_ux_system_slave; /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -109,10 +109,10 @@ UX_SYSTEM_SLAVE *_ux_system_slave; /* added CCID support, */ /* added video support, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed, @@ -474,7 +474,7 @@ UCHAR *memory; /* FUNCTION RELEASE */ /* */ /* _uxe_device_stack_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -505,7 +505,7 @@ UCHAR *memory; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_stack_initialize(UCHAR * device_framework_high_speed, ULONG device_framework_length_high_speed, diff --git a/common/core/src/ux_device_stack_uninitialize.c b/common/core/src/ux_device_stack_uninitialize.c index 4622e382..01128780 100644 --- a/common/core/src/ux_device_stack_uninitialize.c +++ b/common/core/src/ux_device_stack_uninitialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_stack_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,10 +72,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_stack_uninitialize(VOID) diff --git a/common/core/src/ux_hcd_sim_host_initialize.c b/common/core/src/ux_hcd_sim_host_initialize.c index 65a3947c..cc895c0d 100644 --- a/common/core/src/ux_hcd_sim_host_initialize.c +++ b/common/core/src/ux_hcd_sim_host_initialize.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Host Simulator Controller Driver */ /** */ @@ -30,43 +30,43 @@ #include "ux_dcd_sim_slave.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_hcd_sim_host_initialize PORTABLE C */ -/* 6.1.10 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_hcd_sim_host_initialize PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function initializes the simulated host controller */ -/* */ -/* INPUT */ -/* */ -/* HCD Pointer to HCD */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ -/* _ux_hcd_sim_host_periodic_tree_create Create periodic tree */ -/* _ux_utility_memory_allocate Allocate memory block */ -/* _ux_utility_semaphore_put Semaphore put */ -/* _ux_utility_timer_create Create timer */ -/* */ -/* CALLED BY */ -/* */ +/* */ +/* This function initializes the simulated host controller */ +/* */ +/* INPUT */ +/* */ +/* HCD Pointer to HCD */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ +/* _ux_hcd_sim_host_periodic_tree_create Create periodic tree */ +/* _ux_utility_memory_allocate Allocate memory block */ +/* _ux_utility_semaphore_put Semaphore put */ +/* _ux_utility_timer_create Create timer */ +/* */ +/* CALLED BY */ +/* */ /* Host Simulator Controller Driver */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* optimized based on compile */ @@ -81,6 +81,9 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* refined memory management, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_initialize(UX_HCD *hcd) @@ -89,12 +92,12 @@ UINT _ux_hcd_sim_host_initialize(UX_HCD *hcd) UX_SLAVE_DCD *dcd; UX_DCD_SIM_SLAVE *dcd_sim_slave; UX_HCD_SIM_HOST *hcd_sim_host; -UINT status; +UINT status = UX_ERROR; /* The controller initialized here is of host simulator type. */ hcd -> ux_hcd_controller_type = UX_HCD_SIM_HOST_CONTROLLER; - + /* Allocate memory for this host simulator HCD instance. */ hcd_sim_host = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, sizeof(UX_HCD_SIM_HOST)); if (hcd_sim_host == UX_NULL) @@ -119,14 +122,17 @@ UINT status; hcd -> ux_hcd_status = UX_HCD_STATUS_HALTED; /* Allocate the list of EDs. All EDs are allocated on 16 byte memory boundary. */ - hcd_sim_host -> ux_hcd_sim_host_ed_list = _ux_utility_memory_allocate(UX_ALIGN_16, UX_REGULAR_MEMORY, (ULONG)sizeof(UX_HCD_SIM_HOST_ED) * _ux_system_host -> ux_system_host_max_ed); - if (hcd_sim_host -> ux_hcd_sim_host_ed_list == UX_NULL) - status = UX_MEMORY_INSUFFICIENT; - else - status = UX_SUCCESS; + if (_ux_system_host -> ux_system_host_max_ed != 0) + { + hcd_sim_host -> ux_hcd_sim_host_ed_list = _ux_utility_memory_allocate(UX_ALIGN_16, UX_REGULAR_MEMORY, (ULONG)sizeof(UX_HCD_SIM_HOST_ED) * _ux_system_host -> ux_system_host_max_ed); + if (hcd_sim_host -> ux_hcd_sim_host_ed_list == UX_NULL) + status = UX_MEMORY_INSUFFICIENT; + else + status = UX_SUCCESS; + } /* Allocate the list of TDs. All TDs are allocated on 32 byte memory boundary. */ - if (status == UX_SUCCESS) + if ((status == UX_SUCCESS) && (_ux_system_host -> ux_system_host_max_td != 0)) { hcd_sim_host -> ux_hcd_sim_host_td_list = _ux_utility_memory_allocate(UX_ALIGN_32, UX_REGULAR_MEMORY, (ULONG)sizeof(UX_HCD_SIM_HOST_TD) * _ux_system_host -> ux_system_host_max_td); if (hcd_sim_host -> ux_hcd_sim_host_td_list == UX_NULL) @@ -134,7 +140,7 @@ UINT status; } /* Allocate the list of isochronous TDs. All TDs are allocated on 32 byte memory boundary. */ - if (status == UX_SUCCESS) + if ((status == UX_SUCCESS) && (_ux_system_host -> ux_system_host_max_iso_td != 0)) { hcd_sim_host -> ux_hcd_sim_host_iso_td_list = _ux_utility_memory_allocate(UX_ALIGN_32, UX_REGULAR_MEMORY, (ULONG)sizeof(UX_HCD_SIM_HOST_ISO_TD) * _ux_system_host -> ux_system_host_max_iso_td); if (hcd_sim_host -> ux_hcd_sim_host_iso_td_list == UX_NULL) @@ -156,7 +162,7 @@ UINT status; /* The periodic scheduler is not active. */ hcd_sim_host -> ux_hcd_sim_host_periodic_scheduler_active = 0; - + /* We start a timer that will invoke the simulator every timer tick. */ status = _ux_host_timer_create(&hcd_sim_host -> ux_hcd_sim_host_timer, "USBX Simulation Timer", _ux_hcd_sim_host_timer_function, (ULONG) (ALIGN_TYPE) hcd_sim_host, 1, 1, UX_AUTO_ACTIVATE); @@ -197,7 +203,7 @@ UINT status; } } - /* Get the number of ports on the controller. The number of ports needs to be reflected both + /* Get the number of ports on the controller. The number of ports needs to be reflected both for the generic HCD container and the local sim_host container. In the simulator, the number of ports is hardwired to 1 only. */ hcd -> ux_hcd_nb_root_hubs = 1; diff --git a/common/core/src/ux_hcd_sim_host_uninitialize.c b/common/core/src/ux_hcd_sim_host_uninitialize.c index bfd8a480..234c595e 100644 --- a/common/core/src/ux_hcd_sim_host_uninitialize.c +++ b/common/core/src/ux_hcd_sim_host_uninitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_sim_host_uninitialize PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* refined memory management, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_sim_host_uninitialize(UX_HCD_SIM_HOST *hcd_sim_host) @@ -115,9 +118,14 @@ UINT td_index; #endif /* Free TD/ED memories. */ - _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_iso_td_list); - _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_td_list); - _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_ed_list); + if (hcd_sim_host -> ux_hcd_sim_host_iso_td_list) + _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_iso_td_list); + + if (hcd_sim_host -> ux_hcd_sim_host_td_list) + _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_td_list); + + if (hcd_sim_host -> ux_hcd_sim_host_ed_list) + _ux_utility_memory_free(hcd_sim_host -> ux_hcd_sim_host_ed_list); /* Free simulated host controller memory. */ _ux_utility_memory_free(hcd_sim_host); diff --git a/common/core/src/ux_host_stack_class_get.c b/common/core/src/ux_host_stack_class_get.c index 9f52c224..2654670c 100644 --- a/common/core/src/ux_host_stack_class_get.c +++ b/common/core/src/ux_host_stack_class_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_class_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,8 +78,8 @@ /* optimized based on compile */ /* definitions, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class) @@ -145,7 +145,7 @@ ULONG class_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_class_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -175,7 +175,7 @@ ULONG class_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_class_get(UCHAR *class_name, UX_HOST_CLASS **host_class) diff --git a/common/core/src/ux_host_stack_class_instance_get.c b/common/core/src/ux_host_stack_class_instance_get.c index fbdf2a0a..8a19038b 100644 --- a/common/core/src/ux_host_stack_class_instance_get.c +++ b/common/core/src/ux_host_stack_class_instance_get.c @@ -119,7 +119,7 @@ VOID **current_class_instance; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_class_instance_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -151,7 +151,7 @@ VOID **current_class_instance; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_class_instance_get(UX_HOST_CLASS *host_class, UINT class_index, VOID **class_instance) diff --git a/common/core/src/ux_host_stack_class_register.c b/common/core/src/ux_host_stack_class_register.c index fdbb0346..376a0d20 100644 --- a/common/core/src/ux_host_stack_class_register.c +++ b/common/core/src/ux_host_stack_class_register.c @@ -180,7 +180,7 @@ ULONG class_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_class_register PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -211,7 +211,7 @@ ULONG class_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_class_register(UCHAR *class_name, diff --git a/common/core/src/ux_host_stack_configuration_interface_get.c b/common/core/src/ux_host_stack_configuration_interface_get.c index b18444e0..679cc75e 100644 --- a/common/core/src/ux_host_stack_configuration_interface_get.c +++ b/common/core/src/ux_host_stack_configuration_interface_get.c @@ -193,7 +193,7 @@ UX_INTERFACE *current_interface; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_configuration_interface_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -227,7 +227,7 @@ UX_INTERFACE *current_interface; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_configuration_interface_get(UX_CONFIGURATION *configuration, diff --git a/common/core/src/ux_host_stack_device_configuration_activate.c b/common/core/src/ux_host_stack_device_configuration_activate.c index 06b4fd8e..3665d345 100644 --- a/common/core/src/ux_host_stack_device_configuration_activate.c +++ b/common/core/src/ux_host_stack_device_configuration_activate.c @@ -191,7 +191,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_device_configuration_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -222,7 +222,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_device_configuration_activate(UX_CONFIGURATION *configuration) diff --git a/common/core/src/ux_host_stack_device_configuration_deactivate.c b/common/core/src/ux_host_stack_device_configuration_deactivate.c index 69198bd1..5d35776f 100644 --- a/common/core/src/ux_host_stack_device_configuration_deactivate.c +++ b/common/core/src/ux_host_stack_device_configuration_deactivate.c @@ -200,7 +200,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_device_configuration_deactivate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -231,7 +231,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_device_configuration_deactivate(UX_DEVICE *device) diff --git a/common/core/src/ux_host_stack_device_configuration_get.c b/common/core/src/ux_host_stack_device_configuration_get.c index cb476002..5feb9f60 100644 --- a/common/core/src/ux_host_stack_device_configuration_get.c +++ b/common/core/src/ux_host_stack_device_configuration_get.c @@ -140,7 +140,7 @@ UX_CONFIGURATION *current_configuration; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_device_configuration_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -173,7 +173,7 @@ UX_CONFIGURATION *current_configuration; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_device_configuration_get(UX_DEVICE *device, UINT configuration_index, diff --git a/common/core/src/ux_host_stack_device_get.c b/common/core/src/ux_host_stack_device_get.c index de20f999..3ddb9d74 100644 --- a/common/core/src/ux_host_stack_device_get.c +++ b/common/core/src/ux_host_stack_device_get.c @@ -155,7 +155,7 @@ ULONG current_device_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_device_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -185,7 +185,7 @@ ULONG current_device_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_device_get(ULONG device_index, UX_DEVICE **device) diff --git a/common/core/src/ux_host_stack_device_string_get.c b/common/core/src/ux_host_stack_device_string_get.c index 2c44a310..db84f267 100644 --- a/common/core/src/ux_host_stack_device_string_get.c +++ b/common/core/src/ux_host_stack_device_string_get.c @@ -154,7 +154,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_device_string_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -190,7 +190,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_device_string_get(UX_DEVICE *device, UCHAR *descriptor_buffer, ULONG length, ULONG language_id, ULONG string_index) diff --git a/common/core/src/ux_host_stack_endpoint_transfer_abort.c b/common/core/src/ux_host_stack_endpoint_transfer_abort.c index fdef80ba..b212a8c9 100644 --- a/common/core/src/ux_host_stack_endpoint_transfer_abort.c +++ b/common/core/src/ux_host_stack_endpoint_transfer_abort.c @@ -98,7 +98,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_endpoint_transfer_abort PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -129,7 +129,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_endpoint_transfer_abort(UX_ENDPOINT *endpoint) diff --git a/common/core/src/ux_host_stack_hcd_register.c b/common/core/src/ux_host_stack_hcd_register.c index cd9f8687..2816e00c 100644 --- a/common/core/src/ux_host_stack_hcd_register.c +++ b/common/core/src/ux_host_stack_hcd_register.c @@ -163,7 +163,7 @@ ULONG hcd_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_hcd_register PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -193,7 +193,7 @@ ULONG hcd_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_hcd_register(UCHAR *hcd_name, diff --git a/common/core/src/ux_host_stack_hcd_unregister.c b/common/core/src/ux_host_stack_hcd_unregister.c index 9baed92e..08bb43f1 100644 --- a/common/core/src/ux_host_stack_hcd_unregister.c +++ b/common/core/src/ux_host_stack_hcd_unregister.c @@ -202,7 +202,7 @@ UINT hcd_name_length = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_hcd_unregister PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -234,7 +234,7 @@ UINT hcd_name_length = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_hcd_unregister(UCHAR *hcd_name, diff --git a/common/core/src/ux_host_stack_interface_endpoint_get.c b/common/core/src/ux_host_stack_interface_endpoint_get.c index 9bec7025..bf098ad8 100644 --- a/common/core/src/ux_host_stack_interface_endpoint_get.c +++ b/common/core/src/ux_host_stack_interface_endpoint_get.c @@ -142,7 +142,7 @@ UX_ENDPOINT *current_endpoint; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_interface_endpoint_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -174,7 +174,7 @@ UX_ENDPOINT *current_endpoint; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_interface_endpoint_get(UX_INTERFACE *interface_ptr, UINT endpoint_index, UX_ENDPOINT **endpoint) diff --git a/common/core/src/ux_host_stack_interface_setting_select.c b/common/core/src/ux_host_stack_interface_setting_select.c index fd96be92..5b634bac 100644 --- a/common/core/src/ux_host_stack_interface_setting_select.c +++ b/common/core/src/ux_host_stack_interface_setting_select.c @@ -221,7 +221,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_interface_setting_select PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -252,7 +252,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_interface_setting_select(UX_INTERFACE *interface_ptr) diff --git a/common/core/src/ux_host_stack_tasks_run.c b/common/core/src/ux_host_stack_tasks_run.c index 6363268b..ed893aa2 100644 --- a/common/core/src/ux_host_stack_tasks_run.c +++ b/common/core/src/ux_host_stack_tasks_run.c @@ -44,7 +44,7 @@ static inline VOID _ux_host_stack_pending_transfers_run(VOID); /* FUNCTION RELEASE */ /* */ /* _ux_host_stack_tasks_run PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -110,6 +110,9 @@ static inline VOID _ux_host_stack_pending_transfers_run(VOID); /* fixed activation issue on */ /* no class linked interfaces, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved enum transfer, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_stack_tasks_run(VOID) @@ -200,8 +203,8 @@ static inline VOID _ux_host_stack_enum_address_sent(UX_DEVICE *device) { /* Address (request wValue) applied to device. */ - device -> ux_device_address = - device -> ux_device_enum_trans -> ux_transfer_request_value; + device -> ux_device_address = device -> ux_device_control_endpoint. + ux_endpoint_transfer_request.ux_transfer_request_value & 0x7F; device -> ux_device_state = UX_DEVICE_ADDRESSED; /* Unlock enumeration. */ @@ -625,7 +628,7 @@ INT immediate_state = UX_TRUE; case UX_HOST_STACK_ENUM_DEVICE_ADDR_SENT: /* Transfer error check. */ - trans = device -> ux_device_enum_trans; + trans = &device -> ux_device_control_endpoint.ux_endpoint_transfer_request; if (trans -> ux_transfer_request_completion_code != UX_SUCCESS) { device -> ux_device_enum_state = UX_HOST_STACK_ENUM_RETRY; @@ -659,7 +662,7 @@ INT immediate_state = UX_TRUE; case UX_HOST_STACK_ENUM_DEVICE_DESCR_PARSE: /* Transfer error check. */ - trans = device -> ux_device_enum_trans; + trans = &device -> ux_device_control_endpoint.ux_endpoint_transfer_request; buffer = trans -> ux_transfer_request_data_pointer; if (UX_HOST_STACK_ENUM_TRANS_ERROR(trans)) { @@ -707,6 +710,7 @@ INT immediate_state = UX_TRUE; trans -> ux_transfer_request_requested_length = UX_DEVICE_DESCRIPTOR_LENGTH; /* Issue GetDescriptor(Device) again and parse it. */ + device -> ux_device_enum_trans = trans; UX_TRANSFER_STATE_RESET(trans); device -> ux_device_enum_state = UX_HOST_STACK_ENUM_TRANS_WAIT; device -> ux_device_enum_next_state = UX_HOST_STACK_ENUM_DEVICE_DESCR_PARSE; @@ -744,7 +748,7 @@ INT immediate_state = UX_TRUE; case UX_HOST_STACK_ENUM_CONFIG_DESCR_PARSE: /* Transfer error check. */ - trans = device -> ux_device_enum_trans; + trans = &device -> ux_device_control_endpoint.ux_endpoint_transfer_request; buffer = trans -> ux_transfer_request_data_pointer; if (UX_HOST_STACK_ENUM_TRANS_ERROR(trans)) { @@ -792,6 +796,7 @@ INT immediate_state = UX_TRUE; configuration -> ux_configuration_descriptor.wTotalLength; /* Start transfer again. */ + device -> ux_device_enum_trans = trans; UX_TRANSFER_STATE_RESET(device -> ux_device_enum_trans); device -> ux_device_enum_state = UX_HOST_STACK_ENUM_TRANS_WAIT; device -> ux_device_enum_next_state = UX_HOST_STACK_ENUM_CONFIG_DESCR_PARSE; @@ -866,7 +871,7 @@ INT immediate_state = UX_TRUE; continue; case UX_HOST_STACK_ENUM_CONFIG_ACTIVATE: - trans = device -> ux_device_enum_trans; + trans = &device -> ux_device_control_endpoint.ux_endpoint_transfer_request; if (UX_HOST_STACK_ENUM_TRANS_ERROR(trans)) { device -> ux_device_enum_state = UX_HOST_STACK_ENUM_RETRY; @@ -960,6 +965,7 @@ INT immediate_state = UX_TRUE; /* Transfer done - next state. */ if (status == UX_STATE_NEXT || status == UX_STATE_IDLE) { + device -> ux_device_enum_trans = UX_NULL; device -> ux_device_enum_state = device -> ux_device_enum_next_state; continue; } @@ -979,6 +985,7 @@ INT immediate_state = UX_TRUE; _ux_utility_memory_free(device -> ux_device_enum_inst.ptr); device -> ux_device_enum_inst.ptr = UX_NULL; } + device -> ux_device_enum_trans = UX_NULL; device -> ux_device_enum_state = UX_HOST_STACK_ENUM_FAIL; continue; } @@ -996,6 +1003,7 @@ INT immediate_state = UX_TRUE; _ux_utility_memory_free(device -> ux_device_enum_inst.ptr); device -> ux_device_enum_inst.ptr = UX_NULL; } + device -> ux_device_enum_trans = UX_NULL; device -> ux_device_enum_state = UX_HOST_STACK_ENUM_RETRY; continue; } diff --git a/common/core/src/ux_host_stack_transfer_request.c b/common/core/src/ux_host_stack_transfer_request.c index 876f5284..71c3ae71 100644 --- a/common/core/src/ux_host_stack_transfer_request.c +++ b/common/core/src/ux_host_stack_transfer_request.c @@ -224,7 +224,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_transfer_request PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -253,7 +253,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_transfer_request(UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_host_stack_transfer_request_abort.c b/common/core/src/ux_host_stack_transfer_request_abort.c index ea84afd3..aee4078b 100644 --- a/common/core/src/ux_host_stack_transfer_request_abort.c +++ b/common/core/src/ux_host_stack_transfer_request_abort.c @@ -153,7 +153,7 @@ ULONG completion_code; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_transfer_request_abort PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -183,7 +183,7 @@ ULONG completion_code; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_transfer_request_abort(UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_host_stack_transfer_run.c b/common/core/src/ux_host_stack_transfer_run.c index c9478dbd..6308fc74 100644 --- a/common/core/src/ux_host_stack_transfer_run.c +++ b/common/core/src/ux_host_stack_transfer_run.c @@ -300,7 +300,7 @@ UX_TRANSFER *previous; /* FUNCTION RELEASE */ /* */ /* _uxe_host_stack_transfer_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -329,7 +329,7 @@ UX_TRANSFER *previous; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_stack_transfer_run(UX_TRANSFER *transfer_request) diff --git a/common/core/src/ux_system_initialize.c b/common/core/src/ux_system_initialize.c index 06fc65e9..a8fe4fd8 100644 --- a/common/core/src/ux_system_initialize.c +++ b/common/core/src/ux_system_initialize.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** System */ /** */ @@ -64,46 +64,46 @@ UCHAR _ux_system_usb_2_0_extension_descriptor_structure[] = {1,1 UCHAR _ux_system_container_id_descriptor_structure[] = {1,1,1,1,4,4,4,4}; -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_system_initialize PORTABLE C */ -/* 6.x */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_system_initialize PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function initializes the various control data structures for */ -/* the USBX system. */ -/* */ -/* INPUT */ -/* */ +/* */ +/* This function initializes the various control data structures for */ +/* the USBX system. */ +/* */ +/* INPUT */ +/* */ /* regular_memory_pool_start Start of non cached memory pool */ -/* regular_memory_size Size of non cached memory pool */ +/* regular_memory_size Size of non cached memory pool */ /* cache_safe_memory_pool_start Start of cached memory pool */ -/* cache_safe_memory_size Size of cached memory pool */ -/* */ -/* OUTPUT */ -/* */ +/* cache_safe_memory_size Size of cached memory pool */ +/* */ +/* OUTPUT */ +/* */ /* None */ -/* */ -/* CALLS */ -/* */ +/* */ +/* CALLS */ +/* */ /* _ux_utility_memory_allocate Allocate memory */ -/* _ux_utility_memory_set Set memory */ +/* _ux_utility_memory_set Set memory */ /* _ux_utility_mutex_create Create mutex */ -/* */ -/* CALLED BY */ -/* */ -/* Application */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* Application */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* verified memset and memcpy */ @@ -115,24 +115,28 @@ UCHAR _ux_system_container_id_descriptor_structure[] = {1,1 /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* refined memory management, */ /* added UX_ASSERT check for */ /* STD descriptor parse size, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ -UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, +UINT _ux_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size) { - -UX_MEMORY_BLOCK *memory_block; ALIGN_TYPE int_memory_pool_start; VOID *regular_memory_pool_end; +VOID *cache_safe_memory_pool_end; ULONG memory_pool_offset; #if !defined(UX_STANDALONE) UINT status; #endif +ULONG pool_size; + /* Check if the regular memory pool is valid. */ + if ((regular_memory_pool_start == UX_NULL) || (regular_memory_size == 0)) + return(UX_INVALID_PARAMETER); /* Reset memory block */ _ux_utility_memory_set(regular_memory_pool_start, 0, regular_memory_size); /* Use case of memset is verified. */ @@ -150,8 +154,8 @@ UINT status; /* Add to the memory offset the size of the allocated block. */ memory_pool_offset += (ULONG)sizeof(UX_SYSTEM_HOST); - -#endif + +#endif #ifndef UX_HOST_SIDE_ONLY @@ -160,8 +164,8 @@ UINT status; /* Add to the memory offset the size of the allocated block. */ memory_pool_offset += (ULONG)sizeof(UX_SYSTEM_SLAVE); - -#endif + +#endif #ifdef UX_OTG_SUPPORT @@ -171,18 +175,36 @@ UINT status; /* Add to the memory offset the size of the allocated block. */ memory_pool_offset += (ULONG)sizeof(UX_SYSTEM_OTG); -#endif +#endif + /* Set the regular memory pool structure. */ + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] = (UX_MEMORY_BYTE_POOL *) (((UCHAR *) regular_memory_pool_start) + memory_pool_offset); + + /* Add to the memory offset the size of the allocated block. */ + memory_pool_offset += (ULONG)sizeof(UX_MEMORY_BYTE_POOL); + + /* Check if the cache save memory pool is valid. */ + if ((cache_safe_memory_pool_start != UX_NULL) && (cache_safe_memory_size != 0)) + { - /* Set the cache safe memory for the dynamic pool */ - _ux_system -> ux_system_regular_memory_pool_start = (UX_MEMORY_BLOCK *) (((UCHAR *) regular_memory_pool_start) - + memory_pool_offset); + /* Set the cache safe memory pool structure. */ + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] = (UX_MEMORY_BYTE_POOL *) (((UCHAR *) regular_memory_pool_start) + memory_pool_offset); + + /* Add to the memory offset the size of the allocated block. */ + memory_pool_offset += (ULONG)sizeof(UX_MEMORY_BYTE_POOL); + } + else + { + + /* Set the cache safe memory pool structure to regular pool. */ + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] = _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR]; + } /* Make sure the regular memory pool is aligned properly */ - int_memory_pool_start = (ALIGN_TYPE) _ux_system -> ux_system_regular_memory_pool_start; - int_memory_pool_start += UX_ALIGN_MIN; - int_memory_pool_start &= ~((ALIGN_TYPE)UX_ALIGN_MIN); - + int_memory_pool_start = (ALIGN_TYPE) (((UCHAR *) regular_memory_pool_start) + memory_pool_offset); + int_memory_pool_start += UX_ALIGN_MIN; + int_memory_pool_start &= ~((ALIGN_TYPE)UX_ALIGN_MIN); + /* Set the end of the regular memory pool. */ regular_memory_pool_end = (void *) (((UCHAR *) regular_memory_pool_start) + regular_memory_size); @@ -194,53 +216,48 @@ UINT status; return(UX_MEMORY_INSUFFICIENT); } - /* Now, we have a project structure allocated, save the regular memory allocation details */ - _ux_system -> ux_system_regular_memory_pool_size = (ULONG) (((ALIGN_TYPE) regular_memory_pool_end) - int_memory_pool_start); - _ux_system -> ux_system_regular_memory_pool_free = _ux_system -> ux_system_regular_memory_pool_size; - _ux_system -> ux_system_regular_memory_pool_start = (UX_MEMORY_BLOCK *) int_memory_pool_start; + /* get the regular memory pool size. */ + pool_size = (ULONG) (((ALIGN_TYPE) regular_memory_pool_end) - int_memory_pool_start); - /* Build the first free memory block */ - memory_block = _ux_system -> ux_system_regular_memory_pool_start; - memory_block -> ux_memory_block_size = _ux_system -> ux_system_regular_memory_pool_size - (ULONG)sizeof(UX_MEMORY_BLOCK); - memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; + /* Create the regular memory pool. */ + _ux_utility_memory_byte_pool_create(_ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR], + (UX_MEMORY_BYTE_POOL *)int_memory_pool_start, + pool_size); /* Check the definition of the cache safe pool. If the application or controller do not require any cache safe memory, define the cached safe memory region as the regular memory region. */ - if (cache_safe_memory_pool_start == UX_NULL) + if ((cache_safe_memory_pool_start != UX_NULL) && (cache_safe_memory_size != 0)) { - /* Cache safe memory is the same as regular memory. */ - _ux_system -> ux_system_cache_safe_memory_pool_size = _ux_system -> ux_system_regular_memory_pool_size; - _ux_system -> ux_system_cache_safe_memory_pool_free = _ux_system -> ux_system_regular_memory_pool_free; - _ux_system -> ux_system_cache_safe_memory_pool_start = _ux_system -> ux_system_regular_memory_pool_start; - } - else - { - + /* Reset this memory block */ + _ux_utility_memory_set(cache_safe_memory_pool_start, 0, cache_safe_memory_size); /* Use case of memset is verified. */ + /* Make sure the cache safe memory pool is aligned properly */ int_memory_pool_start = (ALIGN_TYPE) cache_safe_memory_pool_start; int_memory_pool_start += UX_ALIGN_MIN; int_memory_pool_start &= ~((ALIGN_TYPE)UX_ALIGN_MIN); - - /* Save the cache safe memory allocation details */ - _ux_system -> ux_system_cache_safe_memory_pool_size = cache_safe_memory_size - UX_ALIGN_MIN; - _ux_system -> ux_system_cache_safe_memory_pool_free = _ux_system -> ux_system_cache_safe_memory_pool_size; - _ux_system -> ux_system_cache_safe_memory_pool_start = (UX_MEMORY_BLOCK *) int_memory_pool_start; - - /* Reset this memory block */ - _ux_utility_memory_set(_ux_system -> ux_system_cache_safe_memory_pool_start, 0, _ux_system -> ux_system_cache_safe_memory_pool_size); /* Use case of memset is verified. */ - - /* Build the first free memory block */ - memory_block = _ux_system -> ux_system_cache_safe_memory_pool_start; - memory_block -> ux_memory_block_size = _ux_system -> ux_system_cache_safe_memory_pool_size - (ULONG)sizeof(UX_MEMORY_BLOCK); - memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; + + cache_safe_memory_pool_end = (void *) (((UCHAR *) cache_safe_memory_pool_start) + cache_safe_memory_size); + + /* Check if we have memory available. */ + if (int_memory_pool_start >= (ALIGN_TYPE) cache_safe_memory_pool_end) + { + + /* No memory available. */ + return(UX_MEMORY_INSUFFICIENT); + } + + pool_size = (ULONG) (((ALIGN_TYPE) cache_safe_memory_pool_end) - int_memory_pool_start); + + _ux_utility_memory_byte_pool_create(_ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE], + (UX_MEMORY_BYTE_POOL *)int_memory_pool_start, pool_size); } #ifdef UX_ENABLE_MEMORY_STATISTICS - _ux_system -> ux_system_regular_memory_pool_base = (UCHAR *) _ux_system -> ux_system_regular_memory_pool_start; - _ux_system -> ux_system_regular_memory_pool_min_free = _ux_system -> ux_system_regular_memory_pool_free; - _ux_system -> ux_system_cache_safe_memory_pool_base = (UCHAR *) _ux_system -> ux_system_cache_safe_memory_pool_start; - _ux_system -> ux_system_cache_safe_memory_pool_min_free = _ux_system -> ux_system_cache_safe_memory_pool_free; + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_min_free = + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_available; + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] -> ux_byte_pool_min_free = + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] -> ux_byte_pool_available; /* Other fields are kept zero. */ #endif @@ -255,10 +272,10 @@ UINT status; /* Setup the head and tail pointers. */ _ux_system -> ux_system_debug_log_head = _ux_system -> ux_system_debug_log_buffer; _ux_system -> ux_system_debug_log_tail = _ux_system -> ux_system_debug_log_buffer; - + /* Keep the size in system structure variable. */ _ux_system -> ux_system_debug_log_size = UX_DEBUG_LOG_SIZE; - + #endif #if !defined(UX_STANDALONE) @@ -278,7 +295,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_system_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -310,10 +327,10 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ -UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, +UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memory_size, VOID *cache_safe_memory_pool_start, ULONG cache_safe_memory_size) { @@ -333,8 +350,8 @@ UINT _uxe_system_initialize(VOID *regular_memory_pool_start, ULONG regular_memo /* Sanity check. */ if ((regular_memory_pool_start == UX_NULL) || (regular_memory_size == 0)) return(UX_INVALID_PARAMETER); - + /* Invoke system initialization function. */ - return(_ux_system_initialize(regular_memory_pool_start, regular_memory_size, + return(_ux_system_initialize(regular_memory_pool_start, regular_memory_size, cache_safe_memory_pool_start, cache_safe_memory_size)); } diff --git a/common/core/src/ux_utility_descriptor_pack.c b/common/core/src/ux_utility_descriptor_pack.c index bc85c554..292d8de0 100644 --- a/common/core/src/ux_utility_descriptor_pack.c +++ b/common/core/src/ux_utility_descriptor_pack.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_descriptor_pack PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_utility_descriptor_pack(UCHAR * descriptor, UCHAR * descriptor_structure, diff --git a/common/core/src/ux_utility_descriptor_parse.c b/common/core/src/ux_utility_descriptor_parse.c index 86bbd85e..827db24a 100644 --- a/common/core/src/ux_utility_descriptor_parse.c +++ b/common/core/src/ux_utility_descriptor_parse.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_utility_descriptor_parse PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_structure, @@ -133,7 +133,7 @@ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_st /* FUNCTION RELEASE */ /* */ /* _ux_utility_descriptor_parse_size PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -165,7 +165,7 @@ VOID _ux_utility_descriptor_parse(UCHAR * raw_descriptor, UCHAR * descriptor_st /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ ULONG _ux_utility_descriptor_parse_size(UCHAR * descriptor_structure, UINT descriptor_entries, UINT size_align_mask) diff --git a/common/core/src/ux_utility_memory_allocate.c b/common/core/src/ux_utility_memory_allocate.c index 547b03d2..37a46bf1 100644 --- a/common/core/src/ux_utility_memory_allocate.c +++ b/common/core/src/ux_utility_memory_allocate.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Utility */ /** */ @@ -27,45 +27,44 @@ #include "ux_api.h" - -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_utility_memory_allocate PORTABLE C */ -/* 6.x */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_memory_allocate PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function allocates a block of memory for the specified size */ +/* */ +/* This function allocates a block of memory for the specified size */ /* and alignment. */ -/* */ -/* INPUT */ -/* */ -/* memory_alignment Memory alignment required */ -/* memory_cache_flag Memory pool source */ -/* memory_size_requested Number of bytes required */ -/* */ -/* OUTPUT */ -/* */ -/* Pointer to block of memory */ -/* */ -/* CALLS */ -/* */ -/* _ux_utility_memory_free_block_best_get Get best fit block of memory */ -/* _ux_utility_memory_set Set block of memory */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* INPUT */ +/* */ +/* memory_alignment Memory alignment required */ +/* memory_cache_flag Memory pool source */ +/* memory_size_requested Number of bytes required */ +/* */ +/* OUTPUT */ +/* */ +/* Pointer to block of memory */ +/* */ +/* CALLS */ +/* */ +/* _ux_utility_memory_free_block_best_get Get best fit block of memory */ +/* _ux_utility_memory_set Set block of memory */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* verified memset and memcpy */ @@ -77,24 +76,54 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* refined memory management, */ /* fixed issue in 64-bit env, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID *_ux_utility_memory_allocate(ULONG memory_alignment, ULONG memory_cache_flag, ULONG memory_size_requested) { +UX_MEMORY_BYTE_POOL *pool_ptr; +UCHAR *current_ptr; +UCHAR *work_ptr; +UCHAR *next_ptr; +ALIGN_TYPE *free_ptr; +UCHAR **this_block_link_ptr; +UCHAR **next_block_link_ptr; +ULONG available_bytes; -UX_MEMORY_BLOCK *memory_block; -UX_MEMORY_BLOCK *new_memory_block; -UX_MEMORY_BLOCK *leftover_memory_block; -ULONG memory_for_alignment; -ULONG memory_removed_from_pool; -ULONG leftover; -UCHAR *memory_buffer; ALIGN_TYPE int_memory_buffer; +#ifdef UX_ENABLE_MEMORY_STATISTICS +UINT index; +#endif + /* Get the pool ptr */ + if (memory_cache_flag == UX_REGULAR_MEMORY) + { + pool_ptr = _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR]; + } + else if (memory_cache_flag == UX_CACHE_SAFE_MEMORY) + { + pool_ptr = _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE]; + } + else + { + return(UX_NULL); + } + + /* Check if pool_ptr is NX_NULL */ + if (pool_ptr == UX_NULL) + { + return(UX_NULL); + } + + /* Check if the memory size requested is 0. */ + if (memory_size_requested == 0) + { + return(UX_NULL); + } /* Get the mutex as this is a critical section. */ _ux_system_mutex_on(&_ux_system -> ux_system_mutex); @@ -105,99 +134,58 @@ ALIGN_TYPE int_memory_buffer; if (memory_alignment == UX_SAFE_ALIGN) { - /* We will use the memory_size_requested for the alignment. + /* We will use the memory_size_requested for the alignment. But we check to see if we have a minimum or maximum alignment. */ if (memory_size_requested < UX_ALIGN_MIN) - + /* No need to bother about alignment for small packets sizes. */ memory_alignment = UX_NO_ALIGN; - + + /* Check if we are over the maximum. */ + else if (memory_size_requested > UX_MAX_SCATTER_GATHER_ALIGNMENT) + + /* We are over the max alignment required. Use the maximum instead. */ + memory_alignment = UX_MAX_SCATTER_GATHER_ALIGNMENT - 1; + + /* We are not over the maximum, so approximate the alignment according to the size of the memory. + Check range for alignment on 4096 bytes. */ + else if (memory_size_requested >= UX_ALIGN_2048 + 1) + memory_alignment = UX_ALIGN_4096; + + /* Check range for alignment on 2048 bytes. */ + else if (memory_size_requested >= UX_ALIGN_1024 + 1) + memory_alignment = UX_ALIGN_2048; + + /* Check range for alignment on 1024 bytes. */ + else if (memory_size_requested >= UX_ALIGN_512 + 1) + memory_alignment = UX_ALIGN_1024; + + /* Check range for alignment on 512 bytes. */ + else if (memory_size_requested >= UX_ALIGN_256 + 1) + memory_alignment = UX_ALIGN_512; + + /* Check range for alignment on 256 bytes. */ + else if (memory_size_requested >= UX_ALIGN_128 + 1) + memory_alignment = UX_ALIGN_256; + + /* Check range for alignment on 128 bytes. */ + else if (memory_size_requested >= UX_ALIGN_64 + 1) + memory_alignment = UX_ALIGN_128; + + /* Check range for alignment on 64 bytes. */ + else if (memory_size_requested >= UX_ALIGN_32 + 1) + memory_alignment = UX_ALIGN_64; + + /* Check range for alignment on 32 bytes. */ + else if (memory_size_requested >= UX_ALIGN_16 + 1) + memory_alignment = UX_ALIGN_32; + + /* Check range for alignment on 16 bytes. */ + else if (memory_size_requested >= UX_ALIGN_8 + 1) + memory_alignment = UX_ALIGN_16; + else - { - - /* Check if we are over the maximum. */ - if (memory_size_requested > UX_MAX_SCATTER_GATHER_ALIGNMENT) - - /* We are over the max alignment required. Use the maximum instead. */ - memory_alignment = UX_MAX_SCATTER_GATHER_ALIGNMENT - 1; - - else - { - /* We are not over the maximum, so approximate the alignment according to the size of the memory. - Check range for alignment on 4096 bytes. */ - if (memory_size_requested >= UX_ALIGN_2048 + 1) - memory_alignment = UX_ALIGN_4096; - - else - { - - /* Check range for alignment on 2048 bytes. */ - if (memory_size_requested >= UX_ALIGN_1024 + 1) - memory_alignment = UX_ALIGN_2048; - - else - { - - /* Check range for alignment on 1024 bytes. */ - if (memory_size_requested >= UX_ALIGN_512 + 1) - memory_alignment = UX_ALIGN_1024; - - else - { - - /* Check range for alignment on 512 bytes. */ - if (memory_size_requested >= UX_ALIGN_256 + 1) - memory_alignment = UX_ALIGN_512; - - else - { - - /* Check range for alignment on 256 bytes. */ - if (memory_size_requested >= UX_ALIGN_128 + 1) - memory_alignment = UX_ALIGN_256; - - else - { - - /* Check range for alignment on 128 bytes. */ - if (memory_size_requested >= UX_ALIGN_64 + 1) - memory_alignment = UX_ALIGN_128; - - else - { - - /* Check range for alignment on 128 bytes. */ - if (memory_size_requested >= UX_ALIGN_64 + 1) - memory_alignment = UX_ALIGN_128; - - else - { - - /* Check range for alignment on 64 bytes. */ - if (memory_size_requested >= UX_ALIGN_32 + 1) - memory_alignment = UX_ALIGN_64; - - else - { - - /* Check range for alignment on 32 bytes. */ - if (memory_size_requested >= UX_ALIGN_16 + 1) - memory_alignment = UX_ALIGN_32; - - else - memory_alignment = UX_ALIGN_MIN; - - - } - } - } - } - } - } - } - } - } - } + memory_alignment = UX_ALIGN_MIN; } #else @@ -205,204 +193,161 @@ ALIGN_TYPE int_memory_buffer; /* Check if safe alignment requested, in this case switch to UX_NO_ALIGN. */ if (memory_alignment == UX_SAFE_ALIGN) memory_alignment = UX_NO_ALIGN; - + #endif /* Ensure the alignment meats the minimum. */ if (memory_alignment < UX_ALIGN_MIN) memory_alignment = UX_ALIGN_MIN; - /* Adjust the memory alignment since our macros are one minus the desired alignment. - Also determine the amount of extra memory we need for the alignment, which is one - minus the actual alignment. */ - memory_for_alignment = memory_alignment; - memory_alignment++; - - /* We need to make sure that the next memory block buffer is 16-byte aligned too. We - do this by first adjusting the requested memory to be 16-byte aligned. One problem - now is that the memory block might not be a size that is a multiple of 16, so we need - to add the amount of memory required such that the memory buffer after the block has - the correct alignment. For example, if the memory block has a size of 24, then we need - to make sure it is placed on an 8-byte alignment that is after a 16-byte alignment so - that the memory right after the memory block is 16-byte aligned (8 + 24 = 32). */ - memory_size_requested = (memory_size_requested + UX_ALIGN_MIN) & (~(ULONG)UX_ALIGN_MIN); - memory_size_requested += (((ULONG)sizeof(UX_MEMORY_BLOCK) + UX_ALIGN_MIN) & (~(ULONG)UX_ALIGN_MIN)) - (ULONG)sizeof(UX_MEMORY_BLOCK); - - /* Try to find the best block for this memory by requesting the maximum amount of - memory we'll need which is calculated as follows: the amount memory requested by - the caller plus the maximum amount of memory wasted due to alignment plus 2 memory - blocks structs - one for the new memory block we'll create for the user block and one - that we might create if there is extra memory after doing the alignment. */ - memory_block = _ux_utility_memory_free_block_best_get(memory_cache_flag, memory_size_requested + memory_for_alignment + (ULONG)sizeof(UX_MEMORY_BLOCK)); - - /* If the block returned is NULL, there is no free memory in the pool - for that size. */ - if (memory_block == UX_NULL) + /* We need to make sure that the next memory block buffer is 8-byte aligned too. We + do this by first adjusting the requested memory to be 8-byte aligned. One problem + now is that the memory block might not be a size that is a multiple of 8, so we need + to add the amount of memory required such that the memory buffer after the block has + the correct alignment. For example, if the memory block has a size of 12, then we need + to make sure it is placed on an 8-byte alignment that is after a 8-byte alignment so + that the memory right after the memory block is 8-byte aligned (16). */ + memory_size_requested = (memory_size_requested + UX_ALIGN_MIN) & (~(ULONG)UX_ALIGN_MIN); + memory_size_requested += (((ULONG)(UX_MEMORY_BLOCK_HEADER_SIZE + UX_ALIGN_MIN) & (~(ULONG)UX_ALIGN_MIN)) - (ULONG)UX_MEMORY_BLOCK_HEADER_SIZE); + + if (memory_alignment <= UX_ALIGN_MIN) + current_ptr = _ux_utility_memory_byte_pool_search(pool_ptr, memory_size_requested); + else + current_ptr = _ux_utility_memory_byte_pool_search(pool_ptr, memory_size_requested + memory_alignment); + + /* Check if we found a memory block. */ + if (current_ptr == UX_NULL) { - /* Release the protection. */ + /* We could not find a memory block. */ _ux_system_mutex_off(&_ux_system -> ux_system_mutex); - /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_INSUFFICIENT, memory_size_requested, 0, 0, UX_TRACE_ERRORS, 0, 0) /* Error trap. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_UTILITY, UX_MEMORY_INSUFFICIENT); - /* Return NULL to indicate no block was found. */ return(UX_NULL); } + /* Pickup the next block's pointer. */ + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(current_ptr); + next_ptr = *this_block_link_ptr; + + /* Calculate the number of bytes available in this block. */ + available_bytes = UX_UCHAR_POINTER_DIF(next_ptr, current_ptr); + available_bytes = available_bytes - UX_MEMORY_BLOCK_HEADER_SIZE; + /* Get the memory buffer for this block. */ - int_memory_buffer = (ALIGN_TYPE) ((UCHAR *) memory_block + sizeof(UX_MEMORY_BLOCK)); + int_memory_buffer = (ALIGN_TYPE) (UX_UCHAR_POINTER_ADD(current_ptr, UX_MEMORY_BLOCK_HEADER_SIZE)); - /* Are we already aligned? */ - if ((int_memory_buffer & (memory_alignment - 1)) == 0) + /* In case we are not aligned */ + if ((int_memory_buffer & memory_alignment) != 0) { - /* Setup the new memory block. */ - new_memory_block = (UX_MEMORY_BLOCK *) ((UCHAR *) memory_block + sizeof(UX_MEMORY_BLOCK) + memory_size_requested); - new_memory_block -> ux_memory_block_next = memory_block -> ux_memory_block_next; - new_memory_block -> ux_memory_block_previous = memory_block; - new_memory_block -> ux_memory_block_size = memory_block -> ux_memory_block_size - memory_size_requested - (ULONG)sizeof(UX_MEMORY_BLOCK); - new_memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; + /* No, we need to align the memory buffer. */ + int_memory_buffer += (ALIGN_TYPE)UX_MEMORY_BLOCK_HEADER_SIZE; + int_memory_buffer += memory_alignment; + int_memory_buffer &= ~((ALIGN_TYPE) memory_alignment); + int_memory_buffer -= (ALIGN_TYPE)UX_MEMORY_BLOCK_HEADER_SIZE; + + /* Setup the new free block. */ + next_ptr = (UCHAR *)int_memory_buffer; + + /* Setup the new free block. */ + next_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr); + *next_block_link_ptr = *this_block_link_ptr; + work_ptr = UX_UCHAR_POINTER_ADD(next_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(work_ptr); + *free_ptr = UX_BYTE_BLOCK_FREE; + + /* Increase the total fragment counter. */ + pool_ptr -> ux_byte_pool_fragments++; + + /* Update the current pointer to point at the newly created block. */ + *this_block_link_ptr = next_ptr; - /* Update the current memory block. */ - memory_block -> ux_memory_block_size = memory_size_requested; - memory_block -> ux_memory_block_next = new_memory_block; - memory_block -> ux_memory_block_status = UX_MEMORY_USED | memory_cache_flag; + /* Calculate the available bytes. */ + available_bytes -= UX_UCHAR_POINTER_DIF(next_ptr, current_ptr); - /* Declare how much memory we removed from the pool. */ - memory_removed_from_pool = memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); + /* Set Current pointer to the aligned memory buffer. */ + current_ptr = next_ptr; } - else + + /* Now we are aligned, determine if we need to split this block. */ + if ((available_bytes - memory_size_requested) >= ((ULONG) UX_BYTE_BLOCK_MIN)) { - /* Align the buffer. The first thing we do is increment by the size of a - memory block because we have to make sure we have enough memory for at - least that. */ - int_memory_buffer += (ULONG)sizeof(UX_MEMORY_BLOCK); - int_memory_buffer += memory_alignment - 1; - int_memory_buffer &= ~(((ALIGN_TYPE) memory_alignment) - 1); - - /* Setup the new memory block. Note that its size is updated again later. */ - new_memory_block = (UX_MEMORY_BLOCK *) (int_memory_buffer - (ULONG)sizeof(UX_MEMORY_BLOCK)); - new_memory_block -> ux_memory_block_previous = memory_block; - new_memory_block -> ux_memory_block_next = memory_block -> ux_memory_block_next; - new_memory_block -> ux_memory_block_size = memory_block -> ux_memory_block_size; - new_memory_block -> ux_memory_block_status = UX_MEMORY_USED | memory_cache_flag; - - /* Update the current memory block. */ - int_memory_buffer = (ALIGN_TYPE) ((UCHAR *) memory_block + sizeof(UX_MEMORY_BLOCK)); - memory_block -> ux_memory_block_next = new_memory_block; - memory_block -> ux_memory_block_size = (ULONG) ((ALIGN_TYPE) new_memory_block - int_memory_buffer); - - /* Update the new memory block's size. */ - new_memory_block -> ux_memory_block_size -= (memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK)); - - /* Calculate how much memory is leftover in the new memory block after doing - the alignment. */ - leftover = new_memory_block -> ux_memory_block_size - memory_size_requested; - - /* Can we fit another block after the new block? */ - if (leftover > sizeof(UX_MEMORY_BLOCK)) - { - - /* Setup the leftover memory block. */ - leftover_memory_block = (UX_MEMORY_BLOCK *) (((ALIGN_TYPE) new_memory_block + sizeof(UX_MEMORY_BLOCK) + memory_size_requested)); - leftover_memory_block -> ux_memory_block_next = new_memory_block -> ux_memory_block_next; - leftover_memory_block -> ux_memory_block_previous = new_memory_block; - leftover_memory_block -> ux_memory_block_size = leftover - (ULONG)sizeof(UX_MEMORY_BLOCK); - leftover_memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; - - new_memory_block -> ux_memory_block_next = leftover_memory_block; - new_memory_block -> ux_memory_block_size -= leftover; - } - - /* Declare how much memory we removed from the pool. */ - memory_removed_from_pool = new_memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); - - /* The new memory block is the one we give to the user. */ - memory_block = new_memory_block; - } + /* Split the block. */ + next_ptr = UX_UCHAR_POINTER_ADD(current_ptr, (memory_size_requested + UX_MEMORY_BLOCK_HEADER_SIZE)); - /* The memory to be returned is after the block header. */ - memory_buffer = ((UCHAR *) memory_block) + sizeof(UX_MEMORY_BLOCK); + /* Setup the new free block. */ + next_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr); + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(current_ptr); + *next_block_link_ptr = *this_block_link_ptr; + work_ptr = UX_UCHAR_POINTER_ADD(next_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(work_ptr); + *free_ptr = UX_BYTE_BLOCK_FREE; - /* Clear the memory block. */ - _ux_utility_memory_set(memory_buffer, 0, memory_size_requested); /* Use case of memset is verified. */ + /* Increase the total fragment counter. */ + pool_ptr -> ux_byte_pool_fragments++; - /* Update the memory free in the pool. */ - if (_ux_system -> ux_system_cache_safe_memory_pool_start == _ux_system -> ux_system_regular_memory_pool_start) - { + /* Update the current pointer to point at the newly created block. */ + *this_block_link_ptr = next_ptr; - /* There is only one memory pool. */ - _ux_system -> ux_system_regular_memory_pool_free -= memory_removed_from_pool; + /* Set available equal to memory size for subsequent calculation. */ + available_bytes = memory_size_requested; } - else - { - - switch (memory_cache_flag) - { - case UX_CACHE_SAFE_MEMORY: - /* Update the amount of free memory in the cache safe memory pool. */ - _ux_system -> ux_system_cache_safe_memory_pool_free -= memory_removed_from_pool; + /* In any case, mark the current block as allocated. */ + work_ptr = UX_UCHAR_POINTER_ADD(current_ptr, (sizeof(UCHAR *))); + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(work_ptr); + *this_block_link_ptr = UX_BYTE_POOL_TO_UCHAR_POINTER_CONVERT(pool_ptr); - break; + /* Reduce the number of available bytes in the pool. */ + pool_ptr -> ux_byte_pool_available = pool_ptr -> ux_byte_pool_available - (available_bytes + UX_MEMORY_BLOCK_HEADER_SIZE); - default: - /* Update the amount of free memory in the regular memory pool. */ - _ux_system -> ux_system_regular_memory_pool_free -= memory_removed_from_pool; - break; + /* Determine if the search pointer needs to be updated. This is only done + if the search pointer matches the block to be returned. */ + if (current_ptr == pool_ptr -> ux_byte_pool_search) + { - } + /* Yes, update the search pointer to the next block. */ + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(current_ptr); + pool_ptr -> ux_byte_pool_search = *this_block_link_ptr; } + /* Adjust the pointer for the application. */ + work_ptr = UX_UCHAR_POINTER_ADD(current_ptr, UX_MEMORY_BLOCK_HEADER_SIZE); + + /* Clear the memory block. */ + _ux_utility_memory_set(work_ptr, 0, available_bytes); /* Use case of memset is verified. */ + #ifdef UX_ENABLE_MEMORY_STATISTICS /* Update allocate count, total size. */ if (memory_cache_flag == UX_REGULAR_MEMORY) - { - _ux_system -> ux_system_regular_memory_pool_alloc_count ++; - _ux_system -> ux_system_regular_memory_pool_alloc_total += memory_size_requested; - if (_ux_system -> ux_system_regular_memory_pool_alloc_max_count < _ux_system -> ux_system_regular_memory_pool_alloc_count) - _ux_system -> ux_system_regular_memory_pool_alloc_max_count = _ux_system -> ux_system_regular_memory_pool_alloc_count; - if (_ux_system -> ux_system_regular_memory_pool_alloc_max_total < _ux_system -> ux_system_regular_memory_pool_alloc_total) - _ux_system -> ux_system_regular_memory_pool_alloc_max_total = _ux_system -> ux_system_regular_memory_pool_alloc_total; - } + index = UX_MEMORY_BYTE_POOL_REGULAR; else - { - _ux_system -> ux_system_cache_safe_memory_pool_alloc_count ++; - _ux_system -> ux_system_cache_safe_memory_pool_alloc_total += memory_size_requested; - if (_ux_system -> ux_system_cache_safe_memory_pool_alloc_max_count < _ux_system -> ux_system_cache_safe_memory_pool_alloc_count) - _ux_system -> ux_system_cache_safe_memory_pool_alloc_max_count = _ux_system -> ux_system_cache_safe_memory_pool_alloc_count; - if (_ux_system -> ux_system_cache_safe_memory_pool_alloc_max_total < _ux_system -> ux_system_cache_safe_memory_pool_alloc_total) - _ux_system -> ux_system_cache_safe_memory_pool_alloc_max_total = _ux_system -> ux_system_cache_safe_memory_pool_alloc_total; - } + index = UX_MEMORY_BYTE_POOL_CACHE_SAFE; + + /* Update allocate count, total size. */ + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_count ++; + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_total += (available_bytes + UX_MEMORY_BLOCK_HEADER_SIZE); + + if (_ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_max_count < _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_count) + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_max_count = _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_count; - /* Log max usage of regular memory pool. */ - memory_removed_from_pool = (ALIGN_TYPE)_ux_system -> ux_system_regular_memory_pool_start - - (ALIGN_TYPE)_ux_system -> ux_system_regular_memory_pool_base; - if (memory_removed_from_pool > _ux_system -> ux_system_regular_memory_pool_max_start_offset) - _ux_system -> ux_system_regular_memory_pool_max_start_offset = memory_removed_from_pool; - if (_ux_system -> ux_system_regular_memory_pool_min_free > _ux_system -> ux_system_regular_memory_pool_free) - _ux_system -> ux_system_regular_memory_pool_min_free = _ux_system -> ux_system_regular_memory_pool_free; - - /* Log max usage of cache safe memory pool. */ - memory_removed_from_pool = (ALIGN_TYPE)_ux_system -> ux_system_cache_safe_memory_pool_start - - (ALIGN_TYPE)_ux_system -> ux_system_cache_safe_memory_pool_base; - if (memory_removed_from_pool > _ux_system -> ux_system_cache_safe_memory_pool_max_start_offset) - _ux_system -> ux_system_cache_safe_memory_pool_max_start_offset = memory_removed_from_pool; - if (_ux_system -> ux_system_cache_safe_memory_pool_min_free > _ux_system -> ux_system_cache_safe_memory_pool_free) - _ux_system -> ux_system_cache_safe_memory_pool_min_free = _ux_system -> ux_system_cache_safe_memory_pool_free; + if (_ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_max_total < _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_total) + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_max_total = _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_total; + /* Log max usage of memory pool. */ + if (_ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_min_free > _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_available) + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_min_free = _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_available; #endif /* Release the protection. */ _ux_system_mutex_off(&_ux_system -> ux_system_mutex); - /* The memory block pointer contains a memory area properly - aligned. */ - return(memory_buffer); -} + return(work_ptr); +} diff --git a/common/core/src/ux_utility_memory_byte_pool_create.c b/common/core/src/ux_utility_memory_byte_pool_create.c new file mode 100644 index 00000000..2d362257 --- /dev/null +++ b/common/core/src/ux_utility_memory_byte_pool_create.c @@ -0,0 +1,130 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** USBX main stack */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_memory_byte_pool_create PORTABLE C */ +/* 6.3.0 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function creates a pool of memory bytes in the specified */ +/* memory area. */ +/* */ +/* INPUT */ +/* */ +/* pool_ptr Pointer to pool control block */ +/* pool_start Address of beginning of pool area */ +/* pool_size Number of bytes in the byte pool */ +/* */ +/* OUTPUT */ +/* */ +/* UX_SUCCESS Successful completion status */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ +/* */ +/**************************************************************************/ +UINT _ux_utility_memory_byte_pool_create(UX_MEMORY_BYTE_POOL *pool_ptr, VOID *pool_start, ULONG pool_size) +{ + +UCHAR *block_ptr; +UCHAR **block_indirect_ptr; +UCHAR *temp_ptr; +ALIGN_TYPE *free_ptr; + + + /* Initialize the byte pool control block to all zeros. */ + _ux_utility_memory_set((UCHAR *)pool_ptr, 0, sizeof(UX_MEMORY_BYTE_POOL)); /* Use case of memset is verified. */ + + /* Round the pool size down to something that is evenly divisible by + an ULONG. */ + pool_size = (pool_size/(sizeof(ALIGN_TYPE))) * (sizeof(ALIGN_TYPE)); + + /* Save the start and size of the pool. */ + pool_ptr -> ux_byte_pool_start = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + pool_ptr -> ux_byte_pool_size = pool_size; + pool_ptr -> ux_byte_pool_search = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + + /* Initially, the pool will have two blocks. One large block at the + beginning that is available and a small allocated block at the end + of the pool that is there just for the algorithm. Be sure to count + the available block's header in the available bytes count. */ + pool_ptr -> ux_byte_pool_available = pool_size - ((sizeof(VOID *)) + (sizeof(ALIGN_TYPE))); + pool_ptr -> ux_byte_pool_fragments = ((UINT) 2); + + /* Each block contains a "next" pointer that points to the next block in the pool followed by a ALIGN_TYPE + field that contains either the constant UX_BYTE_BLOCK_FREE (if the block is free) or a pointer to the + owning pool (if the block is allocated). */ + + /* Calculate the end of the pool's memory area. */ + block_ptr = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + block_ptr = UX_UCHAR_POINTER_ADD(block_ptr, pool_size); + + /* Backup the end of the pool pointer and build the pre-allocated block. */ + block_ptr = UX_UCHAR_POINTER_SUB(block_ptr, (sizeof(ALIGN_TYPE))); + + /* Cast the pool pointer into a ULONG. */ + temp_ptr = UX_BYTE_POOL_TO_UCHAR_POINTER_CONVERT(pool_ptr); + block_indirect_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(block_ptr); + *block_indirect_ptr = temp_ptr; + + block_ptr = UX_UCHAR_POINTER_SUB(block_ptr, (sizeof(UCHAR *))); + block_indirect_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(block_ptr); + *block_indirect_ptr = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + + /* Now setup the large available block in the pool. */ + temp_ptr = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + block_indirect_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(temp_ptr); + *block_indirect_ptr = block_ptr; + block_ptr = UX_VOID_TO_UCHAR_POINTER_CONVERT(pool_start); + block_ptr = UX_UCHAR_POINTER_ADD(block_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(block_ptr); + *free_ptr = UX_BYTE_BLOCK_FREE; + + /* Return UX_SUCCESS. */ + return(UX_SUCCESS); +} diff --git a/common/core/src/ux_utility_memory_byte_pool_search.c b/common/core/src/ux_utility_memory_byte_pool_search.c new file mode 100644 index 00000000..b688d010 --- /dev/null +++ b/common/core/src/ux_utility_memory_byte_pool_search.c @@ -0,0 +1,215 @@ +/**************************************************************************/ +/* */ +/* Copyright (c) Microsoft Corporation. All rights reserved. */ +/* */ +/* This software is licensed under the Microsoft Software License */ +/* Terms for Microsoft Azure RTOS. Full text of the license can be */ +/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */ +/* and in the root directory of this software. */ +/* */ +/**************************************************************************/ + + +/**************************************************************************/ +/**************************************************************************/ +/** */ +/** USBX Component */ +/** */ +/** USBX main stack */ +/** */ +/**************************************************************************/ +/**************************************************************************/ + + +/* Include necessary system files. */ + +#define UX_SOURCE_CODE + +#include "ux_api.h" + + +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_memory_byte_pool_search PORTABLE C */ +/* 6.3.0 */ +/* AUTHOR */ +/* */ +/* Yajun Xia, Microsoft Corporation */ +/* */ +/* DESCRIPTION */ +/* */ +/* This function searches a byte pool for a memory block to satisfy */ +/* the requested number of bytes. Merging of adjacent free blocks */ +/* takes place during the search. */ +/* */ +/* INPUT */ +/* */ +/* pool_ptr Pointer to pool control block */ +/* memory_size Number of bytes required */ +/* */ +/* OUTPUT */ +/* */ +/* UCHAR * Pointer to the allocated memory, */ +/* if successful. Otherwise, a */ +/* NULL is returned */ +/* */ +/* CALLS */ +/* */ +/* None */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ +/* */ +/**************************************************************************/ +UCHAR *_ux_utility_memory_byte_pool_search(UX_MEMORY_BYTE_POOL *pool_ptr, ULONG memory_size) +{ +UCHAR *current_ptr; +UCHAR *next_ptr; +UCHAR **this_block_link_ptr; +UCHAR **next_block_link_ptr; +ULONG available_bytes; +UINT examine_blocks; +UINT first_free_block_found = UX_FALSE; +ALIGN_TYPE *free_ptr; +UCHAR *work_ptr; +ULONG total_theoretical_available; + + /* First, determine if there are enough bytes in the pool. */ + /* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */ + total_theoretical_available = pool_ptr -> ux_byte_pool_available + ((pool_ptr -> ux_byte_pool_fragments - 2) * UX_MEMORY_BLOCK_HEADER_SIZE); + if (memory_size >= total_theoretical_available) + { + + /* Not enough memory, return a NULL pointer. */ + return(UX_NULL); + } + + /* Check if the search pointer is valid. */ + if ((pool_ptr -> ux_byte_pool_search < pool_ptr -> ux_byte_pool_start) || + (pool_ptr -> ux_byte_pool_search > pool_ptr -> ux_byte_pool_start + pool_ptr -> ux_byte_pool_size)) + { + + /* Return a NULL pointer. */ + return(UX_NULL); + } + + /* Walk through the memory pool in search for a large enough block. */ + current_ptr = pool_ptr -> ux_byte_pool_search; + examine_blocks = pool_ptr -> ux_byte_pool_fragments + ((UINT) 1); + available_bytes = ((ULONG) 0); + do + { + /* Check to see if this block is free. */ + work_ptr = UX_UCHAR_POINTER_ADD(current_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(work_ptr); + if ((*free_ptr) == UX_BYTE_BLOCK_FREE) + { + + /* Determine if this is the first free block. */ + if (first_free_block_found == UX_FALSE) + { + /* This is the first free block. */ + pool_ptr->ux_byte_pool_search = current_ptr; + + /* Set the flag to indicate we have found the first free + block. */ + first_free_block_found = UX_TRUE; + } + + /* Block is free, see if it is large enough. */ + + /* Pickup the next block's pointer. */ + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(current_ptr); + next_ptr = *this_block_link_ptr; + + /* Calculate the number of bytes available in this block. */ + available_bytes = UX_UCHAR_POINTER_DIF(next_ptr, current_ptr); + available_bytes = available_bytes - UX_MEMORY_BLOCK_HEADER_SIZE; + + /* If this is large enough, we are done because our first-fit algorithm + has been satisfied! */ + if (available_bytes >= memory_size) + { + + /* Get out of the search loop! */ + break; + } + else + { + + /* Clear the available bytes variable. */ + available_bytes = ((ULONG) 0); + + /* Not enough memory, check to see if the neighbor is + free and can be merged. */ + work_ptr = UX_UCHAR_POINTER_ADD(next_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(work_ptr); + if ((*free_ptr) == UX_BYTE_BLOCK_FREE) + { + + /* Yes, neighbor block can be merged! This is quickly accomplished + by updating the current block with the next blocks pointer. */ + next_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr); + *this_block_link_ptr = *next_block_link_ptr; + + /* Reduce the fragment total. We don't need to increase the bytes + available because all free headers are also included in the available + count. */ + pool_ptr -> ux_byte_pool_fragments--; + + /* See if the search pointer is affected. */ + if (pool_ptr -> ux_byte_pool_search == next_ptr) + { + /* Yes, update the search pointer. */ + pool_ptr -> ux_byte_pool_search = current_ptr; + } + } + else + { + /* Neighbor is not free so we can skip over it! */ + next_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(next_ptr); + current_ptr = *next_block_link_ptr; + + /* Decrement the examined block count to account for this one. */ + if (examine_blocks != ((UINT) 0)) + { + examine_blocks--; + } + } + } + } + else + { + + /* Block is not free, move to next block. */ + this_block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(current_ptr); + current_ptr = *this_block_link_ptr; + } + + /* Another block has been searched... decrement counter. */ + if (examine_blocks != ((UINT) 0)) + { + + examine_blocks--; + } + + } while(examine_blocks != ((UINT) 0)); + + /* If a block was found, just return. */ + if (available_bytes == ((ULONG) 0)) + { + return(UX_NULL); + } + + /* Return the search pointer. */ + return(current_ptr); +} diff --git a/common/core/src/ux_utility_memory_free.c b/common/core/src/ux_utility_memory_free.c index bbab0e93..cbd38e33 100644 --- a/common/core/src/ux_utility_memory_free.c +++ b/common/core/src/ux_utility_memory_free.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Utility */ /** */ @@ -28,59 +28,70 @@ #include "ux_api.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_utility_memory_free PORTABLE C */ -/* 6.1.10 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_memory_free PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function frees a previously allocated memory block. */ -/* */ -/* INPUT */ -/* */ -/* memory Pointer to memory block */ -/* */ -/* OUTPUT */ -/* */ -/* None */ -/* */ -/* CALLS */ -/* */ -/* _ux_utility_mutex_on Start system protection */ -/* _ux_utility_mutex_off End system protection */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* This function frees a previously allocated memory block. */ +/* */ +/* INPUT */ +/* */ +/* memory Pointer to memory block */ +/* */ +/* OUTPUT */ +/* */ +/* None */ +/* */ +/* CALLS */ +/* */ +/* _ux_utility_mutex_on Start system protection */ +/* _ux_utility_mutex_off End system protection */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ +/* added some error traps, */ +/* refined memory management, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_utility_memory_free(VOID *memory) { - -UX_MEMORY_BLOCK *memory_block; -UX_MEMORY_BLOCK *next_block; -ULONG memory_size_returned; -UCHAR *memory_address; +UX_MEMORY_BYTE_POOL *pool_ptr; +UCHAR *work_ptr; +UCHAR *temp_ptr; +UCHAR *next_block_ptr; + +ALIGN_TYPE *free_ptr; +UX_MEMORY_BYTE_POOL **byte_pool_ptr; +UCHAR **block_link_ptr; #ifdef UX_ENABLE_MEMORY_POOL_SANITY_CHECK +UCHAR *memory_address; UCHAR *regular_start, *regular_end; UCHAR *cache_safe_start, *cache_safe_end; +#endif +#ifdef UX_ENABLE_MEMORY_STATISTICS +UINT index; #endif /* Get the mutex as this is a critical section. */ @@ -89,12 +100,13 @@ UCHAR *cache_safe_start, *cache_safe_end; #ifdef UX_ENABLE_MEMORY_POOL_SANITY_CHECK /* Sanity check, check if the memory is in memory pool. */ - regular_start = (UCHAR *)_ux_system -> ux_system_regular_memory_pool_start; - regular_end = regular_start + _ux_system -> ux_system_regular_memory_pool_size; - regular_start += sizeof(UX_MEMORY_BLOCK); - cache_safe_start = (UCHAR *)_ux_system -> ux_system_cache_safe_memory_pool_start; - cache_safe_end = cache_safe_start + _ux_system -> ux_system_cache_safe_memory_pool_size; - cache_safe_start += sizeof(UX_MEMORY_BLOCK); + regular_start = (UCHAR *)_ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_start; + regular_end = regular_start + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_size; + regular_start += UX_MEMORY_BLOCK_HEADER_SIZE; + cache_safe_start = (UCHAR *)_ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] -> ux_byte_pool_start; + cache_safe_end = cache_safe_start + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE] -> ux_byte_pool_size; + cache_safe_start += UX_MEMORY_BLOCK_HEADER_SIZE; + memory_address = (UCHAR *)memory; if (!((memory_address >= regular_start && memory_address < regular_end) || (memory_address >= cache_safe_start && memory_address < cache_safe_end))) @@ -112,117 +124,103 @@ UCHAR *cache_safe_start, *cache_safe_end; } #endif - /* The memory block for this memory pointer is located right before the - memory. */ - memory_block = (UX_MEMORY_BLOCK *) (((UCHAR *) memory) - sizeof(UX_MEMORY_BLOCK)); - - /* Keep track of the memory returned to the pool. */ - memory_size_returned = memory_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); + /* Set the pool pointer to NULL. */ + pool_ptr = UX_NULL; - /* Check this memory block to see if it valid. */ - if (memory_block -> ux_memory_block_status != (UX_MEMORY_USED | UX_REGULAR_MEMORY) && - memory_block -> ux_memory_block_status != (UX_MEMORY_USED | UX_CACHE_SAFE_MEMORY)) + /* Determine if the memory pointer is valid. */ + work_ptr = UX_VOID_TO_UCHAR_POINTER_CONVERT(memory); + if (work_ptr != UX_NULL) { - /* Not valid. Release the protection. */ - _ux_system_mutex_off(&_ux_system -> ux_system_mutex); + /* Back off the memory pointer to pickup its header. */ + work_ptr = UX_UCHAR_POINTER_SUB(work_ptr, UX_MEMORY_BLOCK_HEADER_SIZE); - /* Error trap. */ - _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_UTILITY, UX_MEMORY_CORRUPTED); + /* There is a pointer, pickup the pool pointer address. */ + temp_ptr = UX_UCHAR_POINTER_ADD(work_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(temp_ptr); + if ((*free_ptr) != UX_BYTE_BLOCK_FREE) + { - /* If trace is enabled, insert this event into the trace buffer. */ - UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_MEMORY_CORRUPTED, memory, 0, 0, UX_TRACE_ERRORS, 0, 0) + /* Pickup the pool pointer. */ + temp_ptr = UX_UCHAR_POINTER_ADD(work_ptr, (sizeof(UCHAR *))); + byte_pool_ptr = UX_UCHAR_TO_INDIRECT_BYTE_POOL_POINTER(temp_ptr); + pool_ptr = *byte_pool_ptr; - /* Return to caller. */ - return; - } + /* See if we have a valid pool pointer. */ + if ((pool_ptr == UX_NULL) || + ((pool_ptr != _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR]) && + (pool_ptr != _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_CACHE_SAFE]))) + { -#ifdef UX_ENABLE_MEMORY_STATISTICS + /* Release the protection. */ + _ux_system_mutex_off(&_ux_system -> ux_system_mutex); - /* Update allocate count, total size. */ - if (memory_block -> ux_memory_block_status == (UX_MEMORY_USED | UX_REGULAR_MEMORY)) - { - _ux_system -> ux_system_regular_memory_pool_alloc_count --; - _ux_system -> ux_system_regular_memory_pool_alloc_total -= memory_block -> ux_memory_block_size; - } - else - { - _ux_system -> ux_system_cache_safe_memory_pool_alloc_count --; - _ux_system -> ux_system_cache_safe_memory_pool_alloc_total -= memory_block -> ux_memory_block_size; - } -#endif + /* Error trap: maybe double free/memory issue here! */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, + UX_SYSTEM_CONTEXT_UTILITY, UX_MEMORY_CORRUPTED); - /* We mark this memory block as being unused. */ - memory_block -> ux_memory_block_status = UX_MEMORY_UNUSED; - - /* Now we must concatenate as many free blocks as possible, - that include the blocks before and the blocks after the current - block. Scan memory backwards. */ + /* Return to caller. */ + return; + } + } + else + { + /* Release the protection. */ + _ux_system_mutex_off(&_ux_system -> ux_system_mutex); - while (memory_block -> ux_memory_block_previous !=UX_NULL) - { + /* Error trap: maybe double free/memory issue here! */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, + UX_SYSTEM_CONTEXT_UTILITY, UX_MEMORY_CORRUPTED); - /* Check if the block is free. */ - if (memory_block -> ux_memory_block_previous -> ux_memory_block_status == UX_MEMORY_UNUSED) + /* Return to caller. */ + return; + } + } + else + { - /* The memory block before is free. This will be our starting point to - concatenate memory. */ - memory_block = memory_block -> ux_memory_block_previous; + /* Release the protection. */ + _ux_system_mutex_off(&_ux_system -> ux_system_mutex); - else + /* Error trap: maybe double free/bad flow here! */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, + UX_SYSTEM_CONTEXT_UTILITY, UX_MEMORY_CORRUPTED); - /* The previous memory block is not free. */ - break; + /* Return to caller. */ + return; } - /* The pointer to the memory block is now our first free block. We use this - starting address to concatenate all the contiguous memory block. */ - next_block = memory_block -> ux_memory_block_next; - while (next_block != UX_NULL) - { - - /* Determine if the memory block is used. */ - if (next_block -> ux_memory_block_status != UX_MEMORY_UNUSED) - { + /* At this point, we know that the pool pointer is valid. */ - /* Yes, move to next block. */ - memory_block -> ux_memory_block_next = next_block; - next_block -> ux_memory_block_previous = memory_block; - break; - } + /* Release the memory. */ + temp_ptr = UX_UCHAR_POINTER_ADD(work_ptr, (sizeof(UCHAR *))); + free_ptr = UX_UCHAR_TO_ALIGN_TYPE_POINTER_CONVERT(temp_ptr); + *free_ptr = UX_BYTE_BLOCK_FREE; - memory_block -> ux_memory_block_next = next_block -> ux_memory_block_next; - memory_block -> ux_memory_block_size += next_block -> ux_memory_block_size + (ULONG)sizeof(UX_MEMORY_BLOCK); - next_block = next_block -> ux_memory_block_next; - } + /* Update the number of available bytes in the pool. */ + block_link_ptr = UX_UCHAR_TO_INDIRECT_UCHAR_POINTER_CONVERT(work_ptr); + next_block_ptr = *block_link_ptr; + pool_ptr -> ux_byte_pool_available = + pool_ptr -> ux_byte_pool_available + UX_UCHAR_POINTER_DIF(next_block_ptr, work_ptr); - /* Update the memory free in the appropriate pool. We need to know if this - block is in regular memory or cache safe memory. */ - if(_ux_system -> ux_system_cache_safe_memory_pool_start == _ux_system -> ux_system_regular_memory_pool_start) + /* Determine if the free block is prior to current search pointer. */ + if (work_ptr < (pool_ptr -> ux_byte_pool_search)) { - /* There is only one regular memory pool. */ - _ux_system -> ux_system_regular_memory_pool_free += memory_size_returned; - + /* Yes, update the search pointer to the released block. */ + pool_ptr -> ux_byte_pool_search = work_ptr; } - else - { - - /* Which pool is this memory in ? */ - memory_address = (UCHAR *) _ux_system -> ux_system_regular_memory_pool_start; - - /* If the memory address is in this range, we are in the regular memory pool. */ - if ((UCHAR *) memory_block >= memory_address && (UCHAR *) memory_block < (memory_address + _ux_system -> ux_system_regular_memory_pool_size)) - /* Update the regular memory pool. */ - _ux_system -> ux_system_regular_memory_pool_free += memory_size_returned; +#ifdef UX_ENABLE_MEMORY_STATISTICS + if (((UCHAR*)memory >= _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_start) && + ((UCHAR*)memory < (_ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_start + _ux_system -> ux_system_memory_byte_pool[UX_MEMORY_BYTE_POOL_REGULAR] -> ux_byte_pool_size))) + index = UX_MEMORY_BYTE_POOL_REGULAR; + else + index = UX_MEMORY_BYTE_POOL_CACHE_SAFE; - else - - /* Update the cache safe memory pool. */ - _ux_system -> ux_system_cache_safe_memory_pool_free += memory_size_returned; - - } + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_count --; + _ux_system -> ux_system_memory_byte_pool[index] -> ux_byte_pool_alloc_total -= UX_UCHAR_POINTER_DIF(next_block_ptr, work_ptr); +#endif /* Release the protection. */ _ux_system_mutex_off(&_ux_system -> ux_system_mutex); diff --git a/common/core/src/ux_utility_memory_free_block_best_get.c b/common/core/src/ux_utility_memory_free_block_best_get.c index 87179f3c..b7203bd2 100644 --- a/common/core/src/ux_utility_memory_free_block_best_get.c +++ b/common/core/src/ux_utility_memory_free_block_best_get.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** USBX main stack */ /** */ @@ -28,57 +28,64 @@ #include "ux_api.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_utility_memory_free_block_best_get PORTABLE C */ -/* 6.1 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_utility_memory_free_block_best_get PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function returns the best free memory block. */ -/* */ -/* INPUT */ -/* */ -/* memory_cache_flag Memory pool source */ -/* memory_size_requested Size of memory requested */ -/* */ -/* OUTPUT */ -/* */ -/* Pointer to best free block */ -/* */ -/* CALLS */ -/* */ +/* */ +/* This function returns the best free memory block. */ +/* */ +/* It's deprecated. */ +/* */ +/* INPUT */ +/* */ +/* memory_cache_flag Memory pool source */ +/* memory_size_requested Size of memory requested */ +/* */ +/* OUTPUT */ +/* */ +/* Pointer to best free block */ +/* */ +/* CALLS */ +/* */ /* None */ -/* */ -/* CALLED BY */ -/* */ -/* USBX Components */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* USBX Components */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* deprecated for memory */ +/* footprint optimization, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ -UX_MEMORY_BLOCK *_ux_utility_memory_free_block_best_get(ULONG memory_cache_flag, +#if 0 +UX_MEMORY_BLOCK *_ux_utility_memory_free_block_best_get(ULONG memory_cache_flag, ULONG memory_size_requested) { UX_MEMORY_BLOCK *memory_block; UX_MEMORY_BLOCK *best_memory_block; - + /* Reset the free memory block. */ best_memory_block = UX_NULL; - + /* Check the type of memory we need. */ switch (memory_cache_flag) { @@ -88,15 +95,15 @@ UX_MEMORY_BLOCK *best_memory_block; /* Start at the beginning of the regular memory pool. */ memory_block = _ux_system -> ux_system_regular_memory_pool_start; break; - + case UX_CACHE_SAFE_MEMORY : /* Start at the beginning of the cache safe memory pool. */ memory_block = _ux_system -> ux_system_cache_safe_memory_pool_start; break; - + default : - + /* Wrong memory type. */ return(UX_NULL); @@ -110,11 +117,11 @@ UX_MEMORY_BLOCK *best_memory_block; if (memory_block -> ux_memory_block_status == UX_MEMORY_UNUSED) { - /* Check the size of this free block and see if it will + /* Check the size of this free block and see if it will fit the memory requirement. */ if (memory_block -> ux_memory_block_size > memory_size_requested) { - + /* This memory block will do. Now see if it is the best. The best memory block is the one whose memory is closest to the memory requested. */ @@ -129,15 +136,15 @@ UX_MEMORY_BLOCK *best_memory_block; /* We have discovered a better fit block. */ best_memory_block = memory_block; - } + } } } - /* Search the next free block until the end. */ + /* Search the next free block until the end. */ memory_block = memory_block -> ux_memory_block_next; } /* If no free memory block was found, the return value will be NULL. */ - return(best_memory_block); -} - + return(best_memory_block); +} +#endif 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 d6166cca..b0d2898d 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.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,10 +65,11 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -422,10 +423,6 @@ typedef struct UX_DEVICE_CLASS_AUDIO_STREAM_STRUCT UX_SLAVE_INTERFACE *ux_device_class_audio_stream_interface; UX_SLAVE_ENDPOINT *ux_device_class_audio_stream_endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - UCHAR *ux_device_class_audio_stream_endpoint_buffer; -#endif - #if defined(UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT) UX_SLAVE_ENDPOINT *ux_device_class_audio_stream_feedback; 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 f0080dd4..05c34bfc 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.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,9 +57,9 @@ /* added error checks support, */ /* fixed a macro name, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ 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 1a1c075e..aef29e38 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.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,9 +58,9 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ 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 832422ed..e56b16fc 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -42,9 +42,9 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h b/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h index 748d345e..569c10c5 100644 --- a/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h +++ b/common/usbx_device_classes/inc/ux_device_class_cdc_acm.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_cdc_acm.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,12 +58,12 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added write auto ZLP, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h b/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h index d578136e..457c5922 100644 --- a/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h +++ b/common/usbx_device_classes/inc/ux_device_class_cdc_ecm.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_cdc_ecm.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,10 +55,11 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added wait definitions, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -99,11 +100,26 @@ VOID _ux_network_driver_link_down(VOID *ux_network_handle); #endif +/* Option: defined, it enables zero copy support (works if CDC_ECM owns endpoint buffer). + Enabled, it requires that the NX packet pool is in cache safe area, and buffer max size is + larger than UX_DEVICE_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE (1536). + */ +/* #define UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY */ + + /* Bulk out endpoint buffer size, must be larger than endpoint and ethernet max packet size, and aligned in 4-bytes. */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) +#define UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE 0 +#else #define UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE UX_DEVICE_CLASS_CDC_ECM_MAX_PACKET_LENGTH +#endif /* Bulk in endpoint buffer size, must be larger than endpoint and ethernet max packet size, and aligned in 4-bytes. */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) +#define UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE 0 +#else #define UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE UX_DEVICE_CLASS_CDC_ECM_ETHERNET_PACKET_SIZE +#endif /* Interrupt in endpoint buffer size... */ #define UX_DEVICE_CLASS_CDC_ECM_INTERRUPTIN_BUFFER_SIZE UX_DEVICE_CLASS_CDC_ECM_INTERRUPT_RESPONSE_LENGTH @@ -370,12 +386,16 @@ typedef struct UX_SLAVE_CLASS_CDC_ECM_STRUCT } UX_SLAVE_CLASS_CDC_ECM; /* Define CDC ECM endpoint buffer settings (when CDC ECM owns buffer). */ +#if defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) +#define UX_DEVICE_CLASS_CDC_ECM_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW 0 /* No calculation, no overflow */ +#else #define UX_DEVICE_CLASS_CDC_ECM_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW \ (UX_OVERFLOW_CHECK_ADD_ULONG(UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE, \ UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE) || \ UX_OVERFLOW_CHECK_ADD_ULONG(UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE + \ UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE, \ UX_DEVICE_CLASS_CDC_ECM_INTERRUPTIN_BUFFER_SIZE)) +#endif #define UX_DEVICE_CLASS_CDC_ECM_ENDPOINT_BUFFER_SIZE (UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE + UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE + UX_DEVICE_CLASS_CDC_ECM_INTERRUPTIN_BUFFER_SIZE) #define UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(ecm) ((ecm)->ux_device_class_cdc_ecm_endpoint_buffer) #define UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER(ecm) (UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(ecm) + UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE) diff --git a/common/usbx_device_classes/inc/ux_device_class_dfu.h b/common/usbx_device_classes/inc/ux_device_class_dfu.h index ee4770d0..33a4be47 100644 --- a/common/usbx_device_classes/inc/ux_device_class_dfu.h +++ b/common/usbx_device_classes/inc/ux_device_class_dfu.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_dfu.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,9 +60,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added macros for req types, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* 10-31-2023 Yajun xia Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_hid.h b/common/usbx_device_classes/inc/ux_device_class_hid.h index ffadc242..ab0aee13 100644 --- a/common/usbx_device_classes/inc/ux_device_class_hid.h +++ b/common/usbx_device_classes/inc/ux_device_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_hid.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,12 +64,12 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone int out, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* moved build option check, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_pima.h b/common/usbx_device_classes/inc/ux_device_class_pima.h index 31278b10..5e099816 100644 --- a/common/usbx_device_classes/inc/ux_device_class_pima.h +++ b/common/usbx_device_classes/inc/ux_device_class_pima.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_pima.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,11 +58,12 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* optimized PIMA data sets, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -729,10 +730,11 @@ typedef struct UX_SLAVE_CLASS_PIMA_OBJECT_STRUCT { ULONG ux_device_class_pima_object_storage_id; - ULONG ux_device_class_pima_object_format; - ULONG ux_device_class_pima_object_protection_status; + USHORT ux_device_class_pima_object_format; + USHORT ux_device_class_pima_object_protection_status; ULONG ux_device_class_pima_object_compressed_size; - ULONG ux_device_class_pima_object_thumb_format; + USHORT ux_device_class_pima_object_thumb_format; + USHORT _align_thumb_compressed_size; ULONG ux_device_class_pima_object_thumb_compressed_size; ULONG ux_device_class_pima_object_thumb_pix_width; ULONG ux_device_class_pima_object_thumb_pix_height; @@ -740,7 +742,8 @@ typedef struct UX_SLAVE_CLASS_PIMA_OBJECT_STRUCT ULONG ux_device_class_pima_object_image_pix_height; ULONG ux_device_class_pima_object_image_bit_depth; ULONG ux_device_class_pima_object_parent_object; - ULONG ux_device_class_pima_object_association_type; + USHORT ux_device_class_pima_object_association_type; + USHORT _align_association_desc; ULONG ux_device_class_pima_object_association_desc; ULONG ux_device_class_pima_object_sequence_number; UCHAR ux_device_class_pima_object_filename[UX_DEVICE_CLASS_PIMA_UNICODE_MAX_LENGTH]; @@ -798,9 +801,10 @@ typedef struct UX_SLAVE_CLASS_PIMA_DEVICE_STRUCT typedef struct UX_SLAVE_CLASS_PIMA_STORAGE_STRUCT { - ULONG ux_device_class_pima_storage_type; - ULONG ux_device_class_pima_storage_file_system_type; - ULONG ux_device_class_pima_storage_access_capability; + USHORT ux_device_class_pima_storage_type; + USHORT ux_device_class_pima_storage_file_system_type; + USHORT ux_device_class_pima_storage_access_capability; + USHORT _align_max_capacity_low; ULONG ux_device_class_pima_storage_max_capacity_low; ULONG ux_device_class_pima_storage_max_capacity_high; ULONG ux_device_class_pima_storage_free_space_bytes_low; 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 9dcb4584..c87cb386 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.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,11 +50,11 @@ /* 03-08-2023 Yajun xia Modified comment(s), */ /* added error checks support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* fixed error checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -77,6 +77,16 @@ extern "C" { #define UX_DEVICE_CLASS_PRINTER_ENABLE_ERROR_CHECKING #endif + +/* Option: defined, it enables zero copy support (works if PRINTER owns endpoint buffer). + Defined, it enables zero copy for bulk in/out endpoints (write/read). In this case, the endpoint + buffer is not allocated in class, application must provide the buffer for read/write, and the + buffer must meet device controller driver (DCD) buffer requirements (e.g., aligned and cache + safe if buffer is for DMA). + */ +/* #define UX_DEVICE_CLASS_PRINTER_ZERO_COPY */ + + /* Defined, _write is pending ZLP automatically (complete transfer) after buffer is sent. */ /* #define UX_DEVICE_CLASS_PRINTER_WRITE_AUTO_ZLP */ @@ -93,6 +103,13 @@ extern "C" { #endif +/* Internal: check if class own endpoint buffer */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && \ + (!defined(UX_DEVICE_CLASS_PRINTER_ZERO_COPY)) +#define UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER +#endif + + /* Define Printer Class USB Class constants. */ #define UX_DEVICE_CLASS_PRINTER_CLASS 7 diff --git a/common/usbx_device_classes/inc/ux_device_class_rndis.h b/common/usbx_device_classes/inc/ux_device_class_rndis.h index d1263b72..8440cf58 100644 --- a/common/usbx_device_classes/inc/ux_device_class_rndis.h +++ b/common/usbx_device_classes/inc/ux_device_class_rndis.h @@ -24,7 +24,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_rndis.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,11 +55,12 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added wait and length DEFs, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* improved error checking, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -76,11 +77,27 @@ extern "C" { #endif + +/* Option: defined, it enables zero copy support (works if HID owns endpoint buffer). + Enabled, it requires that the NX packet pool is in cache safe area, and buffer max size is + larger than UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE (1600). + */ +/* #define UX_DEVICE_CLASS_RNDIS_ZERO_COPY */ + + /* Bulk out endpoint buffer size (UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE). */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) +#define UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE 0 +#else #define UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE +#endif /* Bulk in endpoint buffer size (UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE). */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) +#define UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE 0 +#else #define UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE UX_DEVICE_CLASS_RNDIS_MAX_PACKET_TRANSFER_SIZE +#endif /* Interrupt in endpoint buffer size (UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH). */ #define UX_DEVICE_CLASS_RNDIS_INTERRUPTIN_BUFFER_SIZE UX_DEVICE_CLASS_RNDIS_INTERRUPT_RESPONSE_LENGTH @@ -597,12 +614,16 @@ typedef struct UX_SLAVE_CLASS_RNDIS_STRUCT } UX_SLAVE_CLASS_RNDIS; /* Define RNDIS endpoint buffer settings (when RNDIS owns buffer). */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) +#define UX_DEVICE_CLASS_RNDIS_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW 0 /* only one buffer, no calculation */ +#else #define UX_DEVICE_CLASS_RNDIS_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW \ (UX_OVERFLOW_CHECK_ADD_ULONG(UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE, \ UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE) || \ UX_OVERFLOW_CHECK_ADD_ULONG(UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE + \ UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE, \ UX_DEVICE_CLASS_RNDIS_INTERRUPTIN_BUFFER_SIZE)) +#endif #define UX_DEVICE_CLASS_RNDIS_ENDPOINT_BUFFER_SIZE (UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE + UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE + UX_DEVICE_CLASS_RNDIS_INTERRUPTIN_BUFFER_SIZE) #define UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER(rndis) ((rndis)->ux_device_class_rndis_endpoint_buffer) #define UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER(rndis) (UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER(rndis) + UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE) diff --git a/common/usbx_device_classes/inc/ux_device_class_storage.h b/common/usbx_device_classes/inc/ux_device_class_storage.h index 3ff31b5e..57ece444 100644 --- a/common/usbx_device_classes/inc/ux_device_class_storage.h +++ b/common/usbx_device_classes/inc/ux_device_class_storage.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_storage.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,11 +57,11 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_device_classes/inc/ux_device_class_video.h b/common/usbx_device_classes/inc/ux_device_class_video.h index a7a4f72c..89c16b16 100644 --- a/common/usbx_device_classes/inc/ux_device_class_video.h +++ b/common/usbx_device_classes/inc/ux_device_class_video.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_device_class_video.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -44,11 +44,12 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Yajun xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -588,9 +589,6 @@ typedef struct UX_DEVICE_CLASS_VIDEO_STREAM_STRUCT struct UX_DEVICE_CLASS_VIDEO_STRUCT *ux_device_class_video_stream_video; UX_SLAVE_INTERFACE *ux_device_class_video_stream_interface; UX_SLAVE_ENDPOINT *ux_device_class_video_stream_endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - UCHAR *ux_device_class_video_stream_endpoint_buffer; -#endif ULONG ux_device_class_video_stream_error; diff --git a/common/usbx_device_classes/src/ux_device_class_audio_activate.c b/common/usbx_device_classes/src/ux_device_class_audio_activate.c index f6468fdb..1afd5fb7 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,10 +73,11 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -127,8 +128,10 @@ ULONG stream_index; audio -> ux_device_class_audio_status_head = audio -> ux_device_class_audio_status_queue; audio -> ux_device_class_audio_status_tail = audio -> ux_device_class_audio_status_queue; #if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - audio -> ux_device_class_audio_interrupt -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer = audio -> ux_device_class_audio_interrupt_buffer; + if (audio -> ux_device_class_audio_interrupt) + audio -> ux_device_class_audio_interrupt -> + ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = + audio -> ux_device_class_audio_interrupt_buffer; #endif #endif } diff --git a/common/usbx_device_classes/src/ux_device_class_audio_change.c b/common/usbx_device_classes/src/ux_device_class_audio_change.c index 5ad1c8a3..f2eba4e0 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_change.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_change.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_change PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,10 +84,11 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_change(UX_SLAVE_CLASS_COMMAND *command) @@ -238,11 +239,11 @@ ULONG endpoint_dir; } #if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - stream -> ux_device_class_audio_stream_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer = stream -> ux_device_class_audio_stream_endpoint_buffer; #if defined(UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT) - stream -> ux_device_class_audio_stream_feedback -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer = stream -> ux_device_class_audio_stream_feedback_buffer; + if (stream -> ux_device_class_audio_stream_feedback) + stream -> ux_device_class_audio_stream_feedback -> + ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = + stream -> ux_device_class_audio_stream_feedback_buffer; #endif #endif 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 1a261821..830ada94 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,10 +87,11 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -259,16 +260,6 @@ ULONG i; { #if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - - /* Allocate memory for stream endpoint buffer. */ - stream -> ux_device_class_audio_stream_endpoint_buffer = _ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, - stream_parameter -> ux_device_class_audio_stream_parameter_max_frame_buffer_size); - if (stream -> ux_device_class_audio_stream_endpoint_buffer == UX_NULL) - { - status = UX_MEMORY_INSUFFICIENT; - break; - } - #if defined(UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT) /* Allocate memory for feedback endpoint buffer. */ @@ -303,7 +294,11 @@ ULONG i; stream_parameter -> ux_device_class_audio_stream_parameter_max_frame_buffer_nb; /* Create block of buffer buffer is cache safe for USB transfer. */ +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + stream -> ux_device_class_audio_stream_buffer = (UCHAR *)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, memory_size); +#else stream -> ux_device_class_audio_stream_buffer = (UCHAR *)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, memory_size); +#endif /* Check for successful allocation. */ if (stream -> ux_device_class_audio_stream_buffer == UX_NULL) @@ -465,10 +460,6 @@ ULONG i; _ux_device_thread_delete(&stream -> ux_device_class_audio_stream_thread); _ux_utility_memory_free(stream -> ux_device_class_audio_stream_thread_stack); } -#endif -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - if (stream -> ux_device_class_audio_stream_endpoint_buffer) - _ux_utility_memory_free(stream -> ux_device_class_audio_stream_endpoint_buffer); #endif if (stream -> ux_device_class_audio_stream_buffer) _ux_utility_memory_free(stream -> ux_device_class_audio_stream_buffer); @@ -505,7 +496,7 @@ ULONG i; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_audio_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -535,9 +526,9 @@ ULONG i; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Chaoqiong Xiao Initial Version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* fixed error checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_audio_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c index eeac5c25..77127efc 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_interrupt_task_function.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_interrupt_task_function PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -71,6 +71,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Yajun Xia Initial Version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed an error trap, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_interrupt_task_function(UX_DEVICE_CLASS_AUDIO *audio) @@ -100,13 +103,10 @@ UCHAR *buff; /* Get endpoint instance. */ endpoint = audio -> ux_device_class_audio_interrupt; - /* Endpoint not available, maybe it's alternate setting 0. */ + /* Endpoint not available, maybe it's alternate setting 0, + or not exist in framework (accepted use case). */ if (endpoint == UX_NULL) { - - /* Error trap. */ - _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_ENDPOINT_HANDLE_UNKNOWN); - audio -> ux_device_class_audio_interrupt_task_state = UX_STATE_RESET; return(UX_STATE_IDLE); } diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c index 03d43d89..f4f1301c 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_task_function.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_task_function PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -71,6 +71,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Yajun Xia Initial Version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added a new mode to manage */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_read_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream) @@ -116,6 +121,13 @@ UINT status; /* Next state: transfer wait. */ stream -> ux_device_class_audio_stream_task_state = UX_DEVICE_CLASS_AUDIO_STREAM_RW_WAIT; +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use stream buffer for transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = + stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data; +#endif + /* Reset transfer state. */ UX_SLAVE_TRANSFER_STATE_RESET(transfer); } @@ -153,9 +165,14 @@ UINT status; /* Frame received, log it. */ stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_length = actual_length; stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_pos = 0; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0 + + /* Copy data from endpoint buffer. */ _ux_utility_memory_copy(stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data, transfer -> ux_slave_transfer_request_data_pointer, actual_length); /* Use case of memcpy is verified. */ +#endif /* For simple, do not advance the transfer position if there is overflow. */ next_pos = (UCHAR *)stream -> ux_device_class_audio_stream_transfer_pos; diff --git a/common/usbx_device_classes/src/ux_device_class_audio_read_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_read_thread_entry.c index 8af97f0e..17ee997a 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_read_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_read_thread_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_read_thread_entry PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,6 +84,11 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added a new mode to manage */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_audio_read_thread_entry(ULONG audio_stream) @@ -127,6 +132,13 @@ ULONG actual_length; /* Get transfer instance. */ transfer = &endpoint -> ux_slave_endpoint_transfer_request; +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use frame buffer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data; +#endif + /* Start frame transfer anyway. */ status = _ux_device_stack_transfer_request(transfer, max_packet_size, max_packet_size); @@ -146,9 +158,14 @@ ULONG actual_length; /* Frame received, log it. */ stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_length = actual_length; stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_pos = 0; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0 + + /* Copy data from endpoint buffer. */ _ux_utility_memory_copy(stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data, transfer -> ux_slave_transfer_request_data_pointer, actual_length); /* Use case of memcpy is verified. */ +#endif /* For simple, do not advance the transfer position if there is overflow. */ next_pos = (UCHAR *)stream -> ux_device_class_audio_stream_transfer_pos; diff --git a/common/usbx_device_classes/src/ux_device_class_audio_unitialize.c b/common/usbx_device_classes/src/ux_device_class_audio_unitialize.c index 0c59d53c..6bc821d7 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_unitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_unitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,10 +75,11 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_uninitialize(UX_SLAVE_CLASS_COMMAND *command) @@ -118,7 +119,6 @@ ULONG i; _ux_utility_memory_free(stream -> ux_device_class_audio_stream_buffer); #if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - _ux_utility_memory_free(stream -> ux_device_class_audio_stream_endpoint_buffer); #if defined(UX_DEVICE_CLASS_AUDIO_FEEDBACK_SUPPORT) _ux_utility_memory_free(stream -> ux_device_class_audio_stream_feedback_buffer); #endif diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c b/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c index 2c30a3c3..269e97ef 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_task_function.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_audio_write_task_function PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -72,6 +72,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Yajun Xia Initial Version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added a new mode to manage */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_audio_write_task_function(UX_DEVICE_CLASS_AUDIO_STREAM *stream) @@ -119,9 +124,19 @@ UINT status; /* Start frame transfer anyway (even ZLP). */ transfer_length = stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0 + + /* Stack owns buffer, copy data to it. */ if (transfer_length) _ux_utility_memory_copy(transfer -> ux_slave_transfer_request_data_pointer, stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data, transfer_length); /* Use case of memcpy is verified. */ +#else + + /* Zero copy: directly use frame buffer to transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data; +#endif /* Reset transfer state. */ UX_SLAVE_TRANSFER_STATE_RESET(transfer); diff --git a/common/usbx_device_classes/src/ux_device_class_audio_write_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_audio_write_thread_entry.c index ce6bd7bf..3178b0e6 100644 --- a/common/usbx_device_classes/src/ux_device_class_audio_write_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_audio_write_thread_entry.c @@ -78,6 +78,11 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added a new mode to manage */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_audio_write_thread_entry(ULONG audio_stream) @@ -118,9 +123,19 @@ ULONG actual_length; /* Start frame transfer anyway (even ZLP). */ transfer_length = stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 0 + + /* Stack owns endpoint buffer, copy to buffer. */ if (transfer_length) _ux_utility_memory_copy(transfer -> ux_slave_transfer_request_data_pointer, stream -> ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data, transfer_length); /* Use case of memcpy is verified. */ +#else + + /* Zero copy: directly use frame buffer to transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_audio_stream_transfer_pos -> ux_device_class_audio_frame_data; +#endif /* Issue transfer request, thread blocked until transfer done. */ status = _ux_device_stack_transfer_request(transfer, transfer_length, transfer_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 a1bc8653..f254dc7b 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,10 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ 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 ce7996c3..143b2d12 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,8 +70,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_auto_seq_done(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG icc_status) @@ -109,7 +109,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_ccid_auto_seq_done PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -142,7 +142,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_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_hardware_error.c b/common/usbx_device_classes/src/ux_device_class_ccid_hardware_error.c index 3600c2bd..f618132f 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,8 +67,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_hardware_error(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG error) @@ -147,7 +147,7 @@ UX_DEVICE_CLASS_CCID_RDR_TO_PC_SLOT_STATUS_HEADER *rsp; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_ccid_hardware_error PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -178,7 +178,7 @@ UX_DEVICE_CLASS_CCID_RDR_TO_PC_SLOT_STATUS_HEADER *rsp; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_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 632222bc..e926f7a4 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,8 +70,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_insert(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG seq_start) @@ -134,7 +134,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_ccid_icc_insert PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -165,7 +165,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_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 6b0541b3..5cd13c54 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,8 +66,8 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_icc_remove(UX_DEVICE_CLASS_CCID *ccid, ULONG slot) @@ -127,7 +127,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_ccid_icc_remove PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -157,7 +157,7 @@ UX_DEVICE_CLASS_CCID_SLOT *ccid_slot; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_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 dd732bd5..037a6393 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.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,10 +75,10 @@ /* 03-08-2023 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c index 38ff23f8..d0976777 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_time_extension.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_time_extension PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,8 +64,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt) @@ -134,7 +134,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_ccid_icc_insert PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -167,7 +167,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_ccid_time_extension(UX_DEVICE_CLASS_CCID *ccid, ULONG slot, ULONG wt) diff --git a/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c index 2b970a2f..d49b456f 100644 --- a/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_ccid_uninitialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_ccid_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,10 +66,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_ccid_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkin_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkin_thread.c index 22c9b08d..f665b758 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkin_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkin_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_bulkin_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -92,11 +92,11 @@ /* names conflict C++ keyword, */ /* added auto ZLP support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_acm_bulkin_thread(ULONG cdc_acm_class) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c index 707d7fc7..7b71f770 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_bulkout_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_bulkout_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,11 +83,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_acm_bulkout_thread(ULONG cdc_acm_class) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c index 1ac48fd0..c4e17c88 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_initialize.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,11 +87,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c index fb0371a3..32d62ee0 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -96,8 +96,8 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -365,7 +365,7 @@ UX_SLAVE_TRANSFER *transfer_request; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -397,7 +397,7 @@ UX_SLAVE_TRANSFER *transfer_request; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_ioctl(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c index ef77298b..702636c6 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -90,11 +90,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun Xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -273,7 +273,7 @@ ULONG local_requested_length; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -308,7 +308,7 @@ ULONG local_requested_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_read(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c index 0fac5bd3..10e58b76 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_read_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,12 +83,12 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* fixed return code, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Yajun Xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* fixed return code, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, @@ -322,7 +322,7 @@ UINT status = UX_SUCCESS; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -363,7 +363,7 @@ UINT status = UX_SUCCESS; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_read_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c index ab861027..9b0673e0 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_tasks_run.c @@ -43,7 +43,7 @@ static inline VOID _ux_device_class_cdc_acm_transmission_write_run(UX_SLAVE_CLAS /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_tasks_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,11 +86,11 @@ static inline VOID _ux_device_class_cdc_acm_transmission_write_run(UX_SLAVE_CLAS /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_tasks_run(VOID *instance) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_unitialize.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_unitialize.c index 36954f0f..344fd8bb 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_unitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_unitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,11 +82,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c index aee5590c..8fd4ef33 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -92,11 +92,11 @@ /* names conflict C++ keyword, */ /* added auto ZLP support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun Xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -305,7 +305,7 @@ UINT status = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -340,7 +340,7 @@ UINT status = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_write(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c index 33db3f03..bb7ad165 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_run.c @@ -37,7 +37,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,12 +87,12 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* fixed return code, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Yajun Xia, CQ Xiao Modified comment(s), */ +/* 10-31-2023 Yajun Xia, CQ Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* fixed return code, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, @@ -341,7 +341,7 @@ UINT zlp = UX_FALSE; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_write_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -381,7 +381,7 @@ UINT zlp = UX_FALSE; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_write_run(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c index a8fb9475..fba51e4f 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_acm_write_with_callback.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_acm_write_with_callback PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,8 +81,8 @@ /* resulting in version 6.1.10 */ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, @@ -172,7 +172,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_cdc_acm_write_with_callback PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -205,7 +205,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_cdc_acm_write_with_callback(UX_SLAVE_CLASS_CDC_ACM *cdc_acm, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c index 021e66eb..e0724555 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,10 +82,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -200,7 +201,7 @@ ULONG physical_address_lsw; /* We have found the bulk in endpoint, save it. */ cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER(cdc_ecm); #endif @@ -215,7 +216,7 @@ ULONG physical_address_lsw; /* We have found the bulk out endpoint, save it. */ cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(cdc_ecm); #endif @@ -240,11 +241,17 @@ ULONG physical_address_lsw; /* Wake up the Interrupt thread and send a network notification to the host. */ _ux_device_event_flags_set(&cdc_ecm -> ux_slave_class_cdc_ecm_event_flags_group, UX_DEVICE_CLASS_CDC_ECM_NETWORK_NOTIFICATION_EVENT, UX_OR); +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) + + /* There is no endpoint buffer. */ +#else + /* Reset the endpoint buffers. */ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */ +#endif /* Resume the endpoint threads. */ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread); diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkin_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkin_thread.c index ca3bf1e8..d1aef514 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkin_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkin_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_bulkin_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,10 +86,11 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* used NX API to copy data, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_ecm_bulkin_thread(ULONG cdc_ecm_class) @@ -104,6 +105,9 @@ ULONG actual_flags; NX_PACKET *current_packet; ULONG transfer_length; ULONG copied; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) && !defined(NX_DISABLE_PACKET_CHAIN) +NX_PACKET *packet; +#endif /* Cast properly the cdc_ecm instance. */ UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, cdc_ecm_class) @@ -154,7 +158,84 @@ ULONG copied; /* If the link is down no need to rearm a packet. */ if (cdc_ecm -> ux_slave_class_cdc_ecm_link_state == UX_DEVICE_CLASS_CDC_ECM_LINK_STATE_UP) { - +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) + + /* Default to success. */ + status = UX_SUCCESS; + +#ifndef NX_DISABLE_PACKET_CHAIN + + /* Check if packet is chained, allocate a new packet to fill the total data. */ + if (current_packet -> nx_packet_next) + { + + /* Check if collection of chained data can fit in one packet. */ + if (current_packet -> nx_packet_length > + current_packet -> nx_packet_pool_owner -> nx_packet_pool_payload_size) + status = UX_TRANSFER_BUFFER_OVERFLOW; + else + { + + /* Allocate a new packet for chain data collection. */ + status = nx_packet_allocate(cdc_ecm -> ux_slave_class_cdc_ecm_packet_pool, &packet, + NX_RECEIVE_PACKET, UX_MS_TO_TICK(UX_DEVICE_CLASS_CDC_ECM_PACKET_POOL_WAIT)); + if (status == UX_SUCCESS) + { + + /* Copy the packet to the buffer. */ + status = nx_packet_data_extract_offset(current_packet, 0, + packet -> nx_packet_prepend_ptr, + current_packet -> nx_packet_length, &copied); + if (status == NX_SUCCESS) + { + packet -> nx_packet_length = current_packet -> nx_packet_length; + + /* Release the chained packet. */ + nx_packet_transmit_release(current_packet); + + /* Use copied packet instead. */ + current_packet = packet; + } + } + } + + + /* Can not copy/buffer issue. */ + if (status != UX_SUCCESS) + status = UX_TRANSFER_BUFFER_OVERFLOW; + + } +#endif + if (status == UX_SUCCESS) + { + + /* Set the transfer request data pointer to the packet buffer. */ + transfer_request -> ux_slave_transfer_request_data_pointer = current_packet -> nx_packet_prepend_ptr; + + /* Calculate the transfer length. */ + transfer_length = current_packet -> nx_packet_length; + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_CDC_ECM_PACKET_TRANSMIT, cdc_ecm, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) + + /* Send the request to the device controller. */ + status = _ux_device_stack_transfer_request(transfer_request, transfer_length, transfer_length + 1); + } + + /* Check error code. */ + if (status != UX_SUCCESS) + { + + /* Is this not a transfer abort? (this is expected to happen) */ + if (status != UX_TRANSFER_BUS_RESET) + { + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status); + } + } +#else + /* Can the packet fit in the transfer requests data buffer? */ if (current_packet -> nx_packet_length <= UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE) { @@ -197,6 +278,7 @@ ULONG copied; /* Report error to application. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_TRANSFER_BUFFER_OVERFLOW); } +#endif } /* Free the packet that was just sent. First do some housekeeping. */ diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkout_thread.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkout_thread.c index 0b266f78..f5a65285 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkout_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_bulkout_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_bulkout_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,10 +88,11 @@ /* used pool from NX IP inst, */ /* used NX API to copy data, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_cdc_ecm_bulkout_thread(ULONG cdc_ecm_class) @@ -171,10 +172,20 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; /* Reset the queue pointer of this packet. */ packet -> nx_packet_queue_next = UX_NULL; - + +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) + + /* Send the request to the device controller. */ + transfer_request -> ux_slave_transfer_request_data_pointer = packet -> nx_packet_prepend_ptr + sizeof(USHORT); + status = _ux_device_stack_transfer_request(transfer_request, + packet -> nx_packet_pool_owner -> nx_packet_pool_payload_size - sizeof(USHORT), + packet -> nx_packet_pool_owner -> nx_packet_pool_payload_size - sizeof(USHORT)); +#else + /* Send the request to the device controller. */ status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE); +#endif /* Check the completion code. */ if (status == UX_SUCCESS) @@ -188,6 +199,15 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; packet -> nx_packet_prepend_ptr += sizeof(USHORT); packet -> nx_packet_append_ptr += sizeof(USHORT); +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) + + /* Data already in packet. */ + packet -> nx_packet_length = transfer_request -> ux_slave_transfer_request_actual_length; + + /* Send that packet to the NetX USB broker. */ + _ux_network_driver_packet_received(cdc_ecm -> ux_slave_class_cdc_ecm_network_handle, packet); +#else + /* Copy the received packet in the IP packet data area. */ status = nx_packet_data_append(packet, transfer_request -> ux_slave_transfer_request_data_pointer, @@ -207,6 +227,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CLASS_MALFORMED_PACKET_RECEIVED_ERROR); nx_packet_release(packet); } +#endif } else diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_change.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_change.c index 6b472a08..37b76dce 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_change.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_change.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_change PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,10 +85,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_change(UX_SLAVE_CLASS_COMMAND *command) @@ -130,7 +131,7 @@ UX_SLAVE_ENDPOINT *endpoint; /* We have found the bulk in endpoint, save it. */ cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER(cdc_ecm); @@ -143,7 +144,7 @@ UX_SLAVE_ENDPOINT *endpoint; /* We have found the bulk out endpoint, save it. */ cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER(cdc_ecm); @@ -166,11 +167,17 @@ UX_SLAVE_ENDPOINT *endpoint; /* Communicate the state with the network driver. */ _ux_network_driver_link_up(cdc_ecm -> ux_slave_class_cdc_ecm_network_handle); +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_CDC_ECM_ZERO_COPY) + + /* There is no endpoint buffer. */ +#else + /* Reset the endpoint buffers. */ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */ _ux_utility_memory_set(cdc_ecm -> ux_slave_class_cdc_ecm_bulkin_endpoint -> ux_slave_endpoint_transfer_request. ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_CDC_ECM_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */ +#endif /* Resume the endpoint threads. */ _ux_device_thread_resume(&cdc_ecm -> ux_slave_class_cdc_ecm_bulkout_thread); diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_initialize.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_initialize.c index ba3e475b..302b9acd 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,10 +89,10 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* removed internal NX pool, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_uninitialize.c index 36972dd3..a198c29b 100644 --- a/common/usbx_device_classes/src/ux_device_class_cdc_ecm_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_cdc_ecm_uninitialize.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_cdc_ecm_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,10 +85,10 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* removed internal NX pool, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_cdc_ecm_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_entry.c b/common/usbx_device_classes/src/ux_device_class_dfu_entry.c index be1f7d61..c7f3a10f 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_dfu_entry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_dfu_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c index 31f2b2c6..ad0b00b8 100644 --- a/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_dfu_initialize.c @@ -260,7 +260,7 @@ ULONG descriptor_length; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_dfu_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -291,7 +291,7 @@ ULONG descriptor_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_dfu_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_activate.c b/common/usbx_device_classes/src/ux_device_class_hid_activate.c index fb9fb128..4793defb 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,11 +84,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_entry.c b/common/usbx_device_classes/src/ux_device_class_hid_entry.c index 38b4afe7..92c9743d 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_entry.c @@ -73,9 +73,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_event_get.c b/common/usbx_device_classes/src/ux_device_class_hid_event_get.c index b3d060b8..4268651c 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_event_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_event_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_event_check PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,7 +65,7 @@ /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_event_check(UX_SLAVE_CLASS_HID *hid, @@ -98,7 +98,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_event_free PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -125,7 +125,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_event_free(UX_SLAVE_CLASS_HID *hid) @@ -145,7 +145,7 @@ UCHAR *pos; /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_event_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -180,9 +180,9 @@ UCHAR *pos; /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, @@ -225,7 +225,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_event_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -255,7 +255,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_event_get(UX_SLAVE_CLASS_HID *hid, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_event_set.c b/common/usbx_device_classes/src/ux_device_class_hid_event_set.c index 5c3f9237..80c0f4ae 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_event_set.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_event_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_event_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,9 +79,9 @@ /* resulting in version 6.1.10 */ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, @@ -184,7 +184,7 @@ UCHAR *next_position; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_event_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -214,7 +214,7 @@ UCHAR *next_position; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_event_set(UX_SLAVE_CLASS_HID *hid, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_initialize.c b/common/usbx_device_classes/src/ux_device_class_hid_initialize.c index fd87bd04..9abe4e8e 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,12 +88,12 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* checked compile options, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -382,7 +382,7 @@ UCHAR *buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -411,7 +411,7 @@ UCHAR *buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c index 2cd10e09..1388e587 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_interrupt_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_interrupt_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,9 +84,9 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* off for standalone compile, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_interrupt_thread(ULONG hid_class) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read.c b/common/usbx_device_classes/src/ux_device_class_hid_read.c index dbd85b1c..e0d7c7be 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_read.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_read.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,9 +80,9 @@ /* resulting in version 6.1.11 */ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, @@ -238,7 +238,7 @@ ULONG local_requested_length; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -270,7 +270,7 @@ ULONG local_requested_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_read(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c index 923c854d..c71b5d02 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_read_run.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,9 +74,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, @@ -302,7 +302,7 @@ UINT status= UX_SUCCESS; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -334,7 +334,7 @@ UINT status= UX_SUCCESS; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_read_run(UX_SLAVE_CLASS_HID *hid, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c index 5d16067b..6cf22ad9 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_event_free PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,9 +68,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid) @@ -123,7 +123,7 @@ UCHAR *next_pos; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_receiver_event_free PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -153,7 +153,7 @@ UCHAR *next_pos; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_receiver_event_free(UX_SLAVE_CLASS_HID *hid) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c index e765a9d1..2aad7d4a 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_event_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_event_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,9 +71,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* cleaned compile with TRACE, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid, @@ -122,7 +122,7 @@ UX_DEVICE_CLASS_HID_RECEIVED_EVENT *pos; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_hid_receiver_event_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -153,7 +153,7 @@ UX_DEVICE_CLASS_HID_RECEIVED_EVENT *pos; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_hid_receiver_event_get(UX_SLAVE_CLASS_HID *hid, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c index ee1fc3be..02342bb6 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,9 +77,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone receiver, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_receiver_initialize(UX_SLAVE_CLASS_HID *hid, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c index a8b9bbb9..a90e3cf6 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_tasks_run.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_tasks_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,9 +67,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_receiver_tasks_run(UX_SLAVE_CLASS_HID *hid) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c index bf583484..a8231f34 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* added receiver callback, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_receiver_thread(ULONG hid_instance) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c index b45e9122..5abf47d0 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_receiver_uninitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_receiver_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,9 +66,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_hid_receiver_uninitialize(UX_DEVICE_CLASS_HID_RECEIVER *receiver) diff --git a/common/usbx_device_classes/src/ux_device_class_hid_report_get.c b/common/usbx_device_classes/src/ux_device_class_hid_report_get.c index d08fa7a8..458314a3 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_report_get.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_report_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_report_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,8 +75,8 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_get(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_report_set.c b/common/usbx_device_classes/src/ux_device_class_hid_report_set.c index 10b9e44c..f6e95f47 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_report_set.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_report_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_report_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,8 +73,8 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_report_set(UX_SLAVE_CLASS_HID *hid, ULONG descriptor_type, diff --git a/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c b/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c index 4f72f2f7..ef9f23a2 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_tasks_run.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_tasks_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,9 +73,9 @@ /* DATE NAME DESCRIPTION */ /* */ /* 01-31-2022 Chaoqiong Xiao Initial Version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_tasks_run(VOID *instance) @@ -107,6 +107,9 @@ UINT status; hid -> ux_device_class_hid_receiver -> ux_device_class_hid_receiver_tasks_run(hid); #endif + /* Get access to current event instance. */ + hid_event = &hid -> ux_device_class_hid_event; + /* Run HID state machine. */ switch(hid -> ux_device_class_hid_event_state) { @@ -180,7 +183,6 @@ UINT status; /* Run transfer state machine. */ trans = &hid -> ux_device_class_hid_interrupt_endpoint -> ux_slave_endpoint_transfer_request; - hid_event = &hid -> ux_device_class_hid_event; status = _ux_device_stack_transfer_run(trans, hid_event -> ux_device_class_hid_event_length, hid_event -> ux_device_class_hid_event_length); diff --git a/common/usbx_device_classes/src/ux_device_class_hid_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_hid_uninitialize.c index 4770532e..3a83fbc6 100644 --- a/common/usbx_device_classes/src/ux_device_class_hid_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_hid_uninitialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_hid_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,11 +78,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_hid_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_activate.c b/common/usbx_device_classes/src/ux_device_class_pima_activate.c index 1bdf500b..2e5c7c3f 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,10 +76,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* supported optional INT EP, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -145,7 +146,9 @@ UX_SLAVE_ENDPOINT *endpoint_interrupt; UX_DEVICE_CLASS_PIMA_BULKIN_BUFFER(pima); endpoint_out -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_PIMA_BULKOUT_BUFFER(pima); - endpoint_interrupt -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = + if (endpoint_interrupt) + endpoint_interrupt -> ux_slave_endpoint_transfer_request. + ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_PIMA_INTERRUPTIN_BUFFER(pima); #endif diff --git a/common/usbx_device_classes/src/ux_device_class_pima_deactivate.c b/common/usbx_device_classes/src/ux_device_class_pima_deactivate.c index 7bf3fd30..2be45ec4 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_deactivate.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_deactivate.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_deactivate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* supported optional INT EP, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_deactivate(UX_SLAVE_CLASS_COMMAND *command) @@ -87,7 +90,8 @@ UX_SLAVE_CLASS *class_ptr; /* Terminate the transactions pending on the endpoints. */ _ux_device_stack_transfer_all_request_abort(pima -> ux_device_class_pima_bulk_in_endpoint, UX_TRANSFER_BUS_RESET); _ux_device_stack_transfer_all_request_abort(pima -> ux_device_class_pima_bulk_out_endpoint, UX_TRANSFER_BUS_RESET); - _ux_device_stack_transfer_all_request_abort(pima -> ux_device_class_pima_interrupt_endpoint, UX_TRANSFER_BUS_RESET); + if (pima -> ux_device_class_pima_interrupt_endpoint) + _ux_device_stack_transfer_all_request_abort(pima -> ux_device_class_pima_interrupt_endpoint, UX_TRANSFER_BUS_RESET); /* Session is now closed. */ pima -> ux_device_class_pima_session_id = 0; diff --git a/common/usbx_device_classes/src/ux_device_class_pima_device_info_send.c b/common/usbx_device_classes/src/ux_device_class_pima_device_info_send.c index 244fa996..66365421 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_device_info_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_device_info_send.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_info_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,10 +83,10 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_info_send(UX_SLAVE_CLASS_PIMA *pima) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_get.c b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_get.c index fa93952d..33c44661 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_device_prop_value_get.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_device_prop_value_get PORTABLE C */ -/* 6.X */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,10 +85,10 @@ /* updated status handling, */ /* improved sanity checks, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_device_prop_value_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_entry.c b/common/usbx_device_classes/src/ux_device_class_pima_entry.c index f3e96005..251abf38 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_entry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,9 +72,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_event_set.c b/common/usbx_device_classes/src/ux_device_class_pima_event_set.c index 570a477a..62cfcde1 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_event_set.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_event_set.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_event_set PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,9 @@ /* refined macros names, */ /* added transaction ID, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked if INT EP exists, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_event_set(UX_SLAVE_CLASS_PIMA *pima, @@ -97,7 +100,13 @@ UX_SLAVE_DEVICE *device; return(UX_DEVICE_HANDLE_UNKNOWN); } - + + /* Check if interrupt endpoint is available. */ + if (pima -> ux_device_class_pima_interrupt_endpoint == UX_NULL) + { + return (UX_FUNCTION_NOT_SUPPORTED); + } + /* Current position of the head. */ current_pima_event = pima -> ux_device_class_pima_event_array_head; diff --git a/common/usbx_device_classes/src/ux_device_class_pima_initialize.c b/common/usbx_device_classes/src/ux_device_class_pima_initialize.c index c12ed51d..f3636174 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,10 +81,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -263,7 +263,7 @@ UX_SLAVE_CLASS *class_ptr; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_pima_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -292,7 +292,7 @@ UX_SLAVE_CLASS *class_ptr; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_pima_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c b/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c index 68da7f74..db93e51f 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_interrupt_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_interrupt_thread PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,6 +84,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed event message size, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved INT EP management, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_pima_interrupt_thread(ULONG pima_class) @@ -122,13 +125,16 @@ UCHAR *buffer; /* Get the pointer to the device. */ device = &_ux_system_slave -> ux_system_slave_device; - /* All PIMA events are on the interrupt endpoint IN, from the host. */ - transfer_request_in = &pima -> ux_device_class_pima_interrupt_endpoint -> ux_slave_endpoint_transfer_request; /* As long as the device is in the CONFIGURED state. */ while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED) { + /* All PIMA events are on the interrupt endpoint IN, from the host. */ + if (pima -> ux_device_class_pima_interrupt_endpoint == UX_NULL) + break; + transfer_request_in = &pima -> ux_device_class_pima_interrupt_endpoint -> ux_slave_endpoint_transfer_request; + /* Wait until something has awaken us. */ status = _ux_device_semaphore_get(&pima -> ux_device_class_pima_interrupt_thread_semaphore, UX_WAIT_FOREVER); diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_info_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_info_get.c index c990b22a..9a4c224c 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_info_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,10 +80,10 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_info_get(UX_SLAVE_CLASS_PIMA *pima, ULONG object_handle) diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_desc_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_desc_get.c index 86ed781c..15fc349e 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_desc_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_desc_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_prop_desc_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,10 +81,10 @@ /* updated status handling, */ /* passed max length to app, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_prop_desc_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_get.c index e52728d0..66c18456 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_prop_value_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_prop_value_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,10 +84,10 @@ /* updated status handling, */ /* passed max length to app, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_prop_value_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_object_references_get.c b/common/usbx_device_classes/src/ux_device_class_pima_object_references_get.c index 42a4d4dd..4018cd09 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_object_references_get.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_object_references_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_object_references_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,10 +81,10 @@ /* updated status handling, */ /* passed max length to app, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_object_references_get(UX_SLAVE_CLASS_PIMA *pima, diff --git a/common/usbx_device_classes/src/ux_device_class_pima_storage_id_send.c b/common/usbx_device_classes/src/ux_device_class_pima_storage_id_send.c index 2c6b3a32..76552656 100644 --- a/common/usbx_device_classes/src/ux_device_class_pima_storage_id_send.c +++ b/common/usbx_device_classes/src/ux_device_class_pima_storage_id_send.c @@ -42,7 +42,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_pima_storage_id_send PORTABLE C */ -/* 6.X */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,10 +80,10 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* improved sanity checks, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_pima_storage_id_send(UX_SLAVE_CLASS_PIMA *pima) diff --git a/common/usbx_device_classes/src/ux_device_class_printer_activate.c b/common/usbx_device_classes/src/ux_device_class_printer_activate.c index 9080a023..d90ac277 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,10 +68,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -108,7 +108,7 @@ UX_SLAVE_ENDPOINT *endpoint; if (endpoint -> ux_slave_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_IN) { printer -> ux_device_class_printer_endpoint_in = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_PRINTER_WRITE_BUFFER(printer); #endif @@ -118,7 +118,7 @@ UX_SLAVE_ENDPOINT *endpoint; else { printer -> ux_device_class_printer_endpoint_out = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_PRINTER_READ_BUFFER(printer); #endif 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 18385424..e2316656 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 @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,10 +72,10 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -110,7 +110,7 @@ UINT status; printer -> ux_device_class_printer_parameter.ux_device_class_printer_instance_deactivate = printer_parameter -> ux_device_class_printer_instance_deactivate; printer -> ux_device_class_printer_parameter.ux_device_class_printer_soft_reset = printer_parameter -> ux_device_class_printer_soft_reset; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) /* Allocate endpoint buffer. */ UX_ASSERT(!UX_DEVICE_CLASS_PRINTER_ENDPOINT_BUFFER_SIZE_CALC_OVERFLOW); @@ -132,7 +132,7 @@ UINT status; { /* Free the resources. */ -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) _ux_utility_memory_free(printer -> ux_device_class_printer_endpoint_buffer); #endif _ux_utility_memory_free(printer); @@ -152,7 +152,7 @@ UINT status; _ux_device_mutex_delete(&printer -> ux_device_class_printer_endpoint_in_mutex); /* Free the resources. */ -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) _ux_utility_memory_free(printer -> ux_device_class_printer_endpoint_buffer); #endif _ux_utility_memory_free(printer); 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 2e510104..3fdded47 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 @@ -116,6 +116,21 @@ ULONG local_requested_length; /* All Printer reading are on the endpoint OUT, from the host. */ transfer_request = &endpoint -> ux_slave_endpoint_transfer_request; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_PRINTER_ZERO_COPY) + + /* Check if device is configured. */ + if (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED) + { + + /* Issue the transfer request. */ + local_requested_length = requested_length; + transfer_request -> ux_slave_transfer_request_data_pointer = buffer; + status = _ux_device_stack_transfer_request(transfer_request, + local_requested_length, local_requested_length); + *actual_length = transfer_request -> ux_slave_transfer_request_actual_length; + } +#else + /* Reset the actual length. */ *actual_length = 0; @@ -179,6 +194,7 @@ ULONG local_requested_length; return(status); } } +#endif /* Free Mutex resource. */ _ux_device_mutex_off(&printer -> ux_device_class_printer_endpoint_out_mutex); @@ -207,7 +223,7 @@ ULONG local_requested_length; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -243,9 +259,9 @@ ULONG local_requested_length; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* fixed error checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_read(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c index db7499b1..bf57d0d1 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_read_run.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_read_run.c @@ -120,6 +120,53 @@ UINT status = UX_SUCCESS; /* All Printer reading are on the endpoint OUT, from the host. */ transfer_request = &endpoint -> ux_slave_endpoint_transfer_request; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_PRINTER_ZERO_COPY) + + /* Run the transfer state machine. */ + if (printer -> ux_device_class_printer_read_state == UX_STATE_RESET) + { + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PRINTER_READ, printer, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) + + printer -> ux_device_class_printer_read_state = UX_DEVICE_CLASS_PRINTER_READ_START; + printer -> ux_device_class_printer_read_status = UX_TRANSFER_NO_ANSWER; + transfer_request -> ux_slave_transfer_request_data_pointer = buffer; + UX_SLAVE_TRANSFER_STATE_RESET(transfer_request); + } + + /* Issue the transfer request. */ + max_transfer_length = requested_length; + status = _ux_device_stack_transfer_run(transfer_request, max_transfer_length, max_transfer_length); + + /* Error case. */ + if (status < UX_STATE_NEXT) + { + + printer -> ux_device_class_printer_read_state = UX_STATE_RESET; + printer -> ux_device_class_printer_read_status = + transfer_request -> ux_slave_transfer_request_completion_code; + return(UX_STATE_ERROR); + } + + /* Success case. */ + if (status == UX_STATE_NEXT) + { + + /* Last transfer status. */ + printer -> ux_device_class_printer_read_status = + transfer_request -> ux_slave_transfer_request_completion_code; + + /* Update actual length. */ + *actual_length = transfer_request -> ux_slave_transfer_request_actual_length; + + /* It's done. */ + printer -> ux_device_class_printer_read_state = UX_STATE_RESET; + } + + return(status); +#else + /* Handle state cases. */ switch(printer -> ux_device_class_printer_read_state) { @@ -230,6 +277,7 @@ UINT status = UX_SUCCESS; printer -> ux_device_class_printer_read_status = UX_INVALID_STATE; break; } +#endif /* Error cases. */ return(UX_STATE_EXIT); @@ -240,7 +288,7 @@ UINT status = UX_SUCCESS; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_read_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -281,7 +329,7 @@ UINT status = UX_SUCCESS; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_read_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c index 89f5c37f..0a84a349 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_uninitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,10 +75,10 @@ /* 10-31-2022 Yajun Xia Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_uninitialize(UX_SLAVE_CLASS_COMMAND *command) @@ -104,7 +104,7 @@ UX_SLAVE_CLASS *class_ptr; _ux_device_mutex_delete(&printer -> ux_device_class_printer_endpoint_out_mutex); #endif /* Free the resources. */ -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if defined(UX_DEVICE_CLASS_PRINTER_OWN_ENDPOINT_BUFFER) _ux_utility_memory_free(printer -> ux_device_class_printer_endpoint_buffer); #endif _ux_utility_memory_free(printer); 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 f2df267a..a955cd24 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 @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,10 +79,10 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added auto ZLP support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, @@ -146,6 +146,28 @@ UINT status = 0; return(status); } +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_PRINTER_ZERO_COPY) + + /* Check if device is configured. */ + if (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED) + { + +#if defined(UX_DEVICE_CLASS_PRINTER_WRITE_AUTO_ZLP) + + /* Issue with larger host length to append zlp if necessary. */ + local_host_length = requested_length + 1; +#else + local_host_length = requested_length; +#endif + local_requested_length = requested_length; + + /* Issue the transfer request. */ + transfer_request -> ux_slave_transfer_request_data_pointer = buffer; + status = _ux_device_stack_transfer_request(transfer_request, local_requested_length, local_host_length); + *actual_length = transfer_request -> ux_slave_transfer_request_actual_length; + } +#else + /* Check if we need more transactions. */ local_host_length = UX_DEVICE_CLASS_PRINTER_WRITE_BUFFER_SIZE; while (device -> ux_slave_device_state == UX_DEVICE_CONFIGURED && @@ -207,6 +229,7 @@ UINT status = 0; return(status); } } +#endif /* Free Mutex resource. */ _ux_device_mutex_off(&printer -> ux_device_class_printer_endpoint_in_mutex); @@ -235,7 +258,7 @@ UINT status = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -271,9 +294,9 @@ UINT status = 0; /* DATE NAME DESCRIPTION */ /* */ /* 03-08-2023 Yajun Xia Initial Version 6.2.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* fixed error checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_write(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c index 034fcd74..a5dbd1de 100644 --- a/common/usbx_device_classes/src/ux_device_class_printer_write_run.c +++ b/common/usbx_device_classes/src/ux_device_class_printer_write_run.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_printer_write_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -78,10 +78,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Yajun Xia Initial Version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, @@ -91,8 +91,10 @@ UINT _ux_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR UX_SLAVE_ENDPOINT *endpoint; UX_SLAVE_DEVICE *device; UX_SLAVE_TRANSFER *transfer_request; -UINT zlp = UX_FALSE; UINT status = 0; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER != 1) || !defined(UX_DEVICE_CLASS_CDC_ACM_ZERO_COPY) +UINT zlp = UX_FALSE; +#endif /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_PRINTER_WRITE, printer, buffer, requested_length, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) @@ -135,6 +137,54 @@ UINT status = 0; /* We are writing to the IN endpoint. */ transfer_request = &endpoint -> ux_slave_endpoint_transfer_request; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_PRINTER_ZERO_COPY) + + /* Run the transfer state machine. */ + if (printer -> ux_device_class_printer_write_state == UX_STATE_RESET) + { + + /* Set the state to WRITE_WAIT. */ + printer -> ux_device_class_printer_write_state = UX_DEVICE_CLASS_PRINTER_WRITE_WAIT; + printer -> ux_device_class_printer_write_status = UX_TRANSFER_NO_ANSWER; + transfer_request -> ux_slave_transfer_request_data_pointer = buffer; + UX_SLAVE_TRANSFER_STATE_RESET(transfer_request); + } + + /* Issue the transfer request. */ +#if defined(UX_DEVICE_CLASS_PRINTER_WRITE_AUTO_ZLP) + status = _ux_device_stack_transfer_run(transfer_request, requested_length, requested_length + 1); +#else + status = _ux_device_stack_transfer_run(transfer_request, requested_length, requested_length); +#endif + + /* Error case. */ + if (status < UX_STATE_NEXT) + { + + printer -> ux_device_class_printer_write_state = UX_STATE_RESET; + printer -> ux_device_class_printer_write_status = + transfer_request -> ux_slave_transfer_request_completion_code; + return(UX_STATE_ERROR); + } + + /* Success case. */ + if (status == UX_STATE_NEXT) + { + + /* Last transfer status. */ + printer -> ux_device_class_printer_write_status = + transfer_request -> ux_slave_transfer_request_completion_code; + + /* Update actual length. */ + *actual_length = transfer_request -> ux_slave_transfer_request_actual_length; + + /* It's done. */ + printer -> ux_device_class_printer_write_state = UX_STATE_RESET; + } + return(status); + +#else + /* Handle state cases. */ switch(printer -> ux_device_class_printer_write_state) { @@ -254,6 +304,7 @@ UINT status = 0; printer -> ux_device_class_printer_write_state = UX_STATE_RESET; break; } +#endif /* Error case. */ return(UX_STATE_EXIT); @@ -264,7 +315,7 @@ UINT status = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_printer_write_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -305,7 +356,7 @@ UINT status = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_printer_write_run(UX_DEVICE_CLASS_PRINTER *printer, UCHAR *buffer, diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_activate.c b/common/usbx_device_classes/src/ux_device_class_rndis_activate.c index 141cc2e3..d8d946c9 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_activate.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,10 +79,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_activate(UX_SLAVE_CLASS_COMMAND *command) @@ -157,7 +158,7 @@ ULONG physical_address_lsw; /* We have found the bulk in endpoint, save it. */ rndis -> ux_slave_class_rndis_bulkin_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER(rndis); #endif @@ -171,7 +172,7 @@ ULONG physical_address_lsw; /* We have found the bulk out endpoint, save it. */ rndis -> ux_slave_class_rndis_bulkout_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) endpoint -> ux_slave_endpoint_transfer_request.ux_slave_transfer_request_data_pointer = UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER(rndis); #endif @@ -209,12 +210,14 @@ ULONG physical_address_lsw; physical_address_lsw); /* Reset the endpoint buffers. */ +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && !defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkout_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ + ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE); /* Use case of memset is verified. */ _ux_utility_memory_set(rndis -> ux_slave_class_rndis_bulkin_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ + ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE); /* Use case of memset is verified. */ +#endif _ux_utility_memory_set(rndis -> ux_slave_class_rndis_interrupt_endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer, 0, UX_SLAVE_REQUEST_DATA_MAX_LENGTH); /* Use case of memset is verified. */ + ux_slave_transfer_request_data_pointer, 0, UX_DEVICE_CLASS_RNDIS_INTERRUPTIN_BUFFER_SIZE); /* Use case of memset is verified. */ /* Resume the endpoint threads. */ _ux_device_thread_resume(&rndis -> ux_slave_class_rndis_interrupt_thread); diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_bulkin_thread.c b/common/usbx_device_classes/src/ux_device_class_rndis_bulkin_thread.c index c2c0e61d..e0e7de9c 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_bulkin_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_bulkin_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_bulkin_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,10 +88,11 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* used NX API to copy data, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_rndis_bulkin_thread(ULONG rndis_class) @@ -106,6 +107,10 @@ ULONG actual_flags; NX_PACKET *current_packet; ULONG transfer_length; ULONG copied; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) && !defined(NX_DISABLE_PACKET_CHAIN) +NX_PACKET *packet; +UINT do_copy; +#endif /* Cast properly the rndis instance. */ UX_THREAD_EXTENSION_PTR_GET(class_ptr, UX_SLAVE_CLASS, rndis_class) @@ -156,10 +161,125 @@ ULONG copied; /* If the link is down no need to rearm a packet. */ if (rndis -> ux_slave_class_rndis_link_state == UX_DEVICE_CLASS_RNDIS_LINK_STATE_UP) { - + + /* Input packet mapping: + * | <----- nx_packet_length -----> | + * .. NX_PHYSICAL_HEADER? | NX_ETHERNET_SIZE | Packet ... | + * start prepend append + */ + /* Calculate the transfer length. */ transfer_length = current_packet -> nx_packet_length + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH; +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) + + /* Default to success. */ + status = UX_SUCCESS; + + /* Check if there was enough space for RNDIS header, if not data should be copied. */ + do_copy = (current_packet -> nx_packet_data_start + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH > current_packet -> nx_packet_prepend_ptr); + +#ifndef NX_DISABLE_PACKET_CHAIN + + /* Check if packet is chained, chained packets must be joined (copied). */ + if (current_packet -> nx_packet_next) + do_copy = 1; +#endif + + /* Check if data is being copied to new packet. */ + if (do_copy) + { + + /* Check if packet pool is good for data collection. */ + if (transfer_length > current_packet -> nx_packet_pool_owner -> nx_packet_pool_payload_size) + status = UX_TRANSFER_BUFFER_OVERFLOW; + + /* Allocate a new packet for data collection. */ + if (status == UX_SUCCESS) + { + status = nx_packet_allocate(current_packet -> nx_packet_pool_owner, + &packet, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH, + UX_MS_TO_TICK(UX_DEVICE_CLASS_RNDIS_PACKET_POOL_WAIT)); + + /* Reserve space for RNDIS header. */ + packet -> nx_packet_append_ptr = packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH; + + } + + /* Copy the data to allocated. */ + if (status == UX_SUCCESS) + { + + /* RNDIS packet header already reserved. */ + + /* Copy the data to allocated. */ + status = nx_packet_data_extract_offset(current_packet, 0, + packet -> nx_packet_append_ptr, + current_packet -> nx_packet_length, &copied); + if (status == NX_SUCCESS) + { + packet -> nx_packet_length = copied; + + /* Release the chained packet. */ + current_packet -> nx_packet_length = current_packet -> nx_packet_length - UX_DEVICE_CLASS_RNDIS_ETHERNET_SIZE; + nx_packet_transmit_release(current_packet); + + /* Use copied packet to transfer. */ + current_packet = packet; + } + } + + /* Can not copy/buffer issue. */ + if (status != UX_SUCCESS) + status = UX_TRANSFER_BUFFER_OVERFLOW; + } + else + { + + /* There is enough space for RNDIS header, move prepend_ptr for it. */ + current_packet -> nx_packet_prepend_ptr -= UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH; + } + + if (status == UX_SUCCESS) + { + + /* Add the RNDIS header to this packet. */ + + /* Reset the RNDIS header. */ + _ux_utility_memory_set(current_packet -> nx_packet_prepend_ptr, 0x00, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH); /* Use case of memset is verified. */ + + /* Initialize fields in header. */ + _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_TYPE, UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_MSG); + _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_MESSAGE_LENGTH, transfer_length); + _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET, + UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH - UX_DEVICE_CLASS_RNDIS_PACKET_DATA_OFFSET); + _ux_utility_long_put(current_packet -> nx_packet_prepend_ptr + UX_DEVICE_CLASS_RNDIS_PACKET_DATA_LENGTH, current_packet -> nx_packet_length); + + /* Set the transfer request data pointer to the packet buffer. */ + transfer_request -> ux_slave_transfer_request_data_pointer = current_packet -> nx_packet_prepend_ptr; + + /* If trace is enabled, insert this event into the trace buffer. */ + UX_TRACE_IN_LINE_INSERT(UX_TRACE_DEVICE_CLASS_RNDIS_PACKET_TRANSMIT, rndis, 0, 0, 0, UX_TRACE_DEVICE_CLASS_EVENTS, 0, 0) + + /* Send the request to the device controller. */ + status = _ux_device_stack_transfer_request(transfer_request, transfer_length, transfer_length + 1); + } + + /* Check error code. */ + if (status != UX_SUCCESS) + { + + /* Is this not a transfer abort? (it's fine to be aborted) */ + if (status != UX_TRANSFER_BUS_RESET) + { + + /* Error trap. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, status); + } + + } +#else + /* Is there enough space for this packet in the transfer buffer? */ if (transfer_length <= UX_DEVICE_CLASS_RNDIS_BULKIN_BUFFER_SIZE) { @@ -200,6 +320,7 @@ ULONG copied; /* Report error to application. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_MEMORY_INSUFFICIENT); } +#endif } /* Free the packet that was just sent. First do some housekeeping. */ diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_bulkout_thread.c b/common/usbx_device_classes/src/ux_device_class_rndis_bulkout_thread.c index e4c3b508..43b6aee7 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_bulkout_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_bulkout_thread.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_bulkout_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,10 +88,11 @@ /* used NX API to copy data, */ /* used linked NX IP pool, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added zero copy support, */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_rndis_bulkout_thread(ULONG rndis_class) @@ -165,10 +166,41 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; /* Reset the queue pointer of this packet. */ packet -> nx_packet_queue_next = UX_NULL; - + +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) + + /* Adjust the prepend pointer to take into account the RNDIS header and + non 3 bit alignment of the ethernet header. */ + packet -> nx_packet_append_ptr += UX_DEVICE_CLASS_RNDIS_PACKET_BUFFER; + switch(((ALIGN_TYPE)packet -> nx_packet_append_ptr) & 0x3) + { + case 0: + packet -> nx_packet_append_ptr += 2; + break; + case 1: + packet -> nx_packet_append_ptr += 1; + break; + case 3: + packet -> nx_packet_append_ptr += 3; + break; + default: + break; + } + packet -> nx_packet_prepend_ptr = packet -> nx_packet_append_ptr - UX_DEVICE_CLASS_RNDIS_PACKET_BUFFER; + + /* Get actual size of transfer buffer. */ + packet_payload = (ULONG)(packet -> nx_packet_data_end - packet -> nx_packet_prepend_ptr); + + /* Send the request to the device controller. */ + transfer_request -> ux_slave_transfer_request_data_pointer = packet -> nx_packet_prepend_ptr; + status = _ux_device_stack_transfer_request(transfer_request, + packet_payload, packet_payload); +#else + /* Send the request to the device controller. */ status = _ux_device_stack_transfer_request(transfer_request, UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE, UX_DEVICE_CLASS_RNDIS_BULKOUT_BUFFER_SIZE); +#endif /* Check the completion code. */ if (status == UX_SUCCESS) @@ -195,6 +227,17 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; if (packet_payload <= transfer_request -> ux_slave_transfer_request_actual_length - UX_DEVICE_CLASS_RNDIS_PACKET_HEADER_LENGTH) { +#if (UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1) && defined(UX_DEVICE_CLASS_RNDIS_ZERO_COPY) + + /* Data already in buffer, adjust packet start and save length. */ + packet -> nx_packet_prepend_ptr += UX_DEVICE_CLASS_RNDIS_PACKET_BUFFER; + packet -> nx_packet_length = packet_payload; + packet -> nx_packet_append_ptr += packet -> nx_packet_length; + + /* Send that packet to the NetX USB broker. */ + _ux_network_driver_packet_received(rndis -> ux_slave_class_rndis_network_handle, packet); +#else + /* Adjust the prepend pointer to take into account the non 3 bit alignment of the ethernet header. */ packet -> nx_packet_prepend_ptr += sizeof(USHORT); packet -> nx_packet_append_ptr += sizeof(USHORT); @@ -219,6 +262,7 @@ USB_NETWORK_DEVICE_TYPE *ux_nx_device; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CLASS_ETH_PACKET_ERROR); nx_packet_release(packet); } +#endif } else { diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c b/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c index a358e862..d8041869 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_control_request.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_control_request PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -94,10 +94,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_control_request(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c index 582b7746..52bc74a0 100644 --- a/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_rndis_initialize.c @@ -78,7 +78,7 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT /* FUNCTION RELEASE */ /* */ /* _ux_device_class_rndis_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -139,11 +139,11 @@ ULONG ux_device_class_rndis_oid_supported_list[UX_DEVICE_CLASS_RNDIS_OID_SUPPORT /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* removed internal NX pool, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ /* checked compile options, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_rndis_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -156,7 +156,7 @@ UINT _ux_device_class_rndis_initialize(UX_SLAVE_CLASS_COMMAND *command) UX_SLAVE_CLASS_RNDIS *rndis; UX_SLAVE_CLASS_RNDIS_PARAMETER *rndis_parameter; UX_SLAVE_CLASS *class_ptr; -UINT status; +UINT status = UX_SUCCESS; /* Compile option checks. */ diff --git a/common/usbx_device_classes/src/ux_device_class_storage_activate.c b/common/usbx_device_classes/src/ux_device_class_storage_activate.c index 6b34c2a8..d9be6df6 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_activate.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_activate PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,10 +74,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_activate(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c b/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c index 8366314d..66e2a509 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_csw_send.c @@ -39,7 +39,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_csw_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -90,10 +90,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_csw_send(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_entry.c b/common/usbx_device_classes/src/ux_device_class_storage_entry.c index 5d00a9d5..d36472f1 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_entry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,9 +75,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c b/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c index 3ebf4fd7..cd5f5c00 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_get_configuration.c @@ -303,7 +303,7 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_configuration PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -349,10 +349,10 @@ UCHAR usbx_device_class_storage_configuration_active_profile[] = { /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_configuration(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c b/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c index be84a58d..2bc8c129 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_get_performance.c @@ -45,7 +45,7 @@ UCHAR usbx_device_class_storage_performance[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_get_performance PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -90,10 +90,10 @@ UCHAR usbx_device_class_storage_performance[] = { /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_get_performance(UX_SLAVE_CLASS_STORAGE *storage, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_initialize.c b/common/usbx_device_classes/src/ux_device_class_storage_initialize.c index b9e46e99..95e8a47a 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_initialize.c @@ -41,7 +41,7 @@ UCHAR _ux_system_slave_class_storage_product_serial[] = "123 /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,10 +82,10 @@ UCHAR _ux_system_slave_class_storage_product_serial[] = "123 /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -249,7 +249,7 @@ ULONG lun_index; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_storage_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -278,7 +278,7 @@ ULONG lun_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_storage_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c b/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c index 74784a6a..f55da6d2 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_inquiry.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_inquiry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -92,10 +92,10 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* updated dCSWDataResidue, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_inquiry(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c index 64ea671c..7b77c3b7 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_mode_sense.c @@ -66,7 +66,7 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_mode_sense PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -116,10 +116,10 @@ UCHAR usbx_device_class_storage_mode_sense_page_cdrom[USBX_DEVICE_CLASS_STORAGE_ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_mode_sense(UX_SLAVE_CLASS_STORAGE *storage, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c b/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c index 528e496b..dc23299a 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_capacity.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_capacity PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,10 +86,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c b/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c index f5029c60..7c53186b 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_disk_information.c @@ -65,7 +65,7 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_disk_information PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -109,10 +109,10 @@ UCHAR usbx_device_class_storage_disk_information[] = { /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_disk_information(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c b/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c index 795778b8..07ebefd8 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_format_capacity.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_format_capacity PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -85,10 +85,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_format_capacity(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c b/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c index 5f5a390c..394fb72b 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_read_toc.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_read_toc PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,10 +86,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_read_toc(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_report_key.c b/common/usbx_device_classes/src/ux_device_class_storage_report_key.c index 3478e6c6..1a632743 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_report_key.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_report_key.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_report_key PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,10 +86,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_report_key(UX_SLAVE_CLASS_STORAGE *storage, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c b/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c index c1536d58..9bcb0cdd 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_request_sense.c @@ -40,7 +40,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_request_sense PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,10 +87,10 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* checked compiling options */ /* by runtime UX_ASSERT, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_request_sense(UX_SLAVE_CLASS_STORAGE *storage, ULONG lun, UX_SLAVE_ENDPOINT *endpoint_in, diff --git a/common/usbx_device_classes/src/ux_device_class_storage_thread.c b/common/usbx_device_classes/src/ux_device_class_storage_thread.c index 6a2e873a..ad60a154 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_thread.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_thread.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_thread PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -127,10 +127,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_storage_thread(ULONG storage_class) diff --git a/common/usbx_device_classes/src/ux_device_class_storage_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_storage_uninitialize.c index 59a7453e..763a6803 100644 --- a/common/usbx_device_classes/src/ux_device_class_storage_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_storage_uninitialize.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_storage_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,10 +75,10 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ /* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_storage_uninitialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_video_change.c b/common/usbx_device_classes/src/ux_device_class_video_change.c index 443fb9f6..56d37777 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_change.c +++ b/common/usbx_device_classes/src/ux_device_class_video_change.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_change PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,11 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_change(UX_SLAVE_CLASS_COMMAND *command) @@ -149,11 +150,6 @@ ULONG stream_index; /* Save it. */ stream -> ux_device_class_video_stream_endpoint = endpoint; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - endpoint -> ux_slave_endpoint_transfer_request. - ux_slave_transfer_request_data_pointer = - stream -> ux_device_class_video_stream_endpoint_buffer; -#endif break; } diff --git a/common/usbx_device_classes/src/ux_device_class_video_entry.c b/common/usbx_device_classes/src/ux_device_class_video_entry.c index d0c53599..610bee8d 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_video_entry.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_entry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* 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 Yajun xia Modified comment(s), */ +/* 10-31-2023 Yajun xia Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_entry(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_video_initialize.c b/common/usbx_device_classes/src/ux_device_class_video_initialize.c index 12e39bc0..94d2f879 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_initialize.c +++ b/common/usbx_device_classes/src/ux_device_class_video_initialize.c @@ -33,7 +33,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,10 +70,11 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command) @@ -153,7 +154,11 @@ ULONG i; stream_parameter -> ux_device_class_video_stream_parameter_max_payload_buffer_nb; /* Create block of buffer buffer is cache safe for USB transfer. */ +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + stream -> ux_device_class_video_stream_buffer = (UCHAR *)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, memory_size); +#else stream -> ux_device_class_video_stream_buffer = (UCHAR *)_ux_utility_memory_allocate(UX_NO_ALIGN, UX_REGULAR_MEMORY, memory_size); +#endif /* Check for successful allocation. */ if (stream -> ux_device_class_video_stream_buffer == UX_NULL) @@ -166,17 +171,6 @@ ULONG i; stream -> ux_device_class_video_stream_transfer_pos = (UX_DEVICE_CLASS_VIDEO_PAYLOAD *)stream -> ux_device_class_video_stream_buffer; stream -> ux_device_class_video_stream_access_pos = stream -> ux_device_class_video_stream_transfer_pos; -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - stream -> ux_device_class_video_stream_endpoint_buffer = _ux_utility_memory_allocate( - UX_NO_ALIGN, UX_CACHE_SAFE_MEMORY, - stream -> ux_device_class_video_stream_payload_buffer_size); - if (stream -> ux_device_class_video_stream_endpoint_buffer == UX_NULL) - { - status = UX_MEMORY_INSUFFICIENT; - break; - } -#endif - #if !defined(UX_DEVICE_STANDALONE) /* Create memory block for streaming thread stack in addition. */ @@ -261,10 +255,6 @@ ULONG i; _ux_utility_thread_delete(&stream -> ux_device_class_video_stream_thread); if (stream -> ux_device_class_video_stream_thread_stack) _ux_utility_memory_free(stream -> ux_device_class_video_stream_thread_stack); -#endif -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - if (stream -> ux_device_class_video_stream_endpoint_buffer) - _ux_utility_memory_free(stream -> ux_device_class_video_stream_endpoint_buffer); #endif if (stream -> ux_device_class_video_stream_buffer) _ux_utility_memory_free(stream -> ux_device_class_video_stream_buffer); @@ -280,7 +270,7 @@ ULONG i; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_initialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -309,7 +299,7 @@ ULONG i; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_initialize(UX_SLAVE_CLASS_COMMAND *command) diff --git a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c index 517fa15b..79b46259 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_ioctl.c +++ b/common/usbx_device_classes/src/ux_device_class_video_ioctl.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -66,8 +66,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function, @@ -111,7 +111,7 @@ VOID **pptr_parameter; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -143,7 +143,7 @@ VOID **pptr_parameter; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_ioctl(UX_DEVICE_CLASS_VIDEO *video, ULONG ioctl_function, diff --git a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c index 03ce5181..f6248d97 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_max_payload_get.c @@ -96,7 +96,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_max_payload_length PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -129,7 +129,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ ULONG _uxe_device_class_video_max_payload_length(UX_DEVICE_CLASS_VIDEO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c index 5fd4e51a..c9abd3b8 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_free.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_payload_free PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,8 +64,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -129,7 +129,7 @@ UCHAR *next_payload; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_read_payload_free PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -161,7 +161,7 @@ UCHAR *next_payload; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_read_payload_free(UX_DEVICE_CLASS_VIDEO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c index 3244528d..385d776f 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_payload_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_payload_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,8 +68,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, @@ -118,7 +118,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_read_payload_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -154,7 +154,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_read_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c b/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c index a7422cc8..fc480061 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_task_function.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_task_function PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Chaoqiong Xiao Initial Version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* useed zero copy when class */ +/* owns endpoint buffer, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_read_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -116,6 +120,13 @@ UINT status; /* Next state: transfer wait. */ stream -> ux_device_class_video_stream_task_state = UX_DEVICE_CLASS_VIDEO_STREAM_RW_WAIT; +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use frame buffer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data; +#endif + /* Reset transfer state. */ UX_SLAVE_TRANSFER_STATE_RESET(transfer); } @@ -153,9 +164,17 @@ UINT status; /* Frame received, log it. */ stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_length = actual_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: data already in frame buffer. */ +#else + + /* Copy data from endpoint buffer. */ _ux_utility_memory_copy(stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data, transfer -> ux_slave_transfer_request_data_pointer, actual_length); /* Use case of memcpy is verified. */ +#endif /* For simple, do not advance the transfer position if there is overflow. */ next_pos = (UCHAR *)stream -> ux_device_class_video_stream_transfer_pos; diff --git a/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c index 060723d3..e7267cd9 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_video_read_thread_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_read_thread_entry PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added error statistics, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* useed zero copy when class */ +/* owns endpoint buffer, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_video_read_thread_entry(ULONG video_stream) @@ -115,6 +119,13 @@ ULONG actual_length; /* Get transfer instance. */ transfer = &endpoint -> ux_slave_endpoint_transfer_request; +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use frame buffer for transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data; +#endif + /* Start payload transfer anyway. */ status = _ux_device_stack_transfer_request(transfer, max_packet_size, max_packet_size); @@ -132,9 +143,17 @@ ULONG actual_length; /* Frame received, log it. */ stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_length = actual_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: data already in frame buffer. */ +#else + + /* Copy data from endpoint buffer. */ _ux_utility_memory_copy(stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data, transfer -> ux_slave_transfer_request_data_pointer, actual_length); /* Use case of memcpy is verified. */ +#endif /* For simple, do not advance the transfer position if there is overflow. */ next_pos = (UCHAR *)stream -> ux_device_class_video_stream_transfer_pos; diff --git a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c index 3928da34..939af793 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_reception_start.c +++ b/common/usbx_device_classes/src/ux_device_class_video_reception_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,8 +68,8 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -122,7 +122,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -153,7 +153,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_reception_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c index 4216ac53..246a13a1 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c +++ b/common/usbx_device_classes/src/ux_device_class_video_transmission_start.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_transmission_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,8 +68,8 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -123,7 +123,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_transmission_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -155,7 +155,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_transmission_start(UX_DEVICE_CLASS_VIDEO_STREAM *stream) diff --git a/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c b/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c index 1feb1aa5..4eb262c7 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c +++ b/common/usbx_device_classes/src/ux_device_class_video_uninitialize.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_uninitialize PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,10 +65,11 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added a new mode to manage */ -/* endpoint buffer in classes, */ -/* resulting in version 6.x */ +/* endpoint buffer in classes */ +/* with zero copy enabled, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_uninitialize(UX_SLAVE_CLASS_COMMAND *command) @@ -97,9 +98,6 @@ ULONG i; #if !defined(UX_DEVICE_STANDALONE) _ux_utility_thread_delete(&stream -> ux_device_class_video_stream_thread); _ux_utility_memory_free(stream -> ux_device_class_video_stream_thread_stack); -#endif -#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 - _ux_utility_memory_free(stream -> ux_device_class_video_stream_endpoint_buffer); #endif _ux_utility_memory_free(stream -> ux_device_class_video_stream_buffer); diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c index da182c8e..1bfaaf2b 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_commit.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_payload_commit PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -65,8 +65,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length) @@ -129,7 +129,7 @@ UCHAR *next_pos; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_write_payload_commit PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -162,7 +162,7 @@ UCHAR *next_pos; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_write_payload_commit(UX_DEVICE_CLASS_VIDEO_STREAM *stream, ULONG length) diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c index 86431e7f..6fd2a5f0 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_payload_get.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_payload_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,8 +68,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 04-25-2022 Chaoqiong Xiao Initial Version 6.1.11 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length) @@ -118,7 +118,7 @@ UX_SLAVE_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_device_class_video_write_payload_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -154,7 +154,7 @@ UX_SLAVE_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun Xia Initial Version 6.x */ +/* 10-31-2023 Yajun Xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_device_class_video_write_payload_get(UX_DEVICE_CLASS_VIDEO_STREAM *stream, UCHAR **payload, ULONG *length) diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c b/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c index 55dba42a..0fe5b8cf 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_task_function.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_task_function PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* DATE NAME DESCRIPTION */ /* */ /* 10-31-2022 Chaoqiong Xiao Initial Version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* useed zero copy when class */ +/* owns endpoint buffer, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_device_class_video_write_task_function(UX_DEVICE_CLASS_VIDEO_STREAM *stream) @@ -119,9 +123,19 @@ UINT status; /* Start payload transfer anyway (even ZLP). */ transfer_length = stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use frame buffer for transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data; +#else + + /* Copy frame buffer to transfer buffer. */ if (transfer_length) _ux_utility_memory_copy(transfer -> ux_slave_transfer_request_data_pointer, stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data, transfer_length); /* Use case of memcpy is verified. */ +#endif /* Reset transfer state. */ UX_SLAVE_TRANSFER_STATE_RESET(transfer); diff --git a/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c b/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c index 3dce6367..e28de0c1 100644 --- a/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c +++ b/common/usbx_device_classes/src/ux_device_class_video_write_thread_entry.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_device_class_video_write_thread_entry PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,6 +72,10 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added error statistics, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* useed zero copy when class */ +/* owns endpoint buffer, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_device_class_video_write_thread_entry(ULONG video_stream) @@ -112,9 +116,19 @@ ULONG actual_length; /* Start payload transfer anyway (even ZLP). */ transfer_length = stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_length; + +#if UX_DEVICE_ENDPOINT_BUFFER_OWNER == 1 + + /* Zero copy: directly use frame buffer for transfer. */ + transfer -> ux_slave_transfer_request_data_pointer = stream -> + ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data; +#else + + /* Copy frame buffer to transfer buffer. */ if (transfer_length) _ux_utility_memory_copy(transfer -> ux_slave_transfer_request_data_pointer, stream -> ux_device_class_video_stream_transfer_pos -> ux_device_class_video_payload_data, transfer_length); /* Use case of memcpy is verified. */ +#endif /* Issue transfer request, thread blocked until transfer done. */ status = _ux_device_stack_transfer_request(transfer, transfer_length, transfer_length); diff --git a/common/usbx_host_classes/inc/ux_host_class_audio.h b/common/usbx_host_classes/inc/ux_host_class_audio.h index 2405ab36..dde751d3 100644 --- a/common/usbx_host_classes/inc/ux_host_class_audio.h +++ b/common/usbx_host_classes/inc/ux_host_class_audio.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_audio.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,9 +57,10 @@ /* added feedback support, */ /* added Audio 2.0 support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved AC AS management, */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -458,6 +459,7 @@ typedef struct UX_HOST_CLASS_AUDIO_STRUCT #if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT) UX_HOST_CLASS_AUDIO_AC *ux_host_class_audio_ac; + ULONG ux_host_class_audio_ac_as; #endif struct UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST_STRUCT *ux_host_class_audio_head_transfer_request; diff --git a/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h b/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h index f5332d07..fa1c1834 100644 --- a/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h +++ b/common/usbx_host_classes/inc/ux_host_class_cdc_ecm.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_cdc_ecm.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -60,9 +60,9 @@ /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* supported NX packet chain, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_hid.h b/common/usbx_host_classes/inc/ux_host_class_hid.h index 81074b43..4720cc7f 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hid.h +++ b/common/usbx_host_classes/inc/ux_host_class_hid.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hid.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,9 +55,9 @@ /* added interrupt OUT support,*/ /* added standalone mode, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_hub.h b/common/usbx_host_classes/inc/ux_host_class_hub.h index d0086722..3204387f 100644 --- a/common/usbx_host_classes/inc/ux_host_class_hub.h +++ b/common/usbx_host_classes/inc/ux_host_class_hub.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_hub.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -50,9 +50,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* optimized USB descriptors, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_pima.h b/common/usbx_host_classes/inc/ux_host_class_pima.h index 9230395b..7b4b915f 100644 --- a/common/usbx_host_classes/inc/ux_host_class_pima.h +++ b/common/usbx_host_classes/inc/ux_host_class_pima.h @@ -21,12 +21,12 @@ /**************************************************************************/ -/**************************************************************************/ -/* */ -/* COMPONENT DEFINITION RELEASE */ -/* */ -/* ux_host_class_pima.h PORTABLE C */ -/* 6.x */ +/**************************************************************************/ +/* */ +/* COMPONENT DEFINITION RELEASE */ +/* */ +/* ux_host_class_pima.h PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -53,11 +53,13 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* improved internal checks, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed unused semaphore, */ +/* optimized PIMA data sets, */ /* increased default buffer */ /* length to get device info, */ -/* added error checks support, */ -/* resulting in version 6.x */ +/* added error checks support, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -403,7 +405,6 @@ typedef struct UX_HOST_CLASS_PIMA_STRUCT struct UX_HOST_CLASS_PIMA_SESSION_STRUCT *ux_host_class_pima_session; UCHAR *ux_host_class_pima_container; - UX_SEMAPHORE ux_host_class_pima_semaphore; VOID *ux_host_class_pima_application; ULONG ux_host_class_pima_zlp_flag; @@ -447,10 +448,11 @@ typedef struct UX_HOST_CLASS_PIMA_OBJECT_STRUCT { ULONG ux_host_class_pima_object_storage_id; - ULONG ux_host_class_pima_object_format; - ULONG ux_host_class_pima_object_protection_satus; + USHORT ux_host_class_pima_object_format; + USHORT ux_host_class_pima_object_protection_status; ULONG ux_host_class_pima_object_compressed_size; - ULONG ux_host_class_pima_object_thumb_format; + USHORT ux_host_class_pima_object_thumb_format; + USHORT _align_thumb_compressed_size; ULONG ux_host_class_pima_object_thumb_compressed_size; ULONG ux_host_class_pima_object_thumb_pix_width; ULONG ux_host_class_pima_object_thumb_pix_height; @@ -458,7 +460,8 @@ typedef struct UX_HOST_CLASS_PIMA_OBJECT_STRUCT ULONG ux_host_class_pima_object_image_pix_height; ULONG ux_host_class_pima_object_image_bit_depth; ULONG ux_host_class_pima_object_parent_object; - ULONG ux_host_class_pima_object_association_type; + USHORT ux_host_class_pima_object_association_type; + USHORT _align_association_desc; ULONG ux_host_class_pima_object_association_desc; ULONG ux_host_class_pima_object_sequence_number; UCHAR ux_host_class_pima_object_filename[UX_HOST_CLASS_PIMA_UNICODE_MAX_LENGTH]; /* Null terminated unicode string. */ @@ -515,9 +518,10 @@ typedef struct UX_HOST_CLASS_PIMA_DEVICE_STRUCT typedef struct UX_HOST_CLASS_PIMA_STORAGE_STRUCT { - ULONG ux_host_class_pima_storage_type; - ULONG ux_host_class_pima_storage_file_system_type; - ULONG ux_host_class_pima_storage_access_capability; + USHORT ux_host_class_pima_storage_type; + USHORT ux_host_class_pima_storage_file_system_type; + USHORT ux_host_class_pima_storage_access_capability; + USHORT _align_max_capacity_low; ULONG ux_host_class_pima_storage_max_capacity_low; ULONG ux_host_class_pima_storage_max_capacity_high; ULONG ux_host_class_pima_storage_free_space_bytes_low; diff --git a/common/usbx_host_classes/inc/ux_host_class_printer.h b/common/usbx_host_classes/inc/ux_host_class_printer.h index 982d263a..c8ff5e03 100644 --- a/common/usbx_host_classes/inc/ux_host_class_printer.h +++ b/common/usbx_host_classes/inc/ux_host_class_printer.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_printer.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -57,9 +57,9 @@ /* added standalone support, */ /* added a new protocol const, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ +/* 10-31-2023 Yajun xia Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_storage.h b/common/usbx_host_classes/inc/ux_host_class_storage.h index c28ccea4..215511ec 100644 --- a/common/usbx_host_classes/inc/ux_host_class_storage.h +++ b/common/usbx_host_classes/inc/ux_host_class_storage.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_storage.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -64,9 +64,9 @@ /* 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), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ diff --git a/common/usbx_host_classes/inc/ux_host_class_video.h b/common/usbx_host_classes/inc/ux_host_class_video.h index 60164e75..095ecc3a 100644 --- a/common/usbx_host_classes/inc/ux_host_class_video.h +++ b/common/usbx_host_classes/inc/ux_host_class_video.h @@ -26,7 +26,7 @@ /* COMPONENT DEFINITION RELEASE */ /* */ /* ux_host_class_video.h PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -56,10 +56,12 @@ /* according to UVC 1.5 Class */ /* specification, */ /* resulting in version 6.1.8 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* added format and frame data */ +/* fields for H264 support, */ /* optimized USB descriptors, */ /* added error checks support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -607,6 +609,7 @@ typedef struct UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA_STRUCT ULONG ux_host_class_video_parameter_format_requested; ULONG ux_host_class_video_parameter_format_subtype; + UCHAR *ux_host_class_video_parameter_format_guid; /* not NULL if GUID is available for the subtype. */ ULONG ux_host_class_video_parameter_number_frame_descriptors; } UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA; @@ -619,7 +622,8 @@ typedef struct UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA_STRUCT ULONG ux_host_class_video_parameter_frame_width; ULONG ux_host_class_video_parameter_frame_height; ULONG ux_host_class_video_parameter_default_frame_interval; - ULONG ux_host_class_video_parameter_frame_interval_type; + ULONG ux_host_class_video_parameter_frame_interval_type; /* 0: continuous {min,max,step}, n: discrete */ + UCHAR *ux_host_class_video_parameter_frame_intervals; /* {dwMin,dwMax,dwStep},... or dw1,dw2,... depending on interval type. */ } UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA; diff --git a/common/usbx_host_classes/src/ux_host_class_asix_activate.c b/common/usbx_host_classes/src/ux_host_class_asix_activate.c index 760b59ed..98a3018d 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_activate PORTABLE C */ -/* 6.2.0 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -91,15 +91,18 @@ /* added reception buffer, */ /* removed internal NX pool, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* masked in standalone build, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_activate(UX_HOST_CLASS_COMMAND *command) { -#if NX_PHYSICAL_HEADER < 20 +#if (NX_PHYSICAL_HEADER < 20) || defined(UX_HOST_STANDALONE) UX_PARAMETER_NOT_USED(command); - /* Error trap - function not supported due to NX lib settings. */ + /* Function not supported due to NX lib settings/standalone mode. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_FUNCTION_NOT_SUPPORTED); return(UX_FUNCTION_NOT_SUPPORTED); #else diff --git a/common/usbx_host_classes/src/ux_host_class_asix_configure.c b/common/usbx_host_classes/src/ux_host_class_asix_configure.c index 8e32a371..cf5cad00 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_configure PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* optimized based on compile */ /* definitions, */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed interface link, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_configure(UX_HOST_CLASS_ASIX *asix) @@ -141,20 +144,6 @@ UX_DEVICE *parent_device; the interrupt endpoint is hooked to it. */ status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &asix -> ux_host_class_asix_interface); - /* Check status for error. */ - if (status == UX_SUCCESS) - { - - /* Store the instance in the interface container, this is for the USB stack - when it needs to invoke the class. */ - asix -> ux_host_class_asix_interface -> ux_interface_class_instance = (VOID *) asix; - - /* Store the class container in the interface. The device has the correct class, duplicate it to the - interface. */ - asix -> ux_host_class_asix_interface -> ux_interface_class = asix -> ux_host_class_asix_device -> ux_device_class ; - - } - /* Return completion status. */ return(status); } diff --git a/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c b/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c index 8054e959..bb911715 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_transmission_callback.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_transmission_callback PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,10 +81,10 @@ /* supported NX packet chain, */ /* fixed empty queue handling, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* improved 64-bit support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ VOID _ux_host_class_asix_transmission_callback (UX_TRANSFER *transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_asix_write.c b/common/usbx_host_classes/src/ux_host_class_asix_write.c index 5ca7a601..ec6d7102 100644 --- a/common/usbx_host_classes/src/ux_host_class_asix_write.c +++ b/common/usbx_host_classes/src/ux_host_class_asix_write.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_asix_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,10 +82,10 @@ /* added queue modify protect, */ /* improved error check, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* improved 64-bit support, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_asix_write(VOID *asix_class, NX_PACKET *packet) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_activate.c b/common/usbx_host_classes/src/ux_host_class_audio_activate.c index 7e2d3704..23f4113a 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_activate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,6 +88,11 @@ /* added feedback support, */ /* refined error handling, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved AC AS management, */ +/* improved error handling, */ +/* improved descriptors check, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_activate(UX_HOST_CLASS_COMMAND *command) @@ -195,6 +200,11 @@ UINT status; /* In this case, bFirstInterface@2 is AC, followed ASes. */ /* Use bInterfaceCount@3. */ + if (iad[3] <= 1) + { + _ux_utility_memory_free(ac); + return(UX_DESCRIPTOR_CORRUPTED); + } as_count = (ULONG)iad[3] - 1; break; } @@ -204,6 +214,11 @@ UINT status; { /* In this case, bInCollection@7 is AS count. */ + if (desc[7] < 1 || (8 + desc[7]) != desc[0]) + { + _ux_utility_memory_free(ac); + return(UX_DESCRIPTOR_CORRUPTED); + } as_count = (ULONG)uac10_acd[7]; break; } @@ -341,47 +356,58 @@ UINT status; #if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT) - /* Find AC and link them. */ - ac = (UX_HOST_CLASS_AUDIO_AC *)audio -> ux_host_class_audio_class -> ux_host_class_first_instance; - while(ac) + /* Find AC and link it if there is no error. */ + if (status == UX_SUCCESS) { - /* Check interface number to see if it's right AC. */ - if (audio -> ux_host_class_audio_control_interface_number == - ac -> ux_host_class_audio_interface -> ux_interface_descriptor.bInterfaceNumber) + ac = (UX_HOST_CLASS_AUDIO_AC *)audio -> ux_host_class_audio_class -> ux_host_class_first_instance; + while(ac) { - /* Save AS to AC controlled list. */ - for (pos = 0; pos < ac -> ux_host_class_audio_as_count; pos ++) + /* Check interface number to see if it's right AC. */ + if ((ac -> ux_host_class_audio_interface -> ux_interface_configuration == + interface_ptr -> ux_interface_configuration) && + (ac -> ux_host_class_audio_interface -> ux_interface_descriptor.bInterfaceNumber == + audio -> ux_host_class_audio_control_interface_number) && + (ac -> ux_host_class_audio_interface -> ux_interface_descriptor.bInterfaceClass == + UX_HOST_CLASS_AUDIO_CLASS) && + (ac -> ux_host_class_audio_interface -> ux_interface_descriptor.bInterfaceSubClass == + UX_HOST_CLASS_AUDIO_SUBCLASS_CONTROL)) { - if (ac -> ux_host_class_audio_as[pos] == UX_NULL) + + /* Save AS to AC controlled list. */ + for (pos = 0; pos < ac -> ux_host_class_audio_as_count; pos ++) { + if (ac -> ux_host_class_audio_as[pos] == UX_NULL) + { + + /* This AC is for current AS. */ + audio -> ux_host_class_audio_ac = ac; + audio -> ux_host_class_audio_ac_as = pos; + ac -> ux_host_class_audio_as[pos] = audio; + break; + } + } - /* This AC is for current AS. */ - audio -> ux_host_class_audio_ac = ac; - ac -> ux_host_class_audio_as[pos] = audio; + /* If there is no place for AS, something wrong. */ + if (pos >= ac -> ux_host_class_audio_as_count) + { + status = UX_DESCRIPTOR_CORRUPTED; break; } } - /* If there is no place for AS, something wrong. */ - if (pos >= ac -> ux_host_class_audio_as_count) - { - status = UX_DESCRIPTOR_CORRUPTED; + /* If AC is found and linked, done. */ + if (audio -> ux_host_class_audio_ac != UX_NULL) break; - } - } - - /* If AC is found and linked, done. */ - if (audio -> ux_host_class_audio_ac != UX_NULL) - break; - /* If there is error, break. */ - if (status != UX_SUCCESS) - break; + /* If there is error, break. */ + if (status != UX_SUCCESS) + break; - /* Check next AC/AS. */ - ac = (UX_HOST_CLASS_AUDIO_AC *)ac -> ux_host_class_audio_next_instance; + /* Check next AC/AS. */ + ac = (UX_HOST_CLASS_AUDIO_AC *)ac -> ux_host_class_audio_next_instance; + } } #endif @@ -417,6 +443,11 @@ UINT status; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, status, audio, 0, 0, UX_TRACE_ERRORS, 0, 0) +#if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT) + + /* When there is error, AC is not linked (last possible error), no need to unlink. */ +#endif + /* Error, destroy the class instance. */ _ux_host_stack_class_instance_destroy(audio -> ux_host_class_audio_class, (VOID *) audio); diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_get.c b/common/usbx_host_classes/src/ux_host_class_audio_control_get.c index 64eaee77..a2fde919 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_get.c @@ -358,7 +358,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_control_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -388,7 +388,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c index 0f9ecf97..8c8bd0d4 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_request.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_request.c @@ -174,7 +174,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_control_request PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -217,7 +217,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_control_request(UX_HOST_CLASS_AUDIO *audio, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c index a2059e1f..bfed2bd4 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_value_get.c @@ -208,7 +208,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_control_value_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -240,7 +240,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c index 97c4ffbb..084d9067 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_control_value_set.c @@ -270,7 +270,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_control_value_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -302,7 +302,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c b/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c index 2cfd15df..a035c875 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_deactivate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -81,6 +81,9 @@ /* protect reentry with mutex, */ /* added feedback support, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved AC AS management, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_deactivate(UX_HOST_CLASS_COMMAND *command) @@ -89,6 +92,7 @@ UINT _ux_host_class_audio_deactivate(UX_HOST_CLASS_COMMAND *command) UX_HOST_CLASS_AUDIO *audio; #if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT) UX_HOST_CLASS_AUDIO_AC *ac; +UINT i; #endif /* Get the instance for this class. */ @@ -109,7 +113,14 @@ UX_HOST_CLASS_AUDIO_AC *ac; /* The enumeration thread needs to sleep a while to allow the application or the class that may be using endpoints to exit properly. */ - _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); + _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); + + /* Clear the links in AS interfaces. */ + for (i = 0; i < ac -> ux_host_class_audio_as_count; i++) + { + if (ac -> ux_host_class_audio_as[i]) + ac -> ux_host_class_audio_as[i] -> ux_host_class_audio_ac = UX_NULL; + } /* Destroy the instance. */ _ux_host_stack_class_instance_destroy(audio -> ux_host_class_audio_class, (VOID *) audio); @@ -139,6 +150,14 @@ UX_HOST_CLASS_AUDIO_AC *ac; endpoints to exit properly. */ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); +#if defined(UX_HOST_CLASS_AUDIO_INTERRUPT_SUPPORT) + + /* Clear the links in AC interface. */ + ac = audio -> ux_host_class_audio_ac; + if (ac) + ac -> ux_host_class_audio_as[audio -> ux_host_class_audio_ac_as] = UX_NULL; +#endif + /* Destroy the instance. */ _ux_host_stack_class_instance_destroy(audio -> ux_host_class_audio_class, (VOID *) audio); diff --git a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c index 0170b31e..800a153e 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_descriptors_parse.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_descriptors_parse PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,8 +79,8 @@ /* DATE NAME DESCRIPTION */ /* */ /* 07-29-2022 Chaoqiong Xiao Initial Version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio, @@ -213,7 +213,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_descriptors_parse PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -247,7 +247,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_descriptors_parse(UX_HOST_CLASS_AUDIO *audio, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_device_type_get.c b/common/usbx_host_classes/src/ux_host_class_audio_device_type_get.c index c0fe1af4..b23b3e5a 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_device_type_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_device_type_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_audio_device_type_get PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -71,6 +71,9 @@ /* removed protocol store, */ /* added audio 2.0 support, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved descriptors check, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_audio_device_type_get(UX_HOST_CLASS_AUDIO *audio) @@ -146,21 +149,22 @@ UINT i; /* Ensure we have the correct interface for Audio Control. */ if ((descriptor[5] == UX_HOST_CLASS_AUDIO_CLASS) && (descriptor[6] == UX_HOST_CLASS_AUDIO_SUBCLASS_CONTROL)) + { interface_descriptor = descriptor; + + /* Check if interface is out of IAD. */ + if(iad) + { + if ((iad[2] > interface_descriptor[2]) || + (iad[2] + iad[3] <= interface_descriptor[2])) + iad = UX_NULL; + } + } else { interface_descriptor = UX_NULL; descriptor_found = UX_FALSE; - } - - /* Check IAD. */ - if (iad) - { - - /* Check if interface is out of IAD. */ - if ((iad[2] > interface_descriptor[2]) || - (iad[2] + iad[3] <= interface_descriptor[2])) - iad = UX_NULL; + iad = UX_NULL; } break; diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c index a17eb54d..91a1c694 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_get.c @@ -341,7 +341,7 @@ ULONG n_subs, sub, pos, min, max, res, size; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_entity_control_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -373,7 +373,7 @@ ULONG n_subs, sub, pos, min, max, res, size; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_entity_control_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c index 948a3f4e..c5b880e1 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_get.c @@ -158,7 +158,7 @@ ULONG actual_size; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_entity_control_value_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -190,7 +190,7 @@ ULONG actual_size; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_entity_control_value_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c index 16e9088f..f080d074 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_entity_control_value_set.c @@ -148,7 +148,7 @@ ULONG actual_size; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_entity_control_value_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -180,7 +180,7 @@ ULONG actual_size; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_entity_control_value_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_CONTROL *audio_control) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c index 2b5bea15..8afc3107 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_get.c @@ -105,7 +105,7 @@ UINT _ux_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedb /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_feedback_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -136,7 +136,7 @@ UINT _ux_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedb /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_feedback_get(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c index 69eb9905..f55c5602 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_feedback_set.c @@ -122,7 +122,7 @@ UX_TRANSFER *transfer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_feedback_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -153,7 +153,7 @@ UX_TRANSFER *transfer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_feedback_set(UX_HOST_CLASS_AUDIO *audio, UCHAR *feedback) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c index ddeb6c3b..5eb74a85 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_interrupt_start.c @@ -145,7 +145,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_interrupt_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -179,7 +179,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_interrupt_start(UX_HOST_CLASS_AUDIO_AC *audio, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c index 94d793ad..acc46116 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_raw_sampling_parse.c @@ -752,7 +752,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_raw_sampling_parse PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -788,7 +788,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_raw_sampling_parse(UX_HOST_CLASS_AUDIO *audio, diff --git a/common/usbx_host_classes/src/ux_host_class_audio_read.c b/common/usbx_host_classes/src/ux_host_class_audio_read.c index b7654b90..739e82fc 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_read.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_read.c @@ -155,7 +155,7 @@ ULONG mps; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -185,7 +185,7 @@ ULONG mps; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_read(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_stop.c b/common/usbx_host_classes/src/ux_host_class_audio_stop.c index 5c33ffac..54d7b2dd 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_stop.c @@ -174,7 +174,7 @@ UINT streaming_interface; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -203,7 +203,7 @@ UINT streaming_interface; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_stop(UX_HOST_CLASS_AUDIO *audio) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c index 5c9c1af2..6e8ebe26 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_streaming_sampling_get.c @@ -410,7 +410,7 @@ UINT previous_match_found; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_streaming_sampling_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -442,7 +442,7 @@ UINT previous_match_found; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_streaming_sampling_get(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING_CHARACTERISTICS *audio_sampling) 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 c7731b84..f734f026 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 @@ -393,7 +393,7 @@ ULONG res_bytes; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_streaming_sampling_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -425,7 +425,7 @@ ULONG res_bytes; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_streaming_sampling_set(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_SAMPLING *audio_sampling) diff --git a/common/usbx_host_classes/src/ux_host_class_audio_write.c b/common/usbx_host_classes/src/ux_host_class_audio_write.c index f2724f82..5fd94e28 100644 --- a/common/usbx_host_classes/src/ux_host_class_audio_write.c +++ b/common/usbx_host_classes/src/ux_host_class_audio_write.c @@ -151,7 +151,7 @@ ULONG mps; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_audio_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -181,7 +181,7 @@ ULONG mps; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_audio_write(UX_HOST_CLASS_AUDIO *audio, UX_HOST_CLASS_AUDIO_TRANSFER_REQUEST *audio_transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c index 83dc55c6..4131167f 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_activate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,6 +87,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved control searching, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_activate(UX_HOST_CLASS_COMMAND *command) @@ -214,14 +217,15 @@ UX_HOST_CLASS_CDC_ACM_LINE_STATE line_state; while(cdc_acm_inst) { - /* If this data interface is inside the associate list, link it. */ - if (cdc_acm_inst -> ux_host_class_cdc_acm_interfaces_bitmap & - (1ul << interface_ptr -> ux_interface_descriptor.bInterfaceNumber)) + /* If this data interface is on the same device and inside the associate list, link it. */ + if ((cdc_acm_inst -> ux_host_class_cdc_acm_device == + cdc_acm -> ux_host_class_cdc_acm_device) && + (cdc_acm_inst -> ux_host_class_cdc_acm_interfaces_bitmap & + (1ul << interface_ptr -> ux_interface_descriptor.bInterfaceNumber))) { - /* Save control instance and we are done. */ + /* Save control instance. */ cdc_acm -> ux_host_class_cdc_acm_control = cdc_acm_inst; - break; } /* Next instance. */ diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c index ac077b78..76f466d8 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_command.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,8 +82,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command, @@ -218,7 +218,7 @@ ULONG request_direction; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -253,7 +253,7 @@ ULONG request_direction; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_command(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG command, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_deactivate.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_deactivate.c index 86635479..b61411cd 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_deactivate.c @@ -87,6 +87,8 @@ UX_HOST_CLASS_CDC_ACM *cdc_acm; UX_TRANSFER *transfer_request; #if !defined(UX_HOST_STANDALONE) UINT status; +#else +UX_HOST_CLASS_CDC_ACM *cdc_acm_inst; #endif /* Get the instance for this class. */ @@ -120,6 +122,27 @@ UINT status; /* Free data buffer for the interrupt transfer. */ _ux_utility_memory_free(transfer_request -> ux_transfer_request_data_pointer); } + +#if defined(UX_HOST_STANDALONE) + + /* Linked from data instance must be removed then. */ + /* We scan CDC ACM instances to find the master instance. */ + /* Get first instance linked to the class. */ + cdc_acm_inst = (UX_HOST_CLASS_CDC_ACM *) cdc_acm -> + ux_host_class_cdc_acm_class -> ux_host_class_first_instance; + + /* Scan all instances. */ + while(cdc_acm_inst) + { + + /* If this data interface is linking to the control instance, unlink it. */ + if (cdc_acm_inst -> ux_host_class_cdc_acm_control == cdc_acm) + cdc_acm_inst -> ux_host_class_cdc_acm_control = UX_NULL; + + /* Next instance. */ + cdc_acm_inst = cdc_acm_inst -> ux_host_class_cdc_acm_next_instance; + } +#endif } else { diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c index 8a99c7af..724d1177 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_endpoints_get PORTABLE C */ -/* 6.1.11 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,6 +79,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked endpoint get status,*/ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_endpoints_get(UX_HOST_CLASS_CDC_ACM *cdc_acm) @@ -100,7 +103,11 @@ UX_TRANSFER *transfer_request; { /* Get interface endpoint. */ - _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is bulk and OUT. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) && @@ -163,7 +170,11 @@ UX_TRANSFER *transfer_request; { /* Get the endpoint handle. */ - _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(cdc_acm -> ux_host_class_cdc_acm_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is Interrupt and IN. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) && diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_entry.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_entry.c index e126decb..4a2a90ad 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_entry.c @@ -492,6 +492,7 @@ ULONG tick, diff; if (cdc_acm -> ux_host_class_cdc_acm_status == UX_SUCCESS) { + /* We are here only if it's control interface. */ /* We scan CDC ACM instances to find the DATA instance. */ /* Get class. */ cdc_acm_class = cdc_acm -> ux_host_class_cdc_acm_class; @@ -499,21 +500,22 @@ ULONG tick, diff; /* Get first instance linked to the class. */ cdc_acm_inst = (UX_HOST_CLASS_CDC_ACM *)cdc_acm_class -> ux_host_class_first_instance; - /* Scan all instances. */ + /* Scan all data instances to update control links. */ while(cdc_acm_inst) { /* Get interface of the instance. */ interface_ptr = cdc_acm_inst -> ux_host_class_cdc_acm_interface; - /* If this data interface is inside the associate list, link it. */ - if (cdc_acm -> ux_host_class_cdc_acm_interfaces_bitmap & - (1ul << interface_ptr -> ux_interface_descriptor.bInterfaceNumber)) + /* If this data interface is inside the associate list on the same device, link it. */ + if ((cdc_acm_inst -> ux_host_class_cdc_acm_device == + cdc_acm -> ux_host_class_cdc_acm_device) && + (cdc_acm -> ux_host_class_cdc_acm_interfaces_bitmap & + (1ul << interface_ptr -> ux_interface_descriptor.bInterfaceNumber))) { - /* Save control instance and we are done. */ + /* Link this control to the data instance. */ cdc_acm_inst -> ux_host_class_cdc_acm_control = cdc_acm; - break; } /* Next instance. */ diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c index 78fa6cee..2dd98a47 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_acm_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,8 +79,8 @@ /* 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), */ -/* resulting in version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, @@ -348,7 +348,7 @@ UX_TRANSFER *transfer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -379,7 +379,7 @@ UX_TRANSFER *transfer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_ioctl(UX_HOST_CLASS_CDC_ACM *cdc_acm, ULONG ioctl_function, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c index 4bb0c5c2..619b563c 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_read.c @@ -238,7 +238,7 @@ ULONG transfer_flags; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -270,7 +270,7 @@ ULONG transfer_flags; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_read (UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c index 547176aa..98e78236 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_start.c @@ -148,7 +148,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -179,7 +179,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_reception_start (UX_HOST_CLASS_CDC_ACM *cdc_acm, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c index 7030a405..477d9166 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_reception_stop.c @@ -146,7 +146,7 @@ UX_TRANSFER *transfer_request; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_reception_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -176,7 +176,7 @@ UX_TRANSFER *transfer_request; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_reception_stop(UX_HOST_CLASS_CDC_ACM *cdc_acm, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c index 5bf47e7f..23656fb4 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write.c @@ -254,7 +254,7 @@ ULONG transfer_flags; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -286,7 +286,7 @@ ULONG transfer_flags; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_write(UX_HOST_CLASS_CDC_ACM *cdc_acm, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c index a9dfa119..8019c880 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_acm_write_with_callback.c @@ -167,7 +167,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_cdc_acm_write_with_callback PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -199,7 +199,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_cdc_acm_write_with_callback(UX_HOST_CLASS_CDC_ACM *cdc_acm, diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_activate.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_activate.c index f2613314..119d291c 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_activate.c @@ -104,6 +104,10 @@ UX_HOST_CLASS_CDC_ECM_NX_ETHERNET_POOL_ALLOCSIZE_ASSERT /* deprecated ECM pool option, */ /* supported NX packet chain, */ /* resulting in version 6.2.0 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* rejected the CDC ECM data */ +/* interface not next to ctrl, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_activate(UX_HOST_CLASS_COMMAND *command) @@ -163,8 +167,13 @@ UX_INTERFACE *cur_interface; if (cur_interface -> ux_interface_descriptor.bInterfaceClass == UX_HOST_CLASS_CDC_CONTROL_CLASS) { - /* Save it. */ - control_interface = cur_interface; + /* Is this the right one before current interface? */ + if (cur_interface -> ux_interface_next_interface == interface_ptr) + { + + /* Save it. */ + control_interface = cur_interface; + } } /* Advance current interface. */ diff --git a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c index 81ece899..59e24b16 100644 --- a/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_cdc_ecm_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_cdc_ecm_endpoints_get PORTABLE C */ -/* 6.1.9 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* use pre-calculated value */ /* instead of wMaxPacketSize, */ /* resulting in version 6.1.9 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked endpoint get status,*/ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_cdc_ecm_endpoints_get(UX_HOST_CLASS_CDC_ECM *cdc_ecm) @@ -131,7 +134,11 @@ UX_INTERFACE *data_interface; { /* Get interface endpoint. */ - _ux_host_stack_interface_endpoint_get(data_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(data_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is bulk and OUT. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) && @@ -173,7 +180,11 @@ UX_INTERFACE *data_interface; { /* Get the endpoint handle. */ - _ux_host_stack_interface_endpoint_get(data_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(data_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is bulk and IN. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) && @@ -217,7 +228,11 @@ UX_INTERFACE *data_interface; { /* Get the endpoint handle. */ - _ux_host_stack_interface_endpoint_get(cdc_ecm -> ux_host_class_cdc_ecm_interface_control, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(cdc_ecm -> ux_host_class_cdc_ecm_interface_control, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is Interrupt and IN. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) && diff --git a/common/usbx_host_classes/src/ux_host_class_gser_activate.c b/common/usbx_host_classes/src/ux_host_class_gser_activate.c index 1615a8fc..f619452b 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_activate PORTABLE C */ -/* 6.1.11 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,6 +75,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved error handling, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_activate(UX_HOST_CLASS_COMMAND *command) @@ -83,6 +86,7 @@ UINT _ux_host_class_gser_activate(UX_HOST_CLASS_COMMAND *command) UX_DEVICE *device; UX_HOST_CLASS_GSER *gser; UINT status; +ULONG interface_index; /* The Generic Modem class is always activated by the device descriptor. */ @@ -139,6 +143,13 @@ UINT status; return(UX_SUCCESS); } + /* Free created resources. */ + for (interface_index = 0; interface_index < UX_HOST_CLASS_GSER_INTERFACE_NUMBER; interface_index ++) + { + if (_ux_host_semaphore_created(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore)) + _ux_host_semaphore_delete(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore); + } + /* Destroy class instance. */ _ux_host_stack_class_instance_destroy(gser -> ux_host_class_gser_class, (VOID *) gser); diff --git a/common/usbx_host_classes/src/ux_host_class_gser_command.c b/common/usbx_host_classes/src/ux_host_class_gser_command.c index 361dca03..ba51435e 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_command.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_command.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,8 +82,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* refined macros names, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command, @@ -174,7 +174,7 @@ ULONG request_direction; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -208,7 +208,7 @@ ULONG request_direction; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_command(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG command, diff --git a/common/usbx_host_classes/src/ux_host_class_gser_configure.c b/common/usbx_host_classes/src/ux_host_class_gser_configure.c index 1455e596..c345d37f 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_configure PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -77,6 +77,9 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* refined macros names, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed interface link, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_configure(UX_HOST_CLASS_GSER *gser) @@ -147,29 +150,19 @@ UX_DEVICE *parent_device; /* Get that interface. */ status = _ux_host_stack_configuration_interface_get(configuration, interface_index, 0, &gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface); - - /* Should not fail. But do a sanity check. */ - if (status == UX_SUCCESS) - { - - /* Store the instance in the interface container, this is for the USB stack - when it needs to invoke the class. */ - gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface -> ux_interface_class_instance = (VOID *) gser; - - /* Store the class container in the interface. The device has the correct class, duplicate it to the - interface. */ - gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_interface -> ux_interface_class = gser -> ux_host_class_gser_device -> ux_device_class ; - /* Create the semaphore to protect 2 threads from accessing the same gser instance. */ - status = _ux_host_semaphore_create(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore, "ux_host_class_gser_semaphore", 1); + /* If any of interface expected not exist, reject the device. */ + if (status != UX_SUCCESS) + return(status); - /* Check status. */ - if (status != UX_SUCCESS) - return(UX_SEMAPHORE_ERROR); + /* Create the semaphore to protect 2 threads from accessing the same gser instance. */ + status = _ux_host_semaphore_create(&gser -> ux_host_class_gser_interface_array[interface_index].ux_host_class_gser_semaphore, "ux_host_class_gser_semaphore", 1); - } + /* Check status. */ + if (status != UX_SUCCESS) + return(UX_SEMAPHORE_ERROR); } - + /* Return completion status. */ return(UX_SUCCESS); } diff --git a/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c b/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c index 410ca2b0..a705542e 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_gser_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,8 +76,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function, @@ -295,7 +295,7 @@ ULONG value; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -326,7 +326,7 @@ ULONG value; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_ioctl(UX_HOST_CLASS_GSER *gser, ULONG interface_index, ULONG ioctl_function, diff --git a/common/usbx_host_classes/src/ux_host_class_gser_read.c b/common/usbx_host_classes/src/ux_host_class_gser_read.c index f1bba72f..18ab0e99 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_read.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_read.c @@ -223,7 +223,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -255,7 +255,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_read(UX_HOST_CLASS_GSER *gser, diff --git a/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c b/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c index bdd81508..7cf5aaee 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_reception_start.c @@ -141,7 +141,7 @@ ULONG interface_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -172,7 +172,7 @@ ULONG interface_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_reception_start (UX_HOST_CLASS_GSER *gser, diff --git a/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c index c5d8ecc8..976d74b2 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_reception_stop.c @@ -117,7 +117,7 @@ ULONG interface_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_reception_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -147,7 +147,7 @@ ULONG interface_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_reception_stop (UX_HOST_CLASS_GSER *gser, diff --git a/common/usbx_host_classes/src/ux_host_class_gser_write.c b/common/usbx_host_classes/src/ux_host_class_gser_write.c index d2b4e4af..dc6efd2b 100644 --- a/common/usbx_host_classes/src/ux_host_class_gser_write.c +++ b/common/usbx_host_classes/src/ux_host_class_gser_write.c @@ -217,7 +217,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_gser_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -249,7 +249,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_gser_write(UX_HOST_CLASS_GSER *gser, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_client_register.c b/common/usbx_host_classes/src/ux_host_class_hid_client_register.c index 3497abed..11deb1ea 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_client_register.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_client_register.c @@ -194,7 +194,7 @@ UINT client_name_length = 0; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_client_register PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -224,7 +224,7 @@ UINT client_name_length = 0; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_client_register(UCHAR *hid_client_name, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_field_decompress.c b/common/usbx_host_classes/src/ux_host_class_hid_field_decompress.c index afb72877..e1b1d898 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_field_decompress.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_field_decompress.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_field_decompress PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved usage handling, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_field_decompress(UX_HOST_CLASS_HID_FIELD *hid_field, UCHAR *report_buffer, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) @@ -130,8 +133,11 @@ ULONG report_content; if (hid_field -> ux_host_class_hid_field_value & UX_HOST_CLASS_HID_ITEM_VARIABLE) { - /* Take the usage directly from the usage array. */ - field_usage = *(hid_field -> ux_host_class_hid_field_usages + field_report_count); + /* Take the usage directly from the usage array (if specified). */ + if (hid_field -> ux_host_class_hid_field_usages) + field_usage = *(hid_field -> ux_host_class_hid_field_usages + field_report_count); + else + field_usage = 0; } else { diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c index d748966c..7f38d0c3 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_get.c @@ -215,7 +215,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_idle_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -246,7 +246,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_idle_get(UX_HOST_CLASS_HID *hid, USHORT *idle_time, USHORT report_id) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c index 64662fb2..2a5a8a8b 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set.c @@ -155,7 +155,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_idle_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -186,7 +186,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_idle_set(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c index 3c5d9aa7..b55b04cf 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_idle_set_run.c @@ -184,7 +184,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_idle_set_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -215,7 +215,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_idle_set_run(UX_HOST_CLASS_HID *hid, USHORT idle_time, USHORT report_id) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_deactivate.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_deactivate.c index afd243df..f38831b0 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_deactivate.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_keyboard_deactivate PORTABLE C */ -/* 6.1.11 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved unload sequence, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_keyboard_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) @@ -108,23 +111,11 @@ UINT status = UX_SUCCESS; /* Terminate the thread. */ _ux_utility_thread_delete(&keyboard_instance -> ux_host_class_hid_keyboard_thread); - - /* Return to the pool the thread stack. */ - _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_thread_stack); #endif - /* Free memory for key states. */ - _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_key_state); - /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_KEYBOARD_DEACTIVATE, hid, keyboard_instance, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0) - /* Unload all the memory used by the keyboard client. */ - _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_usage_array); - - /* Now free the instance memory. */ - _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); - /* We may need to inform the application if a function has been programmed in the system structure. */ if (_ux_system_host -> ux_system_host_change_function != UX_NULL) @@ -133,7 +124,22 @@ UINT status = UX_SUCCESS; /* Call system change function. */ _ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client); } - + +#if !defined(UX_HOST_STANDALONE) + + /* Return to the pool the thread stack. */ + _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_thread_stack); +#endif + + /* Free memory for key states. */ + _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_key_state); + + /* Unload all the memory used by the keyboard client. */ + _ux_utility_memory_free(keyboard_instance -> ux_host_class_hid_keyboard_usage_array); + + /* Now free the instance memory. */ + _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); + /* Return completion status. */ return(status); } diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c index 47f532cb..afd66132 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_ioctl.c @@ -129,7 +129,7 @@ UINT status = UX_SUCCESS; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_keyboard_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -160,7 +160,7 @@ UINT status = UX_SUCCESS; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_keyboard_ioctl(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c index 3e18fea1..6bbfe178 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_keyboard_key_get.c @@ -128,7 +128,7 @@ UX_HOST_CLASS_HID *hid; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_keyboard_key_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -159,7 +159,7 @@ UX_HOST_CLASS_HID *hid; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_keyboard_key_get(UX_HOST_CLASS_HID_KEYBOARD *keyboard_instance, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c index d6cdc141..6703951b 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_buttons_get.c @@ -105,7 +105,7 @@ UX_HOST_CLASS_HID *hid; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_mouse_buttons_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -135,7 +135,7 @@ UX_HOST_CLASS_HID *hid; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_mouse_buttons_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_deactivate.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_deactivate.c index c7cf7db7..5f611064 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_deactivate.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_mouse_deactivate PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved unload sequence, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_mouse_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) @@ -92,9 +95,6 @@ UINT status; /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_MOUSE_DEACTIVATE, hid, hid_client -> ux_host_class_hid_client_local_instance, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0) - /* Now free the instance memory. */ - _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); - /* We may need to inform the application if a function has been programmed in the system structure. */ if (_ux_system_host -> ux_system_host_change_function != UX_NULL) @@ -104,6 +104,9 @@ UINT status; _ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client); } + /* Now free the instance memory. */ + _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); + /* Return completion status. */ return(status); } diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c index 3c4425f8..6031ac21 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_position_get.c @@ -111,7 +111,7 @@ UX_HOST_CLASS_HID *hid; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_mouse_position_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -142,7 +142,7 @@ UX_HOST_CLASS_HID *hid; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_mouse_position_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c b/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c index 5826a611..7b5020e6 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_mouse_wheel_get.c @@ -105,7 +105,7 @@ UX_HOST_CLASS_HID *hid; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_mouse_wheel_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -135,7 +135,7 @@ UX_HOST_CLASS_HID *hid; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_mouse_wheel_get(UX_HOST_CLASS_HID_MOUSE *mouse_instance, diff --git a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c index 8b5465df..2d322993 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_start.c @@ -142,7 +142,7 @@ UX_TRANSFER *transfer_request; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_periodic_report_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -173,7 +173,7 @@ UX_TRANSFER *transfer_request; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_periodic_report_start(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c index ebfa979a..170b9cad 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_periodic_report_stop.c @@ -121,7 +121,7 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid) /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_periodic_report_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -152,7 +152,7 @@ UINT _ux_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid) /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_periodic_report_stop(UX_HOST_CLASS_HID *hid) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_deactivate.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_deactivate.c index d2083bad..123d80d2 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_deactivate.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_remote_control_deactivate PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,6 +70,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved unload sequence, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_remote_control_deactivate(UX_HOST_CLASS_HID_CLIENT_COMMAND *command) @@ -93,15 +96,9 @@ UINT status; /* Get the remote control local instance. */ remote_control_instance = (UX_HOST_CLASS_HID_REMOTE_CONTROL *) hid_client -> ux_host_class_hid_client_local_instance; - /* Unload all the memory used by the remote control client. */ - _ux_utility_memory_free(remote_control_instance -> ux_host_class_hid_remote_control_usage_array); - /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_HOST_CLASS_HID_REMOTE_CONTROL_DEACTIVATE, hid, remote_control_instance, 0, 0, UX_TRACE_HOST_CLASS_EVENTS, 0, 0) - /* Now free the instance memory. */ - _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); - /* We may need to inform the application if a function has been programmed in the system structure. */ if (_ux_system_host -> ux_system_host_change_function != UX_NULL) @@ -111,6 +108,12 @@ UINT status; _ux_system_host -> ux_system_host_change_function(UX_HID_CLIENT_REMOVAL, hid -> ux_host_class_hid_class, (VOID *) hid_client); } + /* Unload all the memory used by the remote control client. */ + _ux_utility_memory_free(remote_control_instance -> ux_host_class_hid_remote_control_usage_array); + + /* Now free the instance memory. */ + _ux_utility_memory_free(hid_client -> ux_host_class_hid_client_local_instance); + /* Return completion status. */ return(status); } diff --git a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c index bc05f2a7..1e274bac 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_remote_control_usage_get.c @@ -130,7 +130,7 @@ UX_HOST_CLASS_HID *hid; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_remote_control_usage_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -162,7 +162,7 @@ UX_HOST_CLASS_HID *hid; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_remote_control_usage_get( diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_add.c b/common/usbx_host_classes/src/ux_host_class_hid_report_add.c index f97ccc74..2b9b6841 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_add.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hid_report_add PORTABLE C */ -/* 6.1.8 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,6 +78,10 @@ /* 08-02-2021 Wen Wang Modified comment(s), */ /* fixed spelling error, */ /* resulting in version 6.1.8 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed field managing issue, */ +/* improved usage handling, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hid_report_add(UX_HOST_CLASS_HID *hid, UCHAR *descriptor, UX_HOST_CLASS_HID_ITEM *item) @@ -193,13 +197,9 @@ ULONG current_field_address; /* Take care of the bit padding if necessary. */ if (new_hid_report -> ux_host_class_hid_report_bit_length & 7) new_hid_report -> ux_host_class_hid_report_byte_length++; - - /* Get the number of field usage for this report, this value depends on the report type. If this is - an array, we use the number of usages; if this a variable, we use the report count. */ - if (hid_field_value & UX_HOST_CLASS_HID_ITEM_VARIABLE) - hid_field_count = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count; - else - hid_field_count = hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage; + + /* Get the number of fields for this report. */ + hid_field_count = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_report_count; /* If the field count is null, this is only padding and there is no field to be allocated to the report. */ if (hid_field_count == 0) @@ -210,27 +210,6 @@ ULONG current_field_address; if (new_hid_field == UX_NULL) return(UX_MEMORY_INSUFFICIENT); - /* Attach the new field to the report. The report may already contain a field, if so parse the chain - until we reach the end of the chain. */ - new_hid_report -> ux_host_class_hid_report_number_item += hid_field_count; - if (new_hid_report -> ux_host_class_hid_report_field == UX_NULL) - { - - /* This is the first field for the report. */ - new_hid_report -> ux_host_class_hid_report_field = new_hid_field; - } - else - { - - /* We have previous HID fields, so search for the end of the chain. */ - hid_field = new_hid_report -> ux_host_class_hid_report_field; - while(hid_field -> ux_host_class_hid_field_next_field != UX_NULL) - hid_field = hid_field -> ux_host_class_hid_field_next_field; - - /* Attach the new field to the end of the chain. */ - hid_field -> ux_host_class_hid_field_next_field = new_hid_field; - } - /* From the parser structure, update the new field values. Start with logical values. */ new_hid_field -> ux_host_class_hid_field_logical_min = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_min; new_hid_field -> ux_host_class_hid_field_logical_max = hid_parser -> ux_host_class_hid_parser_global.ux_host_class_hid_global_item_logical_max; @@ -269,14 +248,15 @@ ULONG current_field_address; _ux_utility_memory_free(new_hid_field); return(UX_MEMORY_INSUFFICIENT); } - + /* We need some memory for the usages, but only for variable items; usage values for array items can be calculated. */ - if (hid_field_value & UX_HOST_CLASS_HID_ITEM_VARIABLE) + if ((hid_field_value & UX_HOST_CLASS_HID_ITEM_VARIABLE) && + (hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage > 0)) { /* Allocate memory for the usages. */ - new_hid_field -> ux_host_class_hid_field_usages = _ux_utility_memory_allocate_mulc_safe(UX_NO_ALIGN, UX_REGULAR_MEMORY, hid_field_count, 4); + new_hid_field -> ux_host_class_hid_field_usages = _ux_utility_memory_allocate_mulc_safe(UX_NO_ALIGN, UX_REGULAR_MEMORY, hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage, 4); if (new_hid_field -> ux_host_class_hid_field_usages == UX_NULL) { @@ -286,11 +266,32 @@ ULONG current_field_address; } /* Copy the current usages in the field structure. */ - _ux_utility_memory_copy(new_hid_field -> ux_host_class_hid_field_usages, hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usages, hid_field_count*4); /* Use case of memcpy is verified. */ + _ux_utility_memory_copy(new_hid_field -> ux_host_class_hid_field_usages, hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_usages, hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage * 4); /* Use case of memcpy is verified. */ } /* Save the number of usages. */ - new_hid_field -> ux_host_class_hid_field_number_usage = hid_field_count; + new_hid_field -> ux_host_class_hid_field_number_usage = hid_parser -> ux_host_class_hid_parser_local.ux_host_class_hid_local_item_number_usage; + + /* Attach the new field to the report. The report may already contain a field, if so parse the chain + until we reach the end of the chain. */ + new_hid_report -> ux_host_class_hid_report_number_item += hid_field_count; + if (new_hid_report -> ux_host_class_hid_report_field == UX_NULL) + { + + /* This is the first field for the report. */ + new_hid_report -> ux_host_class_hid_report_field = new_hid_field; + } + else + { + + /* We have previous HID fields, so search for the end of the chain. */ + hid_field = new_hid_report -> ux_host_class_hid_report_field; + while(hid_field -> ux_host_class_hid_field_next_field != UX_NULL) + hid_field = hid_field -> ux_host_class_hid_field_next_field; + + /* Attach the new field to the end of the chain. */ + hid_field -> ux_host_class_hid_field_next_field = new_hid_field; + } /* Return successful completion. */ return(UX_SUCCESS); diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c b/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c index 82283e91..61b2bca3 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_callback_register.c @@ -153,7 +153,7 @@ UX_HOST_CLASS_HID_REPORT *hid_report; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_callback_register PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -185,7 +185,7 @@ UX_HOST_CLASS_HID_REPORT *hid_report; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_report_callback_register(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_CALLBACK *call_back) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c index c4ae1ddc..1b0f9322 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_get.c @@ -277,7 +277,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -307,7 +307,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_report_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c b/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c index 9ce374a3..78d3af48 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_id_get.c @@ -186,7 +186,7 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_id_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -216,7 +216,7 @@ UX_HOST_CLASS_HID_REPORT *next_hid_report; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_report_id_get(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_REPORT_GET_ID *report_id) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_set.c b/common/usbx_host_classes/src/ux_host_class_hid_report_set.c index 05376adc..35feafec 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_set.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_set.c @@ -320,7 +320,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -350,7 +350,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_report_set(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) diff --git a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c index 8add05c5..d8e004e9 100644 --- a/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c +++ b/common/usbx_host_classes/src/ux_host_class_hid_report_set_run.c @@ -252,7 +252,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_hid_report_set_run PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -282,7 +282,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_hid_report_set_run(UX_HOST_CLASS_HID *hid, UX_HOST_CLASS_HID_CLIENT_REPORT *client_report) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_deactivate.c b/common/usbx_host_classes/src/ux_host_class_hub_deactivate.c index c64859a8..b1132068 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_deactivate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,6 +84,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved deactivate flow, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_deactivate(UX_HOST_CLASS_COMMAND *command) @@ -91,7 +94,7 @@ UINT _ux_host_class_hub_deactivate(UX_HOST_CLASS_COMMAND *command) UX_HOST_CLASS_HUB *hub; UX_HCD *hcd; -UX_TRANSFER *transfer_request; +UX_TRANSFER *transfer_request = UX_NULL; UINT port_index; @@ -105,7 +108,16 @@ UINT port_index; hub -> ux_host_class_hub_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN; /* We need to abort transactions on the interrupt pipe. */ - _ux_host_stack_endpoint_transfer_abort(hub -> ux_host_class_hub_interrupt_endpoint); +#if defined(UX_HOST_STANDALONE) + if (hub -> ux_host_class_hub_interrupt_endpoint) +#endif + { + _ux_host_stack_endpoint_transfer_abort(hub -> ux_host_class_hub_interrupt_endpoint); + + /* If the Hub class instance has a interrupt pipe with a data payload associated with it + it must be freed. First get the transfer request. */ + transfer_request = &hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_transfer_request; + } /* Each device which is downstream on the HUB ports must be removed. */ for (port_index = 1; port_index <= hub -> ux_host_class_hub_descriptor.bNbPorts; port_index++) @@ -120,20 +132,22 @@ UINT port_index; } } - /* If the Hub class instance has a interrupt pipe with a data payload associated with it - it must be freed. First get the transfer request. */ - transfer_request = &hub -> ux_host_class_hub_interrupt_endpoint -> ux_endpoint_transfer_request; /* The enumeration thread needs to sleep a while to allow the application or the class that may be using endpoints to exit properly. */ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); /* Then de allocate the memory. */ +#if defined(UX_HOST_STANDALONE) + if (transfer_request) +#endif _ux_utility_memory_free(transfer_request -> ux_transfer_request_data_pointer); #if defined(UX_HOST_STANDALONE) if (hub -> ux_host_class_hub_allocated) + { _ux_utility_memory_free(hub -> ux_host_class_hub_allocated); + } #endif /* Destroy the instance. */ @@ -154,10 +168,15 @@ UINT port_index; /* If trace is enabled, register this object. */ UX_TRACE_OBJECT_UNREGISTER(hub); +#if defined(UX_HOST_STANDALONE) + + /* Unlink from device class instance. */ + hub -> ux_host_class_hub_device -> ux_device_class_instance = (VOID *) hub; +#endif + /* Free the memory block used by the class. */ _ux_utility_memory_free(hub); /* Return successful completion. */ return(UX_SUCCESS); } - diff --git a/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c b/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c index 041f26b9..5ff83931 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_descriptor_get.c @@ -129,7 +129,7 @@ ULONG port_index; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_descriptor_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -174,9 +174,9 @@ ULONG port_index; /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* added standalone support, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_descriptor_get(UX_HOST_CLASS_HUB *hub) diff --git a/common/usbx_host_classes/src/ux_host_class_hub_entry.c b/common/usbx_host_classes/src/ux_host_class_hub_entry.c index e73c2e16..040b631a 100644 --- a/common/usbx_host_classes/src/ux_host_class_hub_entry.c +++ b/common/usbx_host_classes/src/ux_host_class_hub_entry.c @@ -41,7 +41,7 @@ static inline UINT _ux_host_class_hub_activate_wait(UX_HOST_CLASS_COMMAND *comma /* FUNCTION RELEASE */ /* */ /* _ux_host_class_hub_entry PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -84,9 +84,10 @@ static inline UINT _ux_host_class_hub_activate_wait(UX_HOST_CLASS_COMMAND *comma /* 10-31-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed power on delay calc, */ /* resulting in version 6.2.0 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed fail code sequence, */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_hub_entry(UX_HOST_CLASS_COMMAND *command) @@ -410,17 +411,14 @@ ULONG current_ms, elapsed_ms; /* Unlink from device. */ device -> ux_device_class_instance = UX_NULL; - /* Free hub. */ - _ux_utility_memory_free(hub); - /* Error trap. */ _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, hub -> ux_host_class_hub_run_status); /* If trace is enabled, insert this event into the trace buffer. */ UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, hub -> ux_host_class_hub_run_status, hub, 0, 0, UX_TRACE_ERRORS, 0, 0) - /* To error state. */ - hub -> ux_host_class_hub_enum_state = UX_STATE_ERROR; + /* Free hub. */ + _ux_utility_memory_free(hub); return(UX_STATE_ERROR); } diff --git a/common/usbx_host_classes/src/ux_host_class_pima_command.c b/common/usbx_host_classes/src/ux_host_class_pima_command.c index d643f633..cce067e7 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_command.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_command.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,8 +79,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* refined macros names, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_command(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_COMMAND *command, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_deactivate.c b/common/usbx_host_classes/src/ux_host_class_pima_deactivate.c index 917ec9fd..18af6251 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_deactivate.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_deactivate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_deactivate PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -59,8 +59,6 @@ /* _ux_host_stack_class_instance_destroy Destroy the class instance */ /* _ux_host_stack_endpoint_transfer_abort Abort endpoint transfer */ /* _ux_utility_memory_free Free memory block */ -/* _ux_host_semaphore_get Get protection semaphore */ -/* _ux_host_semaphore_delete Delete protection semaphore */ /* */ /* CALLED BY */ /* */ @@ -76,6 +74,10 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* refined macros names, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved INT EP support, */ +/* removed unused semaphore, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_deactivate(UX_HOST_CLASS_COMMAND *command) @@ -84,8 +86,7 @@ UINT _ux_host_class_pima_deactivate(UX_HOST_CLASS_COMMAND *command) UX_HOST_CLASS_PIMA *pima; UX_HOST_CLASS_PIMA_SESSION *pima_session; UX_TRANSFER *transfer_request; -UINT status; - + /* Get the instance for this class. */ pima = (UX_HOST_CLASS_PIMA *) command -> ux_host_class_command_instance; @@ -93,13 +94,6 @@ UINT status; /* The pima is being shut down. */ pima -> ux_host_class_pima_state = UX_HOST_CLASS_INSTANCE_SHUTDOWN; - /* Protect thread reentry to this instance. */ - status = _ux_host_semaphore_get(&pima -> ux_host_class_pima_semaphore, UX_WAIT_FOREVER); - if (status != UX_SUCCESS) - - /* Return error. */ - return(status); - /* We come to this point when the device has been extracted. So there may have been a transaction being scheduled. We make sure the transaction has been completed by the controller driver. When the device is extracted, the controller tries multiple times the transaction and retires it @@ -122,12 +116,18 @@ UINT status; /* Then interrupt endpoint. */ - transfer_request = &pima -> ux_host_class_pima_interrupt_endpoint -> ux_endpoint_transfer_request; - if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING) - - /* We need to abort transactions on the Interrupt pipe. */ - _ux_host_stack_endpoint_transfer_abort(pima -> ux_host_class_pima_interrupt_endpoint); - + if (pima -> ux_host_class_pima_interrupt_endpoint != UX_NULL) + { + transfer_request = &pima -> ux_host_class_pima_interrupt_endpoint -> ux_endpoint_transfer_request; + if (transfer_request -> ux_transfer_request_completion_code == UX_TRANSFER_STATUS_PENDING) + + /* We need to abort transactions on the Interrupt pipe. */ + _ux_host_stack_endpoint_transfer_abort(pima -> ux_host_class_pima_interrupt_endpoint); + + /* Free the interrupt transfer buffer. */ + _ux_utility_memory_free(transfer_request -> ux_transfer_request_data_pointer); + } + /* The enumeration thread needs to sleep a while to allow the application or the class that may be using endpoints to exit properly. */ _ux_host_thread_schedule_other(UX_THREAD_PRIORITY_ENUM); @@ -164,9 +164,6 @@ UINT status; /* Destroy the instance. */ _ux_host_stack_class_instance_destroy(pima -> ux_host_class_pima_class, (VOID *) pima); - /* Destroy the semaphore. */ - _ux_host_semaphore_delete(&pima -> ux_host_class_pima_semaphore); - /* Before we free the device resources, we need to inform the application that the device is removed. */ if (_ux_system_host -> ux_system_host_change_function != UX_NULL) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c b/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c index 5d5ca492..448c5650 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_device_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_device_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -79,9 +79,9 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed DeviceInfo extract, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima, @@ -369,7 +369,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_device_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -399,7 +399,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_device_info_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_num_objects_get.c b/common/usbx_host_classes/src/ux_host_class_pima_num_objects_get.c index e64d2a28..44536703 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_num_objects_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_num_objects_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_num_objects_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,8 +70,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_num_objects_get(UX_HOST_CLASS_PIMA *pima, @@ -129,7 +129,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_num_objects_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -162,7 +162,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_num_objects_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_close.c b/common/usbx_host_classes/src/ux_host_class_pima_object_close.c index 10564b9d..9a970794 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_close.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_close.c @@ -228,7 +228,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_close PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -260,7 +260,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_close(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_delete.c b/common/usbx_host_classes/src/ux_host_class_pima_object_delete.c index e746e48e..cc75bf0e 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_delete.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_delete.c @@ -121,7 +121,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_delete PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -152,7 +152,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_delete(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_get.c index 20d73a5c..f0859a4b 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_get.c @@ -423,7 +423,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -459,7 +459,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_handles_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_handles_get.c index ec51d77c..85c6a2c3 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_handles_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_handles_get.c @@ -184,7 +184,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_handles_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -223,7 +223,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_handles_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c b/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c index 970446f8..41894968 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,10 +76,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* fixed allocated buffer */ /* pointer checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_get(UX_HOST_CLASS_PIMA *pima, @@ -245,7 +245,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -277,7 +277,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_info_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c b/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c index 1f9f8e6f..03e7f6f1 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_info_send.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_object_info_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -78,10 +78,10 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun Xia Modified comment(s), */ +/* 10-31-2023 Yajun Xia Modified comment(s), */ /* fixed allocated buffer */ /* pointer checking issue, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_object_info_send(UX_HOST_CLASS_PIMA *pima, @@ -263,7 +263,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_info_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -296,7 +296,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_info_send(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_open.c b/common/usbx_host_classes/src/ux_host_class_pima_object_open.c index 39c38afc..cca73fe2 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_open.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_open.c @@ -109,7 +109,7 @@ UINT _ux_host_class_pima_object_open(UX_HOST_CLASS_PIMA *pima, /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_open PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -141,7 +141,7 @@ UINT _ux_host_class_pima_object_open(UX_HOST_CLASS_PIMA *pima, /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_open(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_send.c b/common/usbx_host_classes/src/ux_host_class_pima_object_send.c index 9bb53186..4a144a5a 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_send.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_send.c @@ -387,7 +387,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_send PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -423,7 +423,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_send(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_object_transfer_abort.c b/common/usbx_host_classes/src/ux_host_class_pima_object_transfer_abort.c index e1285c2b..7acca5c5 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_object_transfer_abort.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_object_transfer_abort.c @@ -113,7 +113,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_object_transfer_abort PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -146,7 +146,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_object_transfer_abort(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_session_close.c b/common/usbx_host_classes/src/ux_host_class_pima_session_close.c index 530a29d9..ee18ec96 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_session_close.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_session_close.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_session_close PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -68,8 +68,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_session_close(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session) @@ -131,7 +131,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_session_close PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -161,7 +161,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_session_close(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_session_open.c b/common/usbx_host_classes/src/ux_host_class_pima_session_open.c index 20b2163d..e54a1b5b 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_session_open.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_session_open.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_session_open PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -70,8 +70,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_session_open(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session) @@ -136,7 +136,7 @@ ULONG status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_session_open PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -166,7 +166,7 @@ ULONG status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_session_open(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session) diff --git a/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c b/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c index 0c63b4f6..5d6230a1 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_storage_ids_get.c @@ -168,7 +168,7 @@ ULONG nb_storage_ids; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_storage_ids_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -202,7 +202,7 @@ ULONG nb_storage_ids; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_storage_ids_get(UX_HOST_CLASS_PIMA *pima, UX_HOST_CLASS_PIMA_SESSION *pima_session, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_storage_info_get.c b/common/usbx_host_classes/src/ux_host_class_pima_storage_info_get.c index 53cefa3b..1815f9b9 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_storage_info_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_storage_info_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_pima_storage_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,8 +76,8 @@ /* verified memset and memcpy */ /* cases, */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_pima_storage_info_get(UX_HOST_CLASS_PIMA *pima, @@ -167,7 +167,7 @@ ULONG unicode_string_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_storage_info_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -200,7 +200,7 @@ ULONG unicode_string_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_storage_info_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_pima_thumb_get.c b/common/usbx_host_classes/src/ux_host_class_pima_thumb_get.c index 3a53b209..5fe6395d 100644 --- a/common/usbx_host_classes/src/ux_host_class_pima_thumb_get.c +++ b/common/usbx_host_classes/src/ux_host_class_pima_thumb_get.c @@ -383,7 +383,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_pima_thumb_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -419,7 +419,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_pima_thumb_get(UX_HOST_CLASS_PIMA *pima, diff --git a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c index 99631172..e654751c 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_device_id_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_device_id_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,9 +83,9 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_device_id_get(UX_HOST_CLASS_PRINTER *printer, UCHAR *descriptor_buffer, ULONG length) @@ -169,7 +169,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_device_id_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -203,7 +203,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_device_id_get(UX_HOST_CLASS_PRINTER *printer, UCHAR *descriptor_buffer, ULONG length) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_name_get.c b/common/usbx_host_classes/src/ux_host_class_printer_name_get.c index a0086569..84c84793 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_name_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_name_get.c @@ -125,7 +125,7 @@ UINT printer_name_length; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_printer_name_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -176,9 +176,9 @@ UINT printer_name_length; /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer) @@ -247,7 +247,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_name_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -276,7 +276,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_name_get(UX_HOST_CLASS_PRINTER *printer) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_read.c b/common/usbx_host_classes/src/ux_host_class_printer_read.c index c6fe27cb..ba996f76 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_read.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_read.c @@ -276,7 +276,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -308,7 +308,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_read (UX_HOST_CLASS_PRINTER *printer, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_printer_soft_reset.c b/common/usbx_host_classes/src/ux_host_class_printer_soft_reset.c index c7122a6b..b5b668d9 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_soft_reset.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_soft_reset.c @@ -177,7 +177,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_soft_reset PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -206,7 +206,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_soft_reset(UX_HOST_CLASS_PRINTER *printer) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_status_get.c b/common/usbx_host_classes/src/ux_host_class_printer_status_get.c index d545a316..646da05e 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_status_get.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_status_get.c @@ -215,7 +215,7 @@ UCHAR * printer_status_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_status_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -245,7 +245,7 @@ UCHAR * printer_status_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_status_get(UX_HOST_CLASS_PRINTER *printer, ULONG *printer_status) diff --git a/common/usbx_host_classes/src/ux_host_class_printer_write.c b/common/usbx_host_classes/src/ux_host_class_printer_write.c index 6599b425..03384785 100644 --- a/common/usbx_host_classes/src/ux_host_class_printer_write.c +++ b/common/usbx_host_classes/src/ux_host_class_printer_write.c @@ -259,7 +259,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_printer_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -291,7 +291,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_printer_write(UX_HOST_CLASS_PRINTER *printer, UCHAR * data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_command.c b/common/usbx_host_classes/src/ux_host_class_prolific_command.c index 88747a93..adb600a0 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_command.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_command.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -82,8 +82,8 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* refined macros names, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command, @@ -130,7 +130,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_command PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -164,7 +164,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_command(UX_HOST_CLASS_PROLIFIC *prolific, ULONG command, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_configure.c b/common/usbx_host_classes/src/ux_host_class_prolific_configure.c index cdb79096..33e905af 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_configure PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -74,6 +74,9 @@ /* optimized based on compile */ /* definitions, */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed interface link, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_configure(UX_HOST_CLASS_PROLIFIC *prolific) @@ -141,20 +144,6 @@ UX_DEVICE *parent_device; the interrupt endpoint is hooked to it. */ status = _ux_host_stack_configuration_interface_get(configuration, 0, 0, &prolific -> ux_host_class_prolific_interface); - /* Check status for error. */ - if (status == UX_SUCCESS) - { - - /* Store the instance in the interface container, this is for the USB stack - when it needs to invoke the class. */ - prolific -> ux_host_class_prolific_interface -> ux_interface_class_instance = (VOID *) prolific; - - /* Store the class container in the interface. The device has the correct class, duplicate it to the - interface. */ - prolific -> ux_host_class_prolific_interface -> ux_interface_class = prolific -> ux_host_class_prolific_device -> ux_device_class ; - - } - /* Return completion status. */ return(status); } diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c b/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c index 9b57a4aa..ada52497 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_prolific_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -80,8 +80,8 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG ioctl_function, @@ -342,7 +342,7 @@ VOID (*callback_function) (struct UX_HOST_CLASS_P /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -373,7 +373,7 @@ VOID (*callback_function) (struct UX_HOST_CLASS_P /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_ioctl(UX_HOST_CLASS_PROLIFIC *prolific, ULONG ioctl_function, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_read.c b/common/usbx_host_classes/src/ux_host_class_prolific_read.c index adca0cb9..6d1c74e7 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_read.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_read.c @@ -201,7 +201,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -233,7 +233,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_read (UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c b/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c index 1ade3ac0..757bc892 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_reception_start.c @@ -134,7 +134,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -165,7 +165,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_reception_start (UX_HOST_CLASS_PROLIFIC *prolific, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c index 4a9b6af5..53321869 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_reception_stop.c @@ -115,7 +115,7 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_reception_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -146,7 +146,7 @@ UINT _ux_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_reception_stop (UX_HOST_CLASS_PROLIFIC *prolific, diff --git a/common/usbx_host_classes/src/ux_host_class_prolific_write.c b/common/usbx_host_classes/src/ux_host_class_prolific_write.c index b6705621..ac49eed6 100644 --- a/common/usbx_host_classes/src/ux_host_class_prolific_write.c +++ b/common/usbx_host_classes/src/ux_host_class_prolific_write.c @@ -200,7 +200,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_prolific_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -232,7 +232,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_prolific_write(UX_HOST_CLASS_PROLIFIC *prolific, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_activate.c b/common/usbx_host_classes/src/ux_host_class_storage_activate.c index f8ff0a14..19aaa99a 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_activate.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_activate.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_activate PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -55,6 +55,9 @@ /* CALLS */ /* */ /* _ux_host_class_storage_configure Configure storage device */ +/* _ux_host_class_storage_device_support_check */ +/* Check protocol support */ +/* _ux_host_class_storage_endpoints_get Get all endpoints */ /* _ux_host_class_storage_device_initialize */ /* Initialize storage device */ /* _ux_host_stack_class_instance_create Create class instance */ @@ -81,6 +84,11 @@ /* fixed parameter/variable */ /* names conflict C++ keyword, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* moved class/sub/protocol */ +/* check and endpoints get */ +/* into _activate function, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_activate(UX_HOST_CLASS_COMMAND *command) @@ -110,14 +118,6 @@ UINT status; /* Store the device container into the storage class instance. */ storage -> ux_host_class_storage_device = interface_ptr -> ux_interface_configuration -> ux_configuration_device; - /* Create this class instance. */ - _ux_host_stack_class_instance_create(command -> ux_host_class_command_class_ptr, (VOID *) storage); - - /* This instance of the device must also be stored in the interface container. */ - interface_ptr -> ux_interface_class_instance = (VOID *) storage; - -#if defined(UX_HOST_STANDALONE) - /* Check class,sub class, protocol. */ status = _ux_host_class_storage_device_support_check(storage); if (status != UX_SUCCESS) @@ -135,6 +135,14 @@ UINT status; return(status); } + /* Create this class instance. */ + _ux_host_stack_class_instance_create(command -> ux_host_class_command_class_ptr, (VOID *) storage); + + /* This instance of the device must also be stored in the interface container. */ + interface_ptr -> ux_interface_class_instance = (VOID *) storage; + +#if defined(UX_HOST_STANDALONE) + /* Activate storage class task function. */ storage -> ux_host_class_storage_class -> ux_host_class_task_function = _ux_host_class_storage_tasks_run; diff --git a/common/usbx_host_classes/src/ux_host_class_storage_device_initialize.c b/common/usbx_host_classes/src/ux_host_class_storage_device_initialize.c index 595fef29..a397486f 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_device_initialize.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_device_initialize.c @@ -36,7 +36,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_device_initialize PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -58,9 +58,6 @@ /* CALLS */ /* */ /* _ux_host_class_storage_device_reset Reset device */ -/* _ux_host_class_storage_device_support_check */ -/* Check protocol support */ -/* _ux_host_class_storage_endpoints_get Get all endpoints */ /* _ux_host_class_storage_max_lun_get Get maximum number of LUNs */ /* _ux_host_class_storage_media_characteristics_get */ /* Get media characteristics */ @@ -90,6 +87,11 @@ /* improved media insert/eject */ /* management without FX, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* moved class/sub/protocol */ +/* check and endpoints get */ +/* into _activate function, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_device_initialize(UX_HOST_CLASS_STORAGE *storage) @@ -104,23 +106,12 @@ UINT inst_index; #endif - /* Check the device protocol support and initialize the transport layer. */ - status = _ux_host_class_storage_device_support_check(storage); - if (status != UX_SUCCESS) - return(status); - /* Get the maximum number of LUN (Bulk Only device only, other device will set the LUN number to 0). */ status = _ux_host_class_storage_max_lun_get(storage); if (status != UX_SUCCESS) return(status); - /* Search all the endpoints for the storage interface (Bulk Out, Bulk in, - and optional Interrupt endpoint). */ - status = _ux_host_class_storage_endpoints_get(storage); - if (status != UX_SUCCESS) - return(status); - /* We need to wait for some device to settle. The INTUIX Flash disk is an example of these device who fail the first Inquiry command if sent too quickly. The timing does not have to be precise so we use the thread sleep function. diff --git a/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c b/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c index fe487614..fcc3edf3 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_endpoints_get.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_endpoints_get PORTABLE C */ -/* 6.1.10 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -76,6 +76,9 @@ /* 01-31-2022 Chaoqiong Xiao Modified comment(s), */ /* initial the timeout value, */ /* resulting in version 6.1.10 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked endpoint get status,*/ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage) @@ -83,6 +86,7 @@ UINT _ux_host_class_storage_endpoints_get(UX_HOST_CLASS_STORAGE *storage) UINT endpoint_index; UX_ENDPOINT *endpoint; +UINT status; /* Search for the bulk OUT endpoint. It is attached to the interface container. */ @@ -91,7 +95,11 @@ UX_ENDPOINT *endpoint; { /* Get an endpoint. */ - _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* We have an endpoint. Check if endpoint is bulk and OUT. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_OUT) && @@ -127,7 +135,11 @@ UX_ENDPOINT *endpoint; { /* Get an endpoint. */ - _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* We have an endpoint. Check if endpoint is bulk and IN. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) && @@ -177,7 +189,11 @@ UX_ENDPOINT *endpoint; { /* Get an endpoint. */ - _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + status = _ux_host_stack_interface_endpoint_get(storage -> ux_host_class_storage_interface, endpoint_index, &endpoint); + + /* Check status. */ + if (status != UX_SUCCESS) + continue; /* Check if endpoint is Interrupt and IN. */ if (((endpoint -> ux_endpoint_descriptor.bEndpointAddress & UX_ENDPOINT_DIRECTION) == UX_ENDPOINT_IN) && 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 b43a66a6..9a31186e 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 @@ -165,7 +165,7 @@ UX_DEVICE *device; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_storage_lock PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -195,7 +195,7 @@ UX_DEVICE *device; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_storage_lock(UX_HOST_CLASS_STORAGE *storage, ULONG wait) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_check.c b/common/usbx_host_classes/src/ux_host_class_storage_media_check.c index eb91a6db..44b19cc3 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_check.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_check.c @@ -90,7 +90,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_storage_media_check PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -119,7 +119,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_storage_media_check(UX_HOST_CLASS_STORAGE *storage) diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_get.c b/common/usbx_host_classes/src/ux_host_class_storage_media_get.c index f9ba6288..22d52be8 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_get.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_get.c @@ -141,7 +141,7 @@ UINT scan_index; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_storage_media_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -172,7 +172,7 @@ UINT scan_index; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_storage_media_get(UX_HOST_CLASS_STORAGE *storage, diff --git a/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c b/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c index de12a0ea..1e593542 100644 --- a/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c +++ b/common/usbx_host_classes/src/ux_host_class_storage_media_lock.c @@ -110,7 +110,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_storage_media_lock PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -141,7 +141,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_storage_media_lock(UX_HOST_CLASS_STORAGE_MEDIA *storage_media, 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 64f7fc32..eeaacc1d 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 @@ -200,7 +200,7 @@ UINT media_retry; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -232,7 +232,7 @@ UINT media_retry; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_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 5186661a..69a33e07 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 @@ -177,7 +177,7 @@ UINT media_retry; /* FUNCTION RELEASE */ /* */ /* _ux_host_class_storage_media_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -209,7 +209,7 @@ UINT media_retry; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_storage_media_write(UX_HOST_CLASS_STORAGE *storage, ULONG sector_start, diff --git a/common/usbx_host_classes/src/ux_host_class_swar_configure.c b/common/usbx_host_classes/src/ux_host_class_swar_configure.c index 7474a23d..b03f06ce 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_configure.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_configure.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_configure PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -73,6 +73,9 @@ /* optimized based on compile */ /* definitions, */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* removed interface link, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_configure(UX_HOST_CLASS_SWAR *swar) @@ -138,19 +141,7 @@ UX_DEVICE *parent_device; /* If the operation went well, the swar default alternate setting for the swar interface is active. We have to memorize the data interface since the bulk in/out endpoints are hooked to it. */ status = _ux_host_stack_configuration_interface_get(configuration, UX_HOST_CLASS_SWAR_DATA_INTERFACE, 0, &swar -> ux_host_class_swar_interface); - if (status == UX_SUCCESS) - { - - /* Store the instance in the interface container, this is for the USB stack - when it needs to invoke the class. */ - swar -> ux_host_class_swar_interface -> ux_interface_class_instance = (VOID *) swar; - - /* Store the class container in the interface. The device has the correct class, duplicate it to the - interface. */ - swar -> ux_host_class_swar_interface -> ux_interface_class = swar -> ux_host_class_swar_device -> ux_device_class ; - } /* Return completion status. */ return(status); } - diff --git a/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c b/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c index 11d093e4..e9839a7a 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_swar_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -72,8 +72,8 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function, @@ -135,7 +135,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_swar_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -166,7 +166,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_swar_ioctl(UX_HOST_CLASS_SWAR *swar, ULONG ioctl_function, diff --git a/common/usbx_host_classes/src/ux_host_class_swar_read.c b/common/usbx_host_classes/src/ux_host_class_swar_read.c index b0aef071..b7f5f30d 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_read.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_read.c @@ -218,7 +218,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_swar_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -250,7 +250,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_swar_read (UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c b/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c index 4866a866..e1162a04 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_reception_start.c @@ -135,7 +135,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_swar_reception_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -166,7 +166,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_swar_reception_start (UX_HOST_CLASS_SWAR *swar, diff --git a/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c b/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c index f80a5013..f140a713 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_reception_stop.c @@ -116,7 +116,7 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_swar_reception_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -146,7 +146,7 @@ UINT _ux_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_swar_reception_stop (UX_HOST_CLASS_SWAR *swar, diff --git a/common/usbx_host_classes/src/ux_host_class_swar_write.c b/common/usbx_host_classes/src/ux_host_class_swar_write.c index 6f9b9da5..2fb244ce 100644 --- a/common/usbx_host_classes/src/ux_host_class_swar_write.c +++ b/common/usbx_host_classes/src/ux_host_class_swar_write.c @@ -219,7 +219,7 @@ ULONG transfer_request_length; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_swar_write PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -251,7 +251,7 @@ ULONG transfer_request_length; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Chaoqiong Xiao Initial Version 6.x */ +/* 10-31-2023 Chaoqiong Xiao Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_swar_write(UX_HOST_CLASS_SWAR *swar, UCHAR *data_pointer, diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_get.c b/common/usbx_host_classes/src/ux_host_class_video_control_get.c index d2cd4865..36ac2618 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_control_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_control_get.c @@ -223,7 +223,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_control_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -254,7 +254,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_control_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control) diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_request.c b/common/usbx_host_classes/src/ux_host_class_video_control_request.c index 0084e88a..63c75369 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_control_request.c +++ b/common/usbx_host_classes/src/ux_host_class_video_control_request.c @@ -212,7 +212,7 @@ UCHAR interface_number; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_control_request PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -251,7 +251,7 @@ UCHAR interface_number; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_control_request(UX_HOST_CLASS_VIDEO *video, diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_value_get.c b/common/usbx_host_classes/src/ux_host_class_video_control_value_get.c index 3b745993..19edace3 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_control_value_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_control_value_get.c @@ -183,7 +183,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_control_value_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -216,7 +216,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_control_value_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control) diff --git a/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c b/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c index a6e49cb3..10d97382 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c +++ b/common/usbx_host_classes/src/ux_host_class_video_control_value_set.c @@ -179,7 +179,7 @@ UCHAR * control_buffer; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_control_value_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -212,7 +212,7 @@ UCHAR * control_buffer; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_control_value_set(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_CONTROL *video_control) diff --git a/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c b/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c index a7dbd973..0a733978 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c +++ b/common/usbx_host_classes/src/ux_host_class_video_entities_parse.c @@ -194,7 +194,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_entities_parse PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -227,7 +227,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_entities_parse(UX_HOST_CLASS_VIDEO *video, diff --git a/common/usbx_host_classes/src/ux_host_class_video_format_data_get.c b/common/usbx_host_classes/src/ux_host_class_video_format_data_get.c index 3a8afd87..d813fda7 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_format_data_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_format_data_get.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Video Class */ /** */ @@ -30,44 +30,47 @@ #include "ux_host_stack.h" -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_host_class_video_format_data_get PORTABLE C */ -/* 6.1 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_video_format_data_get PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function finds the format data within the input terminal. */ -/* */ -/* INPUT */ -/* */ -/* video Pointer to video class */ -/* format_parameter Format Parameter structure */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ +/* */ +/* This function finds the format data within the input terminal. */ +/* */ +/* INPUT */ +/* */ +/* video Pointer to video class */ +/* format_parameter Format Parameter structure */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ /* _ux_system_error_handler Log system error */ -/* */ -/* CALLED BY */ -/* */ -/* Video Class */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* */ +/* CALLED BY */ +/* */ +/* Video Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved extracted data, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_format_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA *format_parameter) @@ -78,12 +81,13 @@ ULONG total_descriptor_length; ULONG descriptor_length; ULONG descriptor_type; ULONG descriptor_subtype; - +UCHAR *guid; + /* Get the descriptor to the selected format. */ descriptor = video -> ux_host_class_video_format_address; total_descriptor_length = video -> ux_host_class_video_length_formats; - + /* Descriptors are arranged in order. First FORMAT then FRAME. */ while (total_descriptor_length) { @@ -101,53 +105,79 @@ ULONG descriptor_subtype; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED); /* If trace is enabled, insert this event into the trace buffer. */ - //UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) return(UX_DESCRIPTOR_CORRUPTED); } - + /* Must be CS_INTERFACE. */ if (descriptor_type == UX_HOST_CLASS_VIDEO_CS_INTERFACE) { /* Process relative to descriptor type. */ + guid = UX_NULL; switch (descriptor_subtype) { - - case UX_HOST_CLASS_VIDEO_VS_FORMAT_UNCOMPRESSED : - case UX_HOST_CLASS_VIDEO_VS_FORMAT_MJPEG : - case UX_HOST_CLASS_VIDEO_VS_FORMAT_MPEG2TS : - case UX_HOST_CLASS_VIDEO_VS_FORMAT_DV : - case UX_HOST_CLASS_VIDEO_VS_FORMAT_FRAME_BASED : - case UX_HOST_CLASS_VIDEO_VS_FORMAT_STREAM_BASED : - - + + case UX_HOST_CLASS_VIDEO_VS_FORMAT_UNCOMPRESSED : /* guidFormat @ 5 */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_FRAME_BASED : /* guidFormat @ 5 */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_STREAM_BASED : /* guidFormat @ 4, no frame */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_MPEG2TS : /* guidStrideFormat @ 7, no frame */ + if (descriptor_subtype == UX_HOST_CLASS_VIDEO_VS_FORMAT_STREAM_BASED) + guid = (descriptor + 4); + else if (descriptor_subtype == UX_HOST_CLASS_VIDEO_VS_FORMAT_MPEG2TS) + guid = (descriptor + 7); + else + guid = (descriptor + 5); + + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_MJPEG : /* no GUID */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_H264 : /* no GUID */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_H264_SIMULCAST : + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_VP8 : /* no GUID */ + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_VP8_SIMULCAST : + /* Fall through. */ + case UX_HOST_CLASS_VIDEO_VS_FORMAT_DV : /* no GUID, no frame */ + /* We found a Format descriptor. Is it the right one ? */ if (format_parameter -> ux_host_class_video_parameter_format_requested == *(descriptor + 3)) { - + /* Save the subtype for this format. */ format_parameter -> ux_host_class_video_parameter_format_subtype = descriptor_subtype; - + /* Save the number of frame descriptors associated with this format. */ - format_parameter -> ux_host_class_video_parameter_number_frame_descriptors = *(descriptor + 4); - + if (descriptor_subtype != UX_HOST_CLASS_VIDEO_VS_FORMAT_STREAM_BASED && + descriptor_subtype != UX_HOST_CLASS_VIDEO_VS_FORMAT_DV && + descriptor_subtype != UX_HOST_CLASS_VIDEO_VS_FORMAT_MPEG2TS) + format_parameter -> ux_host_class_video_parameter_number_frame_descriptors = *(descriptor + 4); + else + format_parameter -> ux_host_class_video_parameter_number_frame_descriptors = 0; + + /* Save the GUID of frame descriptor. */ + format_parameter -> ux_host_class_video_parameter_format_guid = guid; + /* Save the address of this format. */ video -> ux_host_class_video_current_format_address = descriptor; - + /* And the current format index. */ video -> ux_host_class_video_current_format = format_parameter -> ux_host_class_video_parameter_format_requested; - + /* We are done here. */ return(UX_SUCCESS); - + } - break; - - } + } } - + /* Verify if the descriptor is still valid. */ if (descriptor_length > total_descriptor_length) { @@ -156,10 +186,10 @@ ULONG descriptor_subtype; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED); /* If trace is enabled, insert this event into the trace buffer. */ - //UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) return(UX_DESCRIPTOR_CORRUPTED); - } + } /* Jump to the next descriptor if we have not reached the end. */ descriptor += descriptor_length; @@ -175,4 +205,3 @@ ULONG descriptor_subtype; not find the right video device. */ return(UX_HOST_CLASS_VIDEO_WRONG_TYPE); } - diff --git a/common/usbx_host_classes/src/ux_host_class_video_frame_data_get.c b/common/usbx_host_classes/src/ux_host_class_video_frame_data_get.c index 3baf5319..8e33eeea 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_frame_data_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_frame_data_get.c @@ -12,8 +12,8 @@ /**************************************************************************/ /**************************************************************************/ -/** */ -/** USBX Component */ +/** */ +/** USBX Component */ /** */ /** Video Class */ /** */ @@ -29,63 +29,85 @@ #include "ux_host_class_video.h" #include "ux_host_stack.h" +/* + VS_FRAME_UNCOMPRESSED : wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 21, bFrameIntervalType @ 25, intervals @ 26 + VS_FRAME_MJPEG : wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 21, bFrameIntervalType @ 25, intervals @ 26 + VS_FRAME_FRAME_BASED : wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 17, bFrameIntervalType @ 21, intervals @ 26 + VS_FRAME_H264 : wWidth @ 4, wHeight @ 6, dwDefaultFrameInterval @ 39, bNumFrameIntervals @ 43, intervals @ 44 + VS_FRAME_VP8 : wWidth @ 4, wHeight @ 6, dwDefaultFrameInterval @ 26, bNumFrameIntervals @ 30, intervals @ 31 +*/ +static const UCHAR _ux_host_class_video_frame_descriptor_offsets[][5] = +{ + { 5, 7, 21, 25, 26 }, + { 5, 7, 17, 21, 26 }, + { 4, 6, 39, 43, 44 }, + { 4, 6, 26, 30, 31 }, +}; +#define _OFFSETS_UNCOMPRESSED_MJPEG 0 +#define _OFFSETS_FRAME_BASED 1 +#define _OFFSETS_H264 2 +#define _OFFSETS_VP8 3 + -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _ux_host_class_video_frame_data_get PORTABLE C */ -/* 6.1 */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _ux_host_class_video_frame_data_get PORTABLE C */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function finds the frame data within the input terminal. */ -/* */ -/* INPUT */ -/* */ -/* video Pointer to video class */ -/* frame_data Frame request structure */ -/* */ -/* OUTPUT */ -/* */ -/* Completion Status */ -/* */ -/* CALLS */ -/* */ +/* */ +/* This function finds the frame data within the input terminal. */ +/* */ +/* INPUT */ +/* */ +/* video Pointer to video class */ +/* frame_data Frame request structure */ +/* */ +/* OUTPUT */ +/* */ +/* Completion Status */ +/* */ +/* CALLS */ +/* */ /* _ux_system_error_handler Log system error */ -/* _ux_utility_descriptor_parse Parse descriptor */ -/* */ -/* CALLED BY */ -/* */ -/* Video Class */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ -/* */ +/* _ux_utility_descriptor_parse Parse descriptor */ +/* */ +/* CALLED BY */ +/* */ +/* Video Class */ +/* */ +/* RELEASE HISTORY */ +/* */ +/* DATE NAME DESCRIPTION */ +/* */ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* improved extracted data, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_frame_data_get(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA *frame_parameter) { UCHAR *descriptor; -UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR frame_descriptor; ULONG total_descriptor_length; ULONG descriptor_length; ULONG descriptor_type; ULONG descriptor_subtype; - +UCHAR *field_offsets; + /* Get the descriptor to the selected format. */ descriptor = video -> ux_host_class_video_current_format_address; total_descriptor_length = video -> ux_host_class_video_length_formats; - + /* Descriptors are arranged in order. First FORMAT then FRAME. */ while (total_descriptor_length) { @@ -103,7 +125,7 @@ ULONG descriptor_subtype; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED); /* If trace is enabled, insert this event into the trace buffer. */ - //UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) return(UX_DESCRIPTOR_CORRUPTED); } @@ -115,37 +137,45 @@ ULONG descriptor_subtype; /* Process relative to descriptor type. */ switch (descriptor_subtype) { - - case UX_HOST_CLASS_VIDEO_VS_FRAME_UNCOMPRESSED : - case UX_HOST_CLASS_VIDEO_VS_FRAME_MJPEG : - case UX_HOST_CLASS_VIDEO_VS_FRAME_FRAME_BASED : - - /* We found a Frame descriptor. Is it the right one ? */ - if (frame_parameter -> ux_host_class_video_parameter_frame_requested == *(descriptor + 3)) - { - - /* Make the descriptor machine independent. */ - _ux_utility_descriptor_parse(descriptor, _ux_system_class_video_frame_descriptor_structure, - UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR_ENTRIES, (UCHAR *) &frame_descriptor); - - - /* Save the frame subtype. */ - frame_parameter -> ux_host_class_video_parameter_frame_subtype = descriptor_type; - - /* Save useful frame parameters. */ - frame_parameter -> ux_host_class_video_parameter_frame_width = frame_descriptor.wWidth; - frame_parameter -> ux_host_class_video_parameter_frame_height = frame_descriptor.wHeight; - frame_parameter -> ux_host_class_video_parameter_default_frame_interval = frame_descriptor.dwDefaultFrameInterval; - frame_parameter -> ux_host_class_video_parameter_frame_interval_type = frame_descriptor.bFrameIntervalType; - video -> ux_host_class_video_current_frame_address = descriptor; - video -> ux_host_class_video_current_frame_interval = frame_descriptor.dwDefaultFrameInterval; - /* We are done here. */ - return(UX_SUCCESS); - } - - break; - - } + + case UX_HOST_CLASS_VIDEO_VS_FRAME_UNCOMPRESSED : /* wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 21, bFrameIntervalType @ 25, intervals @ 26 */ + case UX_HOST_CLASS_VIDEO_VS_FRAME_MJPEG : /* wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 21, bFrameIntervalType @ 25, intervals @ 26 */ + case UX_HOST_CLASS_VIDEO_VS_FRAME_FRAME_BASED : /* wWidth @ 5, wHeight @ 7, dwDefaultFrameInterval @ 17, bFrameIntervalType @ 21, intervals @ 26 */ + case UX_HOST_CLASS_VIDEO_VS_FRAME_H264 : /* wWidth @ 4, wHeight @ 6, dwDefaultFrameInterval @ 39, bNumFrameIntervals @ 43, intervals @ 44 */ + case UX_HOST_CLASS_VIDEO_VS_FRAME_VP8 : /* wWidth @ 4, wHeight @ 6, dwDefaultFrameInterval @ 26, bNumFrameIntervals @ 30, intervals @ 31 */ + + /* We found a Frame descriptor. Is it the right one ? */ + if (frame_parameter -> ux_host_class_video_parameter_frame_requested == *(descriptor + 3)) + { + + /* Get key offsets. */ + if (descriptor_subtype == UX_HOST_CLASS_VIDEO_VS_FRAME_FRAME_BASED) + field_offsets = (UCHAR*)_ux_host_class_video_frame_descriptor_offsets[_OFFSETS_FRAME_BASED]; + else if (descriptor_subtype == UX_HOST_CLASS_VIDEO_VS_FRAME_H264) + field_offsets = (UCHAR*)_ux_host_class_video_frame_descriptor_offsets[_OFFSETS_H264]; + else if (descriptor_subtype == UX_HOST_CLASS_VIDEO_VS_FRAME_VP8) + field_offsets = (UCHAR*)_ux_host_class_video_frame_descriptor_offsets[_OFFSETS_VP8]; + else + field_offsets = (UCHAR*)_ux_host_class_video_frame_descriptor_offsets[_OFFSETS_UNCOMPRESSED_MJPEG]; + + /* Save the frame subtype. */ + frame_parameter -> ux_host_class_video_parameter_frame_subtype = descriptor_type; + + /* Save useful frame parameters. */ + frame_parameter -> ux_host_class_video_parameter_frame_width = _ux_utility_short_get(descriptor + field_offsets[0]); + frame_parameter -> ux_host_class_video_parameter_frame_height = _ux_utility_short_get(descriptor + field_offsets[1]); + frame_parameter -> ux_host_class_video_parameter_default_frame_interval = _ux_utility_long_get(descriptor + field_offsets[2]); + frame_parameter -> ux_host_class_video_parameter_frame_interval_type = *(descriptor + field_offsets[3]); + frame_parameter -> ux_host_class_video_parameter_frame_intervals = (descriptor + field_offsets[4]); + + video -> ux_host_class_video_current_frame_address = descriptor; + video -> ux_host_class_video_current_frame_interval = frame_parameter -> ux_host_class_video_parameter_default_frame_interval; + + /* We are done here. */ + return(UX_SUCCESS); + } + break; + } } /* Verify if the descriptor is still valid. */ @@ -156,10 +186,10 @@ ULONG descriptor_subtype; _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_DESCRIPTOR_CORRUPTED); /* If trace is enabled, insert this event into the trace buffer. */ - // UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) + UX_TRACE_IN_LINE_INSERT(UX_TRACE_ERROR, UX_DESCRIPTOR_CORRUPTED, descriptor, 0, 0, UX_TRACE_ERRORS, 0, 0) return(UX_DESCRIPTOR_CORRUPTED); - } + } /* Jump to the next descriptor if we have not reached the end. */ descriptor += descriptor_length; @@ -175,4 +205,3 @@ ULONG descriptor_subtype; not find the right video device. */ return(UX_HOST_CLASS_VIDEO_WRONG_TYPE); } - diff --git a/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c b/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c index 6215d67e..dcd759b9 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c +++ b/common/usbx_host_classes/src/ux_host_class_video_frame_parameters_set.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_frame_parameters_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -89,8 +89,9 @@ /* internal clean up, */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia, CQ Xiao Modified comment(s), */ +/* improved interval checking, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULONG frame_format, ULONG width, ULONG height, ULONG frame_interval) @@ -98,7 +99,6 @@ UINT _ux_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULON UX_HOST_CLASS_VIDEO_PARAMETER_FORMAT_DATA format_parameter; UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_DATA frame_parameter; -UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR frame_descriptor; ULONG format_index; ULONG frame_index; UINT status; @@ -174,22 +174,17 @@ ULONG max_payload_size; return(UX_HOST_CLASS_VIDEO_PARAMETER_ERROR); } - /* Make the descriptor machine independent. */ - _ux_utility_descriptor_parse(video -> ux_host_class_video_current_frame_address, - _ux_system_class_video_frame_descriptor_structure, - UX_HOST_CLASS_VIDEO_FRAME_DESCRIPTOR_ENTRIES, (UCHAR *) &frame_descriptor); - /* Initial status for frame interval checking. */ status = UX_HOST_CLASS_VIDEO_PARAMETER_ERROR; /* Check the frame interval type. */ - if (frame_descriptor.bFrameIntervalType == 0) + if (frame_parameter.ux_host_class_video_parameter_frame_interval_type == 0) { /* Frame interval type is continuous. */ - min_frame_interval = _ux_utility_long_get(video -> ux_host_class_video_current_frame_address + 26); - max_frame_interval = _ux_utility_long_get(video -> ux_host_class_video_current_frame_address + 30); - frame_interval_step = _ux_utility_long_get(video -> ux_host_class_video_current_frame_address + 34); + min_frame_interval = _ux_utility_long_get(frame_parameter.ux_host_class_video_parameter_frame_intervals); + max_frame_interval = _ux_utility_long_get(frame_parameter.ux_host_class_video_parameter_frame_intervals + 4); + frame_interval_step = _ux_utility_long_get(frame_parameter.ux_host_class_video_parameter_frame_intervals + 8); /* Check if the frame interval is valid. */ if (frame_interval >= min_frame_interval && frame_interval <= max_frame_interval && @@ -206,11 +201,11 @@ ULONG max_payload_size; { /* Frame interval type is discrete. */ - for(i = 0; i < frame_descriptor.bFrameIntervalType; i++) + for(i = 0; i < frame_parameter.ux_host_class_video_parameter_frame_interval_type; i++) { /* Check if the requested frame interval is valid. */ - if (frame_interval == _ux_utility_long_get(video -> ux_host_class_video_current_frame_address + 26 + i * sizeof(ULONG))) + if (frame_interval == _ux_utility_long_get(frame_parameter.ux_host_class_video_parameter_frame_intervals + i * sizeof(ULONG))) { /* Save the frame interval. */ @@ -327,7 +322,7 @@ ULONG max_payload_size; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_frame_parameters_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -362,7 +357,7 @@ ULONG max_payload_size; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_frame_parameters_set(UX_HOST_CLASS_VIDEO *video, ULONG frame_format, ULONG width, ULONG height, ULONG frame_interval) diff --git a/common/usbx_host_classes/src/ux_host_class_video_ioctl.c b/common/usbx_host_classes/src/ux_host_class_video_ioctl.c index dfef16db..8ed0eff7 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_ioctl.c +++ b/common/usbx_host_classes/src/ux_host_class_video_ioctl.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -83,8 +83,8 @@ /* reset indexes of requests */ /* ring when it is aborted, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_ioctl(UX_HOST_CLASS_VIDEO *video, ULONG ioctl_function, @@ -231,7 +231,7 @@ UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_INTERVAL *interval_parameter; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_ioctl PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -262,7 +262,7 @@ UX_HOST_CLASS_VIDEO_PARAMETER_FRAME_INTERVAL *interval_parameter; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_ioctl(UX_HOST_CLASS_VIDEO *video, ULONG ioctl_function, diff --git a/common/usbx_host_classes/src/ux_host_class_video_max_payload_get.c b/common/usbx_host_classes/src/ux_host_class_video_max_payload_get.c index 881b46d0..6cd6d3bf 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_max_payload_get.c +++ b/common/usbx_host_classes/src/ux_host_class_video_max_payload_get.c @@ -82,7 +82,7 @@ ULONG _ux_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video) /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_max_payload_get PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -111,7 +111,7 @@ ULONG _ux_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video) /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ ULONG _uxe_host_class_video_max_payload_get(UX_HOST_CLASS_VIDEO *video) diff --git a/common/usbx_host_classes/src/ux_host_class_video_read.c b/common/usbx_host_classes/src/ux_host_class_video_read.c index 26bb5d15..c392e4dc 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_read.c +++ b/common/usbx_host_classes/src/ux_host_class_video_read.c @@ -150,7 +150,7 @@ UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *transfer_list; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_read PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -181,7 +181,7 @@ UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *transfer_list; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_read(UX_HOST_CLASS_VIDEO *video, UX_HOST_CLASS_VIDEO_TRANSFER_REQUEST *video_transfer_request) diff --git a/common/usbx_host_classes/src/ux_host_class_video_start.c b/common/usbx_host_classes/src/ux_host_class_video_start.c index 6eb7e1d2..a50f44c0 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_start.c +++ b/common/usbx_host_classes/src/ux_host_class_video_start.c @@ -98,7 +98,7 @@ UINT status; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_start PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -127,7 +127,7 @@ UINT status; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_start(UX_HOST_CLASS_VIDEO *video) diff --git a/common/usbx_host_classes/src/ux_host_class_video_stop.c b/common/usbx_host_classes/src/ux_host_class_video_stop.c index cb798573..26c72c94 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_stop.c +++ b/common/usbx_host_classes/src/ux_host_class_video_stop.c @@ -159,7 +159,7 @@ UINT streaming_interface; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_stop PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -188,7 +188,7 @@ UINT streaming_interface; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_stop(UX_HOST_CLASS_VIDEO *video) diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c index e34870de..e2b78337 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffer_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_buffer_add PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -88,8 +88,8 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* set pending on endpoint, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer) @@ -189,7 +189,7 @@ ULONG packet_size; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_transfer_buffer_add PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -221,7 +221,7 @@ ULONG packet_size; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_transfer_buffer_add(UX_HOST_CLASS_VIDEO *video, UCHAR* buffer) diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c index 316e31c3..1f1c23ba 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_buffers_add.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_host_class_video_transfer_buffers_add PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -97,8 +97,8 @@ /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* set pending on endpoint, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Yajun xia Modified comment(s), */ -/* resulting in version 6.x */ +/* 10-31-2023 Yajun xia Modified comment(s), */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers) @@ -236,7 +236,7 @@ UINT i; /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_transfer_buffers_add PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -270,7 +270,7 @@ UINT i; /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ UINT _uxe_host_class_video_transfer_buffers_add(UX_HOST_CLASS_VIDEO *video, UCHAR** buffers, ULONG num_buffers) diff --git a/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c b/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c index 83f342bd..c54750f2 100644 --- a/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c +++ b/common/usbx_host_classes/src/ux_host_class_video_transfer_callback_set.c @@ -83,7 +83,7 @@ VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOI /* FUNCTION RELEASE */ /* */ /* _uxe_host_class_video_transfer_callback_set PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Yajun Xia, Microsoft Corporation */ @@ -115,7 +115,7 @@ VOID _ux_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOI /* */ /* DATE NAME DESCRIPTION */ /* */ -/* xx-xx-xxxx Yajun xia Initial Version 6.x */ +/* 10-31-2023 Yajun xia Initial Version 6.3.0 */ /* */ /**************************************************************************/ VOID _uxe_host_class_video_transfer_callback_set(UX_HOST_CLASS_VIDEO *video, VOID (*callback_function)(UX_TRANSFER*)) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c index 7aa4cfaf..1b666618 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_asynchronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_asynchronous_endpoint_create PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -75,9 +75,9 @@ /* 11-09-2020 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ /* resulting in version 6.1.2 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_asynchronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_create.c index 21de45b3..56db5758 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_interrupt_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_interrupt_endpoint_create PORTABLE C */ -/* 6.1.11 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -104,6 +104,9 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed split transfer issue, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_interrupt_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -240,7 +243,11 @@ UINT i; /* Keep interval < 1ms for micro-frame calculation. */ /* Make it index steps to move. */ - if (interval > 0) + if (interval >= 4) + { + interval = 3; /* Uses 3 for 1ms calculation */ + } + else if (interval > 0) { interval --; interval &= 0x3; diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c index c5b4a678..761599bd 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_isochronous_endpoint_create.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_isochronous_endpoint_create PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -87,9 +87,11 @@ /* 04-25-2022 Chaoqiong Xiao Modified comment(s), */ /* fixed standalone compile, */ /* resulting in version 6.1.11 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* fixed error handling, */ +/* fixed split transfer issue, */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_isochronous_endpoint_create(UX_HCD_EHCI *hcd_ehci, UX_ENDPOINT *endpoint) @@ -246,6 +248,7 @@ UINT status; for (i = 0; i < ed -> ux_ehci_hsiso_ed_nb_tds; i ++) ed -> ux_ehci_hsiso_ed_fr_td[i] -> ux_ehci_hsiso_td_status = UX_UNUSED; _ux_utility_memory_free(ed); + return(status); } /* Save information not related to periodic things. */ @@ -496,7 +499,7 @@ UINT status; } /* Increment SSplit count. */ - ed_anchor -> REF_AS.ANCHOR.ux_ehci_ed_microframe_ssplit_count[i] ++; + ed_anchor -> REF_AS.ANCHOR.ux_ehci_ed_microframe_ssplit_count[microframe_i] ++; } } diff --git a/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c b/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c index 278715d2..ca412dab 100644 --- a/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c +++ b/common/usbx_host_controllers/src/ux_hcd_ehci_request_control_transfer.c @@ -35,7 +35,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_hcd_ehci_request_control_transfer PORTABLE C */ -/* 6.x */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -86,9 +86,9 @@ /* refined macros names, */ /* fixed compile warnings, */ /* resulting in version 6.1.2 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* fixed compile warnings, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_hcd_ehci_request_control_transfer(UX_HCD_EHCI *hcd_ehci, UX_TRANSFER *transfer_request) diff --git a/common/usbx_network/src/ux_network_driver.c b/common/usbx_network/src/ux_network_driver.c index e1be41f9..c2745c83 100644 --- a/common/usbx_network/src/ux_network_driver.c +++ b/common/usbx_network/src/ux_network_driver.c @@ -743,7 +743,7 @@ UINT i; /* FUNCTION RELEASE */ /* */ /* _ux_network_driver_packet_received PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -781,6 +781,10 @@ UINT i; /* 07-29-2022 Yajun Xia Modified comment(s), */ /* fixed ipv6 support issue, */ /* resulting in version 6.1.12 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked packet data length */ +/* before process the packet, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -802,6 +806,18 @@ NX_IP *nx_ip; } + /* Check if the packet is valid for ethernet header process. */ + if (packet_ptr -> nx_packet_length < NX_ETHERNET_SIZE) + { + + /* We received a malformed packet. Report to application. */ + _ux_system_error_handler(UX_SYSTEM_LEVEL_THREAD, UX_SYSTEM_CONTEXT_CLASS, UX_CLASS_MALFORMED_PACKET_RECEIVED_ERROR); + + /* Invalid ethernet header... release the packet. */ + nx_packet_release(packet_ptr); + return; + } + /* Pickup the packet header to determine where the packet needs to be sent. */ packet_type = _ux_utility_short_get_big_endian(packet_ptr -> nx_packet_prepend_ptr + 12); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_array_element_to_array_hexa.c b/common/usbx_pictbridge/src/ux_pictbridge_array_element_to_array_hexa.c index 4095c0d2..d48c1db3 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_array_element_to_array_hexa.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_array_element_to_array_hexa.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_array_element_to_array_hexa PORTABLE C */ -/* 6.1.11 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -69,6 +69,9 @@ /* 04-25-2022 Yajun Xia Modified comment(s), */ /* internal clean up, */ /* resulting in version 6.1.11 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* limited output array size, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_array_element_to_array_hexa(UCHAR *element, ULONG *hexa_array) @@ -84,6 +87,7 @@ ULONG element_length; ULONG saved_element_length = 0; UINT string_length = UX_PICTBRIDGE_MAX_ELEMENT_SIZE; UINT status; +ULONG *hexa_array_end = hexa_array + UX_PICTBRIDGE_MAX_DEVINFO_ARRAY_SIZE; /* Get the string length. */ @@ -207,6 +211,10 @@ UINT status; remaining_length--; } + /* Check if the array is Full. */ + if (hexa_array == hexa_array_end) + break; + /* Increment the element position to the next one if there. */ element++; @@ -215,8 +223,12 @@ UINT status; } - /* Reset the last position in the array. */ - *hexa_array = 0; + /* Reset the remaining positions in the array. */ + while(hexa_array != hexa_array_end) + { + *hexa_array = 0; + hexa_array++; + } /* Operation was successful. */ return(UX_SUCCESS); diff --git a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c index 79c11b65..f7178210 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_dpsclient_start.c @@ -148,7 +148,7 @@ static UINT _dpsclient_storage_format(struct UX_SLAVE_CLASS_PIMA_STRUCT *pima, /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_dpsclient_start PORTABLE C */ -/* 6.1.12 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -185,9 +185,9 @@ static UINT _dpsclient_storage_format(struct UX_SLAVE_CLASS_PIMA_STRUCT *pima, /* 07-29-2022 Chaoqiong Xiao Modified comment(s), */ /* used macros for RTOS calls, */ /* resulting in version 6.1.12 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* initialized PIMA callbacks, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_dpsclient_start(UX_PICTBRIDGE *pictbridge) diff --git a/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c b/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c index d544c137..65213006 100644 --- a/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c +++ b/common/usbx_pictbridge/src/ux_pictbridge_object_parse.c @@ -34,7 +34,7 @@ /* FUNCTION RELEASE */ /* */ /* _ux_pictbridge_object_parse PORTABLE C */ -/* 6.1 */ +/* 6.3.0 */ /* AUTHOR */ /* */ /* Chaoqiong Xiao, Microsoft Corporation */ @@ -67,6 +67,9 @@ /* 05-19-2020 Chaoqiong Xiao Initial Version 6.0 */ /* 09-30-2020 Chaoqiong Xiao Modified comment(s), */ /* resulting in version 6.1 */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ +/* checked tag nesting depth, */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ UINT _ux_pictbridge_object_parse(UX_PICTBRIDGE *pictbridge, UCHAR *xml_object_buffer, @@ -211,6 +214,17 @@ UINT status; /* Reset the closing tag count. */ closing_tag_count = 0; + /* Check if the tag history depth is fine for saving. */ + if (tag_history_index >= UX_PICTBRIDGE_MAX_TAG_DEPTH) + { + + /* Syntax error. */ + status = UX_BUFFER_OVERFLOW; + + /* Do not proceed. */ + break; + } + /* Save the current tag in the tag history. */ tag_history[tag_history_index] = tag_entry; @@ -317,4 +331,3 @@ UINT status; /* Return completion status. */ return(status); } - diff --git a/ports/arm9/gnu/inc/ux_port.h b/ports/arm9/gnu/inc/ux_port.h index 27af64f3..a870f6ad 100644 --- a/ports/arm9/gnu/inc/ux_port.h +++ b/ports/arm9/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -253,7 +253,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/arm9/iar/inc/ux_port.h b/ports/arm9/iar/inc/ux_port.h index 28c16eef..481e0892 100644 --- a/ports/arm9/iar/inc/ux_port.h +++ b/ports/arm9/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -260,7 +260,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a15/gnu/inc/ux_port.h b/ports/cortex_a15/gnu/inc/ux_port.h index 84ea8dfd..ab934e17 100644 --- a/ports/cortex_a15/gnu/inc/ux_port.h +++ b/ports/cortex_a15/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A15/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -249,7 +249,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A15/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a5/gnu/inc/ux_port.h b/ports/cortex_a5/gnu/inc/ux_port.h index 1a44c1b6..b3265b14 100644 --- a/ports/cortex_a5/gnu/inc/ux_port.h +++ b/ports/cortex_a5/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a5/iar/inc/ux_port.h b/ports/cortex_a5/iar/inc/ux_port.h index 047417ea..d4e105bd 100644 --- a/ports/cortex_a5/iar/inc/ux_port.h +++ b/ports/cortex_a5/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a5x/ac6/inc/ux_port.h b/ports/cortex_a5x/ac6/inc/ux_port.h index e92bc87f..2c371107 100644 --- a/ports/cortex_a5x/ac6/inc/ux_port.h +++ b/ports/cortex_a5x/ac6/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A5x/AC6 */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -273,7 +273,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A5x/AC6 Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a7/gnu/inc/ux_port.h b/ports/cortex_a7/gnu/inc/ux_port.h index 25762468..40a9c9a1 100644 --- a/ports/cortex_a7/gnu/inc/ux_port.h +++ b/ports/cortex_a7/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A7/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -260,7 +260,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a7/iar/inc/ux_port.h b/ports/cortex_a7/iar/inc/ux_port.h index a8f56622..4f725ad8 100644 --- a/ports/cortex_a7/iar/inc/ux_port.h +++ b/ports/cortex_a7/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A7/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -260,7 +260,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A7/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a8/gnu/inc/ux_port.h b/ports/cortex_a8/gnu/inc/ux_port.h index 18a534bd..db1469ea 100644 --- a/ports/cortex_a8/gnu/inc/ux_port.h +++ b/ports/cortex_a8/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A8/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a8/iar/inc/ux_port.h b/ports/cortex_a8/iar/inc/ux_port.h index ee31762e..eda62527 100644 --- a/ports/cortex_a8/iar/inc/ux_port.h +++ b/ports/cortex_a8/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-A8/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-A8/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a9/gnu/inc/ux_port.h b/ports/cortex_a9/gnu/inc/ux_port.h index 0c2e7602..758d2e56 100644 --- a/ports/cortex_a9/gnu/inc/ux_port.h +++ b/ports/cortex_a9/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_a9/iar/inc/ux_port.h b/ports/cortex_a9/iar/inc/ux_port.h index 9a511f09..188d3d25 100644 --- a/ports/cortex_a9/iar/inc/ux_port.h +++ b/ports/cortex_a9/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h ARM9/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX ARM9/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m0/gnu/inc/ux_port.h b/ports/cortex_m0/gnu/inc/ux_port.h index 6eba5b59..292c5777 100644 --- a/ports/cortex_m0/gnu/inc/ux_port.h +++ b/ports/cortex_m0/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M0/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -48,10 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -254,7 +254,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m0/iar/inc/ux_port.h b/ports/cortex_m0/iar/inc/ux_port.h index 5435b53b..e055deb7 100644 --- a/ports/cortex_m0/iar/inc/ux_port.h +++ b/ports/cortex_m0/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M0/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M0/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m3/gnu/inc/ux_port.h b/ports/cortex_m3/gnu/inc/ux_port.h index 484312b1..8a94b71a 100644 --- a/ports/cortex_m3/gnu/inc/ux_port.h +++ b/ports/cortex_m3/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M3/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -48,10 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -254,7 +254,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m3/iar/inc/ux_port.h b/ports/cortex_m3/iar/inc/ux_port.h index 3ba92563..16b6a503 100644 --- a/ports/cortex_m3/iar/inc/ux_port.h +++ b/ports/cortex_m3/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M3/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M3/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m4/gnu/inc/ux_port.h b/ports/cortex_m4/gnu/inc/ux_port.h index 4ac9f89d..aea43883 100644 --- a/ports/cortex_m4/gnu/inc/ux_port.h +++ b/ports/cortex_m4/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M4/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -48,10 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -254,7 +254,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m4/iar/inc/ux_port.h b/ports/cortex_m4/iar/inc/ux_port.h index 65d4e15d..26af446c 100644 --- a/ports/cortex_m4/iar/inc/ux_port.h +++ b/ports/cortex_m4/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M4/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M4/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m7/gnu/inc/ux_port.h b/ports/cortex_m7/gnu/inc/ux_port.h index 9e077aec..eee392de 100644 --- a/ports/cortex_m7/gnu/inc/ux_port.h +++ b/ports/cortex_m7/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M7/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -48,10 +48,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -254,7 +254,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_m7/iar/inc/ux_port.h b/ports/cortex_m7/iar/inc/ux_port.h index 4337c06e..0c15c267 100644 --- a/ports/cortex_m7/iar/inc/ux_port.h +++ b/ports/cortex_m7/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-M7/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-M7/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_r4/gnu/inc/ux_port.h b/ports/cortex_r4/gnu/inc/ux_port.h index 2008bc4a..a7b10613 100644 --- a/ports/cortex_r4/gnu/inc/ux_port.h +++ b/ports/cortex_r4/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R4/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -252,7 +252,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_r4/iar/inc/ux_port.h b/ports/cortex_r4/iar/inc/ux_port.h index 23b0c2ce..f0483f3e 100644 --- a/ports/cortex_r4/iar/inc/ux_port.h +++ b/ports/cortex_r4/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R4/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R4/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_r5/gnu/inc/ux_port.h b/ports/cortex_r5/gnu/inc/ux_port.h index 7858ffa6..18588abb 100644 --- a/ports/cortex_r5/gnu/inc/ux_port.h +++ b/ports/cortex_r5/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R5/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/cortex_r5/iar/inc/ux_port.h b/ports/cortex_r5/iar/inc/ux_port.h index 5e65de2c..f956b9b5 100644 --- a/ports/cortex_r5/iar/inc/ux_port.h +++ b/ports/cortex_r5/iar/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Cortex-R5/IAR */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -256,7 +256,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Cortex-R5/IAR Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/generic/inc/ux_port.h b/ports/generic/inc/ux_port.h index dcd93a6e..52486e23 100644 --- a/ports/generic/inc/ux_port.h +++ b/ports/generic/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Generic */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -257,7 +257,7 @@ VOID outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Generic Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Generic Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif diff --git a/ports/linux/gnu/inc/ux_port.h b/ports/linux/gnu/inc/ux_port.h index 89800c7b..8bc24907 100644 --- a/ports/linux/gnu/inc/ux_port.h +++ b/ports/linux/gnu/inc/ux_port.h @@ -26,7 +26,7 @@ /* PORT SPECIFIC C INFORMATION RELEASE */ /* */ /* ux_port.h Linux/GNU */ -/* 6.x */ +/* 6.3.0 */ /* */ /* AUTHOR */ /* */ @@ -46,10 +46,10 @@ /* moved tx_api.h include and */ /* typedefs from ux_api.h, */ /* resulting in version 6.1.10 */ -/* xx-xx-xxxx Chaoqiong Xiao Modified comment(s), */ +/* 10-31-2023 Chaoqiong Xiao Modified comment(s), */ /* added basic types guards, */ /* improved SLONG typedef, */ -/* resulting in version 6.x */ +/* resulting in version 6.3.0 */ /* */ /**************************************************************************/ @@ -258,7 +258,7 @@ ULONG outpl(ULONG,ULONG); #ifdef UX_SYSTEM_INIT CHAR _ux_version_id[] = - "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Linux/GNU Version 6.2.0 *"; + "Copyright (c) Microsoft Corporation. All rights reserved. * USBX Linux/GNU Version 6.3.0 *"; #else extern CHAR _ux_version_id[]; #endif